diff options
-rw-r--r-- | .github/CODEOWNERS | 3 | ||||
-rw-r--r-- | runtime/doc/editing.txt | 2 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | runtime/doc/helphelp.txt | 4 | ||||
-rw-r--r-- | runtime/doc/map.txt | 29 | ||||
-rw-r--r-- | runtime/doc/message.txt | 2 | ||||
-rw-r--r-- | runtime/doc/motion.txt | 2 | ||||
-rw-r--r-- | runtime/doc/tags | 5 | ||||
-rw-r--r-- | runtime/doc/term.txt | 6 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 5 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 14 | ||||
-rw-r--r-- | runtime/doc/various.txt | 4 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 16 | ||||
-rw-r--r-- | runtime/filetype.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/i3config.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/solution.vim | 37 | ||||
-rw-r--r-- | runtime/optwin.vim | 8 | ||||
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 40 | ||||
-rw-r--r-- | runtime/syntax/c.vim | 3 | ||||
-rw-r--r-- | runtime/syntax/css.vim | 29 | ||||
-rw-r--r-- | runtime/syntax/i3config.vim | 256 | ||||
-rw-r--r-- | runtime/syntax/python.vim | 5 | ||||
-rw-r--r-- | runtime/syntax/texinfo.vim | 406 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 20 | ||||
-rw-r--r-- | src/testdir/README.txt | 42 |
25 files changed, 503 insertions, 452 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 41bf193be7..b07870054c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -89,6 +89,7 @@ runtime/ftplugin/gitsendemail.vim @tpope runtime/ftplugin/gprof.vim @dpelle runtime/ftplugin/haml.vim @tpope runtime/ftplugin/hgcommit.vim @k-takata +runtime/ftplugin/i3config.vim @hiqua runtime/ftplugin/indent.vim @dkearns runtime/ftplugin/javascript.vim @dkearns runtime/ftplugin/javascriptreact.vim @dkearns @@ -114,6 +115,7 @@ runtime/ftplugin/routeros.vim @zainin runtime/ftplugin/ruby.vim @tpope @dkearns runtime/ftplugin/sass.vim @tpope runtime/ftplugin/scss.vim @tpope +runtime/ftplugin/solution.vim @dkearns runtime/ftplugin/spec.vim @ignatenkobrain runtime/ftplugin/systemverilog.vim @Kocha runtime/ftplugin/tcsh.vim @dkearns @@ -208,6 +210,7 @@ runtime/syntax/groff.vim @jmarshall runtime/syntax/haml.vim @tpope runtime/syntax/haskell.vim @coot runtime/syntax/hgcommit.vim @k-takata +runtime/syntax/i3config.vim @hiqua runtime/syntax/indent.vim @dkearns runtime/syntax/kconfig.vim @chrisbra runtime/syntax/less.vim @genoma diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 3493510061..9736d4c481 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 8.2. Last change: 2021 Oct 16 +*editing.txt* For Vim version 8.2. Last change: 2021 Dec 11 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 21cf3f6c17..6765bdcf7e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2021 Nov 20 +*eval.txt* For Vim version 8.2. Last change: 2021 Dec 15 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 0fa5d8fbcd..357a64e78a 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 8.2. Last change: 2021 Nov 18 +*helphelp.txt* For Vim version 8.2. Last change: 2021 Dec 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -163,7 +163,7 @@ If you would like to open the help in the current window, see this tip: The initial height of the help window can be set with the 'helpheight' option (default 20). - + *help-buffer-options* When the help buffer is created, several local options are set to make sure the help text is displayed as it was intended: 'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|' diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 981ecf7925..fc3f42584c 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 8.2. Last change: 2021 Nov 20 +*map.txt* For Vim version 8.2. Last change: 2021 Dec 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -173,7 +173,7 @@ type "a", then "bar" will get inserted. "<unique>" can be used in any order. They must appear right after the command, before any other arguments. - *:map-local* *:map-<buffer>* *E224* *E225* + *:map-local* *:map-<buffer>* *:map-buffer* *E224* *E225* If the first argument to one of these commands is "<buffer>" the mapping will be effective in the current buffer only. Example: > :map <buffer> ,w /[.,;]<CR> @@ -232,7 +232,7 @@ Note: ":map <script>" and ":noremap <script>" do the same thing. The "<script>" overrules the command name. Using ":noremap <script>" is preferred, because it's clearer that remapping is (mostly) disabled. - *:map-<unique>* *E226* *E227* + *:map-<unique>* *:map-unique* *E226* *E227* If the first argument to one of these commands is "<unique>" and it is used to define a new mapping or abbreviation, the command will fail if the mapping or abbreviation already exists. Example: > @@ -974,28 +974,35 @@ Here is an example that counts the number of spaces with <F4>: > " doubling <F4> works on a line nnoremap <expr> <F4><F4> CountSpaces() .. '_' - function CountSpaces(type = '') abort + function CountSpaces(virtualedit = '', irregular_block = v:false, type = '') abort if a:type == '' - set opfunc=CountSpaces + let &operatorfunc = function('CountSpaces', [&virtualedit, v:false]) + set virtualedit=block return 'g@' - endif + endif + let cb_save = &clipboard let sel_save = &selection let reg_save = getreginfo('"') - let cb_save = &clipboard let visual_marks_save = [getpos("'<"), getpos("'>")] try - set clipboard= selection=inclusive - let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\<c-v>`]y"} - silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '') - echom getreg('"')->count(' ') + set clipboard= selection=inclusive virtualedit= + let commands = #{line: "'[V']", char: "`[v`]", block: "`[\<C-V>`]"}->get(a:type, 'v') + if getpos("']")[-1] != 0 || a:irregular_block + let commands ..= 'oO$' + let &operatorfunc = function('CountSpaces', [a:virtualedit, v:true]) + endif + let commands ..= 'y' + execute 'silent noautocmd keepjumps normal! ' .. commands + echomsg getreg('"')->count(' ') finally call setreg('"', reg_save) call setpos("'<", visual_marks_save[0]) call setpos("'>", visual_marks_save[1]) let &clipboard = cb_save let &selection = sel_save + let &virtualedit = a:virtualedit endtry endfunction diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index cbb320a5b5..1690e41e19 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 8.2. Last change: 2021 Jul 31 +*message.txt* For Vim version 8.2. Last change: 2021 Dec 13 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 81310a9291..4412d56d1d 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 8.2. Last change: 2021 Dec 04 +*motion.txt* For Vim version 8.2. Last change: 2021 Dec 13 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tags b/runtime/doc/tags index f694ba2bc5..fc5a0c9254 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -118,6 +118,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 'cc' options.txt /*'cc'* 'ccv' options.txt /*'ccv'* 'cd' options.txt /*'cd'* +'cdh' options.txt /*'cdh'* +'cdhome' options.txt /*'cdhome'* 'cdpath' options.txt /*'cdpath'* 'cedit' options.txt /*'cedit'* 'cf' options.txt /*'cf'* @@ -2754,6 +2756,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :map-<unique> map.txt /*:map-<unique>* :map-alt-keys map.txt /*:map-alt-keys* :map-arguments map.txt /*:map-arguments* +:map-buffer map.txt /*:map-buffer* :map-cmd map.txt /*:map-cmd* :map-commands map.txt /*:map-commands* :map-expression map.txt /*:map-expression* @@ -2767,6 +2770,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :map-special-chars map.txt /*:map-special-chars* :map-special-keys map.txt /*:map-special-keys* :map-undo map.txt /*:map-undo* +:map-unique map.txt /*:map-unique* :map-verbose map.txt /*:map-verbose* :map_l map.txt /*:map_l* :map_l! map.txt /*:map_l!* @@ -7270,6 +7274,7 @@ hasmapto() eval.txt /*hasmapto()* hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* +help-buffer-options helphelp.txt /*help-buffer-options* help-context help.txt /*help-context* help-curwin tips.txt /*help-curwin* help-summary usr_02.txt /*help-summary* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 3333a3ab6f..8862d0a400 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 8.2. Last change: 2021 Dec 04 +*term.txt* For Vim version 8.2. Last change: 2021 Dec 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -150,6 +150,8 @@ terminal that tmux is running in): > " Enable focus event tracking, see :help xterm-focus-event let &t_fe = "\<Esc>[?1004h" let &t_fd = "\<Esc>[?1004l" + execute "set <FocusGained>=\<Esc>[I" + execute "set <FocusLost>=\<Esc>[O" " Enable modified arrow keys, see :help arrow_modifiers execute "silent! set <xUp>=\<Esc>[@;*A" @@ -606,6 +608,8 @@ If your terminal does support this but Vim does not recognize the terminal, you may have to set the options yourself: > let &t_fe = "\<Esc>[?1004h" let &t_fd = "\<Esc>[?1004l" + execute "set <FocusGained>=\<Esc>[I" + execute "set <FocusLost>=\<Esc>[O" If this causes garbage to show when Vim starts up then it doesn't work. *termcap-colors* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index d064dc1bf0..44296f0e71 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 8.2. Last change: 2021 Aug 15 +*testing.txt* For Vim version 8.2. Last change: 2021 Dec 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -65,7 +65,8 @@ test_garbagecollect_now() *test_garbagecollect_now()* Like garbagecollect(), but executed right away. This must only be called directly to avoid any structure to exist internally, and |v:testing| must have been set before calling - any function. + any function. This will not work when called from a :def + function, because variables on the stack will be freed. test_garbagecollect_soon() *test_garbagecollect_soon()* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 1772aa1e92..80ea2a33e5 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2021 Dec 05 +*todo.txt* For Vim version 8.2. Last change: 2021 Dec 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -39,7 +39,7 @@ browser use: https://github.com/vim/vim/issues/1234 -------------------- Known bugs and current work ----------------------- Vim9 - Make everything work: -- Check TODO items in vim9compile.c and vim9execute.c +- Check TODO items in vim9execute.c - use CheckLegacyAndVim9Success(lines) in many more places - For builtin functions using tv_get_string*() use check_for_string() to be more strict about the argument type (not a bool). @@ -194,8 +194,6 @@ Terminal emulator window: - GUI: When using ":set go+=!" a system() call causes the hit-enter prompt. (#3327) - Allow for specifying the directory, with ++cwd={dir}. -- With a vertical split only one window is updated. (Linwei, 2018 Jun 2, - #2977) - When pasting should call vterm_keyboard_start_paste(), e.g. when using K_MIDDLEMOUSE, calling insert_reg(). - Users expect parsing the :term argument like a shell does, also support @@ -271,6 +269,8 @@ Was originally written by Felipe Morales. Request to use "." for the cursor column in search pattern \%<.c and \%<.v. (#8179) +":filter set termcap" only filters terminal codes, not keys. (#9297) + Remove SPACE_IN_FILENAME ? It is only used for completion. When 'term' starts with "foot" then default t_TI and t_TE to the values used @@ -846,9 +846,7 @@ window for the buffer. Win32 key codes are messy. Mike Williams tried to fix that, but now old mappings no longer work. Create a new terminal for the better solution? -Compiler warnings (geeknik, 2017 Oct 26): -- signed integer overflow in do_sub() (#2249) -- signed integer overflow in get_address() (#2248) +Compiler warning (geeknik, 2017 Oct 26): - undefined left shift in get_string_tv() (#2250) Add Native language protocol server (LSP) support. (Yegappan Lakshmanan, 2018 @@ -3895,7 +3893,7 @@ User Friendlier: $HOME/_vimrc, etc.) and add "edit vimrc" to the File menu. - Add a way to save local settings and mappings into a new plugin file. ":mkplugin <file>"? -- Add mappings local to a window: ":map <window> ..."? +- Add mappings local to a window: ":map <window> ..." #9339 9 Add buffer-local menu. Should offer a choice between removing the menu or disabling it. Be careful that tear-offs don't disappear (keep one empty item?). diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 6bccc83b23..b82427ca18 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 8.2. Last change: 2021 Nov 30 +*various.txt* For Vim version 8.2. Last change: 2021 Dec 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -598,7 +598,7 @@ N *+X11* Unix only: can restore window title |X11| |:oldfiles| - filter by file name |:registers| - filter by register contents (does not work multi-line) - |:set| - filter by variable name + |:set| - filter by option name Only normal messages are filtered, error messages are not. diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 856ec2f118..990d759e6c 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 01 +*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -568,6 +568,20 @@ characters, e.g.: > }) No command can follow the "{", only a comment can be used there. +If the statements include a dictionary, its closing bracket must not be +written at the start of a line. Otherwise, it would be parsed as the end of +the block. This does not work: > + command NewCommand { + let g:mydict = { + 'key': 'value', + } # ERROR: will be recognized as the end of the block + } +Put the '}' after the last item to avoid this: > + command NewCommand { + let g:mydict = { + 'key': 'value' } + } + Rationale: The "}" cannot be after a command because it would require parsing the commands to find it. For consistency with that no command can follow the "{". Unfortunately this means using "() => { command }" does not work, line diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 7b2090ceaa..d99527f17b 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Dec 03 +" Last Change: 2021 Dec 14 " Listen very carefully, I will say this only once if exists("did_load_filetypes") diff --git a/runtime/ftplugin/i3config.vim b/runtime/ftplugin/i3config.vim new file mode 100644 index 0000000000..4204510e64 --- /dev/null +++ b/runtime/ftplugin/i3config.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: i3 config file +" Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com> +" Maintainer: Quentin Hibon +" Version: 0.4 +" Last Change: 2021 Dec 14 + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal cms<" + +setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/solution.vim b/runtime/ftplugin/solution.vim new file mode 100644 index 0000000000..bd30c7bb19 --- /dev/null +++ b/runtime/ftplugin/solution.vim @@ -0,0 +1,37 @@ +" Vim filetype plugin file +" Language: Microsoft Visual Studio Solution +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2021 Dec 15 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setl com< cms<" + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = + \ '\<Project\>:\<EndProject\>,' .. + \ '\<ProjectSection\>:\<EndProjectSection\>,' .. + \ '\<Global\>:\<EndGlobal\>,' .. + \ '\<GlobalSection\>:\<EndGlobalSection\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Microsoft Visual Studio Solution Files\t*.sln\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 91824f8065..17fe276376 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Dec 11 +" Last Change: 2021 Dec 12 " If there already is an option window, jump to that one. let buf = bufnr('option-window') @@ -260,10 +260,8 @@ call <SID>OptionG("sect", §) call <SID>AddOption("path", gettext("list of directory names used for file searching")) call append("$", "\t" .. s:global_or_local) call <SID>OptionG("pa", &pa) -if exists("+cdhome") - call <SID>AddOption("cdhome", gettext("change directory to the home directory by :cd")) - call <SID>BinOptionG("cdh", &cdh) -endif +call <SID>AddOption("cdhome", gettext(":cd without argument goes to the home directory")) +call <SID>BinOptionG("cdh", &cdh) call <SID>AddOption("cdpath", gettext("list of directory names used for :cd")) call <SID>OptionG("cd", &cd) if exists("+autochdir") diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index e2d23475eb..2dead80aeb 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2021 Nov 29 +" Last Change: 2021 Dec 16 " " WORK IN PROGRESS - Only the basics work " Note: On MS-Windows you need a recent version of gdb. The one included with @@ -585,7 +585,7 @@ endfunc " to the next ", unescaping characters: " - remove line breaks " - change \\t to \t -" - change \0xhh to \xhh +" - change \0xhh to \xhh (disabled for now) " - change \ooo to octal " - change \\ to \ func s:DecodeMessage(quotedText) @@ -594,12 +594,21 @@ func s:DecodeMessage(quotedText) return endif return a:quotedText - \->substitute('^"\|".*\|\\n', '', 'g') - \->substitute('\\t', "\t", 'g') - \->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g') - \->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g') - \->substitute('\\\\', '\', 'g') + \ ->substitute('^"\|".*\|\\n', '', 'g') + \ ->substitute('\\t', "\t", 'g') + " multi-byte characters arrive in octal form + " NULL-values must be kept encoded as those break the string otherwise + \ ->substitute('\\000', s:NullRepl, 'g') + \ ->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g') + " Note: GDB docs also mention hex encodings - the translations below work + " but we keep them out for performance-reasons until we actually see + " those in mi-returns + " \ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g') + " \ ->substitute('\\0x00', s:NullRepl, 'g') + \ ->substitute('\\\\', '\', 'g') + \ ->substitute(s:NullRepl, '\\000', 'g') endfunc +const s:NullRepl = 'XXXNULLXXX' " Extract the "name" value from a gdb message with fullname="name". func s:GetFullname(msg) @@ -1081,10 +1090,19 @@ let s:evalFromBalloonExpr = 0 " Handle the result of data-evaluate-expression func s:HandleEvaluate(msg) - let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '') - let value = substitute(value, '\\"', '"', 'g') - " multi-byte characters arrive in octal form - let value = substitute(value, '\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g') + let value = a:msg + \ ->substitute('.*value="\(.*\)"', '\1', '') + \ ->substitute('\\"', '"', 'g') + \ ->substitute('\\\\', '\\', 'g') + "\ multi-byte characters arrive in octal form, replace everthing but NULL values + \ ->substitute('\\000', s:NullRepl, 'g') + \ ->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g') + "\ Note: GDB docs also mention hex encodings - the translations below work + "\ but we keep them out for performance-reasons until we actually see + "\ those in mi-returns + "\ ->substitute('\\0x00', s:NullRep, 'g') + "\ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g') + \ ->substitute(s:NullRepl, '\\000', 'g') if s:evalFromBalloonExpr if s:evalFromBalloonExprResult == '' let s:evalFromBalloonExprResult = s:evalexpr . ': ' . value diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 20f8632006..e86e1b8669 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 May 24 +" Last Change: 2021 Dec 07 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -196,7 +196,6 @@ syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" " Flag the first zero of an octal number as something special syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero syn match cOctalZero display contained "\<0" -syn match cFloat display contained "\d\+f" "floating point number, with dot, optional exponent syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index 67ad1ea335..564dc151bc 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -7,7 +7,7 @@ " Nikolai Weibull (Add CSS2 support) " URL: https://github.com/vim-language-dept/css-syntax.vim " Maintainer: Jay Sitter <jay@jaysitter.com> -" Last Change: 2021 Oct 15 +" Last Change: 2021 Oct 20 " quit when a syntax file was already loaded if !exists("main_syntax") @@ -116,7 +116,7 @@ syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFac syn case ignore syn match cssImportant contained "!\s*important\>" -syn match cssCustomProp contained "--[a-zA-Z0-9-_]*" +syn match cssCustomProp contained "\<--[a-zA-Z0-9-_]*\>" syn match cssColor contained "\<transparent\>" syn match cssColor contained "\<currentColor\>" @@ -126,6 +126,7 @@ syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline +syn region cssMathGroup contained matchgroup=cssMathParens start="(" end=")" containedin=cssFunction,cssMathGroup contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline 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 @@ -395,9 +396,9 @@ syn match cssUIAttr contained '\<preserve-3d\>' syn match cssIEUIAttr contained '\<bicubic\>' " Webkit/iOS specific properties -syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>' +syn match cssUIProp contained '\<\(tap-highlight-color\|user-select\|touch-callout\)\>' " IE specific properties -syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>' +syn match cssIEUIProp contained '\<\(interpolation-mode\|zoom\|filter\)\>' " Webkit/Firebox specific properties/attributes syn keyword cssUIProp contained appearance @@ -423,11 +424,15 @@ syn keyword cssAuralAttr contained male female child code digits continuous syn match cssMobileTextProp contained "\<text-size-adjust\>" syn keyword cssMediaProp contained width height orientation scan -syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ +syn keyword cssMediaProp contained any-hover any-pointer color-gamut grid hover +syn keyword cssMediaProp contained overflow-block overflow-inline pointer update +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-pixel-ratio\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-\(height\|width\)\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)\>/ syn keyword cssMediaAttr contained portrait landscape progressive interlace +syn keyword cssMediaAttr contained coarse fast fine hover infinite p3 paged +syn keyword cssMediaAttr contained rec2020 scroll slow srgb syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\<from\|to\>\)\)/ nextgroup=cssDefinition syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition syn keyword cssPageProp contained content size @@ -445,17 +450,17 @@ syn match cssBraceError "}" syn match cssAttrComma "," " Pseudo class -" http://www.w3.org/TR/css3-selectors/ +" https://www.w3.org/TR/selectors-4/ syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn syn keyword cssPseudoClassId contained link visited active hover before after left right -syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid +syn keyword cssPseudoClassId contained root empty target enabled disabled checked invalid syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>" syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>" -syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ +syn match cssPseudoClassId contained "\<focus\(-within\|-visible\)\=\>" +syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|is\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ,cssTagName,cssAttributeSelector,cssClassName,cssIdentifier " ------------------------------------ " Vendor specific properties syn match cssPseudoClassId contained "\<selection\>" -syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>" syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>" " Misc highlight groups diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim new file mode 100644 index 0000000000..a8b6637140 --- /dev/null +++ b/runtime/syntax/i3config.vim @@ -0,0 +1,256 @@ +" Vim syntax file +" Language: i3 config file +" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com> +" Version: 0.4 +" Last Change: 2021 Dec 14 + +" References: +" http://i3wm.org/docs/userguide.html#configuring +" http://vimdoc.sourceforge.net/htmldoc/syntax.html +" +" +" Quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +scriptencoding utf-8 + +" Error +syn match i3ConfigError /.*/ + +" Todo +syn keyword i3ConfigTodo TODO FIXME XXX contained + +" Comment +" Comments are started with a # and can only be used at the beginning of a line +syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo + +" Font +" A FreeType font description is composed by: +" a font family, a style, a weight, a variant, a stretch and a size. +syn match i3ConfigFontSeparator /,/ contained +syn match i3ConfigFontSeparator /:/ contained +syn keyword i3ConfigFontKeyword font contained +syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigFontSeparator +syn match i3ConfigFontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=i3ConfigFontNamespace,i3ConfigFontSeparator,i3ConfigFontKeyword +syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained +syn match i3ConfigFont /^\s*font\s\+.*$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace + +" variables +syn match i3ConfigString /\(['"]\)\(.\{-}\)\1/ contained +syn match i3ConfigColor /#\w\{6}/ contained +syn match i3ConfigVariableModifier /+/ contained +syn match i3ConfigVariableAndModifier /+\w\+/ contained contains=i3ConfigVariableModifier +syn match i3ConfigVariable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=i3ConfigVariableModifier,i3ConfigVariableAndModifier +syn keyword i3ConfigInitializeKeyword set contained +syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString + +" Gaps +syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained +syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,i3ConfigNumber,i3ConfigVariable +syn keyword i3ConfigSmartGapKeyword on inverse_outer contained +syn match i3ConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=i3ConfigSmartGapKeyword +syn keyword i3ConfigSmartBorderKeyword on no_gaps contained +syn match i3ConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=i3ConfigSmartBorderKeyword + +" Keyboard bindings +syn keyword i3ConfigAction toggle fullscreen restart key import kill shrink grow contained +syn keyword i3ConfigAction focus move grow height width split layout resize restore reload mute unmute exit mode workspace container to contained +syn match i3ConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=i3ConfigVariableModifier +syn match i3ConfigNumber /\s\d\+/ contained +syn match i3ConfigUnit /\sp\(pt\|x\)/ contained +syn match i3ConfigUnitOr /\sor/ contained +syn keyword i3ConfigBindKeyword bindsym bindcode exec gaps border contained +syn match i3ConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained +syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword,i3ConfigBorderStyleKeyword + +" Floating +syn keyword i3ConfigSizeSpecial x contained +syn match i3ConfigNegativeSize /-/ contained +syn match i3ConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber,i3ConfigNegativeSize +syn match i3ConfigFloating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=i3ConfigVariable +syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=i3ConfigSize + +" Orientation +syn keyword i3ConfigOrientationKeyword vertical horizontal auto contained +syn match i3ConfigOrientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=i3ConfigOrientationKeyword + +" Layout +syn keyword i3ConfigLayoutKeyword default stacking tabbed contained +syn match i3ConfigLayout /^\s*workspace_layout\s\+ |