tera.vim (1320B)
1 " Vim filetype plugin file 2 " Language: Tera 3 " Maintainer: Muntasir Mahmud <muntasir.joypurhat@gmail.com> 4 " Last Change: 2025 Mar 08 5 " 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) 6 " 2026 Jun 27 by Vim Project (add recommended style guard) 7 8 if exists("b:did_ftplugin") 9 finish 10 endif 11 let b:did_ftplugin = 1 12 13 let s:cpo_save = &cpo 14 set cpo&vim 15 16 setlocal autoindent 17 18 setlocal commentstring={#\ %s\ #} 19 setlocal comments=s:{#,e:#} 20 21 if exists("loaded_matchit") 22 let b:match_ignorecase = 0 23 let b:match_words = '{#:##\|#},{% *if:{% *else\>:{% *elif\>:{% *endif %},{% *for\>:{% *endfor %},{% *macro\>:{% *endmacro %},{% *block\>:{% *endblock %},{% *filter\>:{% *endfilter %},{% *set\>:{% *endset %},{% *raw\>:{% *endraw %},{% *with\>:{% *endwith %}' 24 endif 25 26 setlocal includeexpr=substitute(v:fname,'\\([^.]*\\)$','\\1','g') 27 setlocal suffixesadd=.tera 28 29 if get(g:, 'tera_recommended_style', 30 \ get(g:, 'filetype_recommended_style', 1)) 31 setlocal expandtab 32 setlocal shiftwidth=2 33 setlocal softtabstop=2 34 endif 35 36 let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " .. 37 \ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<" 38 let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words" 39 40 let &cpo = s:cpo_save 41 unlet s:cpo_save