From 0ba77f2f31c9de42f1e7a8435e6322d3f0a04fa5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 16 Oct 2021 17:07:40 +0200 Subject: [PATCH] vim-patch:2286304cdbba Update runtime files https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f --- runtime/doc/autocmd.txt | 36 ++++++------ runtime/doc/change.txt | 6 +- runtime/doc/editing.txt | 7 ++- runtime/doc/options.txt | 4 +- runtime/doc/pattern.txt | 2 +- runtime/doc/various.txt | 2 +- runtime/ftplugin/context.vim | 65 +++++++++++++-------- runtime/ftplugin/csh.vim | 49 ++++++++-------- runtime/ftplugin/tcsh.vim | 21 +++---- runtime/ftplugin/tmux.vim | 3 + runtime/ftplugin/toml.vim | 23 ++++++++ runtime/indent/hamster.vim | 21 ++++++- runtime/indent/sqlanywhere.vim | 22 +++---- runtime/indent/tcsh.vim | 13 +++-- runtime/syntax/css.vim | 27 +++++---- runtime/syntax/tcsh.vim | 66 +++++++++++---------- runtime/syntax/tmux.vim | 103 ++++++++++++++++++--------------- runtime/syntax/toml.vim | 81 ++++++++++++++++++++++++++ 18 files changed, 357 insertions(+), 194 deletions(-) create mode 100644 runtime/ftplugin/toml.vim create mode 100644 runtime/syntax/toml.vim diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index de74ee891e..5923dada43 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -630,7 +630,7 @@ FilterReadPre Before reading a file from a filter command. *FilterWritePost* FilterWritePost After writing a file for a filter command or making a diff with an external diff (see - DiffUpdated for internal diff). + |DiffUpdated| for internal diff). Vim checks the pattern against the name of the current buffer as with FilterWritePre. Not triggered when 'shelltemp' is off. @@ -683,23 +683,6 @@ InsertCharPre When a character is typed in Insert mode, Cannot change the text. |textlock| Not triggered when 'paste' is set. - *TextYankPost* -TextYankPost Just after a |yank| or |deleting| command, but not - if the black hole register |quote_| is used nor - for |setreg()|. Pattern must be *. - Sets these |v:event| keys: - inclusive - operator - regcontents - regname - regtype - visual - The `inclusive` flag combined with the |'[| - and |']| marks can be used to calculate the - precise region of the operation. - - Non-recursive (event cannot trigger itself). - Cannot change the text. |textlock| *InsertEnter* InsertEnter Just before starting Insert mode. Also for Replace mode and Virtual Replace mode. The @@ -948,6 +931,23 @@ TextChangedP After a change was made to the text in the current buffer in Insert mode, only when the popup menu is visible. Otherwise the same as TextChanged. + *TextYankPost* +TextYankPost Just after a |yank| or |deleting| command, but not + if the black hole register |quote_| is used nor + for |setreg()|. Pattern must be *. + Sets these |v:event| keys: + inclusive + operator + regcontents + regname + regtype + visual + The `inclusive` flag combined with the |'[| + and |']| marks can be used to calculate the + precise region of the operation. + + Non-recursive (event cannot trigger itself). + Cannot change the text. |textlock| *User* User Not executed automatically. Use |:doautocmd| to trigger this, typically for "custom events" diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 2b799e3e27..ffdd8427f9 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1129,9 +1129,6 @@ a register, a paste on a visual selected area will paste that single line on each of the selected lines (thus replacing the blockwise selected region by a block of the pasted line). -Use |zP|/|zp| to paste a blockwise yanked register without appending trailing -spaces. - *blockwise-register* If you use a blockwise Visual mode command to get the text into the register, the block of text will be inserted before ("P") or after ("p") the cursor @@ -1142,6 +1139,9 @@ this happen. However, if the width of the block is not a multiple of a width and the text after the inserted block contains s, that text may be misaligned. +Use |zP|/|zp| to paste a blockwise yanked register without appending trailing +spaces. + Note that after a charwise yank command, Vim leaves the cursor on the first yanked character that is closest to the start of the buffer. This means that "yl" doesn't move the cursor, but "yh" moves the cursor one character left. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 0e7e461a61..f91e4f0627 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1310,7 +1310,7 @@ change anything for the current directory. When |:lcd| has been used for a window, the specified directory becomes the current directory for that window. Windows where the |:lcd| command has not been used stick to the global or tab-local directory. When jumping to another -window the current directory will become the last specified local current +window the current directory is changed to the last specified local current directory. If none was specified, the global or tab-local directory is used. When changing tabs the same behaviour applies. If the current tab has no @@ -1467,6 +1467,11 @@ It is also possible that you modified the file yourself, from another edit session or with another command (e.g., a filter command). Then you will know which version of the file you want to keep. +The accuracy of the time check depends on the filesystem. On Unix it is +usually sub-second. With old file sytems and on MS-Windows it is normally one +second. Use has('nanotime') check if sub-second time stamp checks are +available. + There is one situation where you get the message while there is nothing wrong: On a Win32 system on the day daylight saving time starts. There is something in the Win32 libraries that confuses Vim about the hour time difference. The diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 981bdd09fc..3520d40591 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5981,13 +5981,13 @@ A jump table for the options with a short description can be found at |Q_op|. return value of expr contains % items they will get expanded. The expression can contain the } character, the end of expression is denoted by %}. - The For example: > + For example: > func! Stl_filename() abort return "%t" endfunc < `stl=%{Stl_filename()}` results in `"%t"` `stl=%{%Stl_filename()%}` results in `"Name of current file"` - } - End of `{%` expression + %} - End of `{%` expression ( - Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. ) - End of item group. No width fields allowed. diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index c49cc6d540..dfed39dba6 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -977,7 +977,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): /.*\%17v < Column 17 is highlighted by 'hlsearch' because there is another match where ".*" matches zero characters. -< + Character classes: \i identifier character (see 'isident' option) */\i* diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index b06fa7518c..5484e27797 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -168,7 +168,7 @@ g8 Print the hex values of the bytes used in the *:z!* :[range]z![+-^.=][count] - Like ":z:", but when [count] is not specified, it + Like ":z", but when [count] is not specified, it defaults to the Vim window height minus one. :[range]z[!]#[+-^.=][count] *:z#* 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() + 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$ + " $...$ 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 diff --git a/runtime/indent/hamster.vim b/runtime/indent/hamster.vim index b27a173924..ae5c3fdedd 100644 --- a/runtime/indent/hamster.vim +++ b/runtime/indent/hamster.vim @@ -1,8 +1,14 @@ " Vim indent file " Language: Hamster Script -" Version: 2.0.6.0 -" Last Change: Wed Nov 08 2006 12:02:42 PM -" Maintainer: David Fishburn +" Version: 2.0.6.1 +" Last Change: 2021 Oct 11 +" Maintainer: David Fishburn +" Download: https://www.vim.org/scripts/script.php?script_id=1099 +" +" 2.0.6.1 (Oct 2021) +" Added b:undo_indent +" Added cpo check +" " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -14,12 +20,17 @@ setlocal indentkeys+==~if,=~else,=~endif,=~endfor,=~endwhile setlocal indentkeys+==~do,=~until,=~while,=~repeat,=~for,=~loop setlocal indentkeys+==~sub,=~endsub +let b:undo_indent = "setl indentkeys<" + " Define the appropriate indent function but only once setlocal indentexpr=HamGetFreeIndent() if exists("*HamGetFreeIndent") finish endif +let s:keepcpo = &cpo +set cpo&vim + function HamGetIndent(lnum) let ind = indent(a:lnum) let prevline=getline(a:lnum) @@ -52,4 +63,8 @@ function HamGetFreeIndent() return ind endfunction +" Restore: +let &cpo = s:keepcpo +unlet s:keepcpo + " vim:sw=2 tw=80 diff --git a/runtime/indent/sqlanywhere.vim b/runtime/indent/sqlanywhere.vim index d39fa3240e..4772b5951b 100644 --- a/runtime/indent/sqlanywhere.vim +++ b/runtime/indent/sqlanywhere.vim @@ -1,9 +1,8 @@ " Vim indent file " Language: SQL " Maintainer: David Fishburn -" Last Change By Maintainer: 2017 Jun 13 -" Last Change: by Stephen Wall, #5578, 2020 Jun 07 -" Version: 3.0 +" Last Change: 2021 Oct 11 +" Version: 4.0 " Download: http://vim.sourceforge.net/script.php?script_id=495 " Notes: @@ -21,6 +20,9 @@ " it, this can leave the indent hanging to the right one too many. " " History: +" 4.0 (Oct 2021) +" Added b:undo_indent +" " 3.0 (Dec 2012) " Added cpo check " @@ -56,10 +58,13 @@ setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=) " in the indentkeys is typed setlocal indentexpr=GetSQLIndent() +let b:undo_indent = "setl indentexpr< indentkeys<" + " Only define the functions once. if exists("*GetSQLIndent") finish endif + let s:keepcpo= &cpo set cpo&vim @@ -68,14 +73,9 @@ set cpo&vim " IS is excluded, since it is difficult to determine when the " ending block is (especially for procedures/functions). let s:SQLBlockStart = '^\s*\%('. - \ 'if\>.*\\|'. - \ 'elseif\>.*\.(\.*\.*\.*\' let s:SQLBlockEnd = '^\s*\(end\)\>' diff --git a/runtime/indent/tcsh.vim b/runtime/indent/tcsh.vim index 025d9c805d..93d96e7789 100644 --- a/runtime/indent/tcsh.vim +++ b/runtime/indent/tcsh.vim @@ -1,7 +1,8 @@ " Vim indent file " Language: C-shell (tcsh) -" Maintainer: Doug Kearns where a=dougkearns, b=gmail -" Last Modified: Sun 26 Sep 2021 12:38:38 PM EDT +" Maintainer: Doug Kearns +" Previous Maintainer: Gautam Iyer where NoSpam=gmail (Original Author) +" Last Change: 2021 Oct 15 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -11,7 +12,9 @@ endif let b:did_indent = 1 setlocal indentexpr=TcshGetIndent() -setlocal indentkeys+=e,0=end,0=endsw indentkeys-=0{,0},0),:,0# +setlocal indentkeys+=e,0=end +setlocal indentkeys-=0{,0},0),:,0# + let b:undo_indent = "setl inde< indk<" " Only define the function once. @@ -40,9 +43,9 @@ function TcshGetIndent() let ind = ind - shiftwidth() endif - " Subtract indent if current line has on end, endif, case commands + " Subtract indent if current line has on end, endif, endsw, case commands let line = getline(v:lnum) - if line =~ '\v^\s*%(else|end|endif)\s*$' + if line =~ '\v^\s*%(else|end|endif|endsw)\s*$' let ind = ind - shiftwidth() endif diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index 19326d01e4..67ad1ea335 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -2,12 +2,12 @@ " Language: Cascading Style Sheets " Previous Contributor List: " Jules Wang -" Claudio Fleiner (Maintainer) +" Claudio Fleiner " Yeti (Add full CSS2, HTML4 support) " Nikolai Weibull (Add CSS2 support) -" URL: https://github.com/jsit/css.vim +" URL: https://github.com/vim-language-dept/css-syntax.vim " Maintainer: Jay Sitter -" Last Change: 2019 Jul. 29 +" Last Change: 2021 Oct 15 " quit when a syntax file was already loaded if !exists("main_syntax") @@ -23,6 +23,8 @@ let s:cpo_save = &cpo set cpo&vim syn case ignore +" Add dash to allowed keyword characters. +syn iskeyword @,48-57,_,192-255,- " HTML4 tags syn keyword cssTagName abbr address area a b base @@ -32,7 +34,7 @@ syn keyword cssTagName dfn div dl dt em fieldset form syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i syn keyword cssTagName iframe input ins isindex kbd label legend li syn keyword cssTagName link map menu meta noscript ol optgroup -syn keyword cssTagName option p param pre q s samp script small +syn keyword cssTagName option p param picture pre q s samp script small syn keyword cssTagName span strong sub sup tbody td syn keyword cssTagName textarea tfoot th thead title tr ul u var syn keyword cssTagName object svg @@ -127,7 +129,7 @@ syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|loca syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction -syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\|conic-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma syn region cssFunction contained matchgroup=cssFunctionName start="\<\(blur\|brightness\|contrast\|drop-shadow\|grayscale\|hue-rotate\|invert\|opacity\|saturate\|sepia\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at @@ -220,7 +222,7 @@ syn keyword cssFlexibleBoxProp contained order syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>" syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center syn match cssFlexibleBoxAttr contained "\" -syn match cssFlexibleBoxAttr contained "\" +syn match cssFlexibleBoxAttr contained "\" " CSS Fonts Module Level 3 " http://www.w3.org/TR/css-fonts-3/ @@ -234,9 +236,7 @@ syn keyword cssFontAttr contained larger smaller syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>" syn match cssFontAttr contained "\" " font-family attributes -syn match cssFontAttr contained "\<\(sans-\)\=serif\>" -syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf -syn keyword cssFontAttr contained cursive fantasy monospace +syn keyword cssFontAttr contained sans-serif serif cursive fantasy monospace " font-feature-settings attributes syn keyword cssFontAttr contained on off " font-stretch attributes @@ -283,6 +283,7 @@ syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssGridProp contained "\" +syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssHyerlinkProp contained "\" @@ -294,6 +295,10 @@ syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic syn keyword cssListAttr contained disc circle square hebrew armenian georgian syn keyword cssListAttr contained inside outside +" object-fit https://www.w3.org/TR/css-images-3/#the-object-fit +syn match cssObjectProp contained "\" +syn keyword cssObjectAttr contained fill contain cover scale-down + syn keyword cssPositioningProp contained bottom clear clip display float left syn keyword cssPositioningProp contained position right top visibility syn match cssPositioningProp contained "\" @@ -303,7 +308,7 @@ syn keyword cssPositioningAttr contained left right both syn match cssPositioningAttr contained "\" syn match cssPositioningAttr contained "\" syn match cssPositioningAttr contained "\" -syn keyword cssPositioningAttr contained static relative absolute fixed subgrid +syn keyword cssPositioningAttr contained static relative absolute fixed subgrid sticky syn keyword cssPrintAttr contained landscape portrait crop cross always @@ -548,6 +553,7 @@ hi def link cssMarqueeProp cssProp hi def link cssMultiColumnProp cssProp hi def link cssPagedMediaProp cssProp hi def link cssPositioningProp cssProp +hi def link cssObjectProp cssProp hi def link cssPrintProp cssProp hi def link cssRubyProp cssProp hi def link cssSpeechProp cssProp @@ -581,6 +587,7 @@ hi def link cssMultiColumnAttr cssAttr hi def link cssPaddingAttr cssAttr hi def link cssPagedMediaAttr cssAttr hi def link cssPositioningAttr cssAttr +hi def link cssObjectAttr cssAttr hi def link cssGradientAttr cssAttr hi def link cssPrintAttr cssAttr hi def link cssRubyAttr cssAttr diff --git a/runtime/syntax/tcsh.vim b/runtime/syntax/tcsh.vim index 27c6417fd0..6837125129 100644 --- a/runtime/syntax/tcsh.vim +++ b/runtime/syntax/tcsh.vim @@ -1,8 +1,9 @@ -" tcsh.vim: Vim syntax file for tcsh scripts -" Maintainer: Doug Kearns where NoSpam=gmail -" Author: Gautam Iyer where NoSpam=gmail -" Modified: Sun 26 Sep 2021 12:40:55 PM EDT -" +" Vim syntax file +" Language: tcsh scripts +" Maintainer: Doug Kearns +" Previous Maintainer: Gautam Iyer where NoSpam=gmail (Original Author) +" Last Change: 2021 Oct 15 + " Description: We break up each statement into a "command" and an "end" part. " All groups are either a "command" or part of the "end" of a statement (ie " everything after the "command"). This is because blindly highlighting tcsh @@ -20,36 +21,36 @@ endif let s:oldcpo = &cpo set cpo&vim " Line continuation is used -setlocal iskeyword+=- +syn iskeyword @,48-57,_,192-255,- syn case match -" ----- Clusters ----- +" ----- Clusters ----- {{{1 syn cluster tcshModifiers contains=tcshModifier,tcshModifierError syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote -syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement +syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArgument syn cluster tcshStatements contains=tcshBuiltin,tcshCommands,tcshIf,tcshWhile syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst syn cluster tcshConditions contains=tcshCmdSubst,tcshParenExpr,tcshOperator,tcshNumber,@tcshVarList -" ----- Errors ----- +" ----- Errors ----- {{{1 " Define first, so can be easily overridden. syn match tcshError contained '\v\S.+' -" ----- Statements ----- +" ----- Statements ----- {{{1 " Tcsh commands: Any filename / modifiable variable (must be first!) syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd " Builtin commands except those treated specially. Currently (un)set(env), " (un)alias, if, while, else, bindkey -syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which +syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc termname time umask uncomplete unhash universe unlimit ver wait warp watchlog where which " StatementEnd is anything after a built-in / command till the lexical end of a " statement (;, |, ||, |&, && or end of line) syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltin start='' end='\v\\@' -" ----- Strings ----- +" ----- Strings ----- {{{1 " Tcsh does not allow \" in strings unless the "backslash_quote" shell " variable is set. Set the vim variable "tcsh_backslash_quote" to 0 if you " want VIM to assume that no backslash quote constructs exist. " Backquotes are treated as commands, and are not contained in anything -if(exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0) +if exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0 syn region tcshSQuote keepend contained start="\v\\@, >>, >>&, >>!, >>&!] syn match tcshRedir contained '\v\<|\>\>?\&?!?' @@ -190,13 +192,13 @@ syn match tcshOperator contained '&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\| syn match tcshNumber contained '\v<-?\d+>' " Arguments -syn match tcshArguement contained '\v\s@<=-(\w|-)*' +syn match tcshArgument contained '\v\s@<=-(\w|-)*' " Special characters. \xxx, or backslashed characters. "syn match tcshSpecial contained '\v\\@ " License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) @@ -30,14 +30,14 @@ syn match tmuxVariable /\w\+=/ display syn match tmuxVariableExpansion /\${\=\w\+}\=/ display syn match tmuxControl /%\(if\|elif\|else\|endif\)/ -syn region tmuxComment start=/#/ skip=/\\\@ 231 && s:i < 235)) ? 15 : "none" - exec "syn match tmuxColour" . s:i . " /\\/ display" -\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg -endfor +if get(g:, "tmux_syntax_colors", 1) + for s:i in range(0, 255) + let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none" + exec "syn match tmuxColour" . s:i . " /\\/ display" +\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg + endfor +endif syn keyword tmuxOptions -\ backspace buffer-limit command-alias default-terminal escape-time -\ exit-empty activity-action assume-paste-time base-index bell-action -\ default-command default-shell default-size destroy-unattached +\ backspace buffer-limit command-alias copy-command default-terminal editor +\ escape-time exit-empty activity-action assume-paste-time base-index +\ bell-action default-command default-shell default-size destroy-unattached \ detach-on-destroy display-panes-active-colour display-panes-colour -\ display-panes-time display-time exit-unattached focus-events history-file -\ history-limit key-table lock-after-time lock-command message-command-style -\ message-limit message-style aggressive-resize allow-rename -\ alternate-screen automatic-rename automatic-rename-format -\ clock-mode-colour clock-mode-style main-pane-height main-pane-width -\ mode-keys mode-style monitor-activity monitor-bell monitor-silence mouse -\ other-pane-height other-pane-width pane-active-border-style -\ pane-base-index pane-border-format pane-border-status pane-border-style -\ prefix prefix2 remain-on-exit renumber-windows repeat-time set-clipboard -\ set-titles set-titles-string silence-action status status-bg status-fg -\ status-format status-interval status-justify status-keys status-left -\ status-left-length status-left-style status-position status-right -\ status-right-length status-right-style status-style synchronize-panes -\ terminal-overrides update-environment user-keys visual-activity -\ visual-bell visual-silence window-active-style window-size -\ window-status-activity-style window-status-bell-style +\ display-panes-time display-time exit-unattached extended-keys focus-events +\ history-file history-limit key-table lock-after-time lock-command +\ message-command-style message-limit message-style aggressive-resize +\ allow-rename alternate-screen automatic-rename automatic-rename-format +\ clock-mode-colour clock-mode-style copy-mode-current-match-style +\ copy-mode-mark-style copy-mode-match-style main-pane-height +\ main-pane-width mode-keys mode-style monitor-activity monitor-bell +\ monitor-silence mouse other-pane-height other-pane-width +\ pane-active-border-style pane-base-index pane-border-format +\ pane-border-lines pane-border-status pane-border-style pane-colours prefix +\ prefix2 prompt-history-limit remain-on-exit renumber-windows repeat-time +\ set-clipboard set-titles set-titles-string silence-action status status-bg +\ status-fg status-format status-interval status-justify status-keys +\ status-left status-left-length status-left-style status-position +\ status-right status-right-length status-right-style status-style +\ synchronize-panes terminal-features terminal-overrides update-environment +\ user-keys visual-activity visual-bell visual-silence window-active-style +\ window-size window-status-activity-style window-status-bell-style \ window-status-current-format window-status-current-style \ window-status-format window-status-last-style window-status-separator -\ window-status-style window-style word-separators wrap-search xterm-keys +\ window-status-style window-style word-separators wrap-search syn keyword tmuxCommands \ attach attach-session bind bind-key break-pane breakp capture-pane \ capturep choose-buffer choose-client choose-tree clear-history clearhist -\ clock-mode command-prompt confirm confirm-before copy-mode detach -\ detach-client display display-menu display-message display-panes displayp -\ find-window findw if if-shell join-pane joinp kill-pane kill-server -\ kill-session kill-window killp has-session has killw link-window linkw -\ list-buffers list-clients list-commands list-keys list-panes list-sessions -\ list-windows load-buffer loadb lock lock-client lock-server lock-session -\ lockc last-pane lastp locks ls last-window last lsb lsc delete-buffer -\ deleteb lscm lsk lsp lsw menu move-pane move-window movep movew new -\ new-session new-window neww next next-layout next-window nextl -\ paste-buffer pasteb pipe-pane pipep prev previous-layout previous-window -\ prevl refresh refresh-client rename rename-session rename-window renamew -\ resize-pane resize-window resizep resizew respawn-pane respawn-window -\ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb +\ clock-mode command-prompt confirm confirm-before copy-mode customize-mode +\ detach detach-client display display-menu display-message display-panes +\ display-popup displayp find-window findw if if-shell join-pane joinp +\ kill-pane kill-server kill-session kill-window killp has has-session killw +\ link-window linkw list-buffers list-clients list-commands list-keys +\ list-panes list-sessions list-windows load-buffer loadb lock lock-client +\ lock-server lock-session lockc last-pane lastp locks ls last last-window +\ lsb delete-buffer deleteb lsc lscm lsk lsp lsw menu move-pane move-window +\ clear-prompt-history clearphist movep movew new new-session new-window +\ neww next next-layout next-window nextl paste-buffer pasteb pipe-pane +\ pipep popup prev previous-layout previous-window prevl refresh +\ refresh-client rename rename-session rename-window renamew resize-pane +\ resize-window resizep resizew respawn-pane respawn-window respawnp +\ respawnw rotate-window rotatew run run-shell save-buffer saveb \ select-layout select-pane select-window selectl selectp selectw send \ send-keys send-prefix set set-buffer set-environment set-hook set-option \ set-window-option setb setenv setw show show-buffer show-environment -\ show-hooks show-messages show-options show-window-options showb showenv -\ showmsgs showw source source-file split-window splitw start start-server -\ suspend-client suspendc swap-pane swap-window swapp swapw switch-client -\ switchc unbind unbind-key unlink-window unlinkw wait wait-for +\ show-hooks show-messages show-options show-prompt-history +\ show-window-options showb showenv showmsgs showphist showw source +\ source-file split-window splitw start start-server suspend-client suspendc +\ swap-pane swap-window swapp swapw switch-client switchc unbind unbind-key +\ unlink-window unlinkw wait wait-for let &cpo = s:original_cpo unlet! s:original_cpo s:bg s:i diff --git a/runtime/syntax/toml.vim b/runtime/syntax/toml.vim new file mode 100644 index 0000000000..bcb1b0b9c9 --- /dev/null +++ b/runtime/syntax/toml.vim @@ -0,0 +1,81 @@ +" Vim syntax file +" Language: TOML +" Homepage: https://github.com/cespare/vim-toml +" Maintainer: Aman Verma +" Previous Maintainer: Caleb Spare +" Last Change: Oct 8, 2021 + +if exists('b:current_syntax') + finish +endif + +syn match tomlEscape /\\[btnfr"/\\]/ display contained +syn match tomlEscape /\\u\x\{4}/ contained +syn match tomlEscape /\\U\x\{8}/ contained +syn match tomlLineEscape /\\$/ contained + +" Basic strings +syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape +" Multi-line basic strings +syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape +" Literal strings +syn region tomlString oneline start=/'/ end=/'/ +" Multi-line literal strings +syn region tomlString start=/'''/ end=/'''/ + +syn match tomlInteger /[+-]\=\<[1-9]\(_\=\d\)*\>/ display +syn match tomlInteger /[+-]\=\<0\>/ display +syn match tomlInteger /[+-]\=\<0x[[:xdigit:]]\(_\=[[:xdigit:]]\)*\>/ display +syn match tomlInteger /[+-]\=\<0o[0-7]\(_\=[0-7]\)*\>/ display +syn match tomlInteger /[+-]\=\<0b[01]\(_\=[01]\)*\>/ display +syn match tomlInteger /[+-]\=\<\(inf\|nan\)\>/ display + +syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\.\d\+\>/ display +syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\(\.\d\(_\=\d\)*\)\=[eE][+-]\=\d\(_\=\d\)*\>/ display + +syn match tomlBoolean /\<\%(true\|false\)\>/ display + +" https://tools.ietf.org/html/rfc3339 +syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}/ display +syn match tomlDate /\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?/ display +syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display + +syn match tomlDotInKey /\v[^.]+\zs\./ contained display +syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]._-]+\ze\s*\=/ contains=tomlDotInKey display +syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape +syn region tomlKeySq oneline start=/\v(^|[{,])\s*\zs'/ end=/'\ze\s*=/ + +syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq,tomlDotInKey + +syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq,tomlDotInKey + +syn region tomlKeyValueArray start=/=\s*\[\zs/ end=/\]/ contains=@tomlValue + +syn region tomlArray start=/\[/ end=/\]/ contains=@tomlValue contained + +syn cluster tomlValue contains=tomlArray,tomlString,tomlInteger,tomlFloat,tomlBoolean,tomlDate,tomlComment + +syn keyword tomlTodo TODO FIXME XXX BUG contained + +syn match tomlComment /#.*/ contains=@Spell,tomlTodo + +hi def link tomlComment Comment +hi def link tomlTodo Todo +hi def link tomlTableArray Title +hi def link tomlTable Title +hi def link tomlDotInKey Normal +hi def link tomlKeySq Identifier +hi def link tomlKeyDq Identifier +hi def link tomlKey Identifier +hi def link tomlDate Constant +hi def link tomlBoolean Boolean +hi def link tomlFloat Float +hi def link tomlInteger Number +hi def link tomlString String +hi def link tomlLineEscape SpecialChar +hi def link tomlEscape SpecialChar + +syn sync minlines=500 +let b:current_syntax = 'toml' + +" vim: et sw=2 sts=2