patch 9.1.1177: filetype: tera files not detected
Problem: filetype: tera files not detected
Solution: detect '*.tera' files as tera filetype,
include a simple filetype plugin
(MuntasirSZN)
closes: #16806
Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 50c9f08..8b4091a 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Mar 05
+" Last Change: 2025 Mar 06
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Listen very carefully, I will say this only once
@@ -2604,6 +2604,9 @@
" Terminfo
au BufNewFile,BufRead *.ti setf terminfo
+" Tera
+au BufRead,BufNewFile *.tera setf tera
+
" Terraform variables
au BufRead,BufNewFile *.tfvars setf terraform-vars
diff --git a/runtime/ftplugin/tera.vim b/runtime/ftplugin/tera.vim
new file mode 100644
index 0000000..47636f2
--- /dev/null
+++ b/runtime/ftplugin/tera.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin file
+" Language: Tera
+" Maintainer: Muntasir Mahmud <muntasir.joypurhat@gmail.com>
+" Last Change: 2025 Mar 06
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal commentstring={#\ %s\ #}
+
+let b:undo_ftplugin = "setlocal commentstring<"