diff options
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/aap.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/diff.vim | 11 | ||||
-rw-r--r-- | runtime/ftplugin/lua.vim | 38 | ||||
-rw-r--r-- | runtime/ftplugin/routeros.vim | 29 | ||||
-rw-r--r-- | runtime/ftplugin/zimbu.vim | 61 |
5 files changed, 125 insertions, 27 deletions
diff --git a/runtime/ftplugin/aap.vim b/runtime/ftplugin/aap.vim index 9b20ec4766..b5065e5157 100644 --- a/runtime/ftplugin/aap.vim +++ b/runtime/ftplugin/aap.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Aap recipe " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Apr 05 +" Last Change: 2021 Nov 14 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -11,8 +11,9 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -" Reset 'formatoptions', 'comments' and 'expandtab' to undo this plugin. -let b:undo_ftplugin = "setl fo< com< et<" +" Reset 'formatoptions', 'comments', 'commentstring' and 'expandtab' to undo +" this plugin. +let b:undo_ftplugin = "setl fo< com< cms< et<" " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting <CR> or using "o". @@ -20,6 +21,12 @@ setlocal fo-=t fo+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:- +setlocal commentstring=#\ %s " Expand tabs to spaces to avoid trouble. setlocal expandtab + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif diff --git a/runtime/ftplugin/diff.vim b/runtime/ftplugin/diff.vim index 0464290475..bf37d464c0 100644 --- a/runtime/ftplugin/diff.vim +++ b/runtime/ftplugin/diff.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Diff " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Jul 18 +" Last Change: 2021 Nov 14 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -9,10 +9,15 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl modeline<" +let b:undo_ftplugin = "setl modeline< commentstring<" " Don't use modelines in a diff, they apply to the diffed file setlocal nomodeline " If there are comments they start with # -let &commentstring = "# %s" +let &l:commentstring = "# %s" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 3454a4d694..2604257594 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file. -" Language: Lua 4.0+ -" Maintainer: Max Ischenko <mfi@ukr.net> -" Last Change: 2012 Mar 07 +" Language: Lua +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Max Ischenko <mfi@ukr.net> +" Last Change: 2021 Nov 15 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -16,27 +17,30 @@ set cpo&vim " Set 'formatoptions' to break comment lines but not other lines, and insert " the comment leader when hitting <CR> or using "o". -setlocal fo-=t fo+=croql +setlocal formatoptions-=t formatoptions+=croql -setlocal com=:-- -setlocal cms=--%s +setlocal comments=:-- +setlocal commentstring=--%s setlocal suffixesadd=.lua +let b:undo_ftplugin = "setlocal fo< com< cms< sua<" -" The following lines enable the macros/matchit.vim plugin for -" extended matching with the % key. -if exists("loaded_matchit") - +if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = - \ '\<\%(do\|function\|if\)\>:' . - \ '\<\%(return\|else\|elseif\)\>:' . - \ '\<end\>,' . - \ '\<repeat\>:\<until\>' + \ '\<\%(do\|function\|if\)\>:' . + \ '\<\%(return\|else\|elseif\)\>:' . + \ '\<end\>,' . + \ '\<repeat\>:\<until\>,' . + \ '\%(--\)\=\[\(=*\)\[:]\1]' + let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase" +endif -endif " exists("loaded_matchit") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif let &cpo = s:cpo_save unlet s:cpo_save - -let b:undo_ftplugin = "setlocal fo< com< cms< suffixesadd<" diff --git a/runtime/ftplugin/routeros.vim b/runtime/ftplugin/routeros.vim new file mode 100644 index 0000000000..c6e4799aa2 --- /dev/null +++ b/runtime/ftplugin/routeros.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: MikroTik RouterOS Script +" Maintainer: zainin <z@wintr.dev> +" Last Change: 2021 Nov 14 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo-=C + +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setlocal com< cms< fo<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "RouterOS Script Files (*.rsc)\t*.rsc\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:save_cpo +unlet! s:save_cpo + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim index 24674776cb..e365ccf07e 100644 --- a/runtime/ftplugin/zimbu.vim +++ b/runtime/ftplugin/zimbu.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Zimbu " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2017 Dec 05 +" Last Change: 2021 Nov 12 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -34,9 +34,11 @@ setlocal errorformat^=%f\ line\ %l\ col\ %c:\ %m,ERROR:\ %m " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments. -let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=\(}\|\<UNTIL\>\)' - -let b:match_skip = 's:comment\|string\|zimbuchar' +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=\(}\|\<UNTIL\>\)' + let b:match_skip = 's:comment\|string\|zimbuchar' + let b:undo_ftplugin ..= " | unlet! b:match_words b:match_skip" +endif setlocal tw=78 setlocal et sts=2 sw=2 @@ -135,9 +137,60 @@ iabbr <buffer> <expr> until GCUpperSpace("until") iabbr <buffer> <expr> while GCUpperSpace("while") iabbr <buffer> <expr> repeat GCUpper("repeat") +let b:undo_ftplugin ..= + \ " | iunabbr <buffer> alias" .. + \ " | iunabbr <buffer> arg" .. + \ " | iunabbr <buffer> break" .. + \ " | iunabbr <buffer> case" .. + \ " | iunabbr <buffer> catch" .. + \ " | iunabbr <buffer> check" .. + \ " | iunabbr <buffer> class" .. + \ " | iunabbr <buffer> interface" .. + \ " | iunabbr <buffer> implements" .. + \ " | iunabbr <buffer> shared" .. + \ " | iunabbr <buffer> continue" .. + \ " | iunabbr <buffer> default" .. + \ " | iunabbr <buffer> extends" .. + \ " | iunabbr <buffer> do" .. + \ " | iunabbr <buffer> else" .. + \ " | iunabbr <buffer> elseif" .. + \ " | iunabbr <buffer> enum" .. + \ " | iunabbr <buffer> exit" .. + \ " | iunabbr <buffer> false" .. + \ " | iunabbr <buffer> fail" .. + \ " | iunabbr <buffer> finally" .. + \ " | iunabbr <buffer> for" .. + \ " | iunabbr <buffer> func" .. + \ " | iunabbr <buffer> if" .. + \ " | iunabbr <buffer> import" .. + \ " | iunabbr <buffer> in" .. + \ " | iunabbr <buffer> io" .. + \ " | iunabbr <buffer> main" .. + \ " | iunabbr <buffer> module" .. + \ " | iunabbr <buffer> new" .. + \ " | iunabbr <buffer> nil" .. + \ " | iunabbr <buffer> ok" .. + \ " | iunabbr <buffer> proc" .. + \ " | iunabbr <buffer> proceed" .. + \ " | iunabbr <buffer> return" .. + \ " | iunabbr <buffer> step" .. + \ " | iunabbr <buffer> switch" .. + \ " | iunabbr <buffer> sys" .. + \ " | iunabbr <buffer> this" .. + \ " | iunabbr <buffer> throw" .. + \ " | iunabbr <buffer> try" .. + \ " | iunabbr <buffer> to" .. + \ " | iunabbr <buffer> true" .. + \ " | iunabbr <buffer> until" .. + \ " | iunabbr <buffer> while" .. + \ " | iunabbr <buffer> repeat" + if !exists("no_plugin_maps") && !exists("no_zimbu_maps") nnoremap <silent> <buffer> [[ m`:call ZimbuGoStartBlock()<CR> nnoremap <silent> <buffer> ]] m`:call ZimbuGoEndBlock()<CR> + let b:undo_ftplugin ..= + \ " | silent! exe 'nunmap <buffer> [['" .. + \ " | silent! exe 'nunmap <buffer> ]]'" endif " Using a function makes sure the search pattern is restored |