diff options
Diffstat (limited to 'runtime')
33 files changed, 294 insertions, 176 deletions
diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index e8a1879668..3677b25aeb 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Mark Guzman <segfault@hasno.info> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Feb 25 +" Last Change: 2020 Apr 12 " ---------------------------------------------------------------------------- " " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) @@ -501,13 +501,8 @@ class VimRubyCompletion return if rails_base == nil $:.push rails_base unless $:.index( rails_base ) - rails_config = rails_base + "config/" - rails_lib = rails_base + "lib/" - $:.push rails_config unless $:.index( rails_config ) - $:.push rails_lib unless $:.index( rails_lib ) - - bootfile = rails_config + "boot.rb" - envfile = rails_config + "environment.rb" + bootfile = rails_base + "config/boot.rb" + envfile = rails_base + "config/environment.rb" if File.exists?( bootfile ) && File.exists?( envfile ) begin require bootfile diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt index df91b8d065..5d3bf7a761 100644 --- a/runtime/doc/arabic.txt +++ b/runtime/doc/arabic.txt @@ -171,6 +171,13 @@ o Enable Arabic settings [short-cut] and its support is preferred due to its level of offerings. 'arabic' when 'termbidi' is enabled only sets the keymap. + For vertical window isolation while setting 'termbidi' an LTR + vertical separator like "l" or "𝖨" may be used. It may also be + hidden by changing its color to the foreground color: > + :set fillchars=vert:l + :hi VertSplit ctermbg=White +< Note that this is a workaround, not a proper solution. + If, on the other hand, you'd like to be verbose and explicit and are opting not to use the 'arabic' short-cut command, here's what is needed (i.e. if you use ':set arabic' you can skip this section) - diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index aed3acab67..2b799e3e27 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -747,12 +747,14 @@ For compatibility with Vi these two exceptions are allowed: "\/{string}/" and "\?{string}?" do the same as "//{string}/r". "\&{string}&" does the same as "//{string}/". *pattern-delimiter* *E146* -Instead of the '/' which surrounds the pattern and replacement string, you -can use any other single-byte character, but not an alphanumeric character, -'\', '"' or '|'. This is useful if you want to include a '/' in the search -pattern or replacement string. Example: > +Instead of the '/' which surrounds the pattern and replacement string, you can +use another single-byte character. This is useful if you want to include a +'/' in the search pattern or replacement string. Example: > :s+/+//+ +You can use most characters, but not an alphanumeric character, '\', '"' or +'|'. + For the definition of a pattern, see |pattern|. In Visual block mode, use |/\%V| in the pattern to have the substitute work in the block only. Otherwise it works on whole lines anyway. diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 3b5287ee44..861aed4884 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -14,6 +14,7 @@ updated. API ~ *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead. +*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead. *nvim_command_output()* Use |nvim_exec()| instead. *nvim_execute_lua()* Use |nvim_exec_lua()| instead. @@ -54,6 +55,8 @@ Functions ~ without stopping the job. Use chanclose(id) to close any socket. +Lua ~ +*vim.register_keystroke_callback()* Use |vim.on_key()| instead. Modifiers ~ *cpo-<* diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 60a3f870a9..14f35acce3 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -127,14 +127,20 @@ Sometimes a GUI or other application may want to force a provider to DOCUMENTATION *dev-doc* -- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to document - differences from Vim; no other distinction is necessary. -- If a Vim feature is removed, delete its help section and move its tag to - |vim_diff.txt|. -- Move deprecated features to |deprecated.txt|. +- "Just say it". Avoid mushy, colloquial phrasing in all documentation + (docstrings, user manual, website materials, newsletters, …). Don't mince + words. Personality and flavor, used sparingly, are welcome--but in general, + optimize for the reader's time and energy: be "precise yet concise". + - Prefer the active voice: "Foo does X", not "X is done by Foo". +- Vim differences: + - Do not prefix help tags with "nvim-". Use |vim_diff.txt| to catalog + differences from Vim; no other distinction is necessary. + - If a Vim feature is removed, delete its help section and move its tag to + |vim_diff.txt|. +- Mention deprecated features in |deprecated.txt| and delete their old doc. - Use consistent language. - - "terminal" in a help tag always means "the embedded terminal emulator", not - "the user host terminal". + - "terminal" in a help tag always means "the embedded terminal emulator", + not "the user host terminal". - Use "tui-" to prefix help tags related to the host terminal, and "TUI" in prose if possible. - Docstrings: do not start parameter descriptions with "The" or "A" unless it @@ -222,13 +228,13 @@ LUA *dev-lua* - Keep the core Lua modules |lua-stdlib| simple. Avoid elaborate OOP or pseudo-OOP designs. Plugin authors just want functions to call, they don't - want to learn a big, fancy inheritance hierarchy. So we should avoid complex - objects: tables are usually better. + want to learn a big, fancy inheritance hierarchy. Thus avoid specialized + objects; tables or values are usually better. API *dev-api* -Use this template to name new API functions: +Use this template to name new RPC |API| functions: nvim_{thing}_{action}_{arbitrary-qualifiers} If the function acts on an object then {thing} is the name of that object @@ -356,4 +362,19 @@ External UIs are expected to implement these common features: published in this event. See also "mouse_on", "mouse_off". +NAMING *dev-naming* + +Naming is important. Consistent naming in the API and UI helps both users and +developers discover and intuitively understand related concepts ("families"), +and reduces cognitive burden. Discoverability encourages code re-use and +likewise avoids redundant, overlapping mechanisms, which reduces code +surface-area, and thereby minimizes bugs... + +Naming conventions ~ + +Use the "on_" prefix to name event handlers and also the interface for +"registering" such handlers (on_key). The dual nature is acceptable to avoid +a confused collection of naming conventions for these related concepts. + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e6405145cd..5d889983e3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1856,7 +1856,7 @@ v:null Special value used to put "null" in JSON and NIL in msgpack. v:numbermax Maximum value of a number. *v:numbermin* *numbermin-variable* -v:numbermin Minimum value of a number (negative) +v:numbermin Minimum value of a number (negative). *v:numbersize* *numbersize-variable* v:numbersize Number of bits in a Number. This is normally 64, but on some @@ -2149,7 +2149,7 @@ chanclose({id}[, {stream}]) Number Closes a channel or one of its streams chansend({id}, {data}) Number Writes {data} to channel char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} charidx({string}, {idx} [, {countcc}]) - Number char index of byte {idx} in {string} + Number char index of byte {idx} in {string} cindent({lnum}) Number C indent for line {lnum} clearmatches([{win}]) none clear all matches col({expr}) Number column nr of cursor or mark @@ -4196,11 +4196,15 @@ foldclosed({lnum}) *foldclosed()* The result is a Number. If the line {lnum} is in a closed fold, the result is the number of the first line in that fold. If the line {lnum} is not in a closed fold, -1 is returned. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. foldclosedend({lnum}) *foldclosedend()* The result is a Number. If the line {lnum} is in a closed fold, the result is the number of the last line in that fold. If the line {lnum} is not in a closed fold, -1 is returned. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. foldlevel({lnum}) *foldlevel()* The result is a Number, which is the foldlevel of line {lnum} @@ -4211,6 +4215,8 @@ foldlevel({lnum}) *foldlevel()* returned for lines where folds are still to be updated and the foldlevel is unknown. As a special case the level of the previous line is usually available. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. *foldtext()* foldtext() Returns a String, to be displayed for a closed fold. This is @@ -4862,11 +4868,11 @@ getmarklist([{expr}]) *getmarklist()* see |bufname()|. Each item in the returned List is a |Dict| with the following: - name - name of the mark prefixed by "'" - pos - a |List| with the position of the mark: + mark name of the mark prefixed by "'" + pos a |List| with the position of the mark: [bufnum, lnum, col, off] - Refer to |getpos()| for more information. - file - file name + Refer to |getpos()| for more information. + file file name Refer to |getpos()| for getting information about a specific mark. @@ -4877,6 +4883,8 @@ getmatches([{win}]) *getmatches()* |getmatches()| is useful in combination with |setmatches()|, as |setmatches()| can restore a list of matches saved by |getmatches()|. + If {win} is specified, use the window with this number or + window ID instead of the current window. Example: > :echo getmatches() < [{'group': 'MyGroup1', 'pattern': 'TODO', @@ -4945,8 +4953,10 @@ getqflist([{what}]) *getqflist()* valid |TRUE|: recognized error message When there is no error list or it's empty, an empty list is - returned. Quickfix list entries with non-existing buffer - number are returned with "bufnr" set to zero. + returned. Quickfix list entries with a non-existing buffer + number are returned with "bufnr" set to zero (Note: some + functions accept buffer number zero for the alternate buffer, + you may need to explicitly check for zero). Useful application: Find pattern matches in multiple files and do something with them: > @@ -5050,12 +5060,12 @@ getregtype([{regname}]) *getregtype()* <CTRL-V> is one character with value 0x16. If {regname} is not specified, |v:register| is used. -gettabinfo([{arg}]) *gettabinfo()* - If {arg} is not specified, then information about all the tab - pages is returned as a |List|. Each List item is a |Dictionary|. - Otherwise, {arg} specifies the tab page number and information - about that one is returned. If the tab page does not exist an - empty List is returned. +gettabinfo([{tabnr}]) *gettabinfo()* + If {tabnr} is not specified, then information about all the + tab pages is returned as a |List|. Each List item is a + |Dictionary|. Otherwise, {tabnr} specifies the tab page + number and information about that one is returned. If the tab + page does not exist an empty List is returned. Each List item is a |Dictionary| with the following entries: tabnr tab page number. @@ -5099,11 +5109,11 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* To obtain all window-local variables use: > gettabwinvar({tabnr}, {winnr}, '&') -gettagstack([{nr}]) *gettagstack()* - The result is a Dict, which is the tag stack of window {nr}. - {nr} can be the window number or the |window-ID|. - When {nr} is not specified, the current window is used. - When window {nr} doesn't exist, an empty Dict is returned. +gettagstack([{winnr}]) *gettagstack()* + The result is a Dict, which is the tag stack of window {winnr}. + {winnr} can be the window number or the |window-ID|. + When {winnr} is not specified, the current window is used. + When window {winnr} doesn't exist, an empty Dict is returned. The returned dictionary contains the following entries: curidx Current index in the stack. When at diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 36ed6bbac1..894d1627ab 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -580,7 +580,7 @@ To disable bold highlighting: > MARKDOWN *ft-markdown-plugin* To enable folding use this: > - let g:markdown_folding = 1 + let g:markdown_folding = 1 < PDF *ft-pdf-plugin* diff --git a/runtime/doc/ft_ps1.txt b/runtime/doc/ft_ps1.txt index df1480b929..3eb89a4c24 100644 --- a/runtime/doc/ft_ps1.txt +++ b/runtime/doc/ft_ps1.txt @@ -1,4 +1,4 @@ -*ps1.txt* A Windows PowerShell syntax plugin for Vim +*ft_ps1.txt* A Windows PowerShell syntax plugin for Vim Author: Peter Provost <https://www.github.com/PProvost> License: Apache 2.0 diff --git a/runtime/doc/ft_raku.txt b/runtime/doc/ft_raku.txt index 26ada8a140..00b140ee9c 100644 --- a/runtime/doc/ft_raku.txt +++ b/runtime/doc/ft_raku.txt @@ -1,4 +1,4 @@ -*vim-raku.txt* The Raku programming language filetype +*ft_raku.txt* The Raku programming language filetype *vim-raku* @@ -45,7 +45,7 @@ Numbers, subscripts and superscripts are available with 's' and 'S': 1s ₁ 1S ¹ ~ 2s ₂ 9S ⁹ ~ -But some don´t come defined by default. Those are digraph definitions you can +But some don't come defined by default. Those are digraph definitions you can add in your ~/.vimrc file. > exec 'digraph \\ '.char2nr('∖') exec 'digraph \< '.char2nr('≼') diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 353058ec03..6416f49061 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -125,7 +125,7 @@ Advanced editing ~ |windows.txt| commands for using multiple windows and buffers |tabpage.txt| commands for using multiple tab pages |spell.txt| spell checking -|diff.txt| working with two to four versions of the same file +|diff.txt| working with two to eight versions of the same file |autocmd.txt| automatically executing commands on an event |eval.txt| expression evaluation, conditional commands |fold.txt| hide (fold) ranges of lines @@ -145,6 +145,8 @@ Programming language support ~ |filetype.txt| settings done specifically for a type of file |quickfix.txt| commands for a quick edit-compile-fix cycle |ft_ada.txt| Ada (the programming language) support +|ft_ps1.txt| Filetype plugin for Windows PowerShell +|ft_raku.txt| Filetype plugin for Raku |ft_rust.txt| Filetype plugin for Rust |ft_sql.txt| about the SQL filetype plugin diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a44b2e42f5..3fd3875557 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -576,11 +576,11 @@ If you want to exclude visual selections from highlighting on yank, use vim.highlight.on_yank({opts}) *vim.highlight.on_yank()* Highlights the yanked text. The fields of the optional dict {opts} control the highlight: - - {higroup} highlight group for yanked region (default `"IncSearch"`) + - {higroup} highlight group for yanked region (default |hl-IncSearch|) - {timeout} time in ms before highlight is cleared (default `150`) - {on_macro} highlight when executing macro (default `false`) - {on_visual} highlight when yanking visual selection (default `true`) - - {event} event structure (default `vim.v.event`) + - {event} event structure (default |v:event|) vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {rtype}, {inclusive}) *vim.highlight.range()* @@ -687,6 +687,19 @@ vim.diff({a}, {b}, {opts}) *vim.diff()* See {opts.result_type}. nil if {opts.on_hunk} is given. ------------------------------------------------------------------------------ +VIM.MPACK *lua-mpack* + +The *vim.mpack* module provides packing and unpacking of lua objects to +msgpack encoded strings. |vim.NIL| and |vim.empty_dict()| are supported. + +vim.mpack.pack({obj}) *vim.mpack.pack* + Packs a lua object {obj} and returns the msgpack representation as + a string + +vim.mpack.unpack({str}) *vim.mpack.unpack* + Unpacks the msgpack encoded {str} and returns a lua object + +------------------------------------------------------------------------------ VIM *lua-builtin* vim.api.{func}({...}) *vim.api* @@ -1243,37 +1256,6 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()* Return: ~ region lua table of the form {linenr = {startcol,endcol}} - *vim.register_keystroke_callback()* -register_keystroke_callback({fn}, {ns_id}) - Register a lua {fn} with an {id} to be run after every - keystroke. - - If {fn} is nil, it removes the callback for the associated - {ns_id} - Note: - {fn} will not be cleared from |nvim_buf_clear_namespace()| - - Note: - {fn} will receive the keystrokes after mappings have been - evaluated - - Parameters: ~ - {fn} function: Function to call. It should take one - argument, which is a string. The string will contain - the literal keys typed. See |i_CTRL-V| - {ns_id} number? Namespace ID. If not passed or 0, will - generate and return a new namespace ID from - |nvim_create_namesapce()| - - Return: ~ - number Namespace ID associated with {fn} - - Note: - {fn} will be automatically removed if an error occurs - while calling. This is to prevent the annoying situation - of every keystroke erroring while trying to remove a - broken callback. - schedule_wrap({cb}) *vim.schedule_wrap()* Defers callback `cb` until the Nvim API is safe to call. diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 9f8acff88a..c473244827 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -52,9 +52,14 @@ or change text. The following operators are available: |<| < shift left |zf| zf define a fold |g@| g@ call function set with the 'operatorfunc' option - + *motion-count-multiplied* If the motion includes a count and the operator also had a count before it, the two counts are multiplied. For example: "2d3w" deletes six words. + *operator-doubled* +When doubling the operator it operates on a line. When using a count, before +or after the first character, that many lines are operated upon. Thus `3dd` +deletes three lines. A count before and after the first character is +multiplied, thus `2y3y` yanks six lines. After applying the operator the cursor is mostly left at the start of the text that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe" @@ -187,9 +192,9 @@ l or *l* *$* *<End>* *<kEnd>* $ or <End> To the end of the line. When a count is given also go [count - 1] lines downward, or as far is possible. - |inclusive| motion. If a count of 2 of larger is + |inclusive| motion. If a count of 2 or larger is given and the cursor is on the last line, that is an - error an the cursor doesn't move. + error and the cursor doesn't move. In Visual mode the cursor goes to just after the last character in the line. When 'virtualedit' is active, "$" may move the cursor diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d7bd91ad4f..90ba3b86d9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4352,19 +4352,21 @@ A jump table for the options with a short description can be found at |Q_op|. - abbreviations are disabled - 'autoindent' is reset - 'expandtab' is reset - - 'formatoptions' is used like it is empty + - 'hkmap' is reset - 'revins' is reset - 'ruler' is reset - 'showmatch' is reset - - 'smartindent' is reset - 'smarttab' is reset - 'softtabstop' is set to 0 - 'textwidth' is set to 0 - 'wrapmargin' is set to 0 + - 'varsofttabstop' is made empty These options keep their value, but their effect is disabled: - 'cindent' + - 'formatoptions' is used like it is empty - 'indentexpr' - 'lisp' + - 'smartindent' NOTE: When you start editing another file while the 'paste' option is on, settings from the modelines or autocommands may change the settings again, causing trouble when pasting text. You might want to diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index e74f3b72bf..c49cc6d540 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1204,7 +1204,7 @@ x A single character, with no special meaning, matches itself \%d123 Matches the character specified with a decimal number. Must be followed by a non-digit. -\%o40 Matches the character specified with an octal number up to 0377. +\%o40 Matches the character specified with an octal number up to 0o377. Numbers below 0o40 must be followed by a non-octal digit or a non-digit. \%x2a Matches the character specified with up to two hexadecimal characters. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 4b61cd4c25..a39d1e8dc9 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3808,7 +3808,7 @@ netrw: Decho.vim is provided as a "vimball"; see |vimball-intro|. You should edit the Decho.vba.gz file and source it in: > - vim Decho.vba.gz + vim Decho.vba.gz :so % :q < diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index a91aa4d2a0..ed770434d5 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -255,7 +255,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. ftdetect scripts are loaded, only the matching directories are added to 'runtimepath'. This is useful in your .vimrc. The plugins will then be - loaded during initialization, see |load-plugins|. + loaded during initialization, see |load-plugins| (note + that the loading order will be reversed, because each + directory is inserted before others). Note that for ftdetect scripts to be loaded you will need to write `filetype plugin indent on` AFTER all `packadd!` commands. diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index d45a2dce7e..aa11462595 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -70,7 +70,7 @@ o Invocations o Typing backwards *ins-reverse* ---------------- - In lieu of using full-fledged the 'rightleft' option, one can opt for + In lieu of using the full-fledged 'rightleft' option, one can opt for reverse insertion. When the 'revins' (reverse insert) option is set, inserting happens backwards. This can be used to type right-to-left text. When inserting characters the cursor is not moved and the text diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index d6b54fbd01..87a48e6d2a 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -329,12 +329,12 @@ argument. -w{number} Set the 'window' option to {number}. *-w* --w {scriptout} All the characters that you type are recorded in the file - "scriptout", until you exit Vim. This is useful if you want - to create a script file to be used with "vim -s" or - ":source!". When the "scriptout" file already exists, new - characters are appended. See also |complex-repeat|. - {scriptout} cannot start with a digit. +-w {scriptout} All keys that you type are recorded in the file "scriptout", + until you exit Vim. Useful to create a script file to be used + with "vim -s" or ":source!". Appends to the "scriptout" file + if it already exists. {scriptout} cannot start with a digit. + See also |vim.on_key()|. + See also |complex-repeat|. *-W* -W {scriptout} Like -w, but do not append, overwrite an existing file. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 161b4f0d04..a8d8d7d9b8 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1384,11 +1384,11 @@ To select syntax highlighting file for Euphoria, as well as for auto-detecting the *.e and *.E file extensions as Euphoria file type, add the following line to your startup file: > - :let filetype_euphoria="euphoria3" + :let filetype_euphoria = "euphoria3" - or +< or > - :let filetype_euphoria="euphoria4" + :let filetype_euphoria = "euphoria4" ERLANG *erlang.vim* *ft-erlang-syntax* @@ -3385,8 +3385,8 @@ syntax highlighting script handles this with the following logic: Tex: Match Check Control~ Sometimes one actually wants mismatched parentheses, square braces, - and or curly braces; for example, \text{(1,10] is a range from but - not including 1 to and including 10}. This wish, of course, conflicts + and or curly braces; for example, \text{(1,10]} is a range from but + not including 1 to and including 10. This wish, of course, conflicts with the desire to provide delimiter mismatch detection. To accommodate these conflicting goals, syntax/tex.vim provides > g:tex_matchcheck = '[({[]' @@ -4024,7 +4024,7 @@ match in the same position overrules an earlier one). The "transparent" argument makes the "myVim" match use the same highlighting as "myString". But it does not contain anything. If the "contains=NONE" argument would be left out, then "myVim" would use the contains argument from myString and allow -"myWord" to be contained, which will be highlighted as a Constant. This +"myWord" to be contained, which will be highlighted as a Comment. This happens because a contained match doesn't match inside itself in the same position, thus the "myVim" match doesn't overrule the "myWord" match here. diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index a509c328e5..86316b8ac5 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -767,17 +767,4 @@ new({source}, {lang}, {opts}) *languagetree.new()* the injection language query per language. - -============================================================================== -Lua module: vim.treesitter.health *treesitter-health* - -check_health() *check_health()* - TODO: Documentation - -list_parsers() *list_parsers()* - Lists the parsers currently installed - - Return: ~ - A list of parsers - vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 62e1e130ee..29bd6e5e64 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -504,7 +504,7 @@ gO Show a filetype-specific, navigable "outline" of the Queued messages are processed during the sleep. *:sl!* *:sleep!* -:[N]sl[eep]! [N] [m] Same as above. Unlike Vim, it does not hide the +:[N]sl[eep]! [N][m] Same as above. Unlike Vim, it does not hide the cursor. |vim-differences| ============================================================================== diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 4b134926a2..a5fcef2800 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -6,16 +6,16 @@ Differences between Nvim and Vim *vim-differences* -Nvim differs from Vim in many ways, although editor and VimL features are -mostly identical. This document is a complete and centralized reference of -the differences. +Nvim differs from Vim in many ways, although editor and Vimscript (not +Vim9script) features are mostly identical. This document is a complete and +centralized reference of the differences. Type |gO| to see the table of contents. ============================================================================== 1. Configuration *nvim-config* -- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for configuration. +- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for your |config|. - Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files. - Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent session information. |shada| @@ -78,6 +78,8 @@ the differences. Default Mappings ~ *default-mappings* +Nvim creates the following default mappings at |startup|. You can disable any +of these in your config by simply removing the mapping, e.g. ":unmap Y". > nnoremap Y y$ nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<CR><C-L> @@ -101,17 +103,19 @@ nvim_cmdwin: MAJOR COMPONENTS ~ API |API| -Lua scripting |lua| Job control |job-control| -Remote plugins |remote-plugin| +LSP framework |lsp| +Lua scripting |lua| +Parsing engine |treesitter| Providers Clipboard |provider-clipboard| Node.js plugins |provider-nodejs| Python plugins |provider-python| Ruby plugins |provider-ruby| +Remote plugins |remote-plugin| Shared data |shada| -Embedded terminal |terminal| -VimL parser |nvim_parse_expression()| +Terminal emulator |terminal| +Vimscript parser |nvim_parse_expression()| XDG base directories |xdg| USER EXPERIENCE ~ @@ -160,7 +164,7 @@ FEATURES ~ Command-line highlighting: The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted - using a built-in VimL expression parser. |expr-highlight| + using a built-in Vimscript expression parser. |expr-highlight| *E5408* *E5409* |input()|, |inputdialog()| support custom highlighting. |input()-highlight| *g:Nvim_color_cmdline* @@ -413,7 +417,7 @@ TUI: UI/Display: |Visual| selection highlights the character at cursor. |visual-use| -VimL (Vim script) compatibility: +Vimscript compatibility: `count` does not alias to |v:count| `errmsg` does not alias to |v:errmsg| `shell_error` does not alias to |v:shell_error| diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 333da58128..b3148bde25 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 Apr 17 +" Last Change: 2021 Jun 13 " Listen very carefully, I will say this only once if exists("did_load_filetypes") diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index 3c18bada78..e67b00b278 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jan 06 +" Last Change: 2020 Jun 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -118,7 +118,7 @@ endif " TODO: comments= setlocal commentstring=<%#%s%> -let b:undo_ftplugin = "setl cms< " +let b:undo_ftplugin = "setl cms< " . \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin let &cpo = s:save_cpo diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index b4a8eaa0d8..4a476fd8cf 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Nov 06 +" Last Change: 2020 Feb 13 if (exists("b:did_ftplugin")) finish @@ -112,7 +112,7 @@ else if !exists('g:ruby_default_path') if has("ruby") && has("win32") ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) - elseif executable('ruby') + elseif executable('ruby') && !empty($HOME) let g:ruby_default_path = s:query_path($HOME) else let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index 7019bd4a82..d4b91f6421 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -1,7 +1,7 @@ " Vim indent script for HTML " Maintainer: Bram Moolenaar " Original Author: Andy Wokula <anwoku@yahoo.de> -" Last Change: 2021 Jan 26 +" Last Change: 2021 Jun 13 " Version: 1.0 "{{{ " Description: HTML indent script with cached state for faster indenting on a " range of lines. @@ -62,7 +62,7 @@ let s:tagname = '\w\+\(-\w\+\)*' " Prefer using buffer-local settings over global settings, so that there can " be defaults for all HTML files and exceptions for specific types of HTML " files. -func! HtmlIndent_CheckUserSettings() +func HtmlIndent_CheckUserSettings() "{{{ let inctags = '' if exists("b:html_indent_inctags") @@ -178,7 +178,7 @@ let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index "}}} " Add a list of tag names for a pair of <tag> </tag> to "tags". -func! s:AddITags(tags, taglist) +func s:AddITags(tags, taglist) "{{{ for itag in a:taglist let a:tags[itag] = 1 @@ -187,7 +187,7 @@ func! s:AddITags(tags, taglist) endfunc "}}} " Take a list of tag name pairs that are not to be used as tag pairs. -func! s:RemoveITags(tags, taglist) +func s:RemoveITags(tags, taglist) "{{{ for itag in a:taglist let a:tags[itag] = 1 @@ -196,7 +196,7 @@ func! s:RemoveITags(tags, taglist) endfunc "}}} " Add a block tag, that is a tag with a different kind of indenting. -func! s:AddBlockTag(tag, id, ...) +func s:AddBlockTag(tag, id, ...) "{{{ if !(a:id >= 2 && a:id < len(s:endtags)) echoerr 'AddBlockTag ' . a:id @@ -255,7 +255,7 @@ call s:AddBlockTag('<!--[', 6, '![endif]-->') " Return non-zero when "tagname" is an opening tag, not being a block tag, for " which there should be a closing tag. Can be used by scripts that include " HTML indenting. -func! HtmlIndent_IsOpenTag(tagname) +func HtmlIndent_IsOpenTag(tagname) "{{{ if get(s:indent_tags, a:tagname) == 1 return 1 @@ -264,7 +264,7 @@ func! HtmlIndent_IsOpenTag(tagname) endfunc "}}} " Get the value for "tagname", taking care of buffer-local tags. -func! s:get_tag(tagname) +func s:get_tag(tagname) "{{{ let i = get(s:indent_tags, a:tagname) if (i == 1 || i == -1) && get(b:hi_removed_tags, a:tagname) != 0 @@ -277,7 +277,7 @@ func! s:get_tag(tagname) endfunc "}}} " Count the number of start and end tags in "text". -func! s:CountITags(text) +func s:CountITags(text) "{{{ " Store the result in s:curind and s:nextrel. let s:curind = 0 " relative indent steps for current line [unit &sw]: @@ -289,7 +289,7 @@ func! s:CountITags(text) endfunc "}}} " Count the number of start and end tags in text. -func! s:CountTagsAndState(text) +func s:CountTagsAndState(text) "{{{ " Store the result in s:curind and s:nextrel. Update b:hi_newstate.block. let s:curind = 0 " relative indent steps for current line [unit &sw]: @@ -304,7 +304,7 @@ func! s:CountTagsAndState(text) endfunc "}}} " Used by s:CountITags() and s:CountTagsAndState(). -func! s:CheckTag(itag) +func s:CheckTag(itag) "{{{ " Returns an empty string or "SCRIPT". " a:itag can be "tag" or "/tag" or "<!--" or "-->" @@ -338,7 +338,7 @@ func! s:CheckTag(itag) endfunc "}}} " Used by s:CheckTag(). Returns an empty string or "SCRIPT". -func! s:CheckBlockTag(blocktag, ind) +func s:CheckBlockTag(blocktag, ind) "{{{ if a:ind > 0 " a block starts here @@ -366,7 +366,7 @@ func! s:CheckBlockTag(blocktag, ind) endfunc "}}} " Used by s:CheckTag(). -func! s:CheckCustomTag(ctag) +func s:CheckCustomTag(ctag) "{{{ " Returns 1 if ctag is the tag for a custom element, 0 otherwise. " a:ctag can be "tag" or "/tag" or "<!--" or "-->" @@ -396,7 +396,7 @@ func! s:CheckCustomTag(ctag) endfunc "}}} " Return the <script> type: either "javascript" or "" -func! s:GetScriptType(str) +func s:GetScriptType(str) "{{{ if a:str == "" || a:str =~ "java" return "javascript" @@ -407,7 +407,7 @@ endfunc "}}} " Look back in the file, starting at a:lnum - 1, to compute a state for the " start of line a:lnum. Return the new state. -func! s:FreshState(lnum) +func s:FreshState(lnum) "{{{ " A state is to know ALL relevant details about the " lines 1..a:lnum-1, initial calculating (here!) can be slow, but updating is @@ -568,24 +568,29 @@ func! s:FreshState(lnum) endfunc "}}} " Indent inside a <pre> block: Keep indent as-is. -func! s:Alien2() +func s:Alien2() "{{{ return -1 endfunc "}}} " Return the indent inside a <script> block for javascript. -func! s:Alien3() +func s:Alien3() "{{{ let lnum = prevnonblank(v:lnum - 1) while lnum > 1 && getline(lnum) =~ '^\s*/[/*]' " Skip over comments to avoid that cindent() aligns with the <script> tag let lnum = prevnonblank(lnum - 1) endwhile + if lnum < b:hi_indent.blocklnr + " indent for <script> itself + return b:hi_indent.blocktagind + endif if lnum == b:hi_indent.blocklnr " indent for the first line after <script> return eval(b:hi_js1indent) endif if b:hi_indent.scripttype == "javascript" + " indent for further lines return eval(b:hi_js1indent) + GetJavascriptIndent() else return -1 @@ -593,7 +598,7 @@ func! s:Alien3() endfunc "}}} " Return the indent inside a <style> block. -func! s:Alien4() +func s:Alien4() "{{{ if prevnonblank(v:lnum-1) == b:hi_indent.blocklnr " indent for first content line @@ -603,7 +608,7 @@ func! s:Alien4() endfunc "}}} " Indending inside a <style> block. Returns the indent. -func! s:CSSIndent() +func s:CSSIndent() "{{{ " This handles standard CSS and also Closure stylesheets where special lines " start with @. @@ -720,13 +725,13 @@ endfunc "}}} " tag: blah " tag: blah && " tag: blah || -func! s:CssUnfinished(text) +func s:CssUnfinished(text) "{{{ return a:text =~ '\(||\|&&\|:\|\k\)\s*$' endfunc "}}} " Search back for the first unfinished line above "lnum". -func! s:CssFirstUnfinished(lnum, min_lnum) +func s:CssFirstUnfinished(lnum, min_lnum) "{{{ let align_lnum = a:lnum while align_lnum > a:min_lnum && s:CssUnfinished(getline(align_lnum - 1)) @@ -736,7 +741,7 @@ func! s:CssFirstUnfinished(lnum, min_lnum) endfunc "}}} " Find the non-empty line at or before "lnum" that is not a comment. -func! s:CssPrevNonComment(lnum, stopline) +func s:CssPrevNonComment(lnum, stopline) "{{{ " caller starts from a line a:lnum + 1 that is not a comment let lnum = prevnonblank(a:lnum) @@ -761,7 +766,7 @@ func! s:CssPrevNonComment(lnum, stopline) endfunc "}}} " Check the number of {} and () in line "lnum". Return a dict with the counts. -func! HtmlIndent_CountBraces(lnum) +func HtmlIndent_CountBraces(lnum) "{{{ let brs = substitute(getline(a:lnum), '[''"].\{-}[''"]\|/\*.\{-}\*/\|/\*.*$\|[^{}()]', '', 'g') let c_open = 0 @@ -794,7 +799,7 @@ func! HtmlIndent_CountBraces(lnum) endfunc "}}} " Return the indent for a comment: <!-- --> -func! s:Alien5() +func s:Alien5() "{{{ let curtext = getline(v:lnum) if curtext =~ '^\s*\zs-->' @@ -826,7 +831,7 @@ func! s:Alien5() endfunc "}}} " Return the indent for conditional comment: <!--[ ![endif]--> -func! s:Alien6() +func s:Alien6() "{{{ let curtext = getline(v:lnum) if curtext =~ '\s*\zs<!\[endif\]-->' @@ -840,7 +845,7 @@ func! s:Alien6() endfunc "}}} " When the "lnum" line ends in ">" find the line containing the matching "<". -func! HtmlIndent_FindTagStart(lnum) +func HtmlIndent_FindTagStart(lnum) "{{{ " Avoids using the indent of a continuation line. " Moves the cursor. @@ -863,7 +868,7 @@ func! HtmlIndent_FindTagStart(lnum) endfunc "}}} " Find the unclosed start tag from the current cursor position. -func! HtmlIndent_FindStartTag() +func HtmlIndent_FindStartTag() "{{{ " The cursor must be on or before a closing tag. " If found, positions the cursor at the match and returns the line number. @@ -877,7 +882,7 @@ func! HtmlIndent_FindStartTag() endfunc "}}} " Moves the cursor from a "<" to the matching ">". -func! HtmlIndent_FindTagEnd() +func HtmlIndent_FindTagEnd() "{{{ " Call this with the cursor on the "<" of a start tag. " This will move the cursor to the ">" of the matching end tag or, when it's @@ -897,7 +902,7 @@ func! HtmlIndent_FindTagEnd() endfunc "}}} " Indenting inside a start tag. Return the correct indent or -1 if unknown. -func! s:InsideTag(foundHtmlString) +func s:InsideTag(foundHtmlString) "{{{ if a:foundHtmlString " Inside an attribute string. @@ -958,7 +963,7 @@ func! s:InsideTag(foundHtmlString) endfunc "}}} " THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum. -func! HtmlIndent() +func HtmlIndent() "{{{ if prevnonblank(v:lnum - 1) < 1 " First non-blank line has no indent. diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim index 657aa763b1..2a267fdab3 100644 --- a/runtime/indent/ruby.vim +++ b/runtime/indent/ruby.vim @@ -4,6 +4,7 @@ " Previous Maintainer: Nikolai Weibull <now at bitwi.se> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2021 Feb 03 " 0. Initialization {{{1 " ================= diff --git a/runtime/syntax/8th.vim b/runtime/syntax/8th.vim index ddc1084c9f..d543489b72 100644 --- a/runtime/syntax/8th.vim +++ b/runtime/syntax/8th.vim @@ -293,7 +293,7 @@ syn region eighthComment start="\zs\\" end="$" contains=eighthTodo " Define the default highlighting. if !exists("did_eighth_syntax_inits") let did_eighth_syntax_inits=1 - " The default methods for highlighting. Can be overriden later. + " The default methods for highlighting. Can be overridden later. hi def link eighthTodo Todo hi def link eighthOperators Operator hi def link eighthMath Number diff --git a/runtime/syntax/gvpr.vim b/runtime/syntax/gvpr.vim new file mode 100644 index 0000000000..a7378916f9 --- /dev/null +++ b/runtime/syntax/gvpr.vim @@ -0,0 +1,85 @@ +" Vim syntax file +" Language: Graphviz program +" Maintainer: Matthew Fernandez <matthew.fernandez@gmail.com> +" Last Change: Tue, 28 Jul 2020 17:20:44 -0700 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn keyword gvArg ARGC ARGV +syn keyword gvBeg BEGIN BEG_G N E END END_G +syn keyword gvFunc + \ graph fstsubg isDirect isStrict isSubg nEdges nNodes nxtsubg subg + \ degreeOf fstnode indegreeOf isNode isSubnode node nxtnode nxtnode_sg + \ outDegreeOf subnode + \ edge edge_sg fstedge fstedge_sg fstin fstin_sg fstout fstout_sg isEdge + \ isEdge_sg isSubedge nxtedge nxtedge_sg nxtin nxtin_sg nxtout nxtout_sg opp + \ subedge + \ freadG fwriteG readG write[] writeG + \ aget aset clone cloneG compOf copy[] copyA delete[] fstAttr getDflt hasAttr + \ induce isAttr isIn kindOf lock[] nxtAttr setDflt + \ canon gsub html index ishtml length llOf match[] rindex split[] sprintf + \ sscanf strcmp sub substr tokens tolower toupper urOf xOf yOf + \ closeF openF print[] printf scanf readL + \ atan2 cos exp log MAX MIN pow sin[] sqrt + \ in[] unset + \ colorx exit[] rand srand system +syn keyword gvCons + \ NULL TV_bfs TV_dfs TV_en TV_flat TV_fwd TV_ne TV_prepostdfs TV_prepostfwd + \ TV_prepostrev TV_postdfs TV_postfwd tv_postrev TV_rev +syn keyword gvType char double float int long unsigned void + \ string + \ edge_t graph_t node_t obj_t +syn match gvVar + \ "\$\(\(F\|G\|NG\|O\|T\|tgtname\|tvedge\|tvnext\|tvroot\|tvtype\)\>\)\?\(\<\)\@!" +syn keyword gvWord break continue else for forr if return switch while + +" numbers adapted from c.vim's cNumbers and friends +syn match gvNums transparent "\<\d\|\.\d" contains=gvNumber,gvFloat,gvOctal +syn match gvNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match gvNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match gvOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=gvOctalZero +syn match gvOctalZero contained "\<0" +syn match gvFloat contained "\d\+f" +syn match gvFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" +syn match gvFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" +syn match gvFloat contained "\d\+e[-+]\=\d\+[fl]\=\>" + +syn region gvString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gvFormat,gvSpecial extend +syn region gvString start="'" skip="\\\\\|\\'" end="'" contains=gvFormat,gvSpecial extend + +" adapted from c.vim's cFormat for c_no_c99 +syn match gvFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + +syn match gvSpecial "\\." contained + +syn region gvCComment start="//" skip="\\$" end="$" keepend +syn region gvCPPComment start="#" skip="\\$" end="$" keepend +syn region gvCXXComment start="/\*" end="\*/" fold + +hi def link gvArg Identifier +hi def link gvBeg Keyword +hi def link gvFloat Number +hi def link gvFunc Identifier +hi def link gvCons Number +hi def link gvNumber Number +hi def link gvType Type +hi def link gvVar Statement +hi def link gvWord Keyword + +hi def link gvString String +hi def link gvFormat Special +hi def link gvSpecial Special + +hi def link gvCComment Comment +hi def link gvCPPComment Comment +hi def link gvCXXComment Comment + +let b:current_syntax = "gvpr" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index d3d8f4f435..01915d23d7 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: Bram Moolenaar (Bram@vim.org) -" Last Change: 2020 Jul 28 +" Last Change: 2021 Jun 13 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") diff --git a/runtime/syntax/redif.vim b/runtime/syntax/redif.vim index 725067fd32..198d5c7530 100644 --- a/runtime/syntax/redif.vim +++ b/runtime/syntax/redif.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: ReDIF " Maintainer: Axel Castellane <axel.castellane@polytechnique.edu> -" Last Change: 2013 April 17 +" Last Change: 2021 Jun 17 " Original Author: Axel Castellane " Source: http://openlib.org/acmes/root/docu/redif_1.html " File Extension: rdf diff --git a/runtime/syntax/ruby.vim b/runtime/syntax/ruby.vim index 0de63d0ef3..13d6d9efd8 100644 --- a/runtime/syntax/ruby.vim +++ b/runtime/syntax/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 13 +" Last Change: 2021 Jun 06 " ---------------------------------------------------------------------------- " " Previous Maintainer: Mirko Nasato @@ -66,7 +66,7 @@ endfunction com! -nargs=* SynFold call s:run_syntax_fold(<q-args>) " Not-Top Cluster {{{1 -syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses +syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses,@Spell " Whitespace Errors {{{1 if exists("ruby_space_errors") @@ -92,7 +92,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators") syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||" syn match rubyRangeOperator "\.\.\.\=" syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^=" - syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant + syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~" syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop @@ -134,10 +134,10 @@ syn match rubyCurlyBraceEscape "\\[{}]" contained display syn match rubyAngleBracketEscape "\\[<>]" contained display syn match rubySquareBracketEscape "\\[[\]]" contained display -syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained -syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained -syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained -syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained +syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" end=")" transparent contained +syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" end="}" transparent contained +syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" end=">" transparent contained +syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" end="\]" transparent contained syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape syn cluster rubyNestedBrackets contains=rubyNested.\+ @@ -193,7 +193,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"': syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@=" -syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList +syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator if exists('ruby_global_variable_error') @@ -332,7 +332,7 @@ SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([ syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable -syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite skipnl +syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyScopeOperator syn match rubyMethodName "\<\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%([[:alnum:]_.:?!=]\|[^\x00-\x7F]\)\@!" contained containedin=rubyMethodDeclaration @@ -462,7 +462,7 @@ endif syn match rubyDefinedOperator "\%#=1\<defined?" display " 1.9-style Hash Keys and Keyword Parameters {{{1 -syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 +syn match rubySymbol "\%(\w\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 contained containedin=rubyBlockParameterList,rubyCurlyBlock syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1 syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="hs=s+1,he=e-1 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 55c47aa34d..7aae7965a9 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -200,7 +200,7 @@ syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue,vim9Comment +syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile @@ -214,12 +214,13 @@ endif " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand -syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody +syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody + syn match vimFunction "\<def!\=\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList else - syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList + syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList endif syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)" syn match vimFuncSID contained "\c<sid>\|\<s:" @@ -228,6 +229,9 @@ syn match vimFuncBlank contained "\s\+" syn keyword vimPattern contained start skip end +" vimTypes : new for vim9 + syn match vimType ":\s*\zs\<\(bool\|number\|float\|string\|blob\|list<\|dict<\|job\|channel\|func\)\>" + " Special Filenames, Modifiers, Extension Removal: {{{2 " =============================================== syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst @@ -355,7 +359,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 -syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" oneline keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod +syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" @@ -390,7 +394,7 @@ syn case match " Maps: {{{2 " ==== syn match vimMap "\<map\>!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs -syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs +syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vmapc[lear] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn keyword nvimMap tn[oremap] tm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn keyword vimMap mapc[lear] smapc[lear] syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs @@ -981,6 +985,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimSyntax vimCommand hi def link vimSynType vimSpecial hi def link vimTodo Todo + hi def link vimType Type hi def link vimUnmap vimMap hi def link vimUserAttrbCmpltFunc Special hi def link vimUserAttrbCmplt vimSpecial |