From 0ba77f2f31c9de42f1e7a8435e6322d3f0a04fa5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 16 Oct 2021 17:07:40 +0200 Subject: vim-patch:2286304cdbba Update runtime files https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f --- runtime/ftplugin/context.vim | 67 +++++++++++++++++++++++++++----------------- runtime/ftplugin/csh.vim | 49 +++++++++++++++++--------------- runtime/ftplugin/tcsh.vim | 21 ++++++-------- runtime/ftplugin/tmux.vim | 3 ++ runtime/ftplugin/toml.vim | 23 +++++++++++++++ 5 files changed, 101 insertions(+), 62 deletions(-) create mode 100644 runtime/ftplugin/toml.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/context.vim b/runtime/ftplugin/context.vim index 10f1ae1648..37f7240d7b 100644 --- a/runtime/ftplugin/context.vim +++ b/runtime/ftplugin/context.vim @@ -2,7 +2,7 @@ " Language: ConTeXt typesetting engine " Maintainer: Nicola Vitacolonna " Former Maintainers: Nikolai Weibull -" Latest Revision: 2016 Oct 30 +" Latest Revision: 2021 Oct 15 if exists("b:did_ftplugin") finish @@ -17,7 +17,6 @@ if !exists('current_compiler') endif let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<" - \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2 if get(b:, 'context_metapost', get(g:, 'context_metapost', 1)) @@ -35,11 +34,12 @@ let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)' setlocal suffixesadd=.tex -if exists("loaded_matchit") +if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_skip = 'r:\\\@ [[ :call move_around(v:count1, "beginsection", "bW", v:false) -vnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:true) -nnoremap ]] :call move_around(v:count1, "beginsection", "W", v:false) -vnoremap ]] :call move_around(v:count1, "beginsection", "W", v:true) -nnoremap [] :call move_around(v:count1, "endsection", "bW", v:false) -vnoremap [] :call move_around(v:count1, "endsection", "bW", v:true) -nnoremap ][ :call move_around(v:count1, "endsection", "W", v:false) -vnoremap ][ :call move_around(v:count1, "endsection", "W", v:true) -nnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:false) -vnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:true) -nnoremap ]} :call move_around(v:count1, "endblock", "W", v:false) -vnoremap ]} :call move_around(v:count1, "endblock", "W", v:true) +if !exists("no_plugin_maps") && !exists("no_context_maps") + " Move around macros. + nnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:false) + vnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:true) + nnoremap ]] :call move_around(v:count1, "beginsection", "W", v:false) + vnoremap ]] :call move_around(v:count1, "beginsection", "W", v:true) + nnoremap [] :call move_around(v:count1, "endsection", "bW", v:false) + vnoremap [] :call move_around(v:count1, "endsection", "bW", v:true) + nnoremap ][ :call move_around(v:count1, "endsection", "W", v:false) + vnoremap ][ :call move_around(v:count1, "endsection", "W", v:true) + nnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:false) + vnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:true) + nnoremap ]} :call move_around(v:count1, "endblock", "W", v:false) + vnoremap ]} :call move_around(v:count1, "endblock", "W", v:true) + + let b:undo_ftplugin .= " | sil! exe 'nunmap [[' | sil! exe 'vunmap [['" . + \ " | sil! exe 'nunmap ]]' | sil! exe 'vunmap ]]'" . + \ " | sil! exe 'nunmap []' | sil! exe 'vunmap []'" . + \ " | sil! exe 'nunmap ][' | sil! exe 'vunmap ]['" . + \ " | sil! exe 'nunmap [{' | sil! exe 'vunmap [{'" . + \ " | sil! exe 'nunmap ]}' | sil! exe 'vunmap ]}'" +end " Other useful mappings if get(g:, 'context_mappings', 1) @@ -81,16 +90,22 @@ if get(g:, 'context_mappings', 1) call cursor(search(s:tp_regex, 'W') - 1, 1) endf - " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") - onoremap tp :call tp() - " Select TeX paragraph - vnoremap tp :call tp() - - " $...$ text object - onoremap i$ :normal! T$vt$ - onoremap a$ :normal! F$vf$ - vnoremap i$ T$ot$ - vnoremap a$ F$of$ + if !exists("no_plugin_maps") && !exists("no_context_maps") + " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") + onoremap tp :call tp() + " Select TeX paragraph + vnoremap tp :call tp() + + " $...$ text object + onoremap i$ :normal! T$vt$ + onoremap a$ :normal! F$vf$ + vnoremap i$ T$ot$ + vnoremap a$ F$of$ + + let b:undo_ftplugin .= " | sil! exe 'ounmap tp' | sil! exe 'vunmap tp'" . + \ " | sil! exe 'ounmap i$' | sil! exe 'vunmap i$'" . + \ " | sil! exe 'ounmap a$' | sil! exe 'vunmap a$'" + endif endif " Commands for asynchronous typesetting diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index 4ae09f91be..929823219c 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -1,21 +1,23 @@ " Vim filetype plugin file -" Language: csh -" Maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: csh +" Maintainer: Doug Kearns +" Previous Maintainer: Dan Sharp +" Contributor: Johannes Zellner +" Last Change: 2021 Oct 15 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C +setlocal comments=:# setlocal commentstring=#%s setlocal formatoptions-=t setlocal formatoptions+=crql +let b:undo_ftplugin = "setlocal com< cms< fo<" + " Csh: thanks to Johannes Zellner " - Both foreach and end must appear alone on separate lines. " - The words else and endif must appear at the beginning of input lines; @@ -23,26 +25,27 @@ setlocal formatoptions+=crql " - Each case label and the default label must appear at the start of a " line. " - while and end must appear alone on their input lines. -if exists("loaded_matchit") - let b:match_words = - \ '^\s*\.*(.*).*\:'. - \ '^\s*\\s\+\.*(.*).*\:^\s*\:'. - \ '^\s*\,'. - \ '\%(^\s*\\s\+\S\+\|^s*\\).*(.*):'. - \ '\:\:^\s*\,'. - \ '^\s*\.*(.*):^\s*\\s\+:^\s*\:^\s*\' +if exists("loaded_matchit") && !exists("b:match_words") + let s:line_start = '\%(^\s*\)\@<=' + let b:match_words = + \ s:line_start .. 'if\s*(.*)\s*then\>:' .. + \ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' .. + \ s:line_start .. 'endif\>,' .. + \ s:line_start .. '\%(\:\:' .. + \ s:line_start .. 'end\>,' .. + \ s:line_start .. 'switch\s*(:' .. + \ s:line_start .. 'case\s\+:' .. s:line_start .. 'default\>:\:' .. + \ s:line_start .. 'endsw\>' + unlet s:line_start + let b:undo_ftplugin ..= " | unlet b:match_words" endif -" Change the :browse e filter to primarily show csh-related files. -if has("gui_win32") - let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" . - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet b:browsefilter" endif -" Undo the stuff we changed. -let b:undo_ftplugin = "setlocal commentstring< formatoptions<" . - \ " | unlet! b:match_words b:browsefilter" - -" Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/tcsh.vim b/runtime/ftplugin/tcsh.vim index 7e2d959932..33f1aabf68 100644 --- a/runtime/ftplugin/tcsh.vim +++ b/runtime/ftplugin/tcsh.vim @@ -1,19 +1,17 @@ " Vim filetype plugin file -" Language: tcsh -" Maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: tcsh +" Maintainer: Doug Kearns +" Previous Maintainer: Dan Sharp +" Last Change: 2021 Oct 15 if exists("b:did_ftplugin") | finish | endif -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" -let s:browsefilter = "csh Files (*.csh)\t*.csh\n" . +let s:browsefilter = "csh Files (*.csh)\t*.csh\n" .. \ "All Files (*.*)\t*.*\n" runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim @@ -27,14 +25,11 @@ if exists("b:browsefilter") let s:browsefilter = b:browsefilter endif -" Change the :browse e filter to primarily show tcsh-related files. -if has("gui_win32") - let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" . s:browsefilter +if (has("gui_win32") || has("gui_gtk")) + let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter endif -" Undo the stuff we changed. -let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin +let b:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin -" Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/tmux.vim b/runtime/ftplugin/tmux.vim index ed9154924b..5c3461fefb 100644 --- a/runtime/ftplugin/tmux.vim +++ b/runtime/ftplugin/tmux.vim @@ -9,4 +9,7 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 +let b:undo_ftplugin = "setlocal comments< commentstring<" + +setlocal comments=:# setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/toml.vim b/runtime/ftplugin/toml.vim new file mode 100644 index 0000000000..1ef09a16e3 --- /dev/null +++ b/runtime/ftplugin/toml.vim @@ -0,0 +1,23 @@ +" Vim filetype plugin +" Language: TOML +" Homepage: https://github.com/cespare/vim-toml +" Maintainer: Aman Verma +" Author: Kevin Ballard +" Last Change: Sep 21, 2021 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo&vim +let b:undo_ftplugin = 'setlocal commentstring< comments<' + +setlocal commentstring=#\ %s +setlocal comments=:# + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: et sw=2 sts=2 -- cgit