diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-06-15 09:20:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 09:20:32 +0200 |
commit | 504d7decbdef55d58e62217a0a54cbee2a0944cc (patch) | |
tree | 09922dd511d071bdde73df146eca5bda4741c759 /runtime/ftplugin | |
parent | 1493efdc141f0bc0a472b60f87927b3d5ab59f5e (diff) | |
download | rneovim-504d7decbdef55d58e62217a0a54cbee2a0944cc.tar.gz rneovim-504d7decbdef55d58e62217a0a54cbee2a0944cc.tar.bz2 rneovim-504d7decbdef55d58e62217a0a54cbee2a0944cc.zip |
vim-patch:8c1b8cb2e0b5 (#18966)
Update runtime files
https://github.com/vim/vim/commit/8c1b8cb2e0b52d0853f85c2096a2f22dbc57a788
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/m3build.vim | 9 | ||||
-rw-r--r-- | runtime/ftplugin/m3quake.vim | 10 | ||||
-rw-r--r-- | runtime/ftplugin/modula3.vim | 18 | ||||
-rw-r--r-- | runtime/ftplugin/perl.vim | 60 | ||||
-rw-r--r-- | runtime/ftplugin/pod.vim | 71 | ||||
-rw-r--r-- | runtime/ftplugin/tap.vim | 27 | ||||
-rw-r--r-- | runtime/ftplugin/tt2html.vim | 8 | ||||
-rw-r--r-- | runtime/ftplugin/xs.vim | 7 |
8 files changed, 168 insertions, 42 deletions
diff --git a/runtime/ftplugin/m3build.vim b/runtime/ftplugin/m3build.vim index 9e1e169d38..c910eaecd0 100644 --- a/runtime/ftplugin/m3build.vim +++ b/runtime/ftplugin/m3build.vim @@ -1,21 +1,20 @@ " Vim filetype plugin file " Language: Modula-3 Makefile " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 April 15 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish endif -let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim runtime! ftplugin/m3quake.vim -if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Modula-3 Makefile (m3makefile m3overrides)\tm3makefile;m3overrides\n" .. - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && exists("b:m3quake_set_browsefilter") + let b:browsefilter = "Modula-3 Makefile (m3makefile m3overrides)\tm3makefile;m3overrides\n" .. + \ "All Files (*.*)\t*.*\n" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/m3quake.vim b/runtime/ftplugin/m3quake.vim index 627aabdc3e..7762875db9 100644 --- a/runtime/ftplugin/m3quake.vim +++ b/runtime/ftplugin/m3quake.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Modula-3 Quake " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 April 15 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish @@ -15,18 +15,20 @@ setlocal comments=s1:/*,mb:*,ex:*/,:% setlocal commentstring=%\ %s setlocal formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = "setl fo< com< cms<" + if exists("loaded_matchit") && !exists("b:match_words") let b:match_words = '\<\%(proc\|if\|foreach\)\>:\<else\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Modula-3 Quake Source Files (*.quake)\t*.quake\n" .. \ "All Files (*.*)\t*.*\n" + let b:m3quake_set_browsefilter = 1 + let b:undo_ftplugin ..= " | unlet! b:browsefilter b:m3quake_set_browsefilter" endif -let b:undo_ftplugin = "setl fo< com< cms< " .. - \ "| unlet! b:browsefilter b:match_words" - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/modula3.vim b/runtime/ftplugin/modula3.vim index fc9eb57949..1f8ab359d5 100644 --- a/runtime/ftplugin/modula3.vim +++ b/runtime/ftplugin/modula3.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Modula-3 " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 Apr 08 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish @@ -14,24 +14,28 @@ set cpo&vim setlocal comments=s0:(*,mb:\ ,ex:*) setlocal commentstring=(*%s*) setlocal formatoptions-=t formatoptions+=croql +setlocal suffixesadd+=.m3 +setlocal formatprg=m3pp + +let b:undo_ftplugin = "setlocal com< cms< fo< fp< sua<" if exists("loaded_matchit") && !exists("b:match_words") let b:match_words = '\<REPEAT\>:\<UNTIL\>,' .. - \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\)\>' .. + \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\|RECORD\|OBJECT\)\>' .. \ ':' .. - \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\)\>\|\%(^\s*\)\@<=\S.*=>' .. + \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\|METHODS\|OVERRIDES\)\>\|\%(^\s*\)\@<=\S.*=>' .. \ ':' .. - \ '\<END\>' + \ '\<END\>,' .. + \ '(\*:\*),<\*:\*>' + let b:undo_ftplugin ..= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Modula-3 Source Files (*.m3)\t*.m3\n" .. \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -let b:undo_ftplugin = "setl com< cms< fo< " .. - \ "| unlet! b:browsefilter b:match_words" - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index 603ba49502..d0bdbc0cfb 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -3,7 +3,8 @@ " Maintainer: vim-perl <vim-perl@googlegroups.com> " Homepage: https://github.com/vim-perl/vim-perl " Bugs/requests: https://github.com/vim-perl/vim-perl/issues -" Last Change: 2020 Apr 15 +" License: Vim License (see :help license) +" Last Change: 2021 Nov 10 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -20,27 +21,36 @@ setlocal keywordprg=perldoc\ -f setlocal comments=:# setlocal commentstring=#%s -" Change the browse dialog on Win32 to show mainly Perl-related files -if has("gui_win32") - let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . - \ "Perl Modules (*.pm)\t*.pm\n" . - \ "Perl Documentation Files (*.pod)\t*.pod\n" . - \ "All Files (*.*)\t*.*\n" -endif - " Provided by Ned Konz <ned at bike-nomad dot com> "--------------------------------------------- setlocal include=\\<\\(use\\\|require\\)\\> -setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','') +" '+' is removed to support plugins in Catalyst or DBIx::Class +" where the leading plus indicates a fully-qualified module name. +setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','') setlocal define=[^A-Za-z_] setlocal iskeyword+=: " The following line changes a global variable but is necessary to make " gf and similar commands work. Thanks to Andrew Pimlott for pointing -" out the problem. If this causes a problem for you, add an -" after/ftplugin/perl.vim file that contains -" set isfname-=: +" out the problem. +let s:old_isfname = &isfname set isfname+=: +let s:new_isfname = &isfname + +augroup perl_global_options + au! + exe "au BufEnter * if &filetype == 'perl' | let &isfname = '" . s:new_isfname . "' | endif" + exe "au BufLeave * if &filetype == 'perl' | let &isfname = '" . s:old_isfname . "' | endif" +augroup END + +" Undo the stuff we changed. +let b:undo_ftplugin = "setlocal fo< kp< com< cms< inc< inex< def< isk<" . + \ " | let &isfname = '" . s:old_isfname . "'" + +if get(g:, 'perl_fold', 0) + setlocal foldmethod=syntax + let b:undo_ftplugin .= " | setlocal fdm<" +endif " Set this once, globally. if !exists("perlpath") @@ -74,16 +84,26 @@ if &l:path == "" else let &l:path=&l:path.",".perlpath endif + +let b:undo_ftplugin .= " | setlocal pa<" "--------------------------------------------- -" Undo the stuff we changed. -let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" . - \ " | unlet! b:browsefilter" +" Change the browse dialog to show mainly Perl-related files +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . + \ "Perl Modules (*.pm)\t*.pm\n" . + \ "Perl Documentation Files (*.pod)\t*.pod\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif -" proper matching for matchit plugin -let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' -let b:match_words = '\<if\>:\<elsif\>:\<else\>' +" Proper matching for matchit plugin +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' + let b:match_words = '\<if\>:\<elsif\>:\<else\>' + let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip" +endif " Restore the saved compatibility options. let &cpo = s:save_cpo -unlet s:save_cpo +unlet s:save_cpo s:old_isfname s:new_isfname diff --git a/runtime/ftplugin/pod.vim b/runtime/ftplugin/pod.vim new file mode 100644 index 0000000000..2a905ab354 --- /dev/null +++ b/runtime/ftplugin/pod.vim @@ -0,0 +1,71 @@ +" Vim filetype plugin file +" Language: Perl POD format +" Maintainer: vim-perl <vim-perl@googlegroups.com> +" Author: Doug Kearns <dougkearns@gmail.com> +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2021 Oct 19 + +if exists("b:did_ftplugin") + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +setlocal comments=fb:=for\ comment +setlocal commentstring==for\ comment\ %s + +let b:undo_ftplugin = "setl com< cms<" + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = + \ '^=pod\>:^=cut\>,' . + \ '^=begin\s\+\(\S\+\):^=end\s\+\1,' . + \ '^=over\>:^=item\>:^=back\>,' . + \ '[IBCLEFSXZ]<<\%(\s\+\|$\)\@=:\%(\s\+\|^\)\@<=>>,' . + \ '[IBCLEFSXZ]<:>' + let b:undo_ftplugin .= " | unlet! b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "POD Source Files (*.pod)\t*.pod\n" . + \ "Perl Source Files (*.pl)\t*.pl\n" . + \ "Perl Modules (*.pm)\t*.pm\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif + +function! s:jumpToSection(backwards) + let flags = a:backwards ? 'bsWz' : 'sWz' + if has('syntax_items') + let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'" + else + let skip = '' + endif + for i in range(v:count1) + call search('^=\a', flags, 0, 0, skip) + endfor +endfunction + +if !exists("no_plugin_maps") && !exists("no_pod_maps") + nnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> + vnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> + nnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> + vnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> + nnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> + vnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> + nnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> + vnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> + let b:undo_ftplugin .= + \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . + \ " | silent! exe 'nunmap <buffer> ][' | silent! exe 'vunmap <buffer> ]['" . + \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . + \ " | silent! exe 'nunmap <buffer> []' | silent! exe 'vunmap <buffer> []'" +endif + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set expandtab: diff --git a/runtime/ftplugin/tap.vim b/runtime/ftplugin/tap.vim new file mode 100644 index 0000000000..c165c0ce68 --- /dev/null +++ b/runtime/ftplugin/tap.vim @@ -0,0 +1,27 @@ +" Vim filetype plugin file +" Language: Verbose TAP Output +" Maintainer: vim-perl <vim-perl@googlegroups.com> +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2021 Oct 22 + +" Only do this when not done yet for this buffer +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal foldtext=TAPTestLine_foldtext() +function! TAPTestLine_foldtext() + let line = getline(v:foldstart) + let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + return sub +endfunction + +setlocal foldminlines=5 +setlocal foldcolumn=2 +setlocal foldenable +setlocal foldmethod=syntax + +let b:undo_ftplugin = 'setlocal foldtext< foldminlines< foldcolumn< foldenable< foldmethod<' diff --git a/runtime/ftplugin/tt2html.vim b/runtime/ftplugin/tt2html.vim index 10520d8064..0407dbba4e 100644 --- a/runtime/ftplugin/tt2html.vim +++ b/runtime/ftplugin/tt2html.vim @@ -1,8 +1,10 @@ +" Vim filetype plugin file " Language: TT2 embedded with HTML " Maintainer: vim-perl <vim-perl@googlegroups.com> -" Homepage: http://github.com/vim-perl/vim-perl -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2018 Mar 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/xs.vim b/runtime/ftplugin/xs.vim index a28da6aa1e..206fbc2713 100644 --- a/runtime/ftplugin/xs.vim +++ b/runtime/ftplugin/xs.vim @@ -1,9 +1,10 @@ " Vim filetype plugin file " Language: XS (Perl extension interface language) " Maintainer: vim-perl <vim-perl@googlegroups.com> -" Homepage: http://github.com/vim-perl/vim-perl -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2018 Mar 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") |