diff options
Diffstat (limited to 'runtime')
31 files changed, 899 insertions, 290 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 579db62cb8..73c1459f86 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -181,21 +181,20 @@ function! s:get_healthcheck(plugin_names) abort let health_list = s:get_healthcheck_list(a:plugin_names) let healthchecks = {} for c in health_list - let name = c[0] - let existent = get(healthchecks, name, []) - " If an entry with the same name exists and is from vim, prefer Lua so - " overwrite it. - if existent != [] - if existent[1] == "v" - let healthchecks[name] = c[1:] - else - continue - endif + let normalized_name = substitute(c[0], '-', '_', 'g') + let existent = get(healthchecks, normalized_name, []) + " Prefer Lua over vim entries + if existent != [] && existent[2] == 'l' + continue else - let healthchecks[name] = c[1:] + let healthchecks[normalized_name] = c endif endfor - return healthchecks + let output = {} + for v in values(healthchecks) + let output[v[0]] = v[1:] + endfor + return output endfunction " Returns list of lists [ [{name}, {func}, {type}] ] representing healthchecks diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 001379c85d..7b4dce3441 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -710,7 +710,7 @@ function! s:check_perl() abort let latest_cpan = s:system(latest_cpan_cmd) if s:shell_error || empty(latest_cpan) - call health#report_error('Failed to run: '. latest_cpan_cmd, + call health#report_error('Failed to run: '. join(latest_cpan_cmd, " "), \ ["Make sure you're connected to the internet.", \ 'Are you behind a firewall or proxy?']) return diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index c292b374b6..0eeb35cba8 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -96,7 +96,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort if prog_version !~ '^' . a:major_version return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python ' \ . a:major_version . '.'] - elseif prog_version =~ '^' . a:major_version && prog_version < min_version + elseif prog_version =~ '^' . a:major_version && str2nr(prog_version[2:]) < str2nr(min_version[2:]) return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= ' \ . min_version . '.'] endif 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 <Tab> width and the text after the inserted block contains <Tab>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/diagnostic.txt b/runtime/doc/diagnostic.txt index 75c8a2ad6f..17d317522b 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -254,12 +254,31 @@ config({opts}, {namespace}) *vim.diagnostic.config()* Configure diagnostic options globally or for a specific diagnostic namespace. + Configuration can be specified globally, per-namespace, or + ephemerally (i.e. only for a single call to + |vim.diagnostic.set()| or |vim.diagnostic.show()|). Ephemeral + configuration has highest priority, followed by namespace + configuration, and finally global configuration. + + For example, if a user enables virtual text globally with > + + vim.diagnostic.config({virt_text = true}) +< + + and a diagnostic producer sets diagnostics with > + + vim.diagnostic.set(ns, 0, diagnostics, {virt_text = false}) +< + + then virtual text will not be enabled for those diagnostics. + Note: Each of the configuration options below accepts one of the following: • `false` : Disable this feature • `true` : Enable this feature, use default settings. - • `table` : Enable this feature with overrides. + • `table` : Enable this feature with overrides. Use an + empty table to use default values. • `function` : Function with signature (namespace, bufnr) that returns any of the above. @@ -460,8 +479,9 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults}) For example, consider a line of output from a linter: > WARNING filename:27:3: Variable 'foo' does not exist +< - < This can be parsed into a diagnostic |diagnostic-structure| + This can be parsed into a diagnostic |diagnostic-structure| with: > local s = "WARNING filename:27:3: Variable 'foo' does not exist" 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/eval.txt b/runtime/doc/eval.txt index fe19bb3134..e956ccaa77 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1204,7 +1204,7 @@ next method: > mylist->filter(filterexpr)->map(mapexpr)->sort()->join() < Example of using a lambda: > - GetPercentage->{x -> x * 100}()->printf('%d%%') + GetPercentage()->{x -> x * 100}()->printf('%d%%') < When using -> the |expr7| operators will be applied first, thus: > -1.234->string() @@ -2505,7 +2505,7 @@ keys({dict}) List keys in {dict} len({expr}) Number the length of {expr} libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg} libcallnr({lib}, {func}, {arg}) Number idem, but return a Number -line({expr}) Number line nr of cursor, last line or mark +line({expr} [, {winid}]) Number line nr of cursor, last line or mark line2byte({lnum}) Number byte count of line {lnum} lispindent({lnum}) Number Lisp indent for line {lnum} list2str({list} [, {utf8}]) String turn numbers in {list} into a String @@ -3831,6 +3831,9 @@ escape({string}, {chars}) *escape()* c:\\program\ files\\vim < Also see |shellescape()| and |fnameescape()|. + Can also be used as a |method|: > + GetText()->escape(' \') +< *eval()* eval({string}) Evaluate {string} and return the result. Especially useful to turn the result of |string()| back into the original value. @@ -3870,6 +3873,9 @@ executable({expr}) *executable()* -1 not implemented on this system |exepath()| can be used to get the full path of an executable. + Can also be used as a |method|: > + GetCommand()->executable() + execute({command} [, {silent}]) *execute()* Execute {command} and capture its output. If {command} is a |String|, returns {command} output. @@ -3897,12 +3903,18 @@ execute({command} [, {silent}]) *execute()* To execute a command in another window than the current one use `win_execute()`. + Can also be used as a |method|: > + GetCommand()->execute() + exepath({expr}) *exepath()* Returns the full path of {expr} if it is an executable and given as a (partial or full) path or is found in $PATH. Returns empty string otherwise. If {expr} starts with "./" the |current-directory| is used. + Can also be used as a |method|: > + GetCommand()->exepath() + *exists()* exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, zero otherwise. @@ -3988,6 +4000,9 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is < This doesn't check for existence of the "bufcount" variable, but gets the value of "bufcount", and checks if that exists. + Can also be used as a |method|: > + Varname()->exists() + exp({expr}) *exp()* Return the exponential of {expr} as a |Float| in the range [0, inf]. @@ -4094,6 +4109,9 @@ expand({string} [, {nosuf} [, {list}]]) *expand()* See |glob()| for finding existing files. See |system()| for getting the raw output of an external command. + Can also be used as a |method|: > + Getpattern()->expand() + expandcmd({expr}) *expandcmd()* Expand special items in {expr} like what is done for an Ex command such as `:edit`. This expands special keywords, like @@ -4101,6 +4119,9 @@ expandcmd({expr}) *expandcmd()* {expr}. "~user" and "~/path" are only expanded at the start. Returns the expanded string. Example: > :echo expandcmd('make %<.o') + +< Can also be used as a |method|: > + GetCommand()->expandcmd() < extend({expr1}, {expr2} [, {expr3}]) *extend()* {expr1} and {expr2} must be both |Lists| or both @@ -4186,6 +4207,9 @@ feedkeys({string} [, {mode}]) *feedkeys()* Return value is always 0. + Can also be used as a |method|: > + GetInput()->feedkeys() + filereadable({file}) *filereadable()* The result is a Number, which is |TRUE| when a file with the name {file} exists, and can be read. If {file} doesn't exist, @@ -4199,12 +4223,17 @@ filereadable({file}) *filereadable()* echo filereadable(expand('~/.vimrc')) 1 +< Can also be used as a |method|: > + GetName()->filereadable() + filewritable({file}) *filewritable()* The result is a Number, which is 1 when a file with the name {file} exists, and can be written. If {file} doesn't exist, or is not writable, the result is 0. If {file} is a directory, and we can write to it, the result is 2. + Can also be used as a |method|: > + GetName()->filewriteable() filter({expr1}, {expr2}) *filter()* {expr1} must be a |List|, |Blob|, or a |Dictionary|. @@ -4275,6 +4304,9 @@ finddir({name} [, {path} [, {count}]]) *finddir()* This is quite similar to the ex-command `:find`. + Can also be used as a |method|: > + GetName()->finddir() + findfile({name} [, {path} [, {count}]]) *findfile()* Just like |finddir()|, but find a file instead of a directory. Uses 'suffixesadd'. @@ -4283,6 +4315,9 @@ findfile({name} [, {path} [, {count}]]) *findfile()* < Searches from the directory of the current file upwards until it finds the file "tags.vim". + Can also be used as a |method|: > + GetName()->findfile() + flatten({list} [, {maxdepth}]) *flatten()* Flatten {list} up to {maxdepth} levels. Without {maxdepth} the result is a |List| without nesting, as if {maxdepth} is @@ -4372,6 +4407,9 @@ fnameescape({string}) *fnameescape()* :exe "edit " . fnameescape(fname) < results in executing: > edit \+some\ str\%nge\|name +< + Can also be used as a |method|: > + GetName()->fnameescape() fnamemodify({fname}, {mods}) *fnamemodify()* Modify file name {fname} according to {mods}. {mods} is a @@ -4385,6 +4423,9 @@ fnamemodify({fname}, {mods}) *fnamemodify()* Note: Environment variables don't work in {fname}, use |expand()| first then. + Can also be used as a |method|: > + GetName()->fnamemodify(':p:h') + 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. @@ -4392,6 +4433,9 @@ foldclosed({lnum}) *foldclosed()* {lnum} is used like with |getline()|. Thus "." is the current line, "'m" mark m, etc. + Can also be used as a |method|: > + GetLnum()->foldclosed() + 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. @@ -4399,6 +4443,9 @@ foldclosedend({lnum}) *foldclosedend()* {lnum} is used like with |getline()|. Thus "." is the current line, "'m" mark m, etc. + Can also be used as a |method|: > + GetLnum()->foldclosedend() + foldlevel({lnum}) *foldlevel()* The result is a Number, which is the foldlevel of line {lnum} in the current buffer. For nested folds the deepest level is @@ -4411,6 +4458,9 @@ foldlevel({lnum}) *foldlevel()* {lnum} is used like with |getline()|. Thus "." is the current line, "'m" mark m, etc. + Can also be used as a |method|: > + GetLnum()->foldlevel() + *foldtext()* foldtext() Returns a String, to be displayed for a closed fold. This is the default function used for the 'foldtext' option and should @@ -4436,6 +4486,9 @@ foldtextresult({lnum}) *foldtextresult()* line, "'m" mark m, etc. Useful when exporting folded text, e.g., to HTML. + Can also be used as a |method|: > + GetLnum()->foldtextresult() +< *foreground()* foreground() Move the Vim window to the foreground. Useful when sent from a client to a Vim server. |remote_send()| @@ -4454,6 +4507,9 @@ funcref({name} [, {arglist}] [, {dict}]) Also for autoloaded functions. {name} cannot be a builtin function. + Can also be used as a |method|: > + GetFuncname()->funcref([arg]) +< *function()* *E700* *E922* *E923* function({name} [, {arglist}] [, {dict}]) Return a |Funcref| variable that refers to function {name}. @@ -4503,7 +4559,9 @@ function({name} [, {arglist}] [, {dict}]) call Func(500) < Invokes the function as with: > call context.Callback('one', 500) - +< + Can also be used as a |method|: > + GetFuncname()->function([arg]) garbagecollect([{atexit}]) *garbagecollect()* Cleanup unused |Lists| and |Dictionaries| that have circular @@ -4643,6 +4701,9 @@ getbufline({buf}, {lnum} [, {end}]) Example: > :let lines = getbufline(bufnr("myfile"), 1, "$") +< Can also be used as a |method|: > + GetBufnr()->getbufline(lnum) + getbufvar({buf}, {varname} [, {def}]) *getbufvar()* The result is the value of option or local buffer variable {varname} in buffer {buf}. Note that the name without "b:" @@ -4663,8 +4724,11 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()* Examples: > :let bufmodified = getbufvar(1, "&mod") :echo "todo myvar = " . getbufvar("todo", "myvar") + +< Can also be used as a |method|: > + GetBufnr()->getbufvar(varname) < -getchangelist({buf}) *getchangelist()* +getchangelist([{buf}]) *getchangelist()* Returns the |changelist| for the buffer {buf}. For the use of {buf}, see |bufname()| above. If buffer {buf} doesn't exist, an empty list is returned. @@ -4680,6 +4744,9 @@ getchangelist({buf}) *getchangelist()* position refers to the position in the list. For other buffers, it is set to the length of the list. + Can also be used as a |method|: > + GetBufnr()->getchangelist() + getchar([expr]) *getchar()* Get a single character from the user or input stream. If [expr] is omitted, wait until a character is available. @@ -4890,6 +4957,9 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* If there are no matches, an empty list is returned. An invalid value for {type} produces an error. + Can also be used as a |method|: > + GetPattern()->getcompletion('color') +< *getcurpos()* getcurpos() Get the position of the cursor. This is like getpos('.'), but includes an extra "curswant" in the list: @@ -4918,6 +4988,9 @@ getcwd([{winnr}[, {tabnr}]]) *getcwd()* < If {winnr} is -1 it is ignored, only the tab is resolved. {winnr} can be the window number or the |window-ID|. + Can also be used as a |method|: > + GetWinnr()->getcwd() + getenv({name}) *getenv()* Return the value of environment variable {name}. The {name} argument is a string, without a leading '$'. Example: > @@ -4927,6 +5000,9 @@ getenv({name}) *getenv()* is different from a variable set to an empty string. See also |expr-env|. + Can also be used as a |method|: > + GetVarname()->getenv() + getfontname([{name}]) *getfontname()* Without an argument returns the name of the normal font being used. Like what is used for the Normal highlight group @@ -4954,6 +5030,9 @@ getfperm({fname}) *getfperm()* < This will hopefully (from a security point of view) display the string "rw-r--r--" or even "rw-------". + Can also be used as a |method|: > + GetFilename()->getfperm() +< For setting permissions use |setfperm()|. getfsize({fname}) *getfsize()* @@ -4964,6 +5043,9 @@ getfsize({fname}) *getfsize()* If the size of {fname} is too big to fit in a Number then -2 is returned. + Can also be used as a |method|: > + GetFilename()->getfsize() + getftime({fname}) *getftime()* The result is a Number, which is the last modification time of the given file {fname}. The value is measured as seconds @@ -4971,6 +5053,9 @@ getftime({fname}) *getftime()* |localtime()| and |strftime()|. If the file {fname} can't be found -1 is returned. + Can also be used as a |method|: > + GetFilename()->getftime() + getftype({fname}) *getftype()* The result is a String, which is a description of the kind of file of the given file {fname}. @@ -4991,6 +5076,9 @@ getftype({fname}) *getftype()* systems that support it. On some systems only "dir" and "file" are returned. + Can also be used as a |method|: > + GetFilename()->getftype() + getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* Returns the |jumplist| for the specified window. @@ -5010,7 +5098,10 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* filename filename if available lnum line number - *getline()* + Can also be used as a |method|: > + GetWinnr()->getjumplist() + +< *getline()* getline({lnum} [, {end}]) Without {end} the result is a String, which is line {lnum} from the current buffer. Example: > @@ -5033,6 +5124,9 @@ getline({lnum} [, {end}]) :let end = search("^$") - 1 :let lines = getline(start, end) +< Can also be used as a |method|: > + ComputeLnum()->getline() + < To get lines from another buffer see |getbufline()| getloclist({nr},[, {what}]) *getloclist()* @@ -5163,6 +5257,8 @@ getpos({expr}) Get the position for String {expr}. For possible values of call setpos("'a", save_a_mark) < Also see |getcurpos()| and |setpos()|. + Can also be used as a |method|: > + GetMark()->getpos() getqflist([{what}]) *getqflist()* Returns a |List| with all the current quickfix errors. Each @@ -5281,6 +5377,9 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* If {regname} is not specified, |v:register| is used. + Can also be used as a |method|: > + GetRegname()->getreg() + getreginfo([{regname}]) *getreginfo()* Returns detailed information about register {regname} as a Dictionary with the following entries: @@ -5319,6 +5418,9 @@ getregtype([{regname}]) *getregtype()* The {regname} argument is a string. If {regname} is not specified, |v:register| is used. + Can also be used as a |method|: > + GetRegname()->getregtype() + 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 @@ -5332,6 +5434,9 @@ gettabinfo([{tabnr}]) *gettabinfo()* tabpage-local variables windows List of |window-ID|s in the tab page. + Can also be used as a |method|: > + GetTabnr()->gettabinfo() + gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page {tabnr}. |t:var| @@ -5342,6 +5447,9 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* When the tab or variable doesn't exist {def} or an empty string is returned, there is no error message. + Can also be used as a |method|: > + GetTabnr()->gettabvar(varname) + gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* Get the value of window-local variable {varname} in window {winnr} in tab page {tabnr}. @@ -5368,6 +5476,9 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* To obtain all window-local variables use: > gettabwinvar({tabnr}, {winnr}, '&') +< Can also be used as a |method|: > + GetTabnr()->gettabwinvar(winnr, varname) + 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|. @@ -5396,6 +5507,9 @@ gettagstack([{winnr}]) *gettagstack()* See |tagstack| for more information about the tag stack. + Can also be used as a |method|: > + GetWinnr()->gettagstack() + getwininfo([{winid}]) *getwininfo()* Returns information about windows as a |List| with Dictionaries. @@ -5427,6 +5541,9 @@ getwininfo([{winid}]) *getwininfo()* winrow topmost screen line of the window; "row" from |win_screenpos()| + Can also be used as a |method|: > + GetWinnr()->getwininfo() + getwinpos([{timeout}]) *getwinpos()* The result is a |List| with two numbers, the result of |getwinposx()| and |getwinposy()| combined: @@ -5447,6 +5564,9 @@ getwinpos([{timeout}]) *getwinpos()* " Do some work here endwhile < + Can also be used as a |method|: > + GetTimeout()->getwinpos() +< *getwinposx()* getwinposx() The result is a Number, which is the X coordinate in pixels of the left hand side of the GUI Vim window. The result will be @@ -5464,6 +5584,9 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Examples: > :let list_is_on = getwinvar(2, '&list') :echo "myvar = " . getwinvar(1, 'myvar') + +< Can also be used as a |method|: > + GetWinnr()->getwinvar(varname) < glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Expand the file wildcards in {expr}. See |wildcards| for the @@ -5501,6 +5624,9 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* See |expand()| for expanding special Vim variables. See |system()| for getting the raw output of an external command. + Can also be used as a |method|: > + GetExpr()->glob() + glob2regpat({string}) *glob2regpat()* Convert a file pattern, as used by glob(), into a search pattern. The result can be used to match with a string that @@ -5513,7 +5639,9 @@ glob2regpat({string}) *glob2regpat()* Note that the result depends on the system. On MS-Windows a backslash usually means a path separator. - *globpath()* + Can also be used as a |method|: > + GetExpr()->glob2regpat() +< *globpath()* globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]]) Perform glob() for String {expr} on all directories in {path} and concatenate the results. Example: > @@ -5549,6 +5677,10 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]]) < Upwards search and limiting the depth of "**" is not supported, thus using 'path' will not always work properly. + Can also be used as a |method|, the base is passed as the + second argument: > + GetExpr()->globpath(&rtp) +< *has()* has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The {feature} argument is a feature name like "nvim-0.2.1" or @@ -5631,6 +5763,9 @@ haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* {winnr} can be the window number or the |window-ID|. If {winnr} is -1 it is ignored, only the tab is resolved. + Can also be used as a |method|: > + GetWinnr()->haslocaldir() + hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* The result is a Number, which is TRUE if there is a mapping that contains {what} in somewhere in the rhs (what it is @@ -5645,7 +5780,9 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* If no matching mapping is found FALSE is returned. The following characters are recognized in {mode}: n Normal mode - v Visual mode + v Visual and Select mode + x Visual mode + s Select mode o Operator-pending mode i Insert mode l Language-Argument ("r", "f", "t", etc.) @@ -5660,6 +5797,9 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* < This installs the mapping to "\ABCdoit" only if there isn't already a mapping to "\ABCdoit". + Can also be used as a |method|: > + GetRHS()->hasmapto() + histadd({history}, {item}) *histadd()* Add the String {item} to the history {history} which can be one of: *hist-names* @@ -5681,6 +5821,10 @@ histadd({history}, {item}) *histadd()* :let date=input("Enter date: ") < This function is not available in the |sandbox|. + Can also be used as a |method|, the base is used for the + second argument: > + GetPattern()->histadd('search') + histdel({history} [, {item}]) *histdel()* Clear {history}, i.e. delete all its entries. See |hist-names| for the possible values of {history}. @@ -5712,6 +5856,9 @@ histdel({history} [, {item}]) *histdel()* the "n" command and 'hlsearch': > :call histdel("search", -1) :let @/ = histget("search", -1) +< + Can also be used as a |method|: > + GetHistory()->histdel() histget({history} [, {index}]) *histget()* The result is a String, the entry with Number {index} from @@ -5728,6 +5875,9 @@ histget({history} [, {index}]) *histget()* the {num}th entry from the output of |:history|. > :command -nargs=1 H execute histget("cmd", 0+<args>) < + Can also be used as a |method|: > + GetHistory()->histget() + histnr({history}) *histnr()* The result is the Number of the current entry in {history}. See |hist-names| for the possible values of {history}. @@ -5735,6 +5885,9 @@ histnr({history}) *histnr()* Example: > :let inp_index = histnr("expr") + +< Can also be used as a |method|: > + GetHistory()->histnr() < hlexists({name}) *hlexists()* The result is a Number, which is TRUE if a highlight group @@ -5743,6 +5896,9 @@ hlexists({name}) *hlexists()* been defined for it, it may also have been used for a syntax item. + Can also be used as a |method|: > + GetName()->hlexists() +< *hlID()* hlID({name}) The result is a Number, which is the ID of the highlight group with name {name}. When the highlight group doesn't exist, @@ -5751,6 +5907,9 @@ hlID({name}) The result is a Number, which is the ID of the highlight group group. For example, to get the background color of the "Comment" group: > :echo synIDattr(synIDtrans(hlID("Comment")), "bg") +< + Can also be used as a |method|: > + GetName()->hlID() hostname() *hostname()* The result is a String, which is the name of the machine on @@ -5769,6 +5928,9 @@ iconv({string}, {from}, {to}) *iconv()* from/to UCS-2 is automatically changed to use UTF-8. You cannot use UCS-2 in a string anyway, because of the NUL bytes. + Can also be used as a |method|: > + GetText()->iconv('latin1', 'utf-8') +< *indent()* indent({lnum}) The result is a Number, which is indent of line {lnum} in the current buffer. The indent is counted in spaces, the value @@ -5776,6 +5938,8 @@ indent({lnum}) The result is a Number, which is indent of line {lnum} in the |getline()|. When {lnum} is invalid -1 is returned. + Can also be used as a |method|: > + GetLnum()->indent() index({object}, {expr} [, {start} [, {ic}]]) *index()* If {object} is a |List| return the lowest index where the item @@ -5796,6 +5960,8 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* :let idx = index(words, "the") :if index(numbers, 123) >= 0 +< Can also be used as a |method|: > + GetObject()->index(what) input({prompt} [, {text} [, {completion}]]) *input()* input({opts}) @@ -5908,6 +6074,9 @@ input({opts}) : call inputrestore() :endfunction +< Can also be used as a |method|: > + GetPrompt()->input() + inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is displayed, one string per line. The user will be prompted to @@ -5925,6 +6094,9 @@ inputlist({textlist}) *inputlist()* let color = inputlist(['Select color:', '1. red', \ '2. green', '3. blue']) +< Can also be used as a |method|: > + GetChoices()->inputlist() + inputrestore() *inputrestore()* Restore typeahead that was saved with a previous |inputsave()|. Should be called the same number of times inputsave() is @@ -5950,6 +6122,9 @@ inputsecret({prompt} [, {text}]) *inputsecret()* typed on the command-line in response to the issued prompt. NOTE: Command-line completion is not supported. + Can also be used as a |method|: > + GetPrompt()->inputsecret() + insert({object}, {item} [, {idx}]) *insert()* When {object} is a |List| or a |Blob| insert {item} at the start of it. @@ -5996,6 +6171,9 @@ isdirectory({directory}) *isdirectory()* exist, or isn't a directory, the result is |FALSE|. {directory} is any expression, which is used as a String. + Can also be used as a |method|: > + GetName()->isdirectory() + isinf({expr}) *isinf()* Return 1 if {expr} is a positive infinity, or -1 a negative infinity, otherwise 0. > @@ -6021,6 +6199,9 @@ islocked({expr}) *islocked()* *E786* < When {expr} is a variable that does not exist you get an error message. Use |exists()| to check for existence. + Can also be used as a |method|: > + GetName()->islocked() + id({expr}) *id()* Returns a |String| which is a unique identifier of the container type (|List|, |Dict|, |Blob| and |Partial|). It is @@ -6205,6 +6386,9 @@ json_decode({expr}) *json_decode()* recommended and the only one required to be supported. Non-UTF-8 characters are an error. + Can also be used as a |method|: > + ReadObject()->json_decode() + json_encode({expr}) *json_encode()* Convert {expr} into a JSON string. Accepts |msgpack-special-dict| as the input. Will not convert @@ -6217,6 +6401,9 @@ json_encode({expr}) *json_encode()* or special escapes like "\t", other are dumped as-is. |Blob|s are converted to arrays of the individual bytes. + Can also be used as a |method|: > + GetObject()->json_encode() + keys({dict}) *keys()* Return a |List| with all the keys of {dict}. The |List| is in arbitrary order. Also see |items()| and |values()|. @@ -6280,6 +6467,10 @@ libcall({libname}, {funcname}, {argument}) object code must be compiled as position-independent ('PIC'). Examples: > :echo libcall("libc.so", "getenv", "HOME") + +< Can also be used as a |method|, where the base is passed as + the argument to the called function: > + GetValue()->libcall("libc.so", "getenv") < *libcallnr()* libcallnr({libname}, {funcname}, {argument}) @@ -6290,8 +6481,12 @@ libcallnr({libname}, {funcname}, {argument}) :call libcallnr("libc.so", "printf", "Hello World!\n") :call libcallnr("libc.so", "sleep", 10) < - *line()* -line({expr}) The result is a Number, which is the line number of the file + Can also be used as a |method|, where the base is passed as + the argument to the called function: > + GetValue()->libcallnr("libc.so", "printf") +< +line({expr} [, {winid}]) *line()* + The result is a Number, which is the line number of the file position given with {expr}. The {expr} argument is a string. The accepted positions are: . the cursor position @@ -6310,10 +6505,16 @@ line({expr}) The result is a Number, which is the line number of the file then applies to another buffer. To get the column number use |col()|. To get both use |getpos()|. + With the optional {winid} argument the values are obtained for + that window instead of the current window. Examples: > line(".") line number of the cursor + line(".", winid) idem, in window "winid" line("'t") line number of mark t line("'" . marker) line number of mark marker +< + Can also be used as a |method|: > + GetValue()->line() line2byte({lnum}) *line2byte()* Return the byte count from the start of the buffer for line @@ -6328,6 +6529,9 @@ line2byte({lnum}) *line2byte()* |getline()|. When {lnum} is invalid -1 is returned. Also see |byte2line()|, |go| and |:goto|. + Can also be used as a |method|: > + GetLnum()->line2byte() + lispindent({lnum}) *lispindent()* Get the amount of indent for line {lnum} according the lisp indenting rules, as with 'lisp'. @@ -6335,6 +6539,9 @@ lispindent({lnum}) *lispindent()* relevant. {lnum} is used just like in |getline()|. When {lnum} is invalid, -1 is returned. + Can also be used as a |method|: > + GetLnum()->lispindent() + list2str({list} [, {utf8}]) *list2str()* Convert each number in {list} to a character string can concatenate them all. Examples: > @@ -6349,6 +6556,9 @@ list2str({list} [, {utf8}]) *list2str()* With UTF-8 composing characters work as expected: > list2str([97, 769]) returns "á" < + Can also be used as a |method|: > + GetList()->list2str() + localtime() *localtime()* Return the current time, measured as seconds since 1st Jan 1970. See also |strftime()|, |strptime()| and |getftime()|. @@ -6383,6 +6593,9 @@ luaeval({expr}[, {expr}]) Evaluate Lua expression {expr} and return its result converted to Vim data structures. See |lua-eval| for more details. + Can also be used as a |method|: > + GetExpr()->luaeval() + map({expr1}, {expr2}) *map()* {expr1} must be a |List|, |Blob| or |Dictionary|. Replace each item in {expr1} with the result of evaluating @@ -6490,6 +6703,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* mapped, and have it do the original mapping too. Sketch: > exe 'nnoremap <Tab> ==' . maparg('<Tab>', 'n') +< Can also be used as a |method|: > + GetKey()->maparg('n') mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* Check if there is a mapping that matches with {name} in mode @@ -6524,6 +6739,9 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* < This avoids adding the "_vv" mapping when there already is a mapping for "_v" or for "_vvv". + Can also be used as a |method|: > + GetKey()->mapcheck('n') + match({expr}, {pat} [, {start} [, {count}]]) *match()* When {expr} is a |List| then this returns the index of the first item where {pat} matches. Each item is used as a @@ -6586,6 +6804,9 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* zero matches at the start instead of a number of matches further down in the text. + Can also be used as a |method|: > + GetList()->match('word') +< *matchadd()* *E798* *E799* *E801* *E957* matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a @@ -6641,6 +6862,9 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. + Can also be used as a |method|: > + GetGroup()->matchadd('TODO') +< *matchaddpos()* matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) Same as |matchadd()|, but requires a list of positions {pos} @@ -6679,6 +6903,9 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) < Matches added by |matchaddpos()| are returned by |getmatches()|. + Can also be used as a |method|: > + GetGroup()->matchaddpos([23, 11]) + matcharg({nr}) *matcharg()* Selects the {nr} match item, as set with a |:match|, |:2match| or |:3match| command. @@ -6691,6 +6918,9 @@ matcharg({nr}) *matcharg()* Highlighting matches using the |:match| commands are limited to three matches. |matchadd()| does not have this limitation. + Can also be used as a |method|: > + GetMatch()->matcharg() + matchdelete({id} [, {win}]) *matchdelete()* *E802* *E803* Deletes a match with ID {id} previously defined by |matchadd()| or one of the |:match| commands. Returns 0 if successful, @@ -6699,6 +6929,9 @@ matchdelete({id} [, {win}]) *matchdelete()* *E802* *E803* If {win} is specified, use the window with this number or window ID instead of the current window. + Can also be used as a |method|: > + GetMatch()->matchdelete() + matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Same as |match()|, but return the index of first character after the match. Example: > @@ -6718,6 +6951,9 @@ matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* < result is "-1". When {expr} is a |List| the result is equal to |match()|. + Can also be used as a |method|: > + GetText()->matchend('word') + matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Same as |match()|, but return a |List|. The first item in the list is the matched string, same as what matchstr() would @@ -6728,6 +6964,9 @@ matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* < Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', ''] When there is no match an empty list is returned. + Can also be used as a |method|: > + GetList()->matchlist('word') + matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* Same as |match()|, but return the matched string. Example: > :echo matchstr("testing", "ing") @@ -6741,6 +6980,9 @@ matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* When {expr} is a |List| then the matching item is returned. The type isn't changed, it's not necessarily a String. + Can also be used as a |method|: > + GetText()->matchstr('word') + matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* Same as |matchstr()|, but return the matched string, the start position and the end position of the match. Example: > @@ -6759,6 +7001,9 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* < result is ["x", 1, 2, 3]. The type isn't changed, it's not necessarily a String. + Can also be used as a |method|: > + GetText()->matchstrpos('word') + *max()* max({expr}) Return the maximum value of all items in {expr}. {expr} can be a |List| or a |Dictionary|. For a Dictionary, @@ -6849,6 +7094,9 @@ mkdir({name} [, {path} [, {prot}]]) successful or FALSE if the directory creation failed or partly failed. + Can also be used as a |method|: > + GetName()->mkdir() +< *mode()* mode([expr]) Return a string that indicates the current mode. If [expr] is supplied and it evaluates to a non-zero Number or @@ -6864,6 +7112,8 @@ mode([expr]) Return a string that indicates the current mode. niI Normal using |i_CTRL-O| in |Insert-mode| niR Normal using |i_CTRL-O| in |Replace-mode| niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| + nt Normal in |terminal-emulator| (insert goes to + Terminal mode) v Visual by character vs Visual by character using |v_CTRL-O| in Select mode V Visual by line @@ -6898,6 +7148,9 @@ mode([expr]) Return a string that indicates the current mode. the leading character(s). Also see |visualmode()|. + Can also be used as a |method|: > + DoFull()->mode() + msgpackdump({list} [, {type}]) *msgpackdump()* Convert a list of VimL objects to msgpack. Returned value is a |readfile()|-style list. When {type} contains "B", a |Blob| is @@ -7000,6 +7253,9 @@ nextnonblank({lnum}) *nextnonblank()* {lnum} is used like with |getline()|. See also |prevnonblank()|. + Can also be used as a |method|: > + GetLnum()->nextnonblank() + nr2char({expr} [, {utf8}]) *nr2char()* Return a string with a single character, which has the number value {expr}. Examples: > @@ -7014,6 +7270,9 @@ nr2char({expr} [, {utf8}]) *nr2char()* characters. nr2char(0) is a real NUL and terminates the string, thus results in an empty string. + Can also be used as a |method|: > + GetNumber()->nr2char() + nvim_...({...}) *E5555* *nvim_...()* *eval-api* Call nvim |api| functions. The type checking of arguments will be stricter than for most other builtins. For instance, @@ -7042,6 +7301,9 @@ pathshorten({path}) *pathshorten()* < ~/.c/n/a/file1.vim ~ It doesn't matter if the path exists or not. + Can also be used as a |method|: > + GetDirectories()->pathshorten() + perleval({expr}) *perleval()* Evaluate |perl| expression {expr} and return its result converted to Vim data structures. @@ -7057,6 +7319,9 @@ perleval({expr}) *perleval()* :echo perleval('[1 .. 4]') < [1, 2, 3, 4] + Can also be used as a |method|: > + GetExpr()->perleval() + pow({x}, {y}) *pow()* Return the power of {x} to the exponent {y} as a |Float|. {x} and {y} must evaluate to a |Float| or a |Number|. @@ -7080,6 +7345,8 @@ prevnonblank({lnum}) *prevnonblank()* {lnum} is used like with |getline()|. Also see |nextnonblank()|. + Can also be used as a |method|: > + GetLnum()->prevnonblank() printf({fmt}, {expr1} ...) *printf()* Return a String with {fmt}, where "%" items are replaced by @@ -7312,6 +7579,9 @@ prompt_setcallback({buf}, {expr}) *prompt_setcallback()* endif endfunc +< Can also be used as a |method|: > + GetBuffer()->prompt_setcallback(callback) + prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()* Set a callback for buffer {buf} to {expr}. When {expr} is an empty string the callback is removed. This has only effect if @@ -7321,12 +7591,18 @@ prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()* mode. Without setting a callback Vim will exit Insert mode, as in any buffer. + Can also be used as a |method|: > + GetBuffer()->prompt_setinterrupt(callback) + prompt_setprompt({buf}, {text}) *prompt_setprompt()* Set prompt for buffer {buf} to {text}. You most likely want {text} to end in a space. The result is only visible if {buf} has 'buftype' set to "prompt". Example: > call prompt_setprompt(bufnr(''), 'command: ') +< + Can also be used as a |method|: > + GetBuffer()->prompt_setprompt('command: ') pum_getpos() *pum_getpos()* If the popup menu (see |ins-completion-menu|) is not visible, @@ -7357,6 +7633,9 @@ py3eval({expr}) *py3eval()* Dictionaries are represented as Vim |Dictionary| type with keys converted to strings. + Can also be used as a |method|: > + GetExpr()->py3eval() +< *E858* *E859* pyeval({expr}) *pyeval()* Evaluate Python expression {expr} and return its result @@ -7367,12 +7646,18 @@ pyeval({expr}) *pyeval()* Dictionaries are represented as Vim |Dictionary| type, non-string keys result in error. + Can also be used as a |method|: > + GetExpr()->pyeval() + pyxeval({expr}) *pyxeval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. Uses Python 2 or 3, see |python_x| and 'pyxversion'. See also: |pyeval()|, |py3eval()| + Can also be used as a |method|: > + GetExpr()->pyxeval() +< *E726* *E727* range({expr} [, {max} [, {stride}]]) *range()* Returns a |List| with Numbers: @@ -7392,6 +7677,9 @@ range({expr} [, {max} [, {stride}]]) *range()* range(0) " [] range(2, 0) " error! < + Can also be used as a |method|: > + GetExpr()->range() +< *readdir()* readdir({directory} [, {expr}]) Return a list with file and directory names in {directory}. @@ -7419,6 +7707,9 @@ readdir({directory} [, {expr}]) endfunction echo s:tree(".") < + Can also be used as a |method|: > + GetDirName()->readdir() +< *readfile()* readfile({fname} [, {type} [, {max}]]) Read file {fname} and return a |List|, each line of the file @@ -7452,6 +7743,9 @@ readfile({fname} [, {type} [, {max}]]) the result is an empty list. Also see |writefile()|. + Can also be used as a |method|: > + GetFileName()->readfile() + reg_executing() *reg_executing()* Returns the single letter name of the register being executed. Returns an empty string when no register is being executed. @@ -7479,6 +7773,9 @@ reltime([{start} [, {end}]]) *reltime()* The {start} and {end} arguments must be values returned by reltime(). + Can also be used as a |method|: > + GetStart()->reltime() +< Note: |localtime()| returns the current (non-relative) time. reltimefloat({time}) *reltimefloat()* @@ -7492,6 +7789,9 @@ reltimefloat({time}) *reltimefloat()* Also see |profiling|. If there is an error an empty string is returned + Can also be used as a |method|: > + reltime(start)->reltimefloat() + reltimestr({time}) *reltimestr()* Return a String that represents the time value of {time}. This is the number of seconds, a dot and the number of @@ -7506,6 +7806,9 @@ reltimestr({time}) *reltimestr()* < Also see |profiling|. If there is an error an empty string is returned + Can also be used as a |method|: > + reltime(start)->reltimestr() +< *remote_expr()* *E449* remote_expr({server}, {string} [, {idvar} [, {timeout}]]) Send the {string} to {server}. The string is sent as an @@ -7638,6 +7941,9 @@ rename({from}, {to}) *rename()* NOTE: If {to} exists it is overwritten without warning. This function is not available in the |sandbox|. + Can also be used as a |method|: > + GetOldName()->rename(newname) + repeat({expr}, {count}) *repeat()* Repeat {expr} {count} times and return the concatenated result. Example: > @@ -7664,6 +7970,9 @@ resolve({filename}) *resolve()* *E655* current directory (provided the result is still a relative path name) and also keeps a trailing path separator. + Can also be used as a |method|: > + GetName()->resolve() +< *reverse()* reverse({object}) Reverse the order of items in {object} in-place. @@ -7718,6 +8027,9 @@ rubyeval({expr}) *rubyeval()* Other objects are represented as strings resulted from their "Object#to_s" method. + Can also be used as a |method|: > + GetRubyExpr()->rubyeval() + screenattr({row}, {col}) *screenattr()* Like |screenchar()|, but return the attribute. This is a rather arbitrary number that can only be used to compare to the @@ -8281,6 +8593,9 @@ setfperm({fname}, {mode}) *setfperm()* *chmod* Returns non-zero for success, zero for failure. + Can also be used as a |method|: > + GetFilename()->setfperm(mode) +< To read permissions see |getfperm()|. setline({lnum}, {text}) *setline()* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index 5ad69d1122..e83b17f9a0 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -53,7 +53,7 @@ next key is sent unless it is <C-N>. Use <C-\><C-N> to return to normal-mode. Terminal-mode forces these local options: - 'nocursorline' + 'cursorlineopt' = number 'nocursorcolumn' 'scrolloff' = 0 'sidescrolloff' = 0 @@ -171,7 +171,7 @@ program window A terminal window for the executed program. When "run" is The current window is used to show the source code. When gdb pauses the source file location will be displayed, if possible. A sign is used to -highlight the current position, using highlight group debugPC. +highlight the current position, using highlight group debugPC. If the buffer in the current window is modified, another window will be opened to display the current gdb position. @@ -222,7 +222,7 @@ Put focus on the gdb window and type: > run Vim will start running in the program window. Put focus there and type: > :help gui -Gdb will run into the ex_help breakpoint. The source window now shows the +Gdb will run into the ex_help breakpoint. The source window now shows the ex_cmds.c file. A red "1 " marker will appear in the signcolumn where the breakpoint was set. The line where the debugger stopped is highlighted. You can now step through the program. You will see the highlighting move as the diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 85be6eddaa..3520d40591 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1409,9 +1409,9 @@ A jump table for the options with a short description can be found at |Q_op|. When this option is set it overrules 'shellslash' for completion: - When this option is set to "slash", a forward slash is used for path completion in insert mode. This is useful when editing HTML tag, or - Makefile with 'noshellslash' on Windows. + Makefile with 'noshellslash' on MS-Windows. - When this option is set to "backslash", backslash is used. This is - useful when editing a batch file with 'shellslash' set on Windows. + useful when editing a batch file with 'shellslash' set on MS-Windows. - When this option is empty, same character is used as for 'shellslash'. For Insert mode completion the buffer-local value is used. For @@ -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/usr_41.txt b/runtime/doc/usr_41.txt index 5d70834ddc..c575dd9fd8 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1804,7 +1804,7 @@ First of all you must choose a name for your plugin. The features provided by the plugin should be clear from its name. And it should be unlikely that someone else writes a plugin with the same name but which does something different. And please limit the name to 8 characters, to avoid problems on -old Windows systems. +old MS-Windows systems. A script that corrects typing mistakes could be called "typecorr.vim". We will use it here as an example. 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/filetype.vim b/runtime/filetype.vim index c86ca9646b..75354968e9 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -703,6 +703,7 @@ au BufNewFile,BufRead *.gpi setf gnuplot " Go (Google) au BufNewFile,BufRead *.go setf go +au BufNewFile,BufRead Gopkg.lock setf toml " GrADS scripts au BufNewFile,BufRead *.gs setf grads @@ -1283,7 +1284,7 @@ au BufNewFile,BufRead *.rcp setf pilrc au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine " Pipenv Pipfiles -au BufNewFile,BufRead Pipfile setf config +au BufNewFile,BufRead Pipfile setf toml au BufNewFile,BufRead Pipfile.lock setf json " PL/1, PL/I @@ -1517,6 +1518,7 @@ au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby " Rust au BufNewFile,BufRead *.rs setf rust +au BufNewFile,BufRead Cargo.lock,*/.cargo/config,*/.cargo/credentials setf toml " S-lang (or shader language, or SmallLisp) au BufNewFile,BufRead *.sl setf slang @@ -2301,6 +2303,9 @@ au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh") " csh scripts ending in a star au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH() +" tmux configuration with arbitrary extension +au BufNewFile,BufRead {.,}tmux*.conf* setf tmux + " VHDL au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') 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 <nvitacolonna@gmail.com> " Former Maintainers: Nikolai Weibull <now@bitwi.se> -" 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:\\\@<!\%(\\\\\)*%' let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' . \ '\\start\(\a\+\):\\stop\1' + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words b:match_skip" endif let s:context_regex = { @@ -57,19 +57,28 @@ function! s:move_around(count, what, flags, visual) call map(range(2, a:count), 'search(s:context_regex[a:what], a:flags)') endfunction -" Move around macros. -nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR> -vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR> -nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR> -vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR> -nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR> -vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR> -nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR> -vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR> -nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR> -vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR> -nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR> -vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR> +if !exists("no_plugin_maps") && !exists("no_context_maps") + " Move around macros. + nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR> + vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR> + nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR> + vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR> + nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR> + vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR> + nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR> + vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR> + nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR> + vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR> + nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR> + vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR> + + let b:undo_ftplugin .= " | sil! exe 'nunmap <buffer> [[' | sil! exe 'vunmap <buffer> [['" . + \ " | sil! exe 'nunmap <buffer> ]]' | sil! exe 'vunmap <buffer> ]]'" . + \ " | sil! exe 'nunmap <buffer> []' | sil! exe 'vunmap <buffer> []'" . + \ " | sil! exe 'nunmap <buffer> ][' | sil! exe 'vunmap <buffer> ]['" . + \ " | sil! exe 'nunmap <buffer> [{' | sil! exe 'vunmap <buffer> [{'" . + \ " | sil! exe 'nunmap <buffer> ]}' | sil! exe 'vunmap <buffer> ]}'" +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 <silent><buffer> tp :<c-u>call <sid>tp()<cr> - " Select TeX paragraph - vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr> - - " $...$ text object - onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr> - onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr> - vnoremap <buffer> i$ T$ot$ - vnoremap <buffer> a$ F$of$ + if !exists("no_plugin_maps") && !exists("no_context_maps") + " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") + onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr> + " Select TeX paragraph + vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr> + + " $...$ text object + onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr> + onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr> + vnoremap <buffer> i$ T$ot$ + vnoremap <buffer> a$ F$of$ + + let b:undo_ftplugin .= " | sil! exe 'ounmap <buffer> tp' | sil! exe 'vunmap <buffer> tp'" . + \ " | sil! exe 'ounmap <buffer> i$' | sil! exe 'vunmap <buffer> i$'" . + \ " | sil! exe 'ounmap <buffer> a$' | sil! exe 'vunmap <buffer> 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 <dwsharp at users dot sourceforge dot net> -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: csh +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Contributor: Johannes Zellner <johannes@zellner.org> +" 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*\<if\>.*(.*).*\<then\>:'. - \ '^\s*\<else\>\s\+\<if\>.*(.*).*\<then\>:^\s*\<else\>:'. - \ '^\s*\<endif\>,'. - \ '\%(^\s*\<foreach\>\s\+\S\+\|^s*\<while\>\).*(.*):'. - \ '\<break\>:\<continue\>:^\s*\<end\>,'. - \ '^\s*\<switch\>.*(.*):^\s*\<case\>\s\+:^\s*\<default\>:^\s*\<endsw\>' +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 .. '\%(\<foreach\s\+\h\w*\|while\)\s*(:' .. + \ '\<break\>:\<continue\>:' .. + \ s:line_start .. 'end\>,' .. + \ s:line_start .. 'switch\s*(:' .. + \ s:line_start .. 'case\s\+:' .. s:line_start .. 'default\>:\<breaksw\>:' .. + \ 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 <dwsharp at users dot sourceforge dot net> -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: tcsh +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" 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 <kevin@sb.org> +" 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 <fishburn@ianywhere.com> +" Version: 2.0.6.1 +" Last Change: 2021 Oct 11 +" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> +" 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 <dfishburn dot vim at gmail dot com> -" 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\>.*\<then\|'. - \ 'then\|else\>\|'. - \ 'elseif\>.*\<then\|'. - \ 'elsif\>.(\<then\|'. - \ 'while\>.*\<loop\|'. - \ 'for\>.*\<loop\|'. - \ 'foreach\>.*\<loop\|'. - \ 'loop\|do\|declare\|begin\|'. + \ 'if\|else\|elseif\|elsif\|'. + \ 'while\|loop\|do\|for\|'. + \ 'begin\|'. \ 'case\|when\|merge\|exception'. \ '\)\>' 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 <a@b.com> where a=dougkearns, b=gmail -" Last Modified: Sun 26 Sep 2021 12:38:38 PM EDT +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Gautam Iyer <gi1242+vim@NoSpam.com> 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/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index c7c8c1878e..326932d982 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -27,7 +27,10 @@ local global_diagnostic_options = { ---@private local function to_severity(severity) - return type(severity) == 'string' and M.severity[string.upper(severity)] or severity + if type(severity) == 'string' then + return assert(M.severity[string.upper(severity)], string.format("Invalid severity: %s", severity)) + end + return severity end ---@private @@ -90,28 +93,6 @@ local function reformat_diagnostics(format, diagnostics) return formatted end ----@private -local function resolve_optional_value(option, namespace, bufnr) - local enabled_val = {} - - if not option then - return false - elseif option == true then - return enabled_val - elseif type(option) == 'function' then - local val = option(namespace, bufnr) - if val == true then - return enabled_val - else - return val - end - elseif type(option) == 'table' then - return option - else - error("Unexpected option type: " .. vim.inspect(option)) - end -end - local all_namespaces = {} ---@private @@ -125,9 +106,7 @@ local function get_namespace(ns) end end - if not name then - return vim.notify("namespace does not exist or is anonymous", vim.log.levels.ERROR) - end + assert(name, "namespace does not exist or is anonymous") all_namespaces[ns] = { name = name, @@ -139,12 +118,46 @@ local function get_namespace(ns) end ---@private +local function enabled_value(option, namespace) + local ns = get_namespace(namespace) + if type(ns.opts[option]) == "table" then + return ns.opts[option] + end + + if type(global_diagnostic_options[option]) == "table" then + return global_diagnostic_options[option] + end + + return {} +end + +---@private +local function resolve_optional_value(option, value, namespace, bufnr) + if not value then + return false + elseif value == true then + return enabled_value(option, namespace) + elseif type(value) == 'function' then + local val = value(namespace, bufnr) + if val == true then + return enabled_value(option, namespace) + else + return val + end + elseif type(value) == 'table' then + return value + else + error("Unexpected option type: " .. vim.inspect(value)) + end +end + +---@private local function get_resolved_options(opts, namespace, bufnr) local ns = get_namespace(namespace) local resolved = vim.tbl_extend('keep', opts or {}, ns.opts, global_diagnostic_options) for k in pairs(global_diagnostic_options) do if resolved[k] ~= nil then - resolved[k] = resolve_optional_value(resolved[k], namespace, bufnr) + resolved[k] = resolve_optional_value(k, resolved[k], namespace, bufnr) end end return resolved @@ -398,6 +411,17 @@ local function show_diagnostics(opts, diagnostics) diagnostics = prefix_source(opts.source, diagnostics) end + -- Use global setting for severity_sort since 'show_diagnostics' is namespace + -- independent + local severity_sort = global_diagnostic_options.severity_sort + if severity_sort then + if type(severity_sort) == "table" and severity_sort.reverse then + table.sort(diagnostics, function(a, b) return a.severity > b.severity end) + else + table.sort(diagnostics, function(a, b) return a.severity < b.severity end) + end + end + for i, diagnostic in ipairs(diagnostics) do local prefix = string.format("%d. ", i) local hiname = floating_highlight_map[diagnostic.severity] @@ -510,6 +534,9 @@ local function diagnostic_move_pos(opts, pos) return end + -- Save position in the window's jumplist + vim.api.nvim_win_call(win_id, function() vim.cmd("normal! m'") end) + vim.api.nvim_win_set_cursor(win_id, {pos[1] + 1, pos[2]}) if enable_popup then @@ -527,10 +554,27 @@ end --- Configure diagnostic options globally or for a specific diagnostic --- namespace. --- +--- Configuration can be specified globally, per-namespace, or ephemerally +--- (i.e. only for a single call to |vim.diagnostic.set()| or +--- |vim.diagnostic.show()|). Ephemeral configuration has highest priority, +--- followed by namespace configuration, and finally global configuration. +--- +--- For example, if a user enables virtual text globally with +--- <pre> +--- vim.diagnostic.config({virt_text = true}) +--- </pre> +--- +--- and a diagnostic producer sets diagnostics with +--- <pre> +--- vim.diagnostic.set(ns, 0, diagnostics, {virt_text = false}) +--- </pre> +--- +--- then virtual text will not be enabled for those diagnostics. +--- ---@note Each of the configuration options below accepts one of the following: --- - `false`: Disable this feature --- - `true`: Enable this feature, use default settings. ---- - `table`: Enable this feature with overrides. +--- - `table`: Enable this feature with overrides. Use an empty table to use default values. --- - `function`: Function with signature (namespace, bufnr) that returns any of the above. --- ---@param opts table Configuration table with the following keys: @@ -638,8 +682,6 @@ function M.set(namespace, bufnr, diagnostics, opts) if vim.api.nvim_buf_is_loaded(bufnr) then M.show(namespace, bufnr, diagnostics, opts) - elseif opts then - M.config(opts, namespace) end vim.api.nvim_command("doautocmd <nomodeline> User DiagnosticsChanged") @@ -1140,7 +1182,6 @@ function M.show_position_diagnostics(opts, bufnr, position) local diagnostics = M.get(bufnr, opts) clamp_line_numbers(bufnr, diagnostics) local position_diagnostics = vim.tbl_filter(match_position_predicate, diagnostics) - table.sort(position_diagnostics, function(a, b) return a.severity < b.severity end) return show_diagnostics(opts, position_diagnostics) end @@ -1263,6 +1304,7 @@ end --- <pre> --- WARNING filename:27:3: Variable 'foo' does not exist --- </pre> +--- --- This can be parsed into a diagnostic |diagnostic-structure| --- with: --- <pre> diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index c7a88a0993..9c35351608 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -41,6 +41,7 @@ lsp._request_name_to_capability = { ['textDocument/documentSymbol'] = 'document_symbol'; ['textDocument/prepareCallHierarchy'] = 'call_hierarchy'; ['textDocument/rename'] = 'rename'; + ['textDocument/prepareRename'] = 'rename'; ['textDocument/codeAction'] = 'code_action'; ['textDocument/codeLens'] = 'code_lens'; ['codeLens/resolve'] = 'code_lens_resolve'; @@ -85,7 +86,7 @@ end function lsp._unsupported_method(method) local msg = string.format("method %s is not supported by any of the servers registered for the current buffer", method) log.warn(msg) - return lsp.rpc_response_error(protocol.ErrorCodes.MethodNotFound, msg) + return msg end ---@private @@ -130,15 +131,28 @@ local all_client_active_buffers = {} ---@param bufnr (Number) of buffer ---@param fn (function({client}, {client_id}, {bufnr}) Function to run on ---each client attached to that buffer. -local function for_each_buffer_client(bufnr, fn) +---@param restrict_client_ids table list of client ids on which to restrict function application. +local function for_each_buffer_client(bufnr, fn, restrict_client_ids) validate { fn = { fn, 'f' }; + restrict_client_ids = { restrict_client_ids, 't' , true}; } bufnr = resolve_bufnr(bufnr) local client_ids = all_buffer_active_clients[bufnr] if not client_ids or tbl_isempty(client_ids) then return end + + if restrict_client_ids and #restrict_client_ids > 0 then + local filtered_client_ids = {} + for client_id in pairs(client_ids) do + if vim.tbl_contains(restrict_client_ids, client_id) then + filtered_client_ids[client_id] = true + end + end + client_ids = filtered_client_ids + end + for client_id in pairs(client_ids) do local client = active_clients[client_id] if client then @@ -1254,33 +1268,33 @@ function lsp.buf_request(bufnr, method, params, handler) method = { method, 's' }; handler = { handler, 'f', true }; } - local client_request_ids = {} + local supported_clients = {} local method_supported = false - for_each_buffer_client(bufnr, function(client, client_id, resolved_bufnr) + for_each_buffer_client(bufnr, function(client, client_id) if client.supports_method(method) then method_supported = true - local request_success, request_id = client.request(method, params, handler, resolved_bufnr) - - -- This could only fail if the client shut down in the time since we looked - -- it up and we did the request, which should be rare. - if request_success then - client_request_ids[client_id] = request_id - end + table.insert(supported_clients, client_id) end end) - -- if has client but no clients support the given method, call the callback with the proper - -- error message. + -- if has client but no clients support the given method, notify the user if not tbl_isempty(all_buffer_active_clients[resolve_bufnr(bufnr)] or {}) and not method_supported then - local unsupported_err = lsp._unsupported_method(method) - handler = handler or lsp.handlers[method] - if handler then - handler(unsupported_err, nil, {method=method, bufnr=bufnr}) - end + vim.notify(lsp._unsupported_method(method), vim.log.levels.ERROR) + vim.api.nvim_command("redraw") return end + local client_request_ids = {} + for_each_buffer_client(bufnr, function(client, client_id, resolved_bufnr) + local request_success, request_id = client.request(method, params, handler, resolved_bufnr) + -- This could only fail if the client shut down in the time since we looked + -- it up and we did the request, which should be rare. + if request_success then + client_request_ids[client_id] = request_id + end + end, supported_clients) + local function _cancel_all_requests() for client_id, request_id in pairs(client_request_ids) do local client = active_clients[client_id] @@ -1308,12 +1322,13 @@ function lsp.buf_request_all(bufnr, method, params, callback) local request_results = {} local result_count = 0 local expected_result_count = 0 - local cancel, client_request_ids - local set_expected_result_count = once(function() - for _ in pairs(client_request_ids) do - expected_result_count = expected_result_count + 1 - end + local set_expected_result_count = once(function () + for_each_buffer_client(bufnr, function(client) + if client.supports_method(method) then + expected_result_count = expected_result_count + 1 + end + end) end) local function _sync_handler(err, result, ctx) @@ -1326,7 +1341,7 @@ function lsp.buf_request_all(bufnr, method, params, callback) end end - client_request_ids, cancel = lsp.buf_request(bufnr, method, params, _sync_handler) + local _, cancel = lsp.buf_request(bufnr, method, params, _sync_handler) return cancel end @@ -1383,6 +1398,29 @@ function lsp.buf_notify(bufnr, method, params) return resp end + +---@private +local function adjust_start_col(lnum, line, items, encoding) + local min_start_char = nil + for _, item in pairs(items) do + if item.textEdit and item.textEdit.range.start.line == lnum - 1 then + if min_start_char and min_start_char ~= item.textEdit.range.start.character then + return nil + end + min_start_char = item.textEdit.range.start.character + end + end + if min_start_char then + if encoding == 'utf-8' then + return min_start_char + else + return vim.str_byteindex(line, min_start_char, encoding == 'utf-16') + end + else + return nil + end +end + --- Implements 'omnifunc' compatible LSP completion. --- ---@see |complete-functions| @@ -1418,17 +1456,37 @@ function lsp.omnifunc(findstart, base) -- Get the start position of the current keyword local textMatch = vim.fn.match(line_to_cursor, '\\k*$') - local prefix = line_to_cursor:sub(textMatch+1) local params = util.make_position_params() local items = {} - lsp.buf_request(bufnr, 'textDocument/completion', params, function(err, result) + lsp.buf_request(bufnr, 'textDocument/completion', params, function(err, result, ctx) if err or not result or vim.fn.mode() ~= "i" then return end + + -- Completion response items may be relative to a position different than `textMatch`. + -- Concrete example, with sumneko/lua-language-server: + -- + -- require('plenary.asy| + -- ▲ ▲ ▲ + -- │ │ └── cursor_pos: 20 + -- │ └────── textMatch: 17 + -- └────────────── textEdit.range.start.character: 9 + -- .newText = 'plenary.async' + -- ^^^ + -- prefix (We'd remove everything not starting with `asy`, + -- so we'd eliminate the `plenary.async` result + -- + -- `adjust_start_col` is used to prefer the language server boundary. + -- + local client = lsp.get_client_by_id(ctx.client_id) + local encoding = client and client.offset_encoding or 'utf-16' + local candidates = util.extract_completion_items(result) + local startbyte = adjust_start_col(pos[1], line, candidates, encoding) or textMatch + local prefix = line:sub(startbyte + 1, pos[2]) local matches = util.text_document_completion_list_to_complete_items(result, prefix) -- TODO(ashkan): is this the best way to do this? vim.list_extend(items, matches) - vim.fn.complete(textMatch+1, items) + vim.fn.complete(startbyte + 1, items) end) -- Return -2 to signal that we should continue completion so that we can diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index b1bdb24def..d9a684a738 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -466,15 +466,12 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params) -- We sent a number, so we expect a number. local result_id = tonumber(decoded.id) - -- Do not surface RequestCancelled or ContentModified to users, it is RPC-internal. + -- Do not surface RequestCancelled to users, it is RPC-internal. if decoded.error then local mute_error = false if decoded.error.code == protocol.ErrorCodes.RequestCancelled then local _ = log.debug() and log.debug("Received cancellation ack", decoded) mute_error = true - elseif decoded.error.code == protocol.ErrorCodes.ContentModified then - local _ = log.debug() and log.debug("Received content modified ack", decoded) - mute_error = true end if mute_error then diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index fca956fb57..3751f94caf 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -193,6 +193,7 @@ function M.get_progress_messages() title = ctx.title or "empty title", message = ctx.message, percentage = ctx.percentage, + done = ctx.done, progress = true, } table.insert(new_messages, new_report) diff --git a/runtime/lua/vim/uri.lua b/runtime/lua/vim/uri.lua index a3e79a0f2b..5d8d4fa169 100644 --- a/runtime/lua/vim/uri.lua +++ b/runtime/lua/vim/uri.lua @@ -75,13 +75,22 @@ local function uri_from_fname(path) end local URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9+-.]*):.*' +local WINDOWS_URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9+-.]*):[a-zA-Z]:.*' --- Get a URI from a bufnr ---@param bufnr (number): Buffer number ---@return URI local function uri_from_bufnr(bufnr) local fname = vim.api.nvim_buf_get_name(bufnr) - local scheme = fname:match(URI_SCHEME_PATTERN) + local volume_path = fname:match("^([a-zA-Z]:).*") + local is_windows = volume_path ~= nil + local scheme + if is_windows then + fname = fname:gsub("\\", "/") + scheme = fname:match(WINDOWS_URI_SCHEME_PATTERN) + else + scheme = fname:match(URI_SCHEME_PATTERN) + end if scheme then return fname else 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 <w.jq0722@gmail.com> -" Claudio Fleiner <claudio@fleiner.com> (Maintainer) +" Claudio Fleiner <claudio@fleiner.com> " 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 <jay@jaysitter.com> -" 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 "\<flex\(-\(start\|end\)\)\=\>" -syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>" +syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\|evenly\)\)\=\>" " 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 "\<small-\(caps\|caption\)\>" " 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 "\<grid\>" syn match cssGridProp contained "\<grid-template\(-\(columns\|rows\|areas\)\)\=\>" syn match cssGridProp contained "\<grid-\(column\|row\)\(-\(start\|end\|gap\)\)\=\>" syn match cssGridProp contained "\<grid-\(area\|gap\)\>" +syn match cssGridProp contained "\<gap\>" syn match cssGridProp contained "\<grid-auto-\(flow\|rows\|columns\)\>" syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>" @@ -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 "\<object-\(fit\|position\)\>" +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 "\<z-index\>" @@ -303,7 +308,7 @@ syn keyword cssPositioningAttr contained left right both syn match cssPositioningAttr contained "\<list-item\>" syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\|grid\|flex\)\)\=\>" syn match cssPositioningAttr contained "\<flow\(-root\)\=\>" -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 <dougkearns@NoSpam.com> where NoSpam=gmail -" Author: Gautam Iyer <gi1242+vim@NoSpam.com> where NoSpam=gmail -" Modified: Sun 26 Sep 2021 12:40:55 PM EDT -" +" Vim syntax file +" Language: tcsh scripts +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Gautam Iyer <gi1242+vim@NoSpam.com> 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\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds " set expressions (Contains shell variables) -syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars +syn keyword tcshShellVar contained addsuffix afsuser ampm anyerror argv autocorrect autoexpand autolist autologout autorehash backslash_quote catalog cdpath cdtohome color colorcat command compat_expr complete continue continue_args correct csubstnonl cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit editors ellipsis euid euser fignore filec gid globdot globstar group highlight histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd padhour parseoctal path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version vimode visiblebell watch who wordchars syn keyword tcshBuiltin nextgroup=tcshSetEnd set unset syn region tcshSetEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshShellVar,@tcshStatementEnds @@ -96,14 +97,15 @@ syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char \ history-search-forward insert-last-word i-search-fwd \ i-search-back keyboard-quit kill-line kill-region \ kill-whole-line list-choices list-choices-raw list-glob - \ list-or-eof load-average magic-space newline normalize-path - \ normalize-command overwrite-mode prefix-meta quoted-insert - \ redisplay run-fg-editor run-help self-insert-command - \ sequence-lead-in set-mark-command spell-word spell-line - \ stuff-char toggle-literal-history transpose-chars - \ transpose-gosling tty-dsusp tty-flush-output tty-sigintr - \ tty-sigquit tty-sigtsusp tty-start-output tty-stop-output - \ undefined-key universal-argument up-history upcase-word + \ list-or-eof load-average magic-space newline newline-and-hold + \ newline-and-down-history normalize-path normalize-command + \ overwrite-mode prefix-meta quoted-insert redisplay + \ run-fg-editor run-help self-insert-command sequence-lead-in + \ set-mark-command spell-word spell-line stuff-char + \ toggle-literal-history transpose-chars transpose-gosling + \ tty-dsusp tty-flush-output tty-sigintr tty-sigquit tty-sigtsusp + \ tty-start-output tty-stop-output undefined-key + \ universal-argument up-history upcase-word \ vi-beginning-of-next-word vi-add vi-add-at-eol vi-chg-case \ vi-chg-meta vi-chg-to-eol vi-cmd-mode vi-cmd-mode-complete \ vi-delprev vi-delmeta vi-endword vi-eword vi-char-back @@ -116,7 +118,7 @@ syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char \ e_paste_from_clipboard e_dosify_next e_dosify_prev e_page_up \ e_page_down syn keyword tcshBuiltin nextgroup=tcshBindkeyEnd bindkey -syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArguement,tcshBindkeyFuncs +syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArgument,tcshBindkeyFuncs " Expressions start with @. syn match tcshExprStart '\v\@\s+' nextgroup=tcshExprVar @@ -126,20 +128,20 @@ syn match tcshExprOp contained '\v\s*\=' nextgroup=tcshExprEnd syn match tcshExprEnd contained '\v.*$'hs=e+1 contains=@tcshConditions syn match tcshExprEnd contained '\v.{-};'hs=e contains=@tcshConditions -" ----- Comments: ----- +" ----- Comments: ----- {{{1 syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi syn match tcshSharpBang '^#! .*$' syn match tcshCommentTi contained '\v#\s*\u\w*(\s+\u\w*)*:'hs=s+1 contains=tcshTodo syn match tcshTodo contained '\v\c<todo>' -" ----- 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\\@<!'" end="'" syn region tcshDQuote keepend contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell syn region tcshBQuote keepend start='\v\\@<!`' end='`' contains=@tcshStatements @@ -149,7 +151,7 @@ else syn region tcshBQuote keepend matchgroup=tcshBQuoteGrp start='\v\\@<!`' skip='\v\\\\|\\`' end='`' contains=@tcshStatements endif -" ----- Variables ----- +" ----- Variables ----- {{{1 " Variable Errors. Must come first! \$ constructs will be flagged by " tcshSpecial, so we don't consider them here. syn match tcshVarError '\v\$\S*' contained @@ -171,7 +173,7 @@ syn match tcshSubst contained '\v\$\{[%#?]%(\h\w*|\d+)%(:\S*)?\}' contains=tcshM syn match tcshModifierError contained '\v:\S*' syn match tcshModifier contained '\v:[ag]?[htreuls&qx]' nextgroup=@tcshModifiers -" ----- Operators / Specials ----- +" ----- Operators / Specials ----- {{{1 " Standard redirects (except <<) [<, >, >>, >>&, >>!, >>&!] 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\\@<!\\(\d{3}|.)' syn match tcshSpecial contained '\v\\%([0-7]{3}|.)' -" ----- Synchronising ----- +" ----- Synchronising ----- {{{1 if exists('tcsh_minlines') if tcsh_minlines == 'fromstart' syn sync fromstart @@ -207,6 +209,7 @@ else syn sync minlines=100 " Some completions can be quite long endif +" ----- Highlighting ----- {{{1 " Define highlighting of syntax groups hi def link tcshError Error hi def link tcshBuiltin Statement @@ -233,17 +236,20 @@ hi def link tcshVarError Error hi def link tcshUsrVar Type hi def link tcshArgv tcshUsrVar hi def link tcshSubst tcshUsrVar -hi def link tcshModifier tcshArguement +hi def link tcshModifier tcshArgument hi def link tcshModifierError tcshVarError hi def link tcshMeta tcshSubst hi def link tcshRedir tcshOperator hi def link tcshHereDoc tcshSQuote hi def link tcshOperator Operator hi def link tcshNumber Number -hi def link tcshArguement Special +hi def link tcshArgument Special hi def link tcshSpecial SpecialChar +" }}} let &cpo = s:oldcpo unlet s:oldcpo let b:current_syntax = 'tcsh' + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/tmux.vim b/runtime/syntax/tmux.vim index 4f435ab923..867c033cb5 100644 --- a/runtime/syntax/tmux.vim +++ b/runtime/syntax/tmux.vim @@ -1,5 +1,5 @@ " Language: tmux(1) configuration file -" Version: 3.0 (git-48cbbb87) +" Version: 3.2a (git-44ada9cd) " URL: https://github.com/ericpruitt/tmux.vim/ " Maintainer: Eric Pruitt <eric.pruitt@gmail.com> " 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=/\\\@<!\\$/ end=/$/ contains=tmuxTodo +syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell -syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString -syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString +syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,@Spell +syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell " TODO: Figure out how escaping works inside of #(...) and #{...} blocks. syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend -syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ contained keepend +syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend hi def link tmuxFormatString Identifier @@ -55,62 +55,69 @@ hi def link tmuxTodo Todo hi def link tmuxVariable Identifier hi def link tmuxVariableExpansion Identifier -" Make the foreground of colourXXX keywords match the color they represent. +" Make the foreground of colourXXX keywords match the color they represent +" when g:tmux_syntax_colors is unset or set to a non-zero value. " Darker colors have their background set to white. -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 . " /\\<colour" . 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 . " /\\<colour" . 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 <cespare@gmail.com> +" 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 |