From c0efe49e78eca3a17a5934cc283199122d081467 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 17 Nov 2021 10:02:59 +0100 Subject: vim-patch:519cc559b08b (#16340) Update runtime files https://github.com/vim/vim/commit/519cc559b08b800edc429688aece7ad6a00d41eb --- runtime/ftplugin/aap.vim | 13 ++++++--- runtime/ftplugin/diff.vim | 11 +++++--- runtime/ftplugin/lua.vim | 38 +++++++++++++++------------ runtime/ftplugin/routeros.vim | 29 ++++++++++++++++++++ runtime/ftplugin/zimbu.vim | 61 ++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 125 insertions(+), 27 deletions(-) create mode 100644 runtime/ftplugin/routeros.vim (limited to 'runtime/ftplugin') 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 -" 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 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 -" 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 -" Last Change: 2012 Mar 07 +" Language: Lua +" Maintainer: Doug Kearns +" Previous Maintainer: Max Ischenko +" 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 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\)\>:' . - \ '\,' . - \ '\:\' + \ '\<\%(do\|function\|if\)\>:' . + \ '\<\%(return\|else\|elseif\)\>:' . + \ '\,' . + \ '\:\,' . + \ '\%(--\)\=\[\(=*\)\[:]\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 +" 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 -" 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*\)\@<=\(}\|\\)' - -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*\)\@<=\(}\|\\)' + 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 until GCUpperSpace("until") iabbr while GCUpperSpace("while") iabbr repeat GCUpper("repeat") +let b:undo_ftplugin ..= + \ " | iunabbr alias" .. + \ " | iunabbr arg" .. + \ " | iunabbr break" .. + \ " | iunabbr case" .. + \ " | iunabbr catch" .. + \ " | iunabbr check" .. + \ " | iunabbr class" .. + \ " | iunabbr interface" .. + \ " | iunabbr implements" .. + \ " | iunabbr shared" .. + \ " | iunabbr continue" .. + \ " | iunabbr default" .. + \ " | iunabbr extends" .. + \ " | iunabbr do" .. + \ " | iunabbr else" .. + \ " | iunabbr elseif" .. + \ " | iunabbr enum" .. + \ " | iunabbr exit" .. + \ " | iunabbr false" .. + \ " | iunabbr fail" .. + \ " | iunabbr finally" .. + \ " | iunabbr for" .. + \ " | iunabbr func" .. + \ " | iunabbr if" .. + \ " | iunabbr import" .. + \ " | iunabbr in" .. + \ " | iunabbr io" .. + \ " | iunabbr main" .. + \ " | iunabbr module" .. + \ " | iunabbr new" .. + \ " | iunabbr nil" .. + \ " | iunabbr ok" .. + \ " | iunabbr proc" .. + \ " | iunabbr proceed" .. + \ " | iunabbr return" .. + \ " | iunabbr step" .. + \ " | iunabbr switch" .. + \ " | iunabbr sys" .. + \ " | iunabbr this" .. + \ " | iunabbr throw" .. + \ " | iunabbr try" .. + \ " | iunabbr to" .. + \ " | iunabbr true" .. + \ " | iunabbr until" .. + \ " | iunabbr while" .. + \ " | iunabbr repeat" + if !exists("no_plugin_maps") && !exists("no_zimbu_maps") nnoremap [[ m`:call ZimbuGoStartBlock() nnoremap ]] m`:call ZimbuGoEndBlock() + let b:undo_ftplugin ..= + \ " | silent! exe 'nunmap [['" .. + \ " | silent! exe 'nunmap ]]'" endif " Using a function makes sure the search pattern is restored -- cgit