aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/csscomplete.vim6
-rw-r--r--runtime/autoload/health.vim126
-rw-r--r--runtime/autoload/health/lsp.vim5
-rw-r--r--runtime/autoload/health/provider.vim2
-rw-r--r--runtime/autoload/health/treesitter.vim5
-rw-r--r--runtime/autoload/man.vim12
-rw-r--r--runtime/autoload/netrw.vim3
-rw-r--r--runtime/autoload/provider/pythonx.vim2
-rw-r--r--runtime/doc/api.txt631
-rw-r--r--runtime/doc/autocmd.txt49
-rw-r--r--runtime/doc/change.txt6
-rw-r--r--runtime/doc/deprecated.txt4
-rw-r--r--runtime/doc/dev_style.txt1159
-rw-r--r--runtime/doc/develop.txt2
-rw-r--r--runtime/doc/diagnostic.txt225
-rw-r--r--runtime/doc/editing.txt50
-rw-r--r--runtime/doc/eval.txt482
-rw-r--r--runtime/doc/filetype.txt8
-rw-r--r--runtime/doc/helphelp.txt12
-rw-r--r--runtime/doc/intro.txt3
-rw-r--r--runtime/doc/lsp.txt70
-rw-r--r--runtime/doc/lua.txt103
-rw-r--r--runtime/doc/mbyte.txt30
-rw-r--r--runtime/doc/nvim_terminal_emulator.txt6
-rw-r--r--runtime/doc/options.txt17
-rw-r--r--runtime/doc/pattern.txt2
-rw-r--r--runtime/doc/pi_health.txt153
-rw-r--r--runtime/doc/print.txt2
-rw-r--r--runtime/doc/starting.txt3
-rw-r--r--runtime/doc/treesitter.txt8
-rw-r--r--runtime/doc/usr_22.txt24
-rw-r--r--runtime/doc/usr_41.txt6
-rw-r--r--runtime/doc/various.txt2
-rw-r--r--runtime/doc/vim_diff.txt11
-rw-r--r--runtime/filetype.vim27
-rw-r--r--runtime/ftplugin/8th.vim10
-rw-r--r--runtime/ftplugin/c.vim10
-rw-r--r--runtime/ftplugin/context.vim67
-rw-r--r--runtime/ftplugin/csh.vim49
-rw-r--r--runtime/ftplugin/gprof.vim22
-rw-r--r--runtime/ftplugin/nginx.vim6
-rw-r--r--runtime/ftplugin/spec.vim4
-rw-r--r--runtime/ftplugin/tcsh.vim21
-rw-r--r--runtime/ftplugin/tmux.vim3
-rw-r--r--runtime/ftplugin/toml.vim23
-rw-r--r--runtime/indent/cdl.vim3
-rw-r--r--runtime/indent/cobol.vim3
-rw-r--r--runtime/indent/config.vim13
-rw-r--r--runtime/indent/css.vim12
-rw-r--r--runtime/indent/d.vim4
-rw-r--r--runtime/indent/dtd.vim9
-rw-r--r--runtime/indent/dylan.vim3
-rw-r--r--runtime/indent/elm.vim4
-rw-r--r--runtime/indent/eterm.vim9
-rw-r--r--runtime/indent/framescript.vim9
-rw-r--r--runtime/indent/hamster.vim21
-rw-r--r--runtime/indent/idlang.vim5
-rw-r--r--runtime/indent/ld.vim9
-rw-r--r--runtime/indent/mail.vim4
-rw-r--r--runtime/indent/make.vim9
-rw-r--r--runtime/indent/matlab.vim2
-rw-r--r--runtime/indent/mma.vim11
-rw-r--r--runtime/indent/nginx.vim17
-rw-r--r--runtime/indent/occam.vim3
-rw-r--r--runtime/indent/pascal.vim15
-rw-r--r--runtime/indent/postscr.vim7
-rw-r--r--runtime/indent/prolog.vim7
-rw-r--r--runtime/indent/python.vim4
-rw-r--r--runtime/indent/readline.vim9
-rw-r--r--runtime/indent/sdl.vim4
-rw-r--r--runtime/indent/sqlanywhere.vim22
-rw-r--r--runtime/indent/tcl.vim8
-rw-r--r--runtime/indent/tcsh.vim14
-rw-r--r--runtime/indent/zimbu.vim4
-rw-r--r--runtime/lua/health.lua23
-rw-r--r--runtime/lua/vim/diagnostic.lua543
-rw-r--r--runtime/lua/vim/lsp.lua172
-rw-r--r--runtime/lua/vim/lsp/buf.lua137
-rw-r--r--runtime/lua/vim/lsp/codelens.lua42
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua47
-rw-r--r--runtime/lua/vim/lsp/handlers.lua35
-rw-r--r--runtime/lua/vim/lsp/health.lua2
-rw-r--r--runtime/lua/vim/lsp/protocol.lua4
-rw-r--r--runtime/lua/vim/lsp/rpc.lua87
-rw-r--r--runtime/lua/vim/lsp/util.lua22
-rw-r--r--runtime/lua/vim/shared.lua46
-rw-r--r--runtime/lua/vim/treesitter/health.lua2
-rw-r--r--runtime/lua/vim/ui.lua36
-rw-r--r--runtime/lua/vim/uri.lua11
-rw-r--r--runtime/plugin/diagnostic.vim26
-rw-r--r--runtime/syntax/8th.vim535
-rw-r--r--runtime/syntax/chicken.vim4
-rw-r--r--runtime/syntax/css.vim27
-rw-r--r--runtime/syntax/go.vim6
-rw-r--r--runtime/syntax/gprof.vim5
-rw-r--r--runtime/syntax/nginx.vim2307
-rw-r--r--runtime/syntax/php.vim267
-rw-r--r--runtime/syntax/sml.vim7
-rw-r--r--runtime/syntax/tcl.vim4
-rw-r--r--runtime/syntax/tcsh.vim65
-rw-r--r--runtime/syntax/tmux.vim103
-rw-r--r--runtime/syntax/toml.vim81
-rw-r--r--runtime/syntax/typescriptcommon.vim5
-rw-r--r--runtime/syntax/xpm.vim7
104 files changed, 6850 insertions, 1523 deletions
diff --git a/runtime/autoload/csscomplete.vim b/runtime/autoload/csscomplete.vim
index 85e40c862f..4b673ac9b8 100644
--- a/runtime/autoload/csscomplete.vim
+++ b/runtime/autoload/csscomplete.vim
@@ -4,7 +4,7 @@
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2018 Jul 02
+" Last Change: 2021 Sep 21
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
@@ -38,12 +38,12 @@ function! csscomplete#CompleteCSS(findstart, base)
if exists("b:compl_context")
let line = getline('.')
let compl_begin = col('.') - 2
- let after = line[compl_begin:]
+ let b:after = line[compl_begin:]
let line = b:compl_context
unlet! b:compl_context
else
let line = a:base
- let after = ''
+ let b:after = ''
endif
let res = []
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim
index 0f7983f175..73c1459f86 100644
--- a/runtime/autoload/health.vim
+++ b/runtime/autoload/health.vim
@@ -26,8 +26,8 @@ endfunction
" Runs all discovered healthchecks if a:plugin_names is empty.
function! health#check(plugin_names) abort
let healthchecks = empty(a:plugin_names)
- \ ? s:discover_health_checks()
- \ : s:to_fn_names(a:plugin_names)
+ \ ? s:discover_healthchecks()
+ \ : s:get_healthcheck(a:plugin_names)
tabnew
setlocal wrap breakindent linebreak
@@ -41,25 +41,29 @@ function! health#check(plugin_names) abort
call setline(1, 'ERROR: No healthchecks found.')
else
redraw|echo 'Running healthchecks...'
- for c in healthchecks
- let output = ''
- call append('$', split(printf("\n%s\n%s", c, repeat('=',72)), "\n"))
+ for name in sort(keys(healthchecks))
+ let [func, type] = healthchecks[name]
+ let s:output = []
try
- let output = "\n\n".execute('call '.c.'()')
+ if func == ''
+ throw 'healthcheck_not_found'
+ endif
+ eval type == 'v' ? call(func, []) : luaeval(func)
catch
- if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c
- let output = execute(
- \ 'call health#report_error(''No healthcheck found for "'
- \ .s:to_plugin_name(c)
- \ .'" plugin.'')')
+ let s:output = [] " Clear the output
+ if v:exception =~# 'healthcheck_not_found'
+ call health#report_error('No healthcheck found for "'.name.'" plugin.')
else
- let output = execute(
- \ 'call health#report_error(''Failed to run healthcheck for "'
- \ .s:to_plugin_name(c)
- \ .'" plugin. Exception:''."\n".v:throwpoint."\n".v:exception)')
+ call health#report_error(printf(
+ \ "Failed to run healthcheck for \"%s\" plugin. Exception:\n%s\n%s",
+ \ name, v:throwpoint, v:exception))
endif
endtry
- call append('$', split(output, "\n") + [''])
+ let header = [name. ': ' . func, repeat('=', 72)]
+ " remove empty line after header from report_start
+ let s:output = s:output[0] == '' ? s:output[1:] : s:output
+ let s:output = header + s:output + ['']
+ call append('$', s:output)
redraw
endfor
endif
@@ -71,9 +75,13 @@ function! health#check(plugin_names) abort
redraw|echo ''
endfunction
+function! s:collect_output(output)
+ let s:output += split(a:output, "\n", 1)
+endfunction
+
" Starts a new report.
function! health#report_start(name) abort
- echo "\n## " . a:name
+ call s:collect_output("\n## " . a:name)
endfunction
" Indents lines *except* line 1 of a string if it contains newlines.
@@ -119,21 +127,21 @@ endfunction " }}}
" Use {msg} to report information in the current section
function! health#report_info(msg) abort " {{{
- echo s:format_report_message('INFO', a:msg)
+ call s:collect_output(s:format_report_message('INFO', a:msg))
endfunction " }}}
" Reports a successful healthcheck.
function! health#report_ok(msg) abort " {{{
- echo s:format_report_message('OK', a:msg)
+ call s:collect_output(s:format_report_message('OK', a:msg))
endfunction " }}}
" Reports a health warning.
" a:1: Optional advice (string or list)
function! health#report_warn(msg, ...) abort " {{{
if a:0 > 0
- echo s:format_report_message('WARNING', a:msg, a:1)
+ call s:collect_output(s:format_report_message('WARNING', a:msg, a:1))
else
- echo s:format_report_message('WARNING', a:msg)
+ call s:collect_output(s:format_report_message('WARNING', a:msg))
endif
endfunction " }}}
@@ -141,37 +149,73 @@ endfunction " }}}
" a:1: Optional advice (string or list)
function! health#report_error(msg, ...) abort " {{{
if a:0 > 0
- echo s:format_report_message('ERROR', a:msg, a:1)
+ call s:collect_output(s:format_report_message('ERROR', a:msg, a:1))
else
- echo s:format_report_message('ERROR', a:msg)
+ call s:collect_output(s:format_report_message('ERROR', a:msg))
endif
endfunction " }}}
-function! s:filepath_to_function(name) abort
- return substitute(substitute(substitute(a:name, '.*autoload[\/]', '', ''),
- \ '\.vim', '#check', ''), '[\/]', '#', 'g')
+" From a path return a list [{name}, {func}, {type}] representing a healthcheck
+function! s:filepath_to_healthcheck(path) abort
+ if a:path =~# 'vim$'
+ let name = matchstr(a:path, '\zs[^\/]*\ze\.vim$')
+ let func = 'health#'.name.'#check'
+ let type = 'v'
+ else
+ let base_path = substitute(a:path,
+ \ '.*lua[\/]\(.\{-}\)[\/]health\([\/]init\)\?\.lua$',
+ \ '\1', '')
+ let name = substitute(base_path, '[\/]', '.', 'g')
+ let func = 'require("'.name.'.health").check()'
+ let type = 'l'
+ endif
+ return [name, func, type]
endfunction
-function! s:discover_health_checks() abort
- let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1)
- let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)')
- return healthchecks
+function! s:discover_healthchecks() abort
+ return s:get_healthcheck('*')
+endfunction
+
+" Returns Dictionary {name: [func, type], ..} representing healthchecks
+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 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[normalized_name] = c
+ endif
+ endfor
+ let output = {}
+ for v in values(healthchecks)
+ let output[v[0]] = v[1:]
+ endfor
+ return output
endfunction
-" Translates a list of plugin names to healthcheck function names.
-function! s:to_fn_names(plugin_names) abort
+" Returns list of lists [ [{name}, {func}, {type}] ] representing healthchecks
+function! s:get_healthcheck_list(plugin_names) abort
let healthchecks = []
- let plugin_names = type('') ==# type(a:plugin_names)
- \ ? split(a:plugin_names, '', v:false)
+ let plugin_names = type('') == type(a:plugin_names)
+ \ ? split(a:plugin_names, ' ', v:false)
\ : a:plugin_names
for p in plugin_names
- call add(healthchecks, 'health#'.p.'#check')
+ " support vim/lsp/health{/init/}.lua as :checkhealth vim.lsp
+ let p = substitute(p, '\.', '/', 'g')
+ let p = substitute(p, '*$', '**', 'g') " find all submodule e.g vim*
+ let paths = nvim_get_runtime_file('autoload/health/'.p.'.vim', v:true)
+ \ + nvim_get_runtime_file('lua/**/'.p.'/health/init.lua', v:true)
+ \ + nvim_get_runtime_file('lua/**/'.p.'/health.lua', v:true)
+ if len(paths) == 0
+ let healthchecks += [[p, '', '']] " healthchek not found
+ else
+ let healthchecks += map(uniq(sort(paths)),
+ \'<SID>filepath_to_healthcheck(v:val)')
+ end
endfor
return healthchecks
endfunction
-
-" Extracts 'foo' from 'health#foo#check'.
-function! s:to_plugin_name(fn_name) abort
- return substitute(a:fn_name,
- \ '\v.*health\#(.+)\#check.*', '\1', '')
-endfunction
diff --git a/runtime/autoload/health/lsp.vim b/runtime/autoload/health/lsp.vim
deleted file mode 100644
index 2d2ba91cdf..0000000000
--- a/runtime/autoload/health/lsp.vim
+++ /dev/null
@@ -1,5 +0,0 @@
-function! health#lsp#check() abort
- call health#report_start('Checking language server client configuration')
- lua require 'vim.lsp.health'.check_health()
-endfunction
-
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/health/treesitter.vim b/runtime/autoload/health/treesitter.vim
deleted file mode 100644
index 5f167310ce..0000000000
--- a/runtime/autoload/health/treesitter.vim
+++ /dev/null
@@ -1,5 +0,0 @@
-function! health#treesitter#check() abort
- call health#report_start('Checking treesitter configuration')
- lua require 'vim.treesitter.health'.check_health()
-endfunction
-
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 4f132b6121..90d353f9de 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -197,13 +197,21 @@ function! s:extract_sect_and_name_ref(ref) abort
if empty(name)
throw 'manpage reference cannot contain only parentheses'
endif
- return ['', name]
+ return ['', s:spaces_to_underscores(name)]
endif
let left = split(ref, '(')
" see ':Man 3X curses' on why tolower.
" TODO(nhooyr) Not sure if this is portable across OSs
" but I have not seen a single uppercase section.
- return [tolower(split(left[1], ')')[0]), left[0]]
+ return [tolower(split(left[1], ')')[0]), s:spaces_to_underscores(left[0])]
+endfunction
+
+" replace spaces in a man page name with underscores
+" intended for PostgreSQL, which has man pages like 'CREATE_TABLE(7)';
+" while editing SQL source code, it's nice to visually select 'CREATE TABLE'
+" and hit 'K', which requires this transformation
+function! s:spaces_to_underscores(str)
+ return substitute(a:str, ' ', '_', 'g')
endfunction
function! s:get_path(sect, name) abort
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index b6edc4c4d8..ef0282848f 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1711,7 +1711,8 @@ fun! s:NetrwOptionsSafe(islocal)
if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif
if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif
setl fo=nroql2
- call s:NetrwSetSafeSetting("&go","begmr")
+ " call s:NetrwSetSafeSetting("&go","begmr")
+ if &go =~ '\ca' | call s:NetrwSetSafeSetting("&go",substitute(&go,'\ca','','g')) | endif
call s:NetrwSetSafeSetting("&l:hid",0)
call s:NetrwSetSafeSetting("&l:im",0)
setl isk+=@ isk+=* isk+=/
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/api.txt b/runtime/doc/api.txt
index df345e4981..1573bec7ac 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -130,7 +130,9 @@ end of a range, -1 denotes the last line/column.
Exception: the following API functions use "mark-like" indexing (1-based
lines, 0-based columns):
+ |nvim_get_mark()|
|nvim_buf_get_mark()|
+ |nvim_buf_set_mark()|
|nvim_win_get_cursor()|
|nvim_win_set_cursor()|
@@ -529,6 +531,20 @@ nvim__get_hl_defs({ns_id}) *nvim__get_hl_defs()*
nvim__get_lib_dir() *nvim__get_lib_dir()*
TODO: Documentation
+nvim__get_runtime({pat}, {all}, {*opts}) *nvim__get_runtime()*
+ Find files in runtime directories
+
+ Attributes: ~
+ {fast}
+
+ Parameters: ~
+ {pat} pattern of files to search for
+ {all} whether to return all matches or only the first
+ {options} is_lua: only search lua subdirs
+
+ Return: ~
+ list of absolute paths to the found files
+
nvim__id({obj}) *nvim__id()*
Returns object given as argument.
@@ -580,6 +596,9 @@ nvim__id_float({flt}) *nvim__id_float()*
nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()*
TODO: Documentation
+nvim__runtime_inspect() *nvim__runtime_inspect()*
+ TODO: Documentation
+
nvim__screenshot({path}) *nvim__screenshot()*
TODO: Documentation
@@ -706,7 +725,7 @@ nvim_create_buf({listed}, {scratch}) *nvim_create_buf()*
buf_open_scratch
nvim_create_namespace({name}) *nvim_create_namespace()*
- Creates a new namespace, or gets an existing one.
+ Creates a new *namespace* or gets an existing one.
Namespaces are used for buffer highlights and virtual text,
see |nvim_buf_add_highlight()| and |nvim_buf_set_extmark()|.
@@ -735,6 +754,23 @@ nvim_del_keymap({mode}, {lhs}) *nvim_del_keymap()*
See also: ~
|nvim_set_keymap()|
+nvim_del_mark({name}) *nvim_del_mark()*
+ Deletes a uppercase/file named mark. See |mark-motions|.
+
+ Note:
+ fails with error if a lowercase or buffer local named mark
+ is used.
+
+ Parameters: ~
+ {name} Mark name
+
+ Return: ~
+ true if the mark was deleted, else false.
+
+ See also: ~
+ |nvim_buf_del_mark()|
+ |nvim_get_mark()|
+
nvim_del_var({name}) *nvim_del_var()*
Removes a global (g:) variable.
@@ -783,6 +819,39 @@ nvim_eval({expr}) *nvim_eval()*
Return: ~
Evaluation result or expanded object
+nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()*
+ Evaluates statusline string.
+
+ Attributes: ~
+ {fast}
+
+ Parameters: ~
+ {str} Statusline string (see 'statusline').
+ {opts} Optional parameters.
+ • winid: (number) |window-ID| of the window to use
+ as context for statusline.
+ • maxwidth: (number) Maximum width of statusline.
+ • fillchar: (string) Character to fill blank
+ spaces in the statusline (see 'fillchars').
+ • highlights: (boolean) Return highlight
+ information.
+ • use_tabline: (boolean) Evaluate tabline instead
+ of statusline. When |TRUE|, {winid} is ignored.
+
+ Return: ~
+ Dictionary containing statusline information, with these
+ keys:
+ • str: (string) Characters that will be displayed on the
+ statusline.
+ • width: (number) Display width of the statusline.
+ • highlights: Array containing highlight information of
+ the statusline. Only included when the "highlights" key
+ in {opts} is |TRUE|. Each element of the array is a
+ |Dictionary| with these keys:
+ • start: (number) Byte index (0-based) of first
+ character that uses the highlight.
+ • group: (string) Name of highlight group.
+
nvim_exec({src}, {output}) *nvim_exec()*
Executes Vimscript (multiline block of Ex-commands), like
anonymous |:source|.
@@ -828,7 +897,7 @@ nvim_feedkeys({keys}, {mode}, {escape_csi}) *nvim_feedkeys()*
On execution error: does not fail, but updates v:errmsg.
To input sequences like <C-o> use |nvim_replace_termcodes()|
- (typically with escape_csi=true) to replace the keycodes. Then
+ (typically with escape_csi=true) to replace |keycodes|, then
pass the result to nvim_feedkeys().
Example: >
@@ -866,32 +935,33 @@ nvim_get_api_info() *nvim_get_api_info()*
{fast}
nvim_get_chan_info({chan}) *nvim_get_chan_info()*
- Get information about a channel.
+ Gets information about a channel.
Return: ~
Dictionary describing a channel, with these keys:
- • "stream" the stream underlying the channel
+ • "id" Channel id.
+ • "argv" (optional) Job arguments list.
+ • "stream" Stream underlying the channel.
• "stdio" stdin and stdout of this Nvim instance
• "stderr" stderr of this Nvim instance
• "socket" TCP/IP socket or named pipe
- • "job" job with communication over its stdio
-
- • "mode" how data received on the channel is interpreted
- • "bytes" send and receive raw bytes
- • "terminal" a |terminal| instance interprets ASCII
- sequences
- • "rpc" |RPC| communication on the channel is active
-
- • "pty" Name of pseudoterminal, if one is used (optional).
- On a POSIX system, this will be a device path like
- /dev/pts/1. Even if the name is unknown, the key will
- still be present to indicate a pty is used. This is
- currently the case when using winpty on windows.
- • "buffer" buffer with connected |terminal| instance
- (optional)
- • "client" information about the client on the other end
- of the RPC channel, if it has added it using
- |nvim_set_client_info()|. (optional)
+ • "job" Job with communication over its stdio.
+
+ • "mode" How data received on the channel is interpreted.
+ • "bytes" Send and receive raw bytes.
+ • "terminal" |terminal| instance interprets ASCII
+ sequences.
+ • "rpc" |RPC| communication on the channel is active.
+
+ • "pty" (optional) Name of pseudoterminal. On a POSIX
+ system this is a device path like "/dev/pts/1". If the
+ name is unknown, the key will still be present if a pty
+ is used (e.g. for winpty on Windows).
+ • "buffer" (optional) Buffer with connected |terminal|
+ instance.
+ • "client" (optional) Info about the peer (client on the
+ other end of the RPC channel), if provided by it via
+ |nvim_set_client_info()|.
nvim_get_color_by_name({name}) *nvim_get_color_by_name()*
Returns the 24-bit RGB value of a |nvim_get_color_map()| color
@@ -917,7 +987,7 @@ nvim_get_color_map() *nvim_get_color_map()*
Return: ~
Map of color names and RGB values.
-nvim_get_commands({opts}) *nvim_get_commands()*
+nvim_get_commands({*opts}) *nvim_get_commands()*
Gets a map of global (non-buffer-local) Ex commands.
Currently only |user-commands| are supported, not builtin Ex
@@ -930,7 +1000,7 @@ nvim_get_commands({opts}) *nvim_get_commands()*
Return: ~
Map of maps describing commands.
-nvim_get_context({opts}) *nvim_get_context()*
+nvim_get_context({*opts}) *nvim_get_context()*
Gets a map of the current editor state.
Parameters: ~
@@ -1008,6 +1078,27 @@ nvim_get_keymap({mode}) *nvim_get_keymap()*
Array of maparg()-like dictionaries describing mappings.
The "buffer" key is always zero.
+nvim_get_mark({name}) *nvim_get_mark()*
+ Return a tuple (row, col, buffer, buffername) representing the
+ position of the uppercase/file named mark. See |mark-motions|.
+
+ Marks are (1,0)-indexed. |api-indexing|
+
+ Note:
+ fails with error if a lowercase or buffer local named mark
+ is used.
+
+ Parameters: ~
+ {name} Mark name
+
+ Return: ~
+ 4-tuple (row, col, buffer, buffername), (0, 0, 0, '') if
+ the mark is not set.
+
+ See also: ~
+ |nvim_buf_set_mark()|
+ |nvim_del_mark()|
+
nvim_get_mode() *nvim_get_mode()*
Gets the current mode. |mode()| "blocking" is true if Nvim is
waiting for input.
@@ -1079,10 +1170,6 @@ nvim_get_runtime_file({name}, {all}) *nvim_get_runtime_file()*
It is not an error to not find any files. An empty array is
returned then.
- To find a directory, `name` must end with a forward slash,
- like "rplugin/python/". Without the slash it would instead
- look for an ordinary file called "rplugin/python".
-
Attributes: ~
{fast}
@@ -1251,7 +1338,7 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()*
For instance, for a floating display, first create an empty
buffer using |nvim_create_buf()|, then display it using
|nvim_open_win()|, and then call this function. Then
- |nvim_chan_send()| cal be called immediately to process
+ |nvim_chan_send()| can be called immediately to process
sequences in a virtual terminal having the intended size.
Parameters: ~
@@ -1261,156 +1348,6 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()*
Return: ~
Channel id, or 0 on error
-nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
- Open a new window.
-
- Currently this is used to open floating and external windows.
- Floats are windows that are drawn above the split layout, at
- some anchor position in some other window. Floats can be drawn
- internally or by external GUI with the |ui-multigrid|
- extension. External windows are only supported with multigrid
- GUIs, and are displayed as separate top-level windows.
-
- For a general overview of floats, see |api-floatwin|.
-
- Exactly one of `external` and `relative` must be specified.
- The `width` and `height` of the new window must be specified.
-
- With relative=editor (row=0,col=0) refers to the top-left
- corner of the screen-grid and (row=Lines-1,col=Columns-1)
- refers to the bottom-right corner. Fractional values are
- allowed, but the builtin implementation (used by non-multigrid
- UIs) will always round down to nearest integer.
-
- Out-of-bounds values, and configurations that make the float
- not fit inside the main editor, are allowed. The builtin
- implementation truncates values so floats are fully within the
- main screen grid. External GUIs could let floats hover outside
- of the main window like a tooltip, but this should not be used
- to specify arbitrary WM screen positions.
-
- Example (Lua): window-relative float >
- vim.api.nvim_open_win(0, false,
- {relative='win', row=3, col=3, width=12, height=3})
-<
-
- Example (Lua): buffer-relative float (travels as buffer is
- scrolled) >
- vim.api.nvim_open_win(0, false,
- {relative='win', width=12, height=3, bufpos={100,10}})
-<
-
- Attributes: ~
- not allowed when |textlock| is active
-
- Parameters: ~
- {buffer} Buffer to display, or 0 for current buffer
- {enter} Enter the window (make it the current window)
- {config} Map defining the window configuration. Keys:
- • `relative`: Sets the window layout to "floating", placed
- at (row,col) coordinates relative to:
- • "editor" The global editor grid
- • "win" Window given by the `win` field, or
- current window.
- • "cursor" Cursor position in current window.
-
- • `win` : |window-ID| for relative="win".
- • `anchor`: Decides which corner of the float to place
- at (row,col):
- • "NW" northwest (default)
- • "NE" northeast
- • "SW" southwest
- • "SE" southeast
-
- • `width` : Window width (in character cells).
- Minimum of 1.
- • `height` : Window height (in character cells).
- Minimum of 1.
- • `bufpos` : Places float relative to buffer
- text (only when relative="win"). Takes a tuple
- of zero-indexed [line, column]. `row` and
- `col` if given are applied relative to this
- position, else they default to `row=1` and
- `col=0` (thus like a tooltip near the buffer
- text).
- • `row` : Row position in units of "screen cell
- height", may be fractional.
- • `col` : Column position in units of "screen
- cell width", may be fractional.
- • `focusable` : Enable focus by user actions
- (wincmds, mouse events). Defaults to true.
- Non-focusable windows can be entered by
- |nvim_set_current_win()|.
- • `external` : GUI should display the window as
- an external top-level window. Currently
- accepts no other positioning configuration
- together with this.
- • `zindex`: Stacking order. floats with higher`zindex`go on top on floats with lower indices. Must
- be larger than zero. The following screen
- elements have hard-coded z-indices:
- • 100: insert completion popupmenu
- • 200: message scrollback
- • 250: cmdline completion popupmenu (when
- wildoptions+=pum) The default value for
- floats are 50. In general, values below 100
- are recommended, unless there is a good
- reason to overshadow builtin elements.
-
- • `style`: Configure the appearance of the window.
- Currently only takes one non-empty value:
- • "minimal" Nvim will display the window with
- many UI options disabled. This is useful
- when displaying a temporary float where the
- text should not be edited. Disables
- 'number', 'relativenumber', 'cursorline',
- 'cursorcolumn', 'foldcolumn', 'spell' and
- 'list' options. 'signcolumn' is changed to
- `auto` and 'colorcolumn' is cleared. The
- end-of-buffer region is hidden by setting
- `eob` flag of 'fillchars' to a space char,
- and clearing the |EndOfBuffer| region in
- 'winhighlight'.
-
- • `border`: Style of (optional) window border. This can
- either be a string or an array. The string
- values are
- • "none": No border (default).
- • "single": A single line box.
- • "double": A double line box.
- • "rounded": Like "single", but with rounded
- corners ("╭" etc.).
- • "solid": Adds padding by a single whitespace
- cell.
- • "shadow": A drop shadow effect by blending
- with the background.
- • If it is an array, it should have a length
- of eight or any divisor of eight. The array
- will specifify the eight chars building up
- the border in a clockwise fashion starting
- with the top-left corner. As an example, the
- double box style could be specified as [
- "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ]. If
- the number of chars are less than eight,
- they will be repeated. Thus an ASCII border
- could be specified as [ "/", "-", "\\", "|"
- ], or all chars the same as [ "x" ]. An
- empty string can be used to turn off a
- specific border, for instance, [ "", "", "",
- ">", "", "", "", "<" ] will only make
- vertical borders but not horizontal ones. By
- default, `FloatBorder` highlight is used,
- which links to `VertSplit` when not defined.
- It could also be specified by character: [
- {"+", "MyCorner"}, {"x", "MyBorder"} ].
-
- • `noautocmd` : If true then no buffer-related
- autocommand events such as |BufEnter|,
- |BufLeave| or |BufWinEnter| may fire from
- calling this function.
-
- Return: ~
- Window handle, or 0 on error
-
nvim_out_write({str}) *nvim_out_write()*
Writes a message to the Vim output buffer. Does not append
"\n", the message is buffered (won't display) until a linefeed
@@ -1779,7 +1716,7 @@ nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
default cterm attributes are same as attributes
of gui color
-nvim_set_keymap({mode}, {lhs}, {rhs}, {opts}) *nvim_set_keymap()*
+nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
Sets a global |mapping| for the given mode.
To set a buffer-local mapping, use |nvim_buf_set_keymap()|.
@@ -1940,7 +1877,7 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
callbacks.
{opts} Optional parameters.
• on_lines: Lua callback invoked on change.
- Return`true`to detach. Args:
+ Return `true` to detach. Args:
• the string "lines"
• buffer handle
• b:changedtick
@@ -1956,7 +1893,7 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
• on_bytes: lua callback invoked on change.
This callback receives more granular
information about the change compared to
- on_lines. Return`true`to detach. Args:
+ on_lines. Return `true` to detach. Args:
• the string "bytes"
• buffer handle
• b:changedtick
@@ -2063,6 +2000,24 @@ nvim_buf_del_keymap({buffer}, {mode}, {lhs}) *nvim_buf_del_keymap()*
See also: ~
|nvim_del_keymap()|
+nvim_buf_del_mark({buffer}, {name}) *nvim_buf_del_mark()*
+ Deletes a named mark in the buffer. See |mark-motions|.
+
+ Note:
+ only deletes marks set in the buffer, if the mark is not
+ set in the buffer it will return false.
+
+ Parameters: ~
+ {buffer} Buffer to set the mark on
+ {name} Mark name
+
+ Return: ~
+ true if the mark was deleted, else false.
+
+ See also: ~
+ |nvim_buf_set_mark()|
+ |nvim_del_mark()|
+
nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()*
Removes a buffer-scoped (b:) variable
@@ -2107,7 +2062,7 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()*
Return: ~
`b:changedtick` value.
-nvim_buf_get_commands({buffer}, {opts}) *nvim_buf_get_commands()*
+nvim_buf_get_commands({buffer}, {*opts}) *nvim_buf_get_commands()*
Gets a map of buffer-local |user-commands|.
Parameters: ~
@@ -2119,7 +2074,7 @@ nvim_buf_get_commands({buffer}, {opts}) *nvim_buf_get_commands()*
*nvim_buf_get_extmark_by_id()*
nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
- Gets the position (0-indexed) of an extmark {id}.
+ Gets the position (0-indexed) of an extmark.
Parameters: ~
{buffer} Buffer handle, or 0 for current buffer
@@ -2170,12 +2125,12 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
Parameters: ~
{buffer} Buffer handle, or 0 for current buffer
{ns_id} Namespace id from |nvim_create_namespace()|
- {start} Start of range, given as 0-indexed (row, col) or
- valid extmark id (whose position defines the
- bound)
- {end} End of range (inclusive), given as 0-indexed
- (row, col) or valid extmark id (whose position
- defines the bound)
+ {start} Start of range: a 0-indexed (row, col) or valid
+ extmark id (whose position defines the bound).
+ |api-indexing|
+ {end} End of range (inclusive): a 0-indexed (row, col)
+ or valid extmark id (whose position defines the
+ bound). |api-indexing|
{opts} Optional parameters. Keys:
• limit: Maximum number of marks to return
• details Whether to include the details dict
@@ -2217,8 +2172,8 @@ nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing})
Array of lines, or empty array for unloaded buffer.
nvim_buf_get_mark({buffer}, {name}) *nvim_buf_get_mark()*
- Return a tuple (row,col) representing the position of the
- named mark.
+ Returns a tuple (row,col) representing the position of the
+ named mark. See |mark-motions|.
Marks are (1,0)-indexed. |api-indexing|
@@ -2227,7 +2182,12 @@ nvim_buf_get_mark({buffer}, {name}) *nvim_buf_get_mark()*
{name} Mark name
Return: ~
- (row, col) tuple
+ (row, col) tuple, (0, 0) if the mark is not set, or is an
+ uppercase/file mark set in another buffer.
+
+ See also: ~
+ |nvim_buf_set_mark()|
+ |nvim_buf_del_mark()|
nvim_buf_get_name({buffer}) *nvim_buf_get_name()*
Gets the full file name for the buffer
@@ -2310,7 +2270,7 @@ nvim_buf_line_count({buffer}) *nvim_buf_line_count()*
Line count, or 0 for unloaded buffer. |api-buffer|
*nvim_buf_set_extmark()*
-nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
+nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
Creates or updates an extmark.
To create a new extmark, pass id=0. The extmark id will be
@@ -2328,8 +2288,10 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
Parameters: ~
{buffer} Buffer handle, or 0 for current buffer
{ns_id} Namespace id from |nvim_create_namespace()|
- {line} Line where to place the mark, 0-based
- {col} Column where to place the mark, 0-based
+ {line} Line where to place the mark, 0-based.
+ |api-indexing|
+ {col} Column where to place the mark, 0-based.
+ |api-indexing|
{opts} Optional parameters.
• id : id of the extmark to edit.
• end_line : ending line of the mark, 0-based
@@ -2338,6 +2300,10 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
exclusive.
• hl_group : name of the highlight group used to
highlight this mark.
+ • hl_eol : when true, for a multiline highlight
+ covering the EOL of a line, continue the
+ highlight for the rest of the screen line
+ (just like for diff and cursorline highlight).
• virt_text : virtual text to link to this mark.
A list of [text, highlight] tuples, each
representing a text chunk with specified
@@ -2366,17 +2332,35 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
• hl_mode : control how highlights are combined
with the highlights of the text. Currently
only affects virt_text highlights, but might
- affect`hl_group`in later versions.
+ affect `hl_group` in later versions.
• "replace": only show the virt_text color.
This is the default
• "combine": combine with background text
color
• "blend": blend with background text color.
- • hl_eol : when true, for a multiline highlight
- covering the EOL of a line, continue the
- highlight for the rest of the screen line
- (just like for diff and cursorline highlight).
+ • virt_lines : virtual lines to add next to this
+ mark This should be an array over lines, where
+ each line in turn is an array over [text,
+ highlight] tuples. In general, buffer and
+ window options do not affect the display of
+ the text. In particular 'wrap' and 'linebreak'
+ options do not take effect, so the number of
+ extra screen lines will always match the size
+ of the array. However the 'tabstop' buffer
+ option is still used for hard tabs. By default
+ lines are placed below the buffer line
+ containing the mark. • Note: currently virtual lines are limited to
+ one block per buffer. Thus setting a new mark
+ disables any previous `virt_lines` decoration.
+ However plugins should not rely on this
+ behaviour, as this limitation is planned to be
+ removed.
+ • virt_lines_above: place virtual lines above
+ instead.
+ • virt_lines_leftcol: Place extmarks in the
+ leftmost column of the window, bypassing sign
+ and number columns.
• ephemeral : for use with
|nvim_set_decoration_provider| callbacks. The
mark will only be used for the current redraw
@@ -2399,7 +2383,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
Id of the created/updated extmark
*nvim_buf_set_keymap()*
-nvim_buf_set_keymap({buffer}, {mode}, {lhs}, {rhs}, {opts})
+nvim_buf_set_keymap({buffer}, {mode}, {lhs}, {rhs}, {*opts})
Sets a buffer-local |mapping| for the given mode.
Parameters: ~
@@ -2435,6 +2419,29 @@ nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, {replacement})
error.
{replacement} Array of lines to use as replacement
+ *nvim_buf_set_mark()*
+nvim_buf_set_mark({buffer}, {name}, {line}, {col})
+ Sets a named mark in the given buffer, all marks are allowed
+ file/uppercase, visual, last change, etc. See |mark-motions|.
+
+ Marks are (1,0)-indexed. |api-indexing|
+
+ Note:
+ Passing 0 as line deletes the mark
+
+ Parameters: ~
+ {buffer} Buffer to set the mark on
+ {name} Mark name
+ {line} Line number
+ {col} Column/row number
+
+ Return: ~
+ true if the mark was set, else false.
+
+ See also: ~
+ |nvim_buf_del_mark()|
+ |nvim_buf_get_mark()|
+
nvim_buf_set_name({buffer}, {name}) *nvim_buf_set_name()*
Sets the full file name for a buffer
@@ -2534,20 +2541,6 @@ nvim_win_get_buf({window}) *nvim_win_get_buf()*
Return: ~
Buffer handle
-nvim_win_get_config({window}) *nvim_win_get_config()*
- Gets window configuration.
-
- The returned value may be given to |nvim_open_win()|.
-
- `relative` is empty for normal windows.
-
- Parameters: ~
- {window} Window handle, or 0 for current window
-
- Return: ~
- Map defining the window configuration, see
- |nvim_open_win()|
-
nvim_win_get_cursor({window}) *nvim_win_get_cursor()*
Gets the (1,0)-indexed cursor position in the window.
|api-indexing|
@@ -2658,23 +2651,6 @@ nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()*
{window} Window handle, or 0 for current window
{buffer} Buffer handle
-nvim_win_set_config({window}, {config}) *nvim_win_set_config()*
- Configures window layout. Currently only for floating and
- external windows (including changing a split window to those
- layouts).
-
- When reconfiguring a floating window, absent option keys will
- not be changed. `row` / `col` and `relative` must be
- reconfigured together.
-
- Parameters: ~
- {window} Window handle, or 0 for current window
- {config} Map defining the window configuration, see
- |nvim_open_win()|
-
- See also: ~
- |nvim_open_win()|
-
nvim_win_set_cursor({window}, {pos}) *nvim_win_set_cursor()*
Sets the (1,0)-indexed cursor position in the window.
|api-indexing|
@@ -2718,6 +2694,195 @@ nvim_win_set_width({window}, {width}) *nvim_win_set_width()*
==============================================================================
+Win_Config Functions *api-win_config*
+
+nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
+ Open a new window.
+
+ Currently this is used to open floating and external windows.
+ Floats are windows that are drawn above the split layout, at
+ some anchor position in some other window. Floats can be drawn
+ internally or by external GUI with the |ui-multigrid|
+ extension. External windows are only supported with multigrid
+ GUIs, and are displayed as separate top-level windows.
+
+ For a general overview of floats, see |api-floatwin|.
+
+ Exactly one of `external` and `relative` must be specified.
+ The `width` and `height` of the new window must be specified.
+
+ With relative=editor (row=0,col=0) refers to the top-left
+ corner of the screen-grid and (row=Lines-1,col=Columns-1)
+ refers to the bottom-right corner. Fractional values are
+ allowed, but the builtin implementation (used by non-multigrid
+ UIs) will always round down to nearest integer.
+
+ Out-of-bounds values, and configurations that make the float
+ not fit inside the main editor, are allowed. The builtin
+ implementation truncates values so floats are fully within the
+ main screen grid. External GUIs could let floats hover outside
+ of the main window like a tooltip, but this should not be used
+ to specify arbitrary WM screen positions.
+
+ Example (Lua): window-relative float >
+ vim.api.nvim_open_win(0, false,
+ {relative='win', row=3, col=3, width=12, height=3})
+<
+
+ Example (Lua): buffer-relative float (travels as buffer is
+ scrolled) >
+ vim.api.nvim_open_win(0, false,
+ {relative='win', width=12, height=3, bufpos={100,10}})
+<
+
+ Attributes: ~
+ not allowed when |textlock| is active
+
+ Parameters: ~
+ {buffer} Buffer to display, or 0 for current buffer
+ {enter} Enter the window (make it the current window)
+ {config} Map defining the window configuration. Keys:
+ • relative: Sets the window layout to
+ "floating", placed at (row,col) coordinates
+ relative to:
+ • "editor" The global editor grid
+ • "win" Window given by the `win` field, or
+ current window.
+ • "cursor" Cursor position in current window.
+
+ • win: |window-ID| for relative="win".
+ • anchor: Decides which corner of the float to
+ place at (row,col):
+ • "NW" northwest (default)
+ • "NE" northeast
+ • "SW" southwest
+ • "SE" southeast
+
+ • width: Window width (in character cells).
+ Minimum of 1.
+ • height: Window height (in character cells).
+ Minimum of 1.
+ • bufpos: Places float relative to buffer text
+ (only when relative="win"). Takes a tuple of
+ zero-indexed [line, column]. `row` and `col` if given are applied relative to this
+ position, else they default to:
+ • `row=1` and `col=0` if `anchor` is "NW" or
+ "NE"
+ • `row=0` and `col=0` if `anchor` is "SW" or
+ "SE" (thus like a tooltip near the buffer
+ text).
+
+ • row: Row position in units of "screen cell
+ height", may be fractional.
+ • col: Column position in units of "screen cell
+ width", may be fractional.
+ • focusable: Enable focus by user actions
+ (wincmds, mouse events). Defaults to true.
+ Non-focusable windows can be entered by
+ |nvim_set_current_win()|.
+ • external: GUI should display the window as an
+ external top-level window. Currently accepts
+ no other positioning configuration together
+ with this.
+ • zindex: Stacking order. floats with higher `zindex` go on top on floats with lower indices. Must
+ be larger than zero. The following screen
+ elements have hard-coded z-indices:
+ • 100: insert completion popupmenu
+ • 200: message scrollback
+ • 250: cmdline completion popupmenu (when
+ wildoptions+=pum) The default value for
+ floats are 50. In general, values below 100
+ are recommended, unless there is a good
+ reason to overshadow builtin elements.
+
+ • style: Configure the appearance of the window.
+ Currently only takes one non-empty value:
+ • "minimal" Nvim will display the window with
+ many UI options disabled. This is useful
+ when displaying a temporary float where the
+ text should not be edited. Disables
+ 'number', 'relativenumber', 'cursorline',
+ 'cursorcolumn', 'foldcolumn', 'spell' and
+ 'list' options. 'signcolumn' is changed to
+ `auto` and 'colorcolumn' is cleared. The
+ end-of-buffer region is hidden by setting
+ `eob` flag of 'fillchars' to a space char,
+ and clearing the |EndOfBuffer| region in
+ 'winhighlight'.
+
+ • border: Style of (optional) window border.
+ This can either be a string or an array. The
+ string values are
+ • "none": No border (default).
+ • "single": A single line box.
+ • "double": A double line box.
+ • "rounded": Like "single", but with rounded
+ corners ("╭" etc.).
+ • "solid": Adds padding by a single whitespace
+ cell.
+ • "shadow": A drop shadow effect by blending
+ with the background.
+ • If it is an array, it should have a length
+ of eight or any divisor of eight. The array
+ will specifify the eight chars building up
+ the border in a clockwise fashion starting
+ with the top-left corner. As an example, the
+ double box style could be specified as [
+ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ]. If
+ the number of chars are less than eight,
+ they will be repeated. Thus an ASCII border
+ could be specified as [ "/", "-", "\\", "|"
+ ], or all chars the same as [ "x" ]. An
+ empty string can be used to turn off a
+ specific border, for instance, [ "", "", "",
+ ">", "", "", "", "<" ] will only make
+ vertical borders but not horizontal ones. By
+ default, `FloatBorder` highlight is used,
+ which links to `VertSplit` when not defined.
+ It could also be specified by character: [
+ {"+", "MyCorner"}, {"x", "MyBorder"} ].
+
+ • noautocmd: If true then no buffer-related
+ autocommand events such as |BufEnter|,
+ |BufLeave| or |BufWinEnter| may fire from
+ calling this function.
+
+ Return: ~
+ Window handle, or 0 on error
+
+nvim_win_get_config({window}) *nvim_win_get_config()*
+ Gets window configuration.
+
+ The returned value may be given to |nvim_open_win()|.
+
+ `relative` is empty for normal windows.
+
+ Parameters: ~
+ {window} Window handle, or 0 for current window
+
+ Return: ~
+ Map defining the window configuration, see
+ |nvim_open_win()|
+
+nvim_win_set_config({window}, {*config}) *nvim_win_set_config()*
+ Configures window layout. Currently only for floating and
+ external windows (including changing a split window to those
+ layouts).
+
+ When reconfiguring a floating window, absent option keys will
+ not be changed. `row` / `col` and `relative` must be
+ reconfigured together.
+
+ Parameters: ~
+ {window} Window handle, or 0 for current window
+ {config} Map defining the window configuration, see
+ |nvim_open_win()|
+
+ See also: ~
+ |nvim_open_win()|
+
+
+==============================================================================
Tabpage Functions *api-tabpage*
nvim_tabpage_del_var({tabpage}, {name}) *nvim_tabpage_del_var()*
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 7a53f17a78..6c41dd3b10 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -519,11 +519,17 @@ DiffUpdated After diffs have been updated. Depending on
change or when doing |:diffupdate|.
*DirChanged*
DirChanged After the |current-directory| was changed.
+ The pattern can be:
+ "window" to trigger on `:lcd`
+ "tabpage" to trigger on `:tcd`
+ "global" to trigger on `:cd`
+ "auto" to trigger on 'autochdir'.
Sets these |v:event| keys:
cwd: current working directory
scope: "global", "tab", "window"
changed_window: v:true if we fired the event
switching window (or tab)
+ <afile> is set to the new directory name.
Non-recursive (event cannot trigger itself).
*FileAppendCmd*
FileAppendCmd Before appending to a file. Should do the
@@ -630,7 +636,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 +689,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 +937,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"
@@ -1232,6 +1238,13 @@ Example: >
This prevents having the autocommands defined twice (e.g., after sourcing the
vimrc file again).
+ *FileExplorer*
+There is one group that is recognized by Vim: FileExplorer. If this group
+exists Vim assumes that editing a directory is possible and will trigger a
+plugin that lists the files in that directory. This is used by the |netrw|
+plugin. This allows you to do: >
+ browse edit
+
==============================================================================
9. Executing autocommands *autocmd-execute*
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/deprecated.txt b/runtime/doc/deprecated.txt
index a0c291964e..a7ce4135af 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -75,7 +75,9 @@ For each of the functions below, use the corresponding function in
*vim.lsp.diagnostic.get_prev()*
*vim.lsp.diagnostic.get_prev_pos()*
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()*
- Use |vim.diagnostic.get_virt_text_chunks()| instead.
+ No replacement. Use options provided by
+ |vim.diagnostic.config()| to customize
+ virtual text.
*vim.lsp.diagnostic.goto_next()*
*vim.lsp.diagnostic.goto_prev()*
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
new file mode 100644
index 0000000000..82f279e781
--- /dev/null
+++ b/runtime/doc/dev_style.txt
@@ -0,0 +1,1159 @@
+*dev_style.txt* Nvim
+
+
+ NVIM REFERENCE MANUAL
+
+
+Nvim style guide *dev-style*
+
+This is style guide for developers working on Nvim's source code.
+
+License: CC-By 3.0 http://creativecommons.org/licenses/by/3.0/
+
+ Type |gO| to see the table of contents.
+
+==============================================================================
+Background
+
+One way in which we keep the code base manageable is by enforcing consistency.
+It is very important that any programmer be able to look at another's code and
+quickly understand it.
+
+Maintaining a uniform style and following conventions means that we can more
+easily use "pattern-matching" to infer what various symbols are and what
+invariants are true about them. Creating common, required idioms and patterns
+makes code much easier to understand.
+
+In some cases there might be good arguments for changing certain style rules,
+but we nonetheless keep things as they are in order to preserve consistency.
+
+
+==============================================================================
+Header Files *dev-style-header*
+
+
+The #define Guard ~
+
+All header files should have `#define` guards to prevent multiple inclusion.
+The format of the symbol name should be `NVIM_<DIRECTORY>_<FILE>_H`.
+
+ In foo/bar.h:
+>
+ #ifndef NVIM_FOO_BAR_H
+ #define NVIM_FOO_BAR_H
+
+ ...
+
+ #endif // NVIM_FOO_BAR_H
+<
+
+
+Names and Order of Includes ~
+
+Use standard order for readability and to avoid hidden dependencies: C
+library, other libraries' `.h`, your project's `.h`.
+
+ In foo.c order your includes as follows:
+
+ 1. C system files.
+ 2. Other libraries' `.h` files.
+ 3. Your project's `.h` files.
+
+ Exception: sometimes, system-specific code needs conditional includes.
+ Such code can put conditional includes after other includes. Of course,
+ keep your system-specific code small and localized.
+
+
+Constants ~
+
+Do not use macros to define constants in headers.
+
+Macro constants in header files cannot be used by unit tests.
+
+However, you are allowed to define a macro that holds the same value as a
+non-enum constant (defined in the same header) if the value of the constant
+represents the size of an array.
+
+
+==============================================================================
+Scoping *dev-style-scope*
+
+Local Variables ~
+
+Place a function's variables in the narrowest scope possible, and initialize
+variables in the declaration.
+
+C99 allows you to declare variables anywhere in a function. Declare them in as
+local a scope as possible, and as close to the first use as possible. This
+makes it easier for the reader to find the declaration and see what type the
+variable is and what it was initialized to. In particular, initialization
+should be used instead of declaration and assignment, e.g. >
+
+ int i;
+ i = f(); // BAD: initialization separate from declaration.
+
+ int j = g(); // GOOD: declaration has initialization.
+
+
+==============================================================================
+Nvim-Specific Magic
+
+clint ~
+
+Use `clint.py` to detect style errors.
+
+`src/clint.py` is a Python script that reads a source file and identifies
+style errors. It is not perfect, and has both false positives and false
+negatives, but it is still a valuable tool. False positives can be ignored by
+putting `// NOLINT` at the end of the line.
+
+uncrustify ~
+
+src/uncrustify.cfg is the authority for expected code formatting, for cases
+not covered by clint.py. We remove checks in clint.py if they are covered by
+uncrustify rules.
+
+==============================================================================
+Other C Features *dev-style-features*
+
+
+Variable-Length Arrays and alloca() ~
+
+We do not allow variable-length arrays or `alloca()`.
+
+Variable-length arrays can cause hard to detect stack overflows.
+
+
+Postincrement and Postdecrement ~
+
+Use postfix form (`i++`) in statements. >
+
+ for (int i = 0; i < 3; i++) { }
+ int j = ++i; // OK: ++i is used as an expression.
+
+ for (int i = 0; i < 3; ++i) { }
+ ++i; // BAD: ++i is used as a statement.
+
+
+Use of const ~
+
+Use `const` pointers whenever possible. Avoid `const` on non-pointer parameter definitions.
+
+ Where to put the const ~
+
+ Some people favor the form `int const *foo` to `const int *foo` . They
+ argue that this is more readable because it's more consistent: it keeps
+ the rule that `const` always follows the object it's describing. However,
+ this consistency argument doesn't apply in codebases with few
+ deeply-nested pointer expressions since most `const` expressions have only
+ one `const`, and it applies to the underlying value. In such cases, there's
+ no consistency to maintain. Putting the `const` first is arguably more
+ readable, since it follows English in putting the "adjective" (`const`)
+ before the "noun" (`int`).
+
+ That said, while we encourage putting `const` first, we do not require it.
+ But be consistent with the code around you! >
+
+ void foo(const char *p, int i);
+ }
+
+ int foo(const int a, const bool b) {
+ }
+
+ int foo(int *const p) {
+ }
+
+
+Integer Types ~
+
+Of the built-in integer types only use `char`, `int`, `uint8_t`, `int8_t`,
+`uint16_t`, `int16_t`, `uint32_t`, `int32_t`, `uint64_t`, `int64_t`,
+`uintmax_t`, `intmax_t`, `size_t`, `ssize_t`, `uintptr_t`, `intptr_t`, and
+`ptrdiff_t`.
+
+Use `int` for error codes and local, trivial variables only.
+
+Use care when converting integer types. Integer conversions and promotions can
+cause non-intuitive behavior. Note that the signedness of `char` is
+implementation defined.
+
+Public facing types must have fixed width (`uint8_t`, etc.)
+
+There are no convenient `printf` format placeholders for fixed width types.
+Cast to `uintmax_t` or `intmax_t` if you have to format fixed width integers.
+
+Type unsigned signed
+`char` `%hhu` `%hhd`
+`int` n/a `%d`
+`(u)intmax_t` `%ju` `%jd`
+`(s)size_t` `%zu` `%zd`
+`ptrdiff_t` `%tu` `%td`
+
+
+Booleans ~
+
+Use `bool` to represent boolean values. >
+
+ int loaded = 1; // BAD: loaded should have type bool.
+
+
+Variable declarations ~
+
+Declare only one variable per line. >
+
+ int i, j = 1
+
+
+Conditions ~
+
+Don't use "yoda-conditions". Use at most one assignment per condition. >
+
+ if (1 == x) {
+
+ if (x == 1) { //use this order
+
+ if ((x = f()) && (y = g())) {
+
+
+Function declarations ~
+
+Every function must not have a separate declaration.
+
+Function declarations are created by the gendeclarations.lua script. >
+
+ static void f(void);
+
+ static void f(void)
+ {
+ ...
+ }
+
+
+General translation unit layout ~
+
+The definitions of public functions precede the definitions of static
+functions. >
+
+ <HEADER>
+
+ <PUBLIC FUNCTION DEFINITIONS>
+
+ <STATIC FUNCTION DEFINITIONS>
+
+
+Integration with declarations generator ~
+
+Every C file must contain #include of the generated header file, guarded by
+#ifdef INCLUDE_GENERATED_DECLARATIONS.
+
+Include must go after other #includes and typedefs in .c files and after
+everything else in header files. It is allowed to omit #include in a .c file
+if .c file does not contain any static functions.
+
+Included file name consists of the .c file name without extension, preceded by
+the directory name relative to src/nvim. Name of the file containing static
+functions declarations ends with `.c.generated.h`, `*.h.generated.h` files
+contain only non-static function declarations. >
+
+ // src/nvim/foo.c file
+ #include <stddef.h>
+
+ typedef int FooType;
+
+ #ifdef INCLUDE_GENERATED_DECLARATIONS
+ # include "foo.c.generated.h"
+ #endif
+
+ …
+
+
+ // src/nvim/foo.h file
+ #ifndef NVIM_FOO_H
+ #define NVIM_FOO_H
+
+ …
+
+ #ifdef INCLUDE_GENERATED_DECLARATIONS
+ # include "foo.h.generated.h"
+ #endif
+ #endif // NVIM_FOO_H
+
+
+64-bit Portability ~
+
+Code should be 64-bit and 32-bit friendly. Bear in mind problems of printing,
+comparisons, and structure alignment.
+
+- Remember that `sizeof(void *)` != `sizeof(int)`. Use `intptr_t` if you want
+ a pointer-sized integer.
+
+- You may need to be careful with structure alignments, particularly for
+ structures being stored on disk. Any class/structure with a
+ `int64_t`/`uint64_t` member will by default end up being 8-byte aligned on a
+ 64-bit system. If you have such structures being shared on disk between
+ 32-bit and 64-bit code, you will need to ensure that they are packed the
+ same on both architectures. Most compilers offer a way to alter structure
+ alignment. For gcc, you can use `__attribute__((packed))`. MSVC offers
+ `#pragma pack()` and `__declspec(align())`.
+
+- Use the `LL` or `ULL` suffixes as needed to create 64-bit constants. For
+ example: >
+
+ int64_t my_value = 0x123456789LL;
+ uint64_t my_mask = 3ULL << 48;
+
+
+sizeof ~
+
+Prefer `sizeof(varname)` to `sizeof(type)`.
+
+Use `sizeof(varname)` when you take the size of a particular variable.
+`sizeof(varname)` will update appropriately if someone changes the variable
+type either now or later. You may use `sizeof(type)` for code unrelated to any
+particular variable, such as code that manages an external or internal data
+format where a variable of an appropriate C type is not convenient. >
+
+ Struct data;
+ memset(&data, 0, sizeof(data));
+
+ memset(&data, 0, sizeof(Struct));
+
+ if (raw_size < sizeof(int)) {
+ fprintf(stderr, "compressed record not big enough for count: %ju", raw_size);
+ return false;
+ }
+
+
+==============================================================================
+Naming *dev-style-naming*
+
+The most important consistency rules are those that govern naming. The style
+of a name immediately informs us what sort of thing the named entity is: a
+type, a variable, a function, a constant, a macro, etc., without requiring us
+to search for the declaration of that entity. The pattern-matching engine in
+our brains relies a great deal on these naming rules.
+
+Naming rules are pretty arbitrary, but we feel that consistency is more
+important than individual preferences in this area, so regardless of whether
+you find them sensible or not, the rules are the rules.
+
+
+General Naming Rules ~
+
+Function names, variable names, and filenames should be descriptive; eschew
+abbreviation.
+
+Give as descriptive a name as possible, within reason. Do not worry about
+saving horizontal space as it is far more important to make your code
+immediately understandable by a new reader. Do not use abbreviations that are
+ambiguous or unfamiliar to readers outside your project, and do not abbreviate
+by deleting letters within a word. >
+
+ int price_count_reader; // No abbreviation.
+ int num_errors; // "num" is a widespread convention.
+ int num_dns_connections; // Most people know what "DNS" stands for.
+
+ int n; // Meaningless.
+ int nerr; // Ambiguous abbreviation.
+ int n_comp_conns; // Ambiguous abbreviation.
+ int wgc_connections; // Only your group knows what this stands for.
+ int pc_reader; // Lots of things can be abbreviated "pc".
+ int cstmr_id; // Deletes internal letters.
+
+
+File Names ~
+
+Filenames should be all lowercase and can include underscores (`_`).
+
+Use underscores to separate words. Examples of acceptable file names: >
+
+ my_useful_file.c
+ getline_fix.c // OK: getline refers to the glibc function.
+
+C files should end in `.c` and header files should end in `.h`.
+
+Do not use filenames that already exist in `/usr/include`, such as `db.h`.
+
+In general, make your filenames very specific. For example, use
+`http_server_logs.h` rather than `logs.h`.
+
+
+Type Names ~
+
+Typedef-ed structs and enums start with a capital letter and have a capital
+letter for each new word, with no underscores: `MyExcitingStruct`.
+
+Non-Typedef-ed structs and enums are all lowercase with underscores between
+words: `struct my_exciting_struct` . >
+
+ struct my_struct {
+ ...
+ };
+ typedef struct my_struct MyAwesomeStruct;
+
+
+Variable Names ~
+
+Variable names are all lowercase, with underscores between words. For
+instance: `my_exciting_local_variable`.
+
+ Common Variable names ~
+
+ For example: >
+
+ string table_name; // OK: uses underscore.
+ string tablename; // OK: all lowercase.
+
+ string tableName; // BAD: mixed case.
+<
+
+ Struct Variables ~
+
+ Data members in structs should be named like regular variables. >
+
+ struct url_table_properties {
+ string name;
+ int num_entries;
+ }
+<
+
+ Global Variables ~
+
+ Don't use global variables unless absolutely necessary. Prefix global
+ variables with `g_`.
+
+
+Constant Names ~
+
+Use a `k` followed by mixed case: `kDaysInAWeek`.
+
+All compile-time constants, whether they are declared locally or globally,
+follow a slightly different naming convention from other variables. Use a `k`
+followed by words with uppercase first letters: >
+
+ const int kDaysInAWeek = 7;
+
+Function Names ~
+
+Function names are all lowercase, with underscores between words. For
+instance: `my_exceptional_function()`. All functions in the same header file
+should have a common prefix.
+
+In `os_unix.h`: >
+
+ void unix_open(const char *path);
+ void unix_user_id(void);
+
+If your function crashes upon an error, you should append `or_die` to the
+function name. This only applies to functions which could be used by
+production code and to errors that are reasonably likely to occur during
+normal operation.
+
+
+Enumerator Names ~
+
+Enumerators should be named like constants: `kEnumName`. >
+
+ enum url_table_errors {
+ kOK = 0,
+ kErrorOutOfMemory,
+ kErrorMalformedInput,
+ };
+
+
+Macro Names ~
+
+They're like this: `MY_MACRO_THAT_SCARES_CPP_DEVELOPERS`. >
+
+ #define ROUND(x) ...
+ #define PI_ROUNDED 5.0
+
+
+==============================================================================
+Comments *dev-style-comments*
+
+Comments are vital to keeping our code readable. The following rules describe
+what you should comment and where. But remember: while comments are very
+important, the best code is self-documenting.
+
+When writing your comments, write for your audience: the next contributor who
+will need to understand your code. Be generous — the next one may be you!
+
+Nvim uses Doxygen comments.
+
+
+Comment Style ~
+
+Use the `//`-style syntax only. >
+
+ // This is a comment spanning
+ // multiple lines
+ f();
+
+
+File Comments ~
+
+Start each file with a description of its contents.
+
+ Legal Notice ~
+
+ We have no such thing. These things are in LICENSE and only there.
+
+ File Contents ~
+
+ Every file should have a comment at the top describing its contents.
+
+ Generally a `.h` file will describe the variables and functions that are
+ declared in the file with an overview of what they are for and how they
+ are used. A `.c` file should contain more information about implementation
+ details or discussions of tricky algorithms. If you feel the
+ implementation details or a discussion of the algorithms would be useful
+ for someone reading the `.h`, feel free to put it there instead, but
+ mention in the `.c` that the documentation is in the `.h` file.
+
+ Do not duplicate comments in both the `.h` and the `.c`. Duplicated
+ comments diverge. >
+
+ /// A brief description of this file.
+ ///
+ /// A longer description of this file.
+ /// Be very generous here.
+
+
+Struct Comments ~
+
+Every struct definition should have accompanying comments that describes what
+it is for and how it should be used. >
+
+ /// Window info stored with a buffer.
+ ///
+ /// Two types of info are kept for a buffer which are associated with a
+ /// specific window:
+ /// 1. Each window can have a different line number associated with a
+ /// buffer.
+ /// 2. The window-local options for a buffer work in a similar way.
+ /// The window-info is kept in a list at g_wininfo. It is kept in
+ /// most-recently-used order.
+ struct win_info {
+ /// Next entry or NULL for last entry.
+ WinInfo *wi_next;
+ /// Previous entry or NULL for first entry.
+ WinInfo *wi_prev;
+ /// Pointer to window that did the wi_fpos.
+ Win *wi_win;
+ ...
+ };
+
+If the field comments are short, you can also put them next to the field. But
+be consistent within one struct. >
+
+ struct wininfo_S {
+ WinInfo *wi_next; /// Next entry or NULL for last entry.
+ WinInfo *wi_prev; /// Previous entry or NULL for first entry.
+ Win *wi_win; /// Pointer to window that did the wi_fpos.
+ ...
+ };
+
+If you have already described a struct in detail in the comments at the top of
+your file feel free to simply state "See comment at top of file for a complete
+description", but be sure to have some sort of comment.
+
+Document the synchronization assumptions the struct makes, if any. If an
+instance of the struct can be accessed by multiple threads, take extra care to
+document the rules and invariants surrounding multithreaded use.
+
+
+Function Comments ~
+
+Declaration comments describe use of the function; comments at the definition
+of a function describe operation.
+
+ Function Declarations ~
+
+ Every function declaration should have comments immediately preceding it
+ that describe what the function does and how to use it. These comments
+ should be descriptive ("Opens the file") rather than imperative ("Open the
+ file"); the comment describes the function, it does not tell the function
+ what to do. In general, these comments do not describe how the function
+ performs its task. Instead, that should be left to comments in the
+ function definition.
+
+ Types of things to mention in comments at the function declaration:
+
+ - If the function allocates memory that the caller must free.
+ - Whether any of the arguments can be a null pointer.
+ - If there are any performance implications of how a function is used.
+ - If the function is re-entrant. What are its synchronization assumptions?
+ >
+ /// Brief description of the function.
+ ///
+ /// Detailed description.
+ /// May span multiple paragraphs.
+ ///
+ /// @param arg1 Description of arg1
+ /// @param arg2 Description of arg2. May span
+ /// multiple lines.
+ ///
+ /// @return Description of the return value.
+ Iterator *get_iterator(void *arg1, void *arg2);
+<
+
+ Function Definitions ~
+
+ If there is anything tricky about how a function does its job, the
+ function definition should have an explanatory comment. For example, in
+ the definition comment you might describe any coding tricks you use, give
+ an overview of the steps you go through, or explain why you chose to
+ implement the function in the way you did rather than using a viable
+ alternative. For instance, you might mention why it must acquire a lock
+ for the first half of the function but why it is not needed for the second
+ half.
+
+ Note you should not just repeat the comments given with the function
+ declaration, in the `.h` file or wherever. It's okay to recapitulate
+ briefly what the function does, but the focus of the comments should be on
+ how it does it. >
+
+ // Note that we don't use Doxygen comments here.
+ Iterator *get_iterator(void *arg1, void *arg2)
+ {
+ ...
+ }
+
+
+Variable Comments ~
+
+In general the actual name of the variable should be descriptive enough to
+give a good idea of what the variable is used for. In certain cases, more
+comments are required.
+
+ Global Variables ~
+
+ All global variables should have a comment describing what they are and
+ what they are used for. For example: >
+
+ /// The total number of tests cases that we run
+ /// through in this regression test.
+ const int kNumTestCases = 6;
+
+
+Implementation Comments ~
+
+In your implementation you should have comments in tricky, non-obvious,
+interesting, or important parts of your code.
+
+ Line Comments ~
+
+ Also, lines that are non-obvious should get a comment at the end of the
+ line. These end-of-line comments should be separated from the code by 2
+ spaces. Example: >
+
+ // If we have enough memory, mmap the data portion too.
+ mmap_budget = max<int64>(0, mmap_budget - index_->length());
+ if (mmap_budget >= data_size_ && !MmapData(mmap_chunk_bytes, mlock)) {
+ return; // Error already logged.
+ }
+<
+ Note that there are both comments that describe what the code is doing,
+ and comments that mention that an error has already been logged when the
+ function returns.
+
+ If you have several comments on subsequent lines, it can often be more
+ readable to line them up: >
+
+ do_something(); // Comment here so the comments line up.
+ do_something_else_that_is_longer(); // Comment here so there are two spaces between
+ // the code and the comment.
+ { // One space before comment when opening a new scope is allowed,
+ // thus the comment lines up with the following comments and code.
+ do_something_else(); // Two spaces before line comments normally.
+ }
+<
+
+ NULL, true/false, 1, 2, 3... ~
+
+ When you pass in a null pointer, boolean, or literal integer values to
+ functions, you should consider adding a comment about what they are, or
+ make your code self-documenting by using constants. For example, compare:
+ >
+
+ bool success = calculate_something(interesting_value,
+ 10,
+ false,
+ NULL); // What are these arguments??
+<
+
+ versus: >
+
+ bool success = calculate_something(interesting_value,
+ 10, // Default base value.
+ false, // Not the first time we're calling this.
+ NULL); // No callback.
+<
+
+ Or alternatively, constants or self-describing variables: >
+
+ const int kDefaultBaseValue = 10;
+ const bool kFirstTimeCalling = false;
+ Callback *null_callback = NULL;
+ bool success = calculate_something(interesting_value,
+ kDefaultBaseValue,
+ kFirstTimeCalling,
+ null_callback);
+<
+
+ Don'ts ~
+
+ Note that you should never describe the code itself. Assume that the
+ person reading the code knows C better than you do, even though he or she
+ does not know what you are trying to do: >
+
+ // Now go through the b array and make sure that if i occurs,
+ // the next element is i+1.
+ ... // Geez. What a useless comment.
+
+
+Punctuation, Spelling and Grammar ~
+
+Pay attention to punctuation, spelling, and grammar; it is easier to read
+well-written comments than badly written ones.
+
+Comments should be as readable as narrative text, with proper capitalization
+and punctuation. In many cases, complete sentences are more readable than
+sentence fragments. Shorter comments, such as comments at the end of a line of
+code, can sometimes be less formal, but you should be consistent with your
+style.
+
+Although it can be frustrating to have a code reviewer point out that you are
+using a comma when you should be using a semicolon, it is very important that
+source code maintain a high level of clarity and readability. Proper
+punctuation, spelling, and grammar help with that goal.
+
+
+TODO Comments ~
+
+Use `TODO` comments for code that is temporary, a short-term solution, or
+good-enough but not perfect.
+
+`TODO`s should include the string `TODO` in all caps, followed by the name,
+email address, or other identifier of the person who can best provide context
+about the problem referenced by the `TODO`. The main purpose is to have a
+consistent `TODO` format that can be searched to find the person who can
+provide more details upon request. A `TODO` is not a commitment that the
+person referenced will fix the problem. Thus when you create a `TODO`, it is
+almost always your name that is given. >
+
+ // TODO(kl@gmail.com): Use a "*" here for concatenation operator.
+ // TODO(Zeke): change this to use relations.
+
+If your `TODO` is of the form "At a future date do something" make sure that
+you either include a very specific date ("Fix by November 2005") or a very
+specific event ("Remove this code when all clients can handle XML
+responses.").
+
+
+Deprecation Comments ~
+
+Mark deprecated interface points with `@deprecated` docstring token.
+
+You can mark an interface as deprecated by writing a comment containing the
+word `@deprecated` in all caps. The comment goes either before the declaration
+of the interface or on the same line as the declaration.
+
+After `@deprecated`, write your name, email, or other identifier in
+parentheses.
+
+A deprecation comment must include simple, clear directions for people to fix
+their callsites. In C, you can implement a deprecated function as an inline
+function that calls the new interface point.
+
+Marking an interface point `DEPRECATED` will not magically cause any callsites
+to change. If you want people to actually stop using the deprecated facility,
+you will have to fix the callsites yourself or recruit a crew to help you.
+
+New code should not contain calls to deprecated interface points. Use the new
+interface point instead. If you cannot understand the directions, find the
+person who created the deprecation and ask them for help using the new
+interface point.
+
+
+==============================================================================
+Formatting *dev-style-format*
+
+Coding style and formatting are pretty arbitrary, but a project is much easier
+to follow if everyone uses the same style. Individuals may not agree with
+every aspect of the formatting rules, and some of the rules may take some
+getting used to, but it is important that all project contributors follow the
+style rules so that they can all read and understand everyone's code easily.
+
+
+Line Length ~
+
+Each line of text in your code should be at most 100 characters long.
+
+Exception: if a comment line contains an example command or a literal URL
+longer than 100 characters, that line may be longer than 100 characters for ease
+of cut and paste.
+
+
+Non-ASCII Characters ~
+
+Non-ASCII characters should be rare, and must use UTF-8 formatting.
+
+You shouldn't hard-code user-facing text in source (OR SHOULD YOU?), even
+English, so use of non-ASCII characters should be rare. However, in certain
+cases it is appropriate to include such words in your code. For example, if
+your code parses data files from foreign sources, it may be appropriate to
+hard-code the non-ASCII string(s) used in those data files as delimiters. More
+commonly, unittest code (which does not need to be localized) might contain
+non-ASCII strings. In such cases, you should use UTF-8, since that is an
+encoding understood by most tools able to handle more than just ASCII.
+
+Hex encoding is also OK, and encouraged where it enhances readability — for
+example, `"\uFEFF"`, is the Unicode zero-width no-break space character, which
+would be invisible if included in the source as straight UTF-8.
+
+
+Spaces vs. Tabs ~
+
+Use only spaces, and indent 2 spaces at a time. Do not use tabs in your code.
+
+
+Function Declarations and Definitions ~
+
+Return type on the same line as function name, parameters on the same line if
+they fit.
+
+Functions look like this: >
+
+ ReturnType function_name(Type par_name1, Type par_name2)
+ {
+ do_something();
+ ...
+ }
+
+If you have too much text to fit on one line: >
+
+ ReturnType really_long_function_name(Type par_name1, Type par_name2,
+ Type par_name3)
+ {
+ do_something();
+ ...
+ }
+
+or if you cannot fit even the first parameter (but only then): >
+
+ ReturnType really_really_really_long_function_name(
+ Type par_name1, // 4 space indent
+ Type par_name2,
+ Type par_name3)
+ {
+ do_something(); // 2 space indent
+ ...
+ }
+
+Some points to note:
+
+- The open parenthesis is always on the same line as the function name.
+- There is never a space between the function name and the open parenthesis.
+- There is never a space between the parentheses and the parameters.
+- The open curly brace is always on the next line.
+- The close curly brace is always on the last line by itself.
+- There should be a space between the close parenthesis and the open curly
+ brace.
+- All parameters should be named, with identical names in the declaration and
+ implementation.
+- All parameters should be aligned if possible.
+- Default indentation is 2 spaces.
+- Wrapped parameters have a 4 space indent.
+
+
+Function Calls ~
+
+On one line if it fits; otherwise, wrap arguments at the parenthesis.
+
+Function calls have the following format: >
+
+ bool retval = do_something(argument1, argument2, argument3);
+
+If the arguments do not all fit on one line, they should be broken up onto
+multiple lines, with each subsequent line aligned with the first argument. Do
+not add spaces after the open paren or before the close paren: >
+
+ bool retval = do_something(averyveryveryverylongargument1,
+ argument2, argument3);
+
+If the function has many arguments, consider having one per line if this makes
+the code more readable: >
+
+ bool retval = do_something(argument1,
+ argument2,
+ argument3,
+ argument4);
+
+Arguments may optionally all be placed on subsequent lines, with one line per
+argument: >
+
+ if (...) {
+ ...
+ ...
+ if (...) {
+ do_something(
+ argument1, // 4 space indent
+ argument2,
+ argument3,
+ argument4);
+ }
+
+In particular, this should be done if the function signature is so long that
+it cannot fit within the maximum line length.
+
+
+Braced Initializer Lists ~
+
+Format a braced list exactly like you would format a function call in its
+place but with one space after the `{` and one space before the `}`
+
+If the braced list follows a name (e.g. a type or variable name), format as if
+the `{}` were the parentheses of a function call with that name. If there is
+no name, assume a zero-length name. >
+
+ struct my_struct m = { // Here, you could also break before {.
+ superlongvariablename1,
+ superlongvariablename2,
+ { short, interior, list },
+ { interiorwrappinglist,
+ interiorwrappinglist2 } };
+
+
+Conditionals ~
+
+Don't use spaces inside parentheses. Always use curly braces. >
+
+ if (condition) { // no spaces inside parentheses
+ ... // 2 space indent.
+ } else if (...) { // The else goes on the same line as the closing brace.
+ ...
+ } else {
+ ...
+ }
+
+You must have a space between the `if` and the open parenthesis. You must also
+have a space between the close parenthesis and the curly brace, if you're
+using one. >
+
+ if(condition) { // BAD: space missing after IF.
+ if (condition){ // BAD: space missing before {.
+ if (condition) { // GOOD: proper space after IF and before {.
+
+
+Loops and Switch Statements ~
+
+Annotate non-trivial fall-through between cases. Empty loop bodies should use
+`{}` or `continue`.
+
+If not conditional on an enumerated value, switch statements should always
+have a `default` case (in the case of an enumerated value, the compiler will
+warn you if any values are not handled). If the default case should never
+execute, simply `assert`: >
+
+ switch (var) {
+ case 0: // 2 space indent
+ ... // 4 space indent
+ break;
+ case 1:
+ ...
+ break;
+ default:
+ assert(false);
+ }
+
+Empty loop bodies should use `{}` or `continue`, but not a single semicolon. >
+
+ while (condition) {
+ // Repeat test until it returns false.
+ }
+ for (int i = 0; i < kSomeNumber; i++) {} // GOOD: empty body.
+ while (condition) continue; // GOOD: continue indicates no logic.
+
+ while (condition); // BAD: looks like part of do/while loop.
+
+Pointer Expressions ~
+
+No spaces around period or arrow. Pointer operators do not have trailing
+spaces.
+
+The following are examples of correctly-formatted pointer and reference
+expressions: >
+
+ x = *p;
+ p = &x;
+ x = r.y;
+ x = r->y;
+
+Note that:
+
+ - There are no spaces around the period or arrow when accessing a member.
+ - Pointer operators have no space after the * or &.
+
+When declaring a pointer variable or argument, place the asterisk adjacent to
+the variable name: >
+
+ char *c;
+
+ char * c; // BAD: spaces on both sides of *
+ char* c; // BAD
+
+
+Boolean Expressions ~
+
+When you have a boolean expression that is longer than the standard line
+length, keep operators at the start of the line. >
+
+ if (this_one_thing > this_other_thing
+ && a_third_thing == a_fourth_thing
+ && yet_another && last_one) {
+ ...
+ }
+
+Also note that you should always use the punctuation operators, such as `&&`
+and `~`, rather than the word operators, such as `and` and `compl`.
+
+
+Return Values ~
+
+Do not needlessly surround the `return` expression with parentheses.
+
+Use parentheses in `return expr`; only where you would use them in `x =
+expr;`. >
+
+ return result;
+ return (some_long_condition && another_condition);
+
+ return (value); // You wouldn't write var = (value);
+ return(result); // return is not a function!
+
+
+Preprocessor Directives ~
+
+The hash mark that starts a preprocessor directive should always be at the
+beginning of the line.
+
+Even when preprocessor directives are within the body of indented code, the
+directives should start at the beginning of the line.
+
+Nested directives should add one spaces after the hash mark for each level of
+indentation.
+
+ // GOOD: directives at beginning of line >
+ if (lopsided_score) {
+ #if DISASTER_PENDING // Correct -- Starts at beginning of line
+ drop_everything();
+ # if NOTIFY // One space after #
+ notify_client();
+ # endif
+ #endif
+ BackToNormal();
+ }
+
+< // BAD: indented directives >
+ if (lopsided_score) {
+ #if DISASTER_PENDING // Wrong! The "#if" should be at beginning of line
+ drop_everything();
+ #endif // Wrong! Do not indent "#endif"
+ back_to_normal();
+ }
+
+
+Horizontal Whitespace ~
+
+Use of horizontal whitespace depends on location. Never put trailing
+whitespace at the end of a line.
+
+ General ~
+>
+ if (x) { // Open braces should always have a space before them.
+ ...
+ }
+ int i = 0; // Semicolons usually have no space before them.
+ int x[] = { 0 }; // Spaces inside braces for braced-init-list.
+<
+
+ Variables ~
+>
+ int long_variable = 0; // Don't align assignments.
+ int i = 1;
+
+ struct my_struct { // Exception: struct arrays.
+ const char *boy;
+ const char *girl;
+ int pos;
+ } my_variable[] = {
+ { "Mia", "Michael", 8 },
+ { "Elizabeth", "Aiden", 10 },
+ { "Emma", "Mason", 2 },
+ };
+<
+
+ Macros ~
+>
+ #define FI(x) \ // Don't align \'s in macro definitions.
+ foo(); \
+ bar(); \
+ ...
+<
+
+ Loops and Conditionals ~
+>
+ if (b) { // Space after the keyword in condition.
+ } else { // Spaces around else.
+ }
+ while (test) {} // There is usually no space inside parentheses.
+ for (; i < 5; i++) { // For loops always have a space after the
+ ... // semicolon and no a space before the
+ ... // semicolon.
+ }
+ switch (i) {
+ case 1: // No space before colon in a switch case.
+ ...
+ case 2: break; // Space after a colon if there's code after it.
+<
+
+ Operators ~
+>
+ x = 0; // Assignment operators always have spaces around
+ // them.
+ x = -5; // No spaces separating unary operators and their
+ x++; // arguments.
+ if (x && !y)
+ ...
+ v = w*x + y/z; // Use spaces to indicate operator precedence.
+ v = w * (x + z); // Parentheses should have no spaces inside them.
+ i = (int)d; // No spaces after a cast operator.
+<
+
+Vertical Whitespace ~
+
+Minimize use of vertical whitespace.
+
+This is more a principle than a rule: don't use blank lines when you don't
+have to. In particular, don't put more than one or two blank lines between
+functions, resist starting functions with a blank line, don't end functions
+with a blank line, and be discriminating with your use of blank lines inside
+functions.
+
+The basic principle is: The more code that fits on one screen, the easier it
+is to follow and understand the control flow of the program. Of course,
+readability can suffer from code being too dense as well as too spread out, so
+use your judgment. But in general, minimize use of vertical whitespace.
+
+
+==============================================================================
+Parting Words
+
+The style guide is intended to make the code more readable. If you think you
+must violate its rules for the sake of clarity, do it! But please add a note
+to your pull request explaining your reasoning.
+
+
+ vim:tw=78:ts=8:et:ft=help:norl:
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 14f35acce3..7127c74134 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -166,7 +166,7 @@ Docstring format:
- Use `<pre>` for code samples.
Example: the help for |nvim_open_win()| is generated from a docstring defined
-in src/nvim/api/vim.c like this: >
+in src/nvim/api/win_config.c like this: >
/// Opens a new window.
/// ...
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 59b73771a6..4d1e5ac997 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -47,6 +47,7 @@ A diagnostic is a Lua table with the following keys:
end_col: The final column of the diagnostic
severity: The severity of the diagnostic |vim.diagnostic.severity|
message: The diagnostic text
+ source: The source of the diagnostic
Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based
rows and columns). |api-indexing|
@@ -186,6 +187,11 @@ can be customized using the following: >
sign define DiagnosticSignInfo text=I texthl=DiagnosticSignInfo linehl= numhl=
sign define DiagnosticSignHint text=H texthl=DiagnosticSignHint linehl= numhl=
+When the "severity_sort" option is set (see |vim.diagnostic.config()|) the
+priority of each sign depends on the severity of the associated diagnostic.
+Otherwise, all signs have the same priority (the value of the "priority"
+option in the "signs" table of |vim.diagnostic.config()| or 10 if unset).
+
==============================================================================
EVENTS *diagnostic-events*
@@ -195,7 +201,52 @@ DiagnosticsChanged After diagnostics have changed.
Example: >
autocmd User DiagnosticsChanged lua vim.diagnostic.setqflist({open = false })
<
-
+==============================================================================
+CUSTOMIZATION *diagnostic-config*
+
+If you need more customization over the way diagnostics are displayed than the
+built-in configuration options provide, you can override the display handler
+explicitly. For example, use the following to only show a sign for the highest
+severity diagnostic on a given line: >
+
+ -- Disable the default signs handler
+ vim.diagnostic.config({signs = false})
+
+ -- Create a namespace. This won't be used to add any diagnostics,
+ -- only to display them.
+ local ns = vim.api.nvim_create_namespace("my_namespace")
+
+ -- Create a reference to the original function
+ local orig_show = vim.diagnostic.show
+
+ local function set_signs(bufnr)
+ -- Get all diagnostics from the current buffer
+ local diagnostics = vim.diagnostic.get(bufnr)
+
+ -- Find the "worst" diagnostic per line
+ local max_severity_per_line = {}
+ for _, d in pairs(diagnostics) do
+ local m = max_severity_per_line[d.lnum]
+ if not m or d.severity < m.severity then
+ max_severity_per_line[d.lnum] = d
+ end
+ end
+
+ -- Show the filtered diagnostics using the custom namespace. Use the
+ -- reference to the original function to avoid a loop.
+ local filtered_diagnostics = vim.tbl_values(max_severity_per_line)
+ orig_show(ns, bufnr, filtered_diagnostics, {
+ virtual_text=false,
+ underline=false,
+ signs=true
+ })
+ end
+
+ function vim.diagnostic.show(namespace, bufnr, ...)
+ orig_show(namespace, bufnr, ...)
+ set_signs(bufnr)
+ end
+<
==============================================================================
Lua module: vim.diagnostic *diagnostic-api*
@@ -203,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({virtual_text = true})
+<
+
+ and a diagnostic producer sets diagnostics with >
+
+ vim.diagnostic.set(ns, 0, diagnostics, {virtual_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.
@@ -226,12 +296,45 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
• severity: Only show virtual text for
diagnostics matching the given severity
|diagnostic-severity|
+ • source: (string) Include the diagnostic
+ source in virtual text. One of "always"
+ or "if_many".
+ • format: (function) A function that takes
+ a diagnostic as input and returns a
+ string. The return value is the text used
+ to display the diagnostic. Example: >
+
+ function(diagnostic)
+ if diagnostic.severity == vim.diagnostic.severity.ERROR then
+ return string.format("E: %s", diagnostic.message)
+ end
+ return diagnostic.message
+ end
+<
• signs: (default true) Use signs for
diagnostics. Options:
• severity: Only show signs for diagnostics
matching the given severity
|diagnostic-severity|
+ • priority: (number, default 10) Base
+ priority to use for signs. When
+ {severity_sort} is used, the priority of
+ a sign is adjusted based on its severity.
+ Otherwise, all signs use the same
+ priority.
+
+ • float: Options for floating windows:
+ • severity: See |diagnostic-severity|.
+ • show_header: (boolean, default true) Show
+ "Diagnostics:" header
+ • source: (string) Include the diagnostic
+ source in the message. One of "always" or
+ "if_many".
+ • format: (function) A function that takes
+ a diagnostic as input and returns a
+ string. The return value is the text used
+ to display the diagnostic.
• update_in_insert: (default false) Update
diagnostics in Insert mode (if false,
@@ -291,6 +394,13 @@ get({bufnr}, {opts}) *vim.diagnostic.get()*
Return: ~
table A list of diagnostic items |diagnostic-structure|.
+get_namespaces() *vim.diagnostic.get_namespaces()*
+ Get current diagnostic namespaces.
+
+ Return: ~
+ table A list of active diagnostic namespaces
+ |vim.diagnostic|.
+
get_next({opts}) *vim.diagnostic.get_next()*
Get the next diagnostic closest to the cursor position.
@@ -329,26 +439,6 @@ get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
Return: ~
table Previous diagnostic position as a (row, col) tuple.
- *vim.diagnostic.get_virt_text_chunks()*
-get_virt_text_chunks({line_diags}, {opts})
- Get virtual text chunks to display using
- |nvim_buf_set_extmark()|.
-
- Parameters: ~
- {line_diags} table The diagnostics associated with the
- line.
- {opts} table|nil Configuration table with the
- following keys:
- • prefix: (string) Prefix to display before
- virtual text on line.
- • spacing: (number) Number of spaces to
- insert before virtual text.
-
- Return: ~
- array of ({text}, {hl_group}) tuples. This can be passed
- directly to the {virt_text} option of
- |nvim_buf_set_extmark()|.
-
goto_next({opts}) *vim.diagnostic.goto_next()*
Move to the next diagnostic.
@@ -364,12 +454,10 @@ goto_next({opts}) *vim.diagnostic.goto_next()*
• wrap: (boolean, default true) Whether to loop
around file or not. Similar to 'wrapscan'.
• severity: See |diagnostic-severity|.
- • enable_popup: (boolean, default true) Call
- |vim.diagnostic.show_line_diagnostics()| on
- jump.
- • popup_opts: (table) Table to pass as {opts}
- parameter to
- |vim.diagnostic.show_line_diagnostics()|
+ • float: (boolean or table, default true) If
+ "true", call |vim.diagnostic.open_float()| after
+ moving. If a table, pass the table as the {opts}
+ parameter to |vim.diagnostic.open_float()|.
• win_id: (number, default 0) Window ID
goto_prev({opts}) *vim.diagnostic.goto_prev()*
@@ -401,8 +489,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"
@@ -429,6 +518,46 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
diagnostic |diagnostic-structure| or `nil` if {pat} fails
to match {str}.
+open_float({bufnr}, {opts}) *vim.diagnostic.open_float()*
+ Show diagnostics in a floating window.
+
+ Parameters: ~
+ {bufnr} number|nil Buffer number. Defaults to the current
+ buffer.
+ {opts} table|nil Configuration table with the same keys
+ as |vim.lsp.util.open_floating_preview()| in
+ addition to the following:
+ • namespace: (number) Limit diagnostics to the
+ given namespace
+ • scope: (string, default "buffer") Show
+ diagnostics from the whole buffer ("buffer"),
+ the current cursor line ("line"), or the
+ current cursor position ("cursor").
+ • pos: (number or table) If {scope} is "line" or
+ "cursor", use this position rather than the
+ cursor position. If a number, interpreted as a
+ line number; otherwise, a (row, col) tuple.
+ • severity_sort: (default false) Sort diagnostics
+ by severity. Overrides the setting from
+ |vim.diagnostic.config()|.
+ • severity: See |diagnostic-severity|. Overrides
+ the setting from |vim.diagnostic.config()|.
+ • show_header: (boolean, default true) Show
+ "Diagnostics:" header. Overrides the setting
+ from |vim.diagnostic.config()|.
+ • source: (string) Include the diagnostic source
+ in the message. One of "always" or "if_many".
+ Overrides the setting from
+ |vim.diagnostic.config()|.
+ • format: (function) A function that takes a
+ diagnostic as input and returns a string. The
+ return value is the text used to display the
+ diagnostic. Overrides the setting from
+ |vim.diagnostic.config()|.
+
+ Return: ~
+ tuple ({float_bufnr}, {win_id})
+
reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
Remove all diagnostics from the given namespace.
@@ -502,44 +631,6 @@ show({namespace}, {bufnr}, {diagnostics}, {opts})
{opts} table|nil Display options. See
|vim.diagnostic.config()|.
- *vim.diagnostic.show_line_diagnostics()*
-show_line_diagnostics({opts}, {bufnr}, {lnum})
- Open a floating window with the diagnostics from the given
- line.
-
- Parameters: ~
- {opts} table Configuration table. See
- |vim.diagnostic.show_position_diagnostics()|.
- {bufnr} number|nil Buffer number. Defaults to the current
- buffer.
- {lnum} number|nil Line number. Defaults to line number
- of cursor.
-
- Return: ~
- tuple ({popup_bufnr}, {win_id})
-
- *vim.diagnostic.show_position_diagnostics()*
-show_position_diagnostics({opts}, {bufnr}, {position})
- Open a floating window with the diagnostics at the given
- position.
-
- Parameters: ~
- {opts} table|nil Configuration table with the same
- keys as |vim.lsp.util.open_floating_preview()|
- in addition to the following:
- • namespace: (number) Limit diagnostics to the
- given namespace
- • severity: See |diagnostic-severity|.
- • show_header: (boolean, default true) Show
- "Diagnostics:" header
- {bufnr} number|nil Buffer number. Defaults to the
- current buffer.
- {position} table|nil The (0,0)-indexed position. Defaults
- to the current cursor position.
-
- Return: ~
- tuple ({popup_bufnr}, {win_id})
-
toqflist({diagnostics}) *vim.diagnostic.toqflist()*
Convert a list of diagnostics to a list of quickfix items that
can be passed to |setqflist()| or |setloclist()|.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 4700af41b7..4e3173cfa9 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1183,7 +1183,8 @@ If you want to always use ":confirm", set the 'confirm' option.
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|:source|, |:update|, |:visual|, |:vsplit|,
and |:qall| if 'confirm' is set.
- {only in Win32 GUI}
+ {only in Win32 GUI, in console `browse edit` works
+ if the FileExplorer autocommand group exists}
When ":browse" is not possible you get an error
message. If {command} doesn't support browsing, the
{command} is executed without a dialog.
@@ -1274,10 +1275,12 @@ exist, the next-higher scope in the hierarchy applies.
*:chd* *:chdir*
:chd[ir][!] [path] Same as |:cd|.
- *:tc* *:tcd* *E5000* *E5001* *E5002*
-:tc[d][!] {path} Like |:cd|, but set the current directory for the
- current tab and window. The current directory for
- other tabs and windows is not changed.
+ *:tc* *:tcd*
+:tc[d][!] {path} Like |:cd|, but only set the directory for the current
+ tab. The current window will also use this directory.
+ The current directory is not changed for windows in
+ other tabs and for windows in the current tab that
+ have their own window-local directory.
*:tcd-*
:tc[d][!] - Change to the previous current directory (before the
@@ -1301,23 +1304,39 @@ exist, the next-higher scope in the hierarchy applies.
*:pw* *:pwd* *E187*
:pw[d] Print the current directory name.
Also see |getcwd()|.
+ *:pwd-verbose*
+ When 'verbose' is non-zero, |:pwd| will also display
+ what scope the current directory was set. Example: >
-So long as no |:tcd| or |:lcd| command has been used, all windows share the
-same "current directory". Using a command to jump to another window doesn't
+ " Set by :cd
+ :verbose pwd
+ [global] /path/to/current
+
+ " Set by :lcd
+ :verbose pwd
+ [window] /path/to/current
+
+ " Set by :tcd
+ :verbose pwd
+ [tabpage] /path/to/current
+
+So long as no |:lcd| or |:tcd| command has been used, all windows share the
+same current directory. Using a command to jump to another window doesn't
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
-local working directory the global working directory is used. When a |:cd|
-command is used, the current window and tab will lose their local current
-directories and will use the global current directory from now on. When
-a |:tcd| command is used, only the current window will lose its local working
-directory.
+local working directory the global working directory is used.
+
+When a |:cd| command is used, the current window and tab will lose their local
+current directories and will use the global current directory from now on.
+When a |:tcd| command is used, only the current window will lose its local
+working directory.
After using |:cd| the full path name will be used for reading and writing
files. On some networked file systems this may cause problems. The result of
@@ -1466,6 +1485,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 b3d5f4d7e9..6549d0b5f3 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -586,7 +586,7 @@ It is not necessary to use the "dict" attribute for a numbered function.
If you get an error for a numbered function, you can find out what it is with
a trick. Assuming the function is 42, the command is: >
- :function {42}
+ :function g:42
Functions for Dictionaries ~
@@ -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()
@@ -1307,7 +1307,7 @@ A string constant accepts these special characters:
\U.... same as \u but allows up to 8 hex numbers.
\b backspace <BS>
\e escape <Esc>
-\f formfeed <FF>
+\f formfeed 0x0C
\n newline <NL>
\r return <CR>
\t tab <Tab>
@@ -1316,7 +1316,7 @@ A string constant accepts these special characters:
\<xxx> Special key named "xxx". e.g. "\<C-W>" for CTRL-W. This is for use
in mappings, the 0x80 byte is escaped.
To use the double quote character it must be escaped: "<M-\">".
- Don't use <Char-xxxx> to get a utf-8 character, use \uxxxx as
+ Don't use <Char-xxxx> to get a UTF-8 character, use \uxxxx as
mentioned above.
Note that "\xff" is stored as the byte 255, which may be invalid in some
@@ -2313,9 +2313,10 @@ ceil({expr}) Float round {expr} up
changenr() Number current change number
chanclose({id}[, {stream}]) Number Closes a channel or one of its streams
chansend({id}, {data}) Number Writes {data} to channel
-char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
+char2nr({expr}[, {utf8}]) Number ASCII/UTF-8 value of first char in {expr}
charidx({string}, {idx} [, {countcc}])
Number char index of byte {idx} in {string}
+chdir({dir}) String change current working directory
cindent({lnum}) Number C indent for line {lnum}
clearmatches([{win}]) none clear all matches
col({expr}) Number column nr of cursor or mark
@@ -2431,13 +2432,15 @@ getloclist({nr}) List list of location list items
getloclist({nr}, {what}) Dict get specific location list properties
getmarklist([{buf}]) List list of global/local marks
getmatches([{win}]) List list of current matches
+getmousepos() Dict last known mouse position
getpid() Number process ID of Vim
getpos({expr}) List position of cursor, mark, etc.
getqflist() List list of quickfix items
getqflist({what}) Dict get specific quickfix list properties
getreg([{regname} [, 1 [, {list}]]])
- String or List contents of register
-getregtype([{regname}]) String type of register
+ String or List contents of a register
+getreginfo([{regname}]) Dict information about a register
+getregtype([{regname}]) String type of a register
gettabinfo([{expr}]) List list of tab pages
gettabvar({nr}, {varname} [, {def}])
any variable {varname} in tab {nr} or {def}
@@ -2458,7 +2461,8 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
has({feature}) Number |TRUE| if feature {feature} supported
has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key}
haslocaldir([{winnr} [, {tabnr}]])
- Number |TRUE| if current window executed |:lcd|
+ Number |TRUE| if the window executed |:lcd| or
+ the tab executed |:tcd|
hasmapto({what} [, {mode} [, {abbr}]])
Number |TRUE| if mapping to {what} exists
histadd({history}, {item}) String add an item to a history
@@ -2503,7 +2507,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
@@ -2542,7 +2546,7 @@ mode([expr]) String current editing mode
msgpackdump({list} [, {type}]) List/Blob dump objects to msgpack
msgpackparse({data}) List parse msgpack to a list of objects
nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
-nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
+nr2char({expr}[, {utf8}]) String single char with ASCII/UTF-8 value {expr}
nvim_...({args}...) any call nvim |api| functions
or({expr}, {expr}) Number bitwise OR
pathshorten({expr}) String shorten directory names in a path
@@ -2678,7 +2682,7 @@ stdioopen({dict}) Number open stdio in a headless instance.
stdpath({what}) String/List returns the standard path(s) for {what}
str2float({expr} [, {quoted}]) Float convert String to Float
str2list({expr} [, {utf8}]) List convert each character of {expr} to
- ASCII/UTF8 value
+ ASCII/UTF-8 value
str2nr({expr} [, {base} [, {quoted}]])
Number convert String to Number
strchars({expr} [, {skipcc}]) Number character length of the String {expr}
@@ -3278,6 +3282,27 @@ charidx({string}, {idx} [, {countcc}])
echo charidx('áb́ć', 6, 1) returns 4
echo charidx('áb́ć', 16) returns -1
+chdir({dir}) *chdir()*
+ Change the current working directory to {dir}. The scope of
+ the directory change depends on the directory of the current
+ window:
+ - If the current window has a window-local directory
+ (|:lcd|), then changes the window local directory.
+ - Otherwise, if the current tabpage has a local
+ directory (|:tcd|) then changes the tabpage local
+ directory.
+ - Otherwise, changes the global directory.
+ If successful, returns the previous working directory. Pass
+ this to another chdir() to restore the directory.
+ On failure, returns an empty string.
+
+ Example: >
+ let save_dir = chdir(newdir)
+ if save_dir
+ " ... do some work
+ call chdir(save_dir)
+ endif
+<
cindent({lnum}) *cindent()*
Get the amount of indent for line {lnum} according the C
indenting rules, as with 'cindent'.
@@ -3417,6 +3442,8 @@ complete_info([{what}]) *complete_info()*
"" Not in completion mode
"keyword" Keyword completion |i_CTRL-X_CTRL-N|
"ctrl_x" Just pressed CTRL-X |i_CTRL-X|
+ "scroll" Scrolling with |i_CTRL-X_CTRL-E| or
+ |i_CTRL-X_CTRL-Y|
"whole_line" Whole lines |i_CTRL-X_CTRL-L|
"files" File names |i_CTRL-X_CTRL-F|
"tags" Tags |i_CTRL-X_CTRL-]|
@@ -3827,6 +3854,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.
@@ -3866,6 +3896,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.
@@ -3893,12 +3926,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.
@@ -3984,6 +4023,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].
@@ -4090,6 +4132,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
@@ -4097,6 +4142,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
@@ -4182,6 +4230,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,
@@ -4195,12 +4246,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|.
@@ -4271,6 +4327,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'.
@@ -4279,6 +4338,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
@@ -4368,6 +4430,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
@@ -4381,6 +4446,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.
@@ -4388,6 +4456,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.
@@ -4395,6 +4466,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
@@ -4407,6 +4481,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
@@ -4432,6 +4509,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()|
@@ -4450,6 +4530,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}.
@@ -4499,7 +4582,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
@@ -4639,6 +4724,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:"
@@ -4659,8 +4747,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.
@@ -4676,6 +4767,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.
@@ -4708,7 +4802,8 @@ getchar([expr]) *getchar()*
When the user clicks a mouse button, the mouse event will be
returned. The position can then be found in |v:mouse_col|,
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
- Mouse move events will be ignored.
+ |getmousepos()| can also be used. Mouse move events will be
+ ignored.
This example positions the mouse as it would normally happen: >
let c = getchar()
if c == "\<LeftMouse>" && v:mouse_win > 0
@@ -4885,6 +4980,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:
@@ -4912,6 +5010,12 @@ getcwd([{winnr}[, {tabnr}]]) *getcwd()*
getcwd(0, 0)
< If {winnr} is -1 it is ignored, only the tab is resolved.
{winnr} can be the window number or the |window-ID|.
+ If both {winnr} and {tabnr} are -1 the global working
+ directory is returned.
+ Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
+
+ Can also be used as a |method|: >
+ GetWinnr()->getcwd()
getenv({name}) *getenv()*
Return the value of environment variable {name}. The {name}
@@ -4922,6 +5026,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
@@ -4949,6 +5056,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()*
@@ -4959,6 +5069,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
@@ -4966,6 +5079,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}.
@@ -4986,6 +5102,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.
@@ -5005,7 +5124,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: >
@@ -5028,6 +5150,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()*
@@ -5098,6 +5223,35 @@ getmatches([{win}]) *getmatches()*
'pattern': 'FIXME', 'priority': 10, 'id': 2}] >
:unlet m
<
+getmousepos() *getmousepos()*
+ Returns a Dictionary with the last known position of the
+ mouse. This can be used in a mapping for a mouse click. The
+ items are:
+ screenrow screen row
+ screencol screen column
+ winid Window ID of the click
+ winrow row inside "winid"
+ wincol column inside "winid"
+ line text line inside "winid"
+ column text column inside "winid"
+ All numbers are 1-based.
+
+ If not over a window, e.g. when in the command line, then only
+ "screenrow" and "screencol" are valid, the others are zero.
+
+ When on the status line below a window or the vertical
+ separater right of a window, the "line" and "column" values
+ are zero.
+
+ When the position is after the text then "column" is the
+ length of the text in bytes plus one.
+
+ If the mouse is over a focusable floating window then that
+ window is used.
+
+ When using |getchar()| the Vim variables |v:mouse_lnum|,
+ |v:mouse_col| and |v:mouse_winid| also provide these values.
+
*getpid()*
getpid() Return a Number which is the process ID of the Vim process.
This is a unique number, until Vim exits.
@@ -5129,6 +5283,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
@@ -5247,6 +5403,35 @@ 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:
+ regcontents List of lines contained in register
+ {regname}, like
+ |getreg|({regname}, 1, 1).
+ regtype the type of register {regname}, as in
+ |getregtype()|.
+ isunnamed Boolean flag, v:true if this register
+ is currently pointed to by the unnamed
+ register.
+ points_to for the unnamed register, gives the
+ single letter name of the register
+ currently pointed to (see |quotequote|).
+ For example, after deleting a line
+ with `dd`, this field will be "1",
+ which is the register that got the
+ deleted text.
+
+ The {regname} argument is a string. If {regname} is invalid
+ or not set, an empty Dictionary will be returned.
+ If {regname} is not specified, |v:register| is used.
+ The returned Dictionary can be passed to |setreg()|.
+
+ Can also be used as a |method|: >
+ GetRegname()->getreginfo()
getregtype([{regname}]) *getregtype()*
The result is a String, which is type of register {regname}.
@@ -5259,6 +5444,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
@@ -5272,6 +5460,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|
@@ -5282,6 +5473,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}.
@@ -5308,6 +5502,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|.
@@ -5336,6 +5533,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.
@@ -5367,6 +5567,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:
@@ -5387,6 +5590,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
@@ -5404,6 +5610,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
@@ -5441,6 +5650,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
@@ -5453,7 +5665,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: >
@@ -5489,6 +5703,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
@@ -5557,8 +5775,9 @@ has_key({dict}, {key}) *has_key()*
mydict->has_key(key)
haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()*
- The result is a Number, which is 1 when the tabpage or window
- has set a local path via |:tcd| or |:lcd|, otherwise 0.
+ The result is a Number, which is 1 when the window has set a
+ local path via |:lcd| or when {winnr} is -1 and the tabpage
+ has set a local path via |:tcd|, otherwise 0.
Tabs and windows are identified by their respective numbers,
0 means current tab or window. Missing argument implies 0.
@@ -5570,6 +5789,10 @@ haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()*
With {winnr} and {tabnr} use the window in that tabpage.
{winnr} can be the window number or the |window-ID|.
If {winnr} is -1 it is ignored, only the tab is resolved.
+ Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
+
+ 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
@@ -5585,7 +5808,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.)
@@ -5600,6 +5825,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*
@@ -5621,6 +5849,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}.
@@ -5652,6 +5884,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
@@ -5668,6 +5903,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}.
@@ -5675,6 +5913,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
@@ -5683,6 +5924,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,
@@ -5691,6 +5935,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
@@ -5709,6 +5956,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
@@ -5716,6 +5966,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
@@ -5736,6 +5988,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})
@@ -5848,6 +6102,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
@@ -5865,6 +6122,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
@@ -5890,6 +6150,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.
@@ -5936,6 +6199,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. >
@@ -5961,6 +6227,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
@@ -6145,6 +6414,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
@@ -6157,6 +6429,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()|.
@@ -6220,6 +6495,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})
@@ -6230,8 +6509,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
@@ -6250,10 +6533,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
@@ -6268,6 +6557,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'.
@@ -6275,6 +6567,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: >
@@ -6284,11 +6579,14 @@ list2str({list} [, {utf8}]) *list2str()*
join(map(list, {nr, val -> nr2char(val)}), '')
< |str2list()| does the opposite.
- When {utf8} is omitted or zero, the current 'encoding' is used.
- With {utf8} is 1, always return utf-8 characters.
- With utf-8 composing characters work as expected: >
+ UTF-8 encoding is always used, {utf8} option has no effect,
+ and exists only for backwards-compatibility.
+ 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()|.
@@ -6323,6 +6621,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
@@ -6430,6 +6731,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
@@ -6464,6 +6767,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
@@ -6526,6 +6832,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
@@ -6581,6 +6890,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}
@@ -6619,6 +6931,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.
@@ -6631,6 +6946,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,
@@ -6639,6 +6957,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: >
@@ -6658,6 +6979,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
@@ -6668,6 +6992,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")
@@ -6681,6 +7008,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: >
@@ -6699,6 +7029,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,
@@ -6789,6 +7122,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
@@ -6804,30 +7140,34 @@ 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
+ Vs Visual by line using |v_CTRL-O| in Select mode
CTRL-V Visual blockwise
+ CTRL-Vs Visual blockwise using |v_CTRL-O| in Select mode
s Select by character
S Select by line
CTRL-S Select blockwise
- vs Visual by character using |v_CTRL-O| from
- Select mode
- Vs Visual by line using |v_CTRL-O| from Select mode
- CTRL-Vs Visual blockwise using |v_CTRL-O| from Select mode
i Insert
ic Insert mode completion |compl-generic|
ix Insert mode |i_CTRL-X| completion
R Replace |R|
Rc Replace mode completion |compl-generic|
- Rv Virtual Replace |gR|
Rx Replace mode |i_CTRL-X| completion
+ Rv Virtual Replace |gR|
+ Rvc Virtual Replace mode completion |compl-generic|
+ Rvx Virtual Replace mode |i_CTRL-X| completion
c Command-line editing
cv Vim Ex mode |Q| or |gQ|
r Hit-enter prompt
rm The -- more -- prompt
- r? |:confirm| query of some sort
+ r? A |:confirm| query of some sort
! Shell or external command is executing
t Terminal mode: keys go to the job
+
This is useful in the 'statusline' option or when used
with |remote_expr()| In most other places it always returns
"c" or "n".
@@ -6836,6 +7176,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
@@ -6938,6 +7281,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: >
@@ -6952,6 +7298,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,
@@ -6980,6 +7329,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.
@@ -6995,6 +7347,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|.
@@ -7018,6 +7373,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
@@ -7250,6 +7607,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
@@ -7259,12 +7619,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,
@@ -7295,6 +7661,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
@@ -7305,12 +7674,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:
@@ -7330,6 +7705,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}.
@@ -7357,6 +7735,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
@@ -7390,6 +7771,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.
@@ -7417,6 +7801,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()*
@@ -7430,6 +7817,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
@@ -7444,6 +7834,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
@@ -7576,6 +7969,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: >
@@ -7602,6 +7998,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.
@@ -7656,6 +8055,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
@@ -8219,6 +8621,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()*
@@ -8435,8 +8840,8 @@ setreg({regname}, {value} [, {options}])
Set the register {regname} to {value}.
The {regname} argument is a string.
- {value} may be any value returned by |getreg()|, including
- a |List|.
+ {value} may be any value returned by |getreg()| or
+ |getreginfo()|, including a |List| or |Dict|.
If {options} contains "a" or {regname} is upper case,
then the value is appended.
@@ -8466,9 +8871,13 @@ setreg({regname}, {value} [, {options}])
:call setreg(v:register, @*)
:call setreg('*', @%, 'ac')
:call setreg('a', "1\n2\n3", 'b5')
+ :call setreg('"', { 'points_to': 'a'})
< This example shows using the functions to save and restore a
register: >
+ :let var_a = getreginfo()
+ :call setreg('a', var_a)
+< or: >
:let var_a = getreg('a', 1, 1)
:let var_amode = getregtype('a')
....
@@ -8906,10 +9315,9 @@ str2list({string} [, {utf8}]) *str2list()*
str2list("ABC") returns [65, 66, 67]
< |list2str()| does the opposite.
- When {utf8} is omitted or zero, the current 'encoding' is used.
- With {utf8} set to TRUE, always treat the String as utf-8
- characters. With utf-8 composing characters are handled
- properly: >
+ UTF-8 encoding is always used, {utf8} option has no effect,
+ and exists only for backwards-compatibility.
+ With UTF-8 composing characters are handled properly: >
str2list("á") returns [97, 769]
< Can also be used as a |method|: >
@@ -10921,7 +11329,7 @@ text...
literal then the items also cannot be changed: >
const ll = [1, 2, 3]
let ll[1] = 5 " Error!
-< Nested references are not locked: >
+< Nested references are not locked: >
let lvar = ['a']
const lconst = [0, lvar]
let lconst[0] = 2 " Error!
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 4d0fdd71cc..42a9993c8c 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -501,6 +501,14 @@ One command, :DiffGitCached, is provided to show a diff of the current commit
in the preview window. It is equivalent to calling "git diff --cached" plus
any arguments given to the command.
+GPROF *ft-gprof-plugin*
+
+The gprof filetype plugin defines a mapping <C-]> to jump from a function
+entry in the gprof flat profile or from a function entry in the call graph
+to the details of that function in the call graph.
+
+The mapping can be disabled with: >
+ let g:no_gprof_maps = 1
MAIL *ft-mail-plugin*
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 4a94701b2e..aaa2a35fe1 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -389,17 +389,5 @@ highlighting. So do these:
You can find the details in $VIMRUNTIME/syntax/help.vim
- *inclusion*
-Vim is for everybody, no matter race, gender or anything. Some people make a
-big deal about using "he" or "his" when referring to the user, thinking it
-means we assume the user is male. That is not the case, it's just a habit of
-writing help text, which quite often is many years old. Also, a lot of the
-text is written by contributors for whom English is not their first language.
-We do not make any assumptions about the gender of the user, no matter how the
-text is phrased. Some people have suggested using "they", but that is not
-regular English. We do not want to spend much time on this discussion. The
-goal is that the reader understands how Vim works, the exact wording is
-secondary.
-
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 2baf3a247f..a89263861b 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -55,7 +55,7 @@ Nvim on the interwebs *internet*
Nvim home page: https://neovim.io/
Nvim FAQ: https://github.com/neovim/neovim/wiki/FAQ
Downloads: https://github.com/neovim/neovim/releases
- Vim FAQ: https://vimhelp.appspot.com/vim_faq.txt.html
+ Vim FAQ: https://vimhelp.org/vim_faq.txt.html
*bugs* *bug-report*
@@ -312,7 +312,6 @@ notation meaning equivalent decimal value(s) ~
<Tab> tab CTRL-I 9 *tab* *Tab*
*linefeed*
<NL> linefeed CTRL-J 10 (used for <Nul>)
-<FF> formfeed CTRL-L 12 *formfeed*
<CR> carriage return CTRL-M 13 *carriage-return*
<Return> same as <CR> *<Return>*
<Enter> same as <CR> *<Enter>*
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 48d65a22b6..5549d3c180 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -224,6 +224,11 @@ For |lsp-request|, each |lsp-handler| has this signature: >
The ID of the |vim.lsp.client|.
{bufnr} (Buffer)
Buffer handle, or 0 for current.
+
+ {params} (table|nil)
+ The parameters used in the original request
+ which resulted in this handler
+ call.
{config} (table)
Configuration for the handler.
@@ -234,6 +239,7 @@ For |lsp-request|, each |lsp-handler| has this signature: >
To configure a particular |lsp-handler|, see:
|lsp-handler-configuration|
+
Returns: ~
The |lsp-handler| can respond by returning two values: `result, err`
Where `err` must be shaped like an RPC error:
@@ -622,6 +628,10 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
flush({client}) *vim.lsp.flush()*
TODO: Documentation
+ *vim.lsp.for_each_buffer_client()*
+for_each_buffer_client({bufnr}, {fn})
+ TODO: Documentation
+
get_active_clients() *vim.lsp.get_active_clients()*
Gets all active clients.
@@ -660,7 +670,7 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
{base} If findstart=0, text to match against
Return: ~
- (number) Decided by`findstart`:
+ (number) Decided by {findstart}:
• findstart=0: column where the completion starts, or -2
or -3
• findstart=1: list of matches (actually just calls
@@ -863,12 +873,17 @@ clear_references() *vim.lsp.buf.clear_references()*
Removes document highlights from current buffer.
code_action({context}) *vim.lsp.buf.code_action()*
- Selects a code action from the input list that is available at
- the current cursor position.
+ Selects a code action available at the current cursor
+ position.
Parameters: ~
- {context} (table, optional) Valid `CodeActionContext`
- object
+ {context} table|nil `CodeActionContext` of the LSP specification:
+ • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not
+ provided.
+ • only: (string|nil) LSP `CodeActionKind` used
+ to filter the code actions. Most language
+ servers support values like `refactor` or
+ `quickfix` .
See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
@@ -1004,13 +1019,21 @@ outgoing_calls() *vim.lsp.buf.outgoing_calls()*
cursor in the |quickfix| window. If the symbol can resolve to
multiple items, the user can pick one in the |inputlist|.
+prepare_rename({err}, {result}) *vim.lsp.buf.prepare_rename()*
+ TODO: Documentation
+
*vim.lsp.buf.range_code_action()*
range_code_action({context}, {start_pos}, {end_pos})
Performs |vim.lsp.buf.code_action()| for a given range.
Parameters: ~
- {context} (table, optional) Valid `CodeActionContext`
- object
+ {context} table|nil `CodeActionContext` of the LSP specification:
+ • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not
+ provided.
+ • only: (string|nil) LSP `CodeActionKind`
+ used to filter the code actions. Most
+ language servers support values like
+ `refactor` or `quickfix` .
{start_pos} ({number, number}, optional) mark-indexed
position. Defaults to the start of the last
visual selection.
@@ -1235,8 +1258,8 @@ apply_text_edits({text_edits}, {bufnr})
Applies a list of text edits to a buffer.
Parameters: ~
- {text_edits} (table) list of `TextEdit` objects
- {buf_nr} (number) Buffer id
+ {text_edits} table list of `TextEdit` objects
+ {bufnr} number Buffer id
See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
@@ -1456,6 +1479,13 @@ make_floating_popup_options({width}, {height}, {opts})
{width} (number) window width (in character cells)
{height} (number) window height (in character cells)
{opts} (table, optional)
+ • offset_x (number) offset to add to `col`
+ • offset_y (number) offset to add to `row`
+ • border (string or table) override `border`
+ • focusable (string or table) override
+ `focusable`
+ • zindex (string or table) override `zindex` ,
+ defaults to 50
Return: ~
(table) Options
@@ -1546,10 +1576,6 @@ open_floating_preview({contents}, {syntax}, {opts})
height when wrap is enabled
• max_width maximal width of floating window
• max_height maximal height of floating window
- • pad_left number of columns to pad contents
- at left
- • pad_right number of columns to pad contents
- at right
• pad_top number of lines to pad contents at
top
• pad_bottom number of lines to pad contents
@@ -1569,10 +1595,10 @@ parse_snippet({input}) *vim.lsp.util.parse_snippet()*
Parses snippets in a completion entry.
Parameters: ~
- {input} (string) unparsed snippet
+ {input} string unparsed snippet
Return: ~
- (string) parsed snippet
+ string parsed snippet
preview_location({location}, {opts}) *vim.lsp.util.preview_location()*
Previews a location in a floating window
@@ -1633,10 +1659,6 @@ stylize_markdown({bufnr}, {contents}, {opts})
height
• max_width maximal width of floating window
• max_height maximal height of floating window
- • pad_left number of columns to pad contents
- at left
- • pad_right number of columns to pad contents
- at right
• pad_top number of lines to pad contents at
top
• pad_bottom number of lines to pad contents
@@ -1703,6 +1725,16 @@ get_filename() *vim.lsp.log.get_filename()*
Return: ~
(string) log filename
+get_level() *vim.lsp.log.get_level()*
+ TODO: Documentation
+
+set_format_func({handle}) *vim.lsp.log.set_format_func()*
+ Sets formatting function used to format logs
+
+ Parameters: ~
+ {handle} function function to apply to logging arguments,
+ pass vim.inspect for multi-line formatting
+
set_level({level}) *vim.lsp.log.set_level()*
Sets the current log level.
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 53d68fa5e6..fe94e89e2a 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -928,6 +928,7 @@ Example: >
vim.g.foo = 5 -- Set the g:foo Vimscript variable.
print(vim.g.foo) -- Get and print the g:foo Vimscript variable.
vim.g.foo = nil -- Delete (:unlet) the Vimscript variable.
+ vim.b[2].foo = 6 -- Set b:foo for buffer 2
vim.g *vim.g*
Global (|g:|) editor variables.
@@ -935,15 +936,18 @@ vim.g *vim.g*
vim.b *vim.b*
Buffer-scoped (|b:|) variables for the current buffer.
- Invalid or unset key returns `nil`.
+ Invalid or unset key returns `nil`. Can be indexed with
+ an integer to access variables for a specific buffer.
vim.w *vim.w*
Window-scoped (|w:|) variables for the current window.
- Invalid or unset key returns `nil`.
+ Invalid or unset key returns `nil`. Can be indexed with
+ an integer to access variables for a specific window.
vim.t *vim.t*
Tabpage-scoped (|t:|) variables for the current tabpage.
- Invalid or unset key returns `nil`.
+ Invalid or unset key returns `nil`. Can be indexed with
+ an integer to access variables for a specific tabpage.
vim.v *vim.v*
|v:| variables.
@@ -1206,6 +1210,36 @@ notify({msg}, {log_level}, {_opts}) *vim.notify()*
See also: ~
:help nvim_notify
+on_key({fn}, {ns_id}) *vim.on_key()*
+ Adds Lua function {fn} with namespace id {ns_id} as a listener
+ to every, yes every, input key.
+
+ The Nvim command-line option |-w| is related but does not
+ support callbacks and cannot be toggled dynamically.
+
+ Note:
+ {fn} will not be cleared by |nvim_buf_clear_namespace()|
+
+ Note:
+ {fn} will receive the keys after mappings have been
+ evaluated
+
+ Parameters: ~
+ {fn} function: Callback function. It should take one
+ string argument. On each key press, Nvim passes
+ the key char to fn(). |i_CTRL-V| If {fn} is nil,
+ it removes the callback for the associated
+ {ns_id}
+ {ns_id} number? Namespace ID. If nil or 0, generates and
+ returns a new |nvim_create_namesapce()| id.
+
+ Return: ~
+ number Namespace id associated with {fn}. Or count of all
+ callbacks if on_key() is called without arguments.
+
+ Note:
+ {fn} will be removed if an error occurs while calling.
+
paste({lines}, {phase}) *vim.paste()*
Paste handler, invoked by |nvim_paste()| when a conforming UI
(such as the |TUI|) pastes text into the editor.
@@ -1268,8 +1302,7 @@ schedule_wrap({cb}) *vim.schedule_wrap()*
deep_equal({a}, {b}) *vim.deep_equal()*
Deep compare values for equality
- Tables are compared recursively unless they both provide the `eq` methamethod.
- All other types are compared using the equality `==` operator.
+ Tables are compared recursively unless they both provide the `eq` methamethod. All other types are compared using the equality `==` operator.
Parameters: ~
{a} first value
@@ -1373,20 +1406,25 @@ pesc({s}) *vim.pesc()*
See also: ~
https://github.com/rxi/lume
-split({s}, {sep}, {plain}) *vim.split()*
+split({s}, {sep}, {kwargs}) *vim.split()*
Splits a string at each instance of a separator.
Examples: >
- split(":aa::b:", ":") --> {'','aa','','b',''}
- split("axaby", "ab?") --> {'','x','y'}
- split(x*yz*o, "*", true) --> {'x','yz','o'}
+
+ split(":aa::b:", ":") --> {'','aa','','b',''}
+ split("axaby", "ab?") --> {'','x','y'}
+ split("x*yz*o", "*", {plain=true}) --> {'x','yz','o'}
+ split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
<
Parameters: ~
- {s} String to split
- {sep} Separator string or pattern
- {plain} If `true` use `sep` literally (passed to
- String.find)
+ {s} String to split
+ {sep} Separator string or pattern
+ {kwargs} Keyword arguments:
+ • plain: (boolean) If `true` use `sep` literally
+ (passed to string.find)
+ • trimempty: (boolean) If `true` remove empty
+ items from the front and back of the list
Return: ~
List-like table of the split components.
@@ -1484,7 +1522,7 @@ tbl_flatten({t}) *vim.tbl_flatten()*
Flattened copy of the given list-like table.
See also: ~
- Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua
+ From https://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_isempty({t}) *vim.tbl_isempty()*
Checks if a table is empty.
@@ -1520,7 +1558,7 @@ tbl_keys({t}) *vim.tbl_keys()*
list of keys
See also: ~
- Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua
+ From https://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_map({func}, {t}) *vim.tbl_map()*
Apply a function to all values of a table.
@@ -1571,12 +1609,14 @@ validate({opt}) *vim.validate()*
vim.validate{arg1={{'foo'}, 'table'}, arg2={'foo', 'string'}}
=> NOP (success)
-
- vim.validate{arg1={1, 'table'}}
- => error('arg1: expected table, got number')
-
- vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}}
- => error('arg1: expected even number, got 3')
+<
+>
+ vim.validate{arg1={1, 'table'}}
+ => error('arg1: expected table, got number')
+<
+>
+ vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}}
+ => error('arg1: expected even number, got 3')
<
Parameters: ~
@@ -1645,4 +1685,25 @@ uri_to_fname({uri}) *vim.uri_to_fname()*
Return: ~
Filename
+
+==============================================================================
+Lua module: ui *lua-ui*
+
+select({items}, {opts}, {on_choice}) *vim.ui.select()*
+ Prompts the user to pick a single item from a collection of
+ entries
+
+ Parameters: ~
+ {items} table Arbitrary items
+ {opts} table Additional options
+ • prompt (string|nil) Text of the prompt.
+ Defaults to `Select one of:`
+ • format_item (function item -> text)
+ Function to format an individual item from
+ `items` . Defaults to `tostring` .
+ {on_choice} function ((item|nil, idx|nil) -> ()) Called
+ once the user made a choice. `idx` is the
+ 1-based index of `item` within `item` . `nil`
+ if the user aborted the dialog.
+
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index a6c797a860..3bbf36c642 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -663,7 +663,7 @@ This file explains what characters are available in UTF-8 and CP1255 encodings,
and what the keymaps are to get those characters:
glyph encoding keymap ~
-Char utf-8 cp1255 hebrew hebrewp name ~
+Char UTF-8 cp1255 hebrew hebrewp name ~
א 0x5d0 0xe0 t a 'alef
ב 0x5d1 0xe1 c b bet
ג 0x5d2 0xe2 d g gimel
@@ -716,11 +716,11 @@ Vowel marks and special punctuation:
ױ 0x5f1 0xd5 VY VY vav-yod
ײ 0x5f2 0xd6 YY YY yod-yod
-The following are only available in utf-8
+The following are only available in UTF-8
Cantillation marks:
glyph
-Char utf-8 hebrew name
+Char UTF-8 hebrew name
ב֑ 0x591 C: etnahta
ב֒ 0x592 Cs segol
ב֓ 0x593 CS shalshelet
@@ -803,7 +803,7 @@ ASCII. On MS-Windows UTF-16 is also used (previously UCS-2), which uses
internally.
Vim has comprehensive UTF-8 support. It works well in:
-- xterm with utf-8 support enabled
+- xterm with UTF-8 support enabled
- MS-Windows GUI
- several other platforms
@@ -814,14 +814,14 @@ a space to fill the gap.
*bom-bytes*
When reading a file a BOM (Byte Order Mark) can be used to recognize the
Unicode encoding:
- EF BB BF utf-8
- FE FF utf-16 big endian
- FF FE utf-16 little endian
- 00 00 FE FF utf-32 big endian
- FF FE 00 00 utf-32 little endian
-
-Utf-8 is the recommended encoding. Note that it's difficult to tell utf-16
-and utf-32 apart. Utf-16 is often used on MS-Windows, utf-32 is not
+ EF BB BF UTF-8
+ FE FF UTF-16 big endian
+ FF FE UTF-16 little endian
+ 00 00 FE FF UTF-32 big endian
+ FF FE 00 00 UTF-32 little endian
+
+UTF-8 is the recommended encoding. Note that it's difficult to tell UTF-16
+and UTF-32 apart. UTF-16 is often used on MS-Windows, UTF-32 is not
widespread as file format.
@@ -888,10 +888,10 @@ Motif. Use the ":hi Menu font={fontname}" command for this. |:highlight|
TYPING UTF-8 *utf-8-typing*
If you are using X-Windows, you should find an input method that supports
-utf-8.
+UTF-8.
-If your system does not provide support for typing utf-8, you can use the
-'keymap' feature. This allows writing a keymap file, which defines a utf-8
+If your system does not provide support for typing UTF-8, you can use the
+'keymap' feature. This allows writing a keymap file, which defines a UTF-8
character as a sequence of ASCII characters. See |mbyte-keymap|.
If everything else fails, you can type any character as four hex bytes: >
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 853d774232..be397117b2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1159,9 +1159,9 @@ A jump table for the options with a short description can be found at |Q_op|.
'cdpath' 'cd' string (default: equivalent to $CDPATH or ",,")
global
This is a list of directories which will be searched when using the
- |:cd| and |:lcd| commands, provided that the directory being searched
- for has a relative path, not an absolute part starting with "/", "./"
- or "../", the 'cdpath' option is not used then.
+ |:cd|, |:tcd| and |:lcd| commands, provided that the directory being
+ searched for has a relative path, not an absolute part starting with
+ "/", "./" or "../", the 'cdpath' option is not used then.
The 'cdpath' option's value has the same form and semantics as
|'path'|. Also see |file-searching|.
The default value is taken from $CDPATH, with a "," prepended to look
@@ -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.
@@ -6821,8 +6821,9 @@ A jump table for the options with a short description can be found at |Q_op|.
More info here: |cmdline-completion|.
The character is not recognized when used inside a macro. See
'wildcharm' for that.
+ Some keys will not work, such as CTRL-C, <CR> and Enter.
Although 'wc' is a number option, you can set it to a special key: >
- :set wc=<Esc>
+ :set wc=<Tab>
<
*'wildcharm'* *'wcm'*
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/pi_health.txt b/runtime/doc/pi_health.txt
index bb688770fc..179c1066cd 100644
--- a/runtime/doc/pi_health.txt
+++ b/runtime/doc/pi_health.txt
@@ -5,7 +5,7 @@ Author: TJ DeVries <devries.timothyj@gmail.com>
Type |gO| to see the table of contents.
==============================================================================
-Introduction *health*
+Introduction *health*
health.vim is a minimal framework to help with troubleshooting user
configuration. Nvim ships with healthchecks for configuration, performance,
@@ -18,65 +18,136 @@ To run the healthchecks, use this command: >
Plugin authors are encouraged to write new healthchecks. |health-dev|
==============================================================================
-Commands *health-commands*
+Commands *health-commands*
- *:checkhealth* *:CheckHealth*
+ *:checkhealth* *:CheckHealth*
:checkhealth Run all healthchecks.
- *E5009*
- Nvim depends on |$VIMRUNTIME| and 'runtimepath' to find
- the standard "runtime files" for syntax highlighting,
- filetype-specific behavior, and standard plugins
- (including :checkhealth). If the runtime files cannot
- be found then those features will not work.
+ *E5009*
+ Nvim depends on |$VIMRUNTIME|, 'runtimepath' and 'packpath' to
+ find the standard "runtime files" for syntax highlighting,
+ filetype-specific behavior, and standard plugins (including
+ :checkhealth). If the runtime files cannot be found then
+ those features will not work.
:checkhealth {plugins}
- Run healthcheck(s) for one or more plugins. E.g. to run
- only the standard Nvim healthcheck: >
+ Run healthcheck(s) for one or more plugins. E.g. to run only
+ the standard Nvim healthcheck: >
:checkhealth nvim
-< To run the healthchecks for the "foo" and "bar" plugins
- (assuming these plugins are on your 'runtimepath' and
- they have implemented health#foo#check() and
- health#bar#check(), respectively): >
+<
+ To run the healthchecks for the "foo" and "bar" plugins
+ (assuming these plugins are on 'runtimepath' or 'packpath' and
+ they have implemented the Lua or Vimscript interface
+ require("foo.health").check() and health#bar#check(),
+ respectively): >
:checkhealth foo bar
<
+ To run healthchecks for lua submodules, use dot notation or
+ "*" to refer to all submodules. For example nvim provides
+ `vim.lsp` and `vim.treesitter` >
+ :checkhealth vim.lsp vim.treesitter
+ :checkhealth vim*
+<
==============================================================================
-Functions *health-functions*
+Lua Functions *health-functions-lua* *health-lua*
+
+The Lua "health" module can be used to create new healthchecks (see also
+|health-functions-vim|). To get started, simply use: >
+ local health = require('health')
+<
+health.report_start({name}) *health.report_start()*
+ Starts a new report. Most plugins should call this only once, but if
+ you want different sections to appear in your report, call this once
+ per section.
+
+health.report_info({msg}) *health.report_info()*
+ Reports an informational message.
+
+health.report_ok({msg}) *health.report_ok()*
+ Reports a "success" message.
+
+health.report_warn({msg} [, {advice}]) *health.report_warn()*
+ Reports a warning. {advice} is an optional List of suggestions.
+
+health.report_error({msg} [, {advice}]) *health.report_error()*
+ Reports an error. {advice} is an optional List of suggestions.
+
+==============================================================================
+Create a Lua healthcheck *health-dev-lua*
+
+Healthchecks are functions that check the user environment, configuration,
+etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/.
-health.vim functions are for creating new healthchecks. They mostly just do
-some layout and formatting, to give users a consistent presentation.
+To add a new healthcheck for your own plugin, simply define a Lua module in
+your plugin that returns a table with a "check()" function. |:checkhealth|
+will automatically find and invoke this function.
-health#report_start({name}) *health#report_start*
- Starts a new report. Most plugins should call this only once, but if
+If your plugin is named "foo", then its healthcheck module should be a file in
+one of these locations on 'runtimepath' or 'packpath':
+ - lua/foo/health/init.lua
+ - lua/foo/health.lua
+
+If your plugin provides a submodule named "bar" for which you want a separate
+healthcheck, define the healthcheck at one of these locations on 'runtimepath'
+or 'packpath':
+ - lua/foo/bar/health/init.lua
+ - lua/foo/bar/health.lua
+
+All submodules should return a Lua table containing the method `check()`.
+
+Copy this sample code into `lua/foo/health/init.lua` or `lua/foo/health.lua`,
+replacing "foo" in the path with your plugin name: >
+
+ local M = {}
+ local health = require("health")
+
+ M.check = function()
+ health.report_start("my_plugin report")
+ -- make sure setup function parameters are ok
+ if check_setup() then
+ health.report_ok("Setup function is correct")
+ else
+ health.report_error("Setup function is incorrect")
+ end
+ -- do some more checking
+ -- ...
+ end
+
+ return M
+
+==============================================================================
+Vimscript Functions *health-functions-vimscript* *health-vimscript*
+
+health.vim functions are for creating new healthchecks. (See also
+|health-functions-lua|)
+
+health#report_start({name}) *health#report_start*
+ Starts a new report. Most plugins should call this only once, but if
you want different sections to appear in your report, call this once
per section.
-health#report_info({msg}) *health#report_info*
- Reports an informational message.
+health#report_info({msg}) *health#report_info*
+ Reports an informational message.
-health#report_ok({msg}) *health#report_ok*
- Reports a "success" message.
+health#report_ok({msg}) *health#report_ok*
+ Reports a "success" message.
-health#report_warn({msg}, [{advice}]) *health#report_warn*
+health#report_warn({msg} [, {advice}]) *health#report_warn*
Reports a warning. {advice} is an optional List of suggestions.
-health#report_error({msg}, [{advice}]) *health#report_error*
+health#report_error({msg} [, {advice}]) *health#report_error*
Reports an error. {advice} is an optional List of suggestions.
-health#{plugin}#check() *health.user_checker*
+health#{plugin}#check() *health.user_checker*
Healthcheck function for {plugin}. Called by |:checkhealth|
automatically. Example: >
- function! health#my_plug#check() abort
- silent call s:check_environment_vars()
- silent call s:check_python_configuration()
- endfunction
+ function! health#my_plug#check() abort
+ silent call s:check_environment_vars()
+ silent call s:check_python_configuration()
+ endfunction
<
- All output will be captured from the healthcheck. Use the
- health#report_* functions so that your healthcheck has a format
- consistent with the standard healthchecks.
-
==============================================================================
-Create a healthcheck *health-dev*
+Create a healthcheck *health-dev-vim*
Healthchecks are functions that check the user environment, configuration,
etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/.
@@ -88,8 +159,8 @@ health#{plugin}#check() function in autoload/health/{plugin}.vim.
If your plugin is named "foo", then its healthcheck function must be >
health#foo#check()
-defined in this file on 'runtimepath': >
- autoload/health/foo.vim
+defined in this file on 'runtimepath' or 'packpath':
+ - autoload/health/foo.vim
Copy this sample code into autoload/health/foo.vim and replace "foo" with your
plugin name: >
@@ -97,7 +168,7 @@ plugin name: >
call health#report_start('sanity checks')
" perform arbitrary checks
" ...
-
+
if looks_good
call health#report_ok('found required dependencies')
else
@@ -106,6 +177,4 @@ plugin name: >
endif
endfunction
-==============================================================================
-
-vim:tw=78:ts=8:ft=help:fdm=marker
+vim:et:tw=78:ts=8:ft=help:fdm=marker
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index d9320ad315..f54d0429a6 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -690,7 +690,7 @@ There are a couple of points to bear in mind:
==============================================================================
8. Formfeed Characters *printing-formfeed*
-By default Vim does not do any special processing of |formfeed| control
+By default Vim does not do any special processing of formfeed control
characters. Setting the 'printoptions' formfeed item will make Vim recognize
formfeed characters and continue printing the current line at the beginning
of the first line on a new page. The use of formfeed characters provides
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 87a48e6d2a..bb775ec884 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -90,10 +90,11 @@ argument.
See |info-message| about capturing the text.
*--clean*
---clean Equivalent to "-u NONE -i NONE":
+--clean Mimics a fresh install of Nvim:
- Skips initializations from files and environment variables.
- No 'shada' file is read or written.
- Excludes user directories from 'runtimepath'
+ - Loads builtin plugins, unlike "-u NONE -i NONE".
*--noplugin*
--noplugin Skip loading plugins. Resets the 'loadplugins' option.
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index ac10aeec88..441ae13df4 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -531,9 +531,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
for id, node in pairs(match) do
local name = query.captures[id]
-- `node` was captured by the `name` capture in the match
-
- local node_data = metadata[id] -- Node level metadata
-
+<
+>
+ local node_data = metadata[id] -- Node level metadata
+<
+>
... use the info here ...
end
end
diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt
index 56fe5ada2b..f53d578456 100644
--- a/runtime/doc/usr_22.txt
+++ b/runtime/doc/usr_22.txt
@@ -202,14 +202,28 @@ the other window. This is called a local directory. >
:pwd
/home/Bram/VeryLongFileName
-So long as no ":lcd" command has been used, all windows share the same current
-directory. Doing a ":cd" command in one window will also change the current
+So long as no `:lcd` command has been used, all windows share the same current
+directory. Doing a `:cd` command in one window will also change the current
directory of the other window.
- For a window where ":lcd" has been used a different current directory is
-remembered. Using ":cd" or ":lcd" in other windows will not change it.
- When using a ":cd" command in a window that uses a different current
+ For a window where `:lcd` has been used a different current directory is
+remembered. Using `:cd` or `:lcd` in other windows will not change it.
+ When using a `:cd` command in a window that uses a different current
directory, it will go back to using the shared directory.
+
+TAB LOCAL DIRECTORY
+
+When you open a new tab page, it uses the directory of the window in the
+previous tab page from which the new tab page was opened. You can change the
+directory of the current tab page using the `:tcd` command. All the windows in
+a tab page share this directory except for windows with a window-local
+directory. Any new windows opened in this tab page will use this directory as
+the current working directory. Using a `:cd` command in a tab page will not
+change the working directory of tab pages which have a tab local directory.
+When the global working directory is changed using the ":cd" command in a tab
+page, it will also change the current tab page working directory.
+
+
==============================================================================
*22.3* Finding a file
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 5fddadcf01..6a9284dac9 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -785,9 +785,10 @@ System functions and manipulation of files:
isdirectory() check if a directory exists
getfsize() get the size of a file
getcwd() get the current working directory
- haslocaldir() check if current window used |:lcd|
+ haslocaldir() check if current window used |:lcd| or |:tcd|
tempname() get the name of a temporary file
mkdir() create a new directory
+ chdir() change current working directory
delete() delete a file
rename() rename a file
system() get the result of a shell command as a string
@@ -1025,6 +1026,7 @@ Various: *various-functions*
undotree() return the state of the undo tree
getreg() get contents of a register
+ getreginfo() get information about a register
getregtype() get type of a register
setreg() set contents and type of a register
reg_executing() return the name of the register being executed
@@ -1803,7 +1805,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/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 64824b2e3f..77bf1d29eb 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -248,6 +248,8 @@ Variables:
Nvim always builds with all features, in contrast to Vim which may have
certain features removed/added at compile-time. |feature-compile|
+Some Vim features were changed in Nvim, and vice versa.
+
If a Python interpreter is available on your `$PATH`, |:python| and |:python3|
are always available and may be used simultaneously. See |provider-python|.
@@ -423,6 +425,15 @@ Vimscript compatibility:
`shell_error` does not alias to |v:shell_error|
`this_session` does not alias to |v:this_session|
+Working directory (Vim implemented some of these later than Nvim):
+- |DirChanged| can be triggered when switching to another window.
+- |getcwd()| and |haslocaldir()| may throw errors if the tab page or window
+ cannot be found. *E5000* *E5001* *E5002*
+- |haslocaldir()| only checks for tab-local directory when -1 is passed as
+ window number, and its only possible returns values are 0 and 1.
+- `getcwd(-1)` is equivalent to `getcwd(-1, 0)` instead of returning the global
+ working directory. Use `getcwd(-1, -1)` to get the global working directory.
+
==============================================================================
5. Missing legacy features *nvim-features-missing*
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 0de04e9774..75354968e9 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2021 Aug 23
+" Last Change: 2021 Oct 03
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -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
@@ -872,6 +873,9 @@ au BufNewFile,BufRead *.json-patch setf json
" Jupyter Notebook is also json
au BufNewFile,BufRead *.ipynb setf json
+" Other files that look like json
+au BufNewFile,BufRead .babelrc,.eslintrc,.prettierrc,.firebaserc setf json
+
" JSONC
au BufNewFile,BufRead *.jsonc setf jsonc
@@ -1106,6 +1110,9 @@ au BufNewFile,BufRead *.mysql setf mysql
" Mutt setup files (must be before catch *.rc)
au BufNewFile,BufRead */etc/Muttrc.d/* call s:StarSetf('muttrc')
+" Tcl Shell RC file
+au BufNewFile,BufRead tclsh.rc setf tcl
+
" M$ Resource files
au BufNewFile,BufRead *.rc,*.rch setf rc
@@ -1136,6 +1143,9 @@ au BufNewFile,BufRead Neomuttrc setf neomuttrc
" Netrc
au BufNewFile,BufRead .netrc setf netrc
+" Nginx
+au BufNewFile,BufRead *.nginx,nginx*.conf,*nginx.conf,*/etc/nginx/*,*/usr/local/nginx/conf/*,*/nginx/*.conf setf nginx
+
" Ninja file
au BufNewFile,BufRead *.ninja setf ninja
@@ -1274,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
@@ -1508,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
@@ -1798,7 +1809,7 @@ au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata
au BufRead,BufNewFile *.task setf taskedit
" Tcl (JACL too)
-au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl
+au BufNewFile,BufRead *.tcl,*.tm,*.tk,*.itcl,*.itk,*.jacl,.tclshrc,.wishrc setf tcl
" TealInfo
au BufNewFile,BufRead *.tli setf tli
@@ -1995,14 +2006,15 @@ au BufNewFile,BufRead *.ws[fc] setf wsh
" XHTML
au BufNewFile,BufRead *.xhtml,*.xht setf xhtml
-" X Pixmap (dynamically sets colors, use BufEnter to make it work better)
-au BufEnter *.xpm
+" X Pixmap (dynamically sets colors, this used to trigger on BufEnter to make
+" it work better, but that breaks setting 'filetype' manually)
+au BufNewFile,BufRead *.xpm
\ if getline(1) =~ "XPM2" |
\ setf xpm2 |
\ else |
\ setf xpm |
\ endif
-au BufEnter *.xpm2 setf xpm2
+au BufNewFile,BufRead *.xpm2 setf xpm2
" XFree86 config
au BufNewFile,BufRead XF86Config
@@ -2291,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/8th.vim b/runtime/ftplugin/8th.vim
index 14301187d6..ad04f9ac84 100644
--- a/runtime/ftplugin/8th.vim
+++ b/runtime/ftplugin/8th.vim
@@ -1,9 +1,10 @@
" Vim ftplugin file
" Language: 8th
" Version: any
-" Last Change: 2015/11/08
+" Last Change: 2021 Sep 20
+" Last Change: 2021/09/20
" Maintainer: Ron Aaron <ron@aaron-tech.com>
-" URL: https://8th-dev.com/
+" URL: https://8th-dev.com/
" Filetypes: *.8th
" NOTE: 8th allows any non-whitespace in a name, so you need to do:
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
@@ -14,12 +15,13 @@ if exists("b:did_8thplugin")
finish
endif
-" Don't load another plugin for this buffer
+" Don't load another 8th plugin for this buffer
let b:did_8thplugin = 1
setlocal ts=2 sts=2 sw=2 et
-setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
+setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\
setlocal fo=tcrqol
setlocal matchpairs+=\::;
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
setlocal suffixesadd=.8th
+let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<"
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index 00937c2383..d4564a4aec 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Feb 01
+" Last Change: 2021 Sep 21
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -35,8 +35,11 @@ setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments properly.
-let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
-let b:match_skip = 's:comment\|string\|character\|special'
+if !exists("b:match_words")
+ let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
+ let b:match_skip = 's:comment\|string\|character\|special'
+ let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words"
+endif
" Win32 can filter files in the browse dialog
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
@@ -57,6 +60,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
\ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
\ "All Files (*.*)\t*.*\n"
endif
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
let b:man_default_sects = '3,2'
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/gprof.vim b/runtime/ftplugin/gprof.vim
index d4547ae9a6..d8974bcc84 100644
--- a/runtime/ftplugin/gprof.vim
+++ b/runtime/ftplugin/gprof.vim
@@ -1,6 +1,7 @@
-" Language: gprof
-" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
-" Last Change: 2021 Apr 08
+" Language: gprof
+" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
+" Contributors: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2021 Sep 19
" When cursor is on one line of the gprof call graph,
" calling this function jumps to this function in the call graph.
@@ -9,7 +10,7 @@ if exists("b:did_ftplugin")
endif
let b:did_ftplugin=1
-fun! <SID>GprofJumpToFunctionIndex()
+func! <SID>GprofJumpToFunctionIndex()
let l:line = getline('.')
if l:line =~ '[\d\+\]$'
" We're in a line in the call graph.
@@ -22,11 +23,14 @@ fun! <SID>GprofJumpToFunctionIndex()
call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW')
norm! zz
endif
-endfun
+endfunc
-" Pressing <C-]> on a line in the gprof flat profile or in
-" the call graph, jumps to the corresponding function inside
-" the flat profile.
-map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
+if !exists("no_plugin_maps") && !exists("no_gprof_maps")
+ " Pressing <C-]> on a line in the gprof flat profile or in
+ " the call graph, jumps to the corresponding function inside
+ " the flat profile.
+ map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
+ let b:undo_ftplugin = "silent! unmap <buffer> <C-]>"
+endif
" vim:sw=2 fdm=indent
diff --git a/runtime/ftplugin/nginx.vim b/runtime/ftplugin/nginx.vim
new file mode 100644
index 0000000000..e808db1277
--- /dev/null
+++ b/runtime/ftplugin/nginx.vim
@@ -0,0 +1,6 @@
+" Vim filetype plugin
+" Language: nginx.conf
+" Maintainer: Chris Aumann <me@chr4.org>
+" Last Change: Apr 15, 2017
+
+setlocal commentstring=#\ %s
diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim
index ce00021a69..75eebec56a 100644
--- a/runtime/ftplugin/spec.vim
+++ b/runtime/ftplugin/spec.vim
@@ -18,8 +18,8 @@ if !exists("no_plugin_maps") && !exists("no_spec_maps")
endif
endif
-if !hasmapto("call <SID>SpecChangelog(\"\")<CR>")
- noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
+if !hasmapto("call SpecChangelog(\"\")<CR>")
+ noremap <buffer> <unique> <script> <Plug>SpecChangelog :call SpecChangelog("")<CR>
endif
if !exists("*s:GetRelVer")
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/cdl.vim b/runtime/indent/cdl.vim
index fb4fe27310..0e3c6152b0 100644
--- a/runtime/indent/cdl.vim
+++ b/runtime/indent/cdl.vim
@@ -1,5 +1,6 @@
" Description: Comshare Dimension Definition Language (CDL)
-" Author: Raul Segura Acevedo <raulseguraaceved@netscape.net>
+" Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
" Last Change: Fri Nov 30 13:35:48 2001 CST
if exists("b:did_indent")
diff --git a/runtime/indent/cobol.vim b/runtime/indent/cobol.vim
index 590a729df4..01f7212602 100644
--- a/runtime/indent/cobol.vim
+++ b/runtime/indent/cobol.vim
@@ -7,6 +7,7 @@
" Ankit Jain 22.03.2019 Changes & fixes:
" Allow chars in 1st 6 columns
" #C22032019
+" Ankit Jain 24.09.2021 add b:undo_indent (request by tpope)
if exists("b:did_indent")
finish
@@ -18,6 +19,8 @@ setlocal indentexpr=GetCobolIndent(v:lnum)
setlocal indentkeys&
setlocal indentkeys+=0<*>,0/,0$,0=01,=~division,=~section,0=~end,0=~then,0=~else,0=~when,*<Return>,.
+let b:undo_indent = "setlocal expandtab< indentexpr< indentkeys<"
+
" Only define the function once.
if exists("*GetCobolIndent")
finish
diff --git a/runtime/indent/config.vim b/runtime/indent/config.vim
index c987a78d64..b840b1e391 100644
--- a/runtime/indent/config.vim
+++ b/runtime/indent/config.vim
@@ -1,9 +1,10 @@
" Vim indent file
-" Language: Autoconf configure.{ac,in} file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-12-20
-" TODO: how about nested [()]'s in one line
-" what's wrong with '\\\@!'?
+" Language: Autoconf configure.{ac,in} file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
+
+" TODO: how about nested [()]'s in one line what's wrong with '\\\@!'?
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -16,6 +17,8 @@ setlocal indentexpr=GetConfigIndent()
setlocal indentkeys=!^F,o,O,=then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
" Only define the function once.
if exists("*GetConfigIndent")
finish
diff --git a/runtime/indent/css.vim b/runtime/indent/css.vim
index 4d15b8d2dc..793f05820f 100644
--- a/runtime/indent/css.vim
+++ b/runtime/indent/css.vim
@@ -1,8 +1,10 @@
" Vim indent file
-" Language: CSS
-" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2012-05-30
-" Use of shiftwidth() added by Oleg Zubchenko.
+" Language: CSS
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
+
+" Use of shiftwidth() added by Oleg Zubchenko.
if exists("b:did_indent")
finish
@@ -13,7 +15,7 @@ setlocal indentexpr=GetCSSIndent()
setlocal indentkeys=0{,0},!^F,o,O
setlocal nosmartindent
-let b:undo_indent = "setl smartindent< indentkeys< indentexpr<"
+let b:undo_indent = "setl inde< indk< si<"
if exists("*GetCSSIndent")
finish
diff --git a/runtime/indent/d.vim b/runtime/indent/d.vim
index b5dd5e8fa7..57f9125890 100644
--- a/runtime/indent/d.vim
+++ b/runtime/indent/d.vim
@@ -1,7 +1,7 @@
" Vim indent file for the D programming language (version 0.137).
-"
" Language: D
-" Maintainer: Jason Mills<jmills@cs.mun.ca>
+" Maintainer: Jason Mills <jmills@cs.mun.ca> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
" Last Change: 2005 Nov 22
" Version: 0.1
"
diff --git a/runtime/indent/dtd.vim b/runtime/indent/dtd.vim
index 30c06aa8b2..c2b3c0c58e 100644
--- a/runtime/indent/dtd.vim
+++ b/runtime/indent/dtd.vim
@@ -1,12 +1,15 @@
" Vim indent file
-" Language: DTD (Document Type Definition for XML)
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2011-07-08
+" Language: DTD (Document Type Definition for XML)
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
setlocal indentexpr=GetDTDIndent()
setlocal indentkeys=!^F,o,O,>
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetDTDIndent")
finish
endif
diff --git a/runtime/indent/dylan.vim b/runtime/indent/dylan.vim
index 6811ec4af5..55255ddfa9 100644
--- a/runtime/indent/dylan.vim
+++ b/runtime/indent/dylan.vim
@@ -1,8 +1,9 @@
" Vim indent file
" Language: Dylan
+" Maintainer: Brent A. Fulgham <bfulgham@debian.org> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
" Version: 0.01
" Last Change: 2017 Jun 13
-" Maintainer: Brent A. Fulgham <bfulgham@debian.org>
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
diff --git a/runtime/indent/elm.vim b/runtime/indent/elm.vim
index 232c347c66..7b08de7126 100644
--- a/runtime/indent/elm.vim
+++ b/runtime/indent/elm.vim
@@ -4,7 +4,7 @@
" Original Author: Joseph Hager <ajhager@gmail.com>
" Copyright: Joseph Hager <ajhager@gmail.com>
" License: BSD3
-" Latest Revision: 2020-05-29
+" Latest Revision: 2021-09-29
" Only load this indent file when no other was loaded.
if exists('b:did_indent')
@@ -19,6 +19,8 @@ setlocal indentkeys+=0=else,0=if,0=of,0=import,0=then,0=type,0\|,0},0\],0),=-},0
setlocal nolisp
setlocal nosmartindent
+let b:undo_indent = "setl et< inde< indk< lisp< si<"
+
" Only define the function once.
if exists('*GetElmIndent')
finish
diff --git a/runtime/indent/eterm.vim b/runtime/indent/eterm.vim
index 8ee342fcfa..3accf9bff1 100644
--- a/runtime/indent/eterm.vim
+++ b/runtime/indent/eterm.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: Eterm configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-12-20
+" Language: Eterm configuration file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ setlocal indentexpr=GetEtermIndent()
setlocal indentkeys=!^F,o,O,=end
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetEtermIndent")
finish
endif
diff --git a/runtime/indent/framescript.vim b/runtime/indent/framescript.vim
index f9a274eab6..4611d34e85 100644
--- a/runtime/indent/framescript.vim
+++ b/runtime/indent/framescript.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: FrameScript
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-19
+" Language: FrameScript
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ setlocal indentexpr=GetFrameScriptIndent()
setlocal indentkeys=!^F,o,O,0=~Else,0=~EndIf,0=~EndLoop,0=~EndSub
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetFrameScriptIndent")
finish
endif
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/idlang.vim b/runtime/indent/idlang.vim
index 7402e8688e..e6a1d73775 100644
--- a/runtime/indent/idlang.vim
+++ b/runtime/indent/idlang.vim
@@ -1,7 +1,8 @@
" IDL (Interactive Data Language) indent file.
-" Language: IDL (ft=idlang)
+" Language: IDL (ft=idlang)
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
" Last change: 2017 Jun 13
-" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
diff --git a/runtime/indent/ld.vim b/runtime/indent/ld.vim
index a72a3a9548..ddf003e2de 100644
--- a/runtime/indent/ld.vim
+++ b/runtime/indent/ld.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: ld(1) script
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-12-20
+" Language: ld(1) script
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ setlocal indentexpr=GetLDIndent()
setlocal indentkeys=0{,0},!^F,o,O
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetLDIndent")
finish
endif
diff --git a/runtime/indent/mail.vim b/runtime/indent/mail.vim
index 6246b407e9..22bb0f7e12 100644
--- a/runtime/indent/mail.vim
+++ b/runtime/indent/mail.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Mail
" Maintainer: Bram Moolenaar
-" Last Change: 2009 Jun 03
+" Last Change: 2021 Sep 26
if exists("b:did_indent")
finish
@@ -11,3 +11,5 @@ let b:did_indent = 1
" What works best is auto-indenting, disable other indenting.
" For formatting see the ftplugin.
setlocal autoindent nosmartindent nocindent indentexpr=
+
+let b:undo_indent = "setl ai< cin< inde< si<"
diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim
index 4483efdbd8..76c8f83399 100644
--- a/runtime/indent/make.vim
+++ b/runtime/indent/make.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: Makefile
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2007-05-07
+" Language: Makefile
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ setlocal indentexpr=GetMakeIndent()
setlocal indentkeys=!^F,o,O,<:>,=else,=endif
setlocal nosmartindent
+let b:undo_indent = "setl ai< inde< indk<"
+
if exists("*GetMakeIndent")
finish
endif
diff --git a/runtime/indent/matlab.vim b/runtime/indent/matlab.vim
index 6390445c60..10d84602af 100644
--- a/runtime/indent/matlab.vim
+++ b/runtime/indent/matlab.vim
@@ -2,6 +2,7 @@
" Language: MATLAB
" Maintainer: Axel Forsman <axelsfor@gmail.com>
" Previous maintainer: Christophe Poucet <christophe.poucet@pandora.be>
+" Last Update: 2021-10-01
" Only load if no other indent file is loaded
if exists('b:did_indent') | finish | endif
@@ -9,6 +10,7 @@ let b:did_indent = 1
setlocal indentexpr=GetMatlabIndent()
setlocal indentkeys=!,o,O,e,0=end,0=elseif,0=case,0=otherwise,0=catch,0=function,0=elsei
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
" The value of the Function indenting format in
" MATLAB Editor/Debugger Language Preferences.
diff --git a/runtime/indent/mma.vim b/runtime/indent/mma.vim
index a76fa8ede0..ebf98b9a38 100644
--- a/runtime/indent/mma.vim
+++ b/runtime/indent/mma.vim
@@ -1,9 +1,10 @@
" Vim indent file
-" Language: Mathematica
-" Author: steve layland <layland@wolfram.com>
-" Last Change: Sat May 10 18:56:22 CDT 2005
-" Source: http://vim.sourceforge.net/scripts/script.php?script_id=1274
-" http://members.wolfram.com/layland/vim/indent/mma.vim
+" Language: Mathematica
+" Maintainer: Steve Layland <layland@wolfram.com> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
+" Last Change: Sat May 10 18:56:22 CDT 2005
+" Source: http://vim.sourceforge.net/scripts/script.php?script_id=1274
+" http://members.wolfram.com/layland/vim/indent/mma.vim
"
" NOTE:
" Empty .m files will automatically be presumed to be Matlab files
diff --git a/runtime/indent/nginx.vim b/runtime/indent/nginx.vim
new file mode 100644
index 0000000000..d4afec1c11
--- /dev/null
+++ b/runtime/indent/nginx.vim
@@ -0,0 +1,17 @@
+" Vim indent file
+" Language: nginx.conf
+" Maintainer: Chris Aumann <me@chr4.org>
+" Last Change: Apr 15, 2017
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=
+
+" cindent actually works for nginx' simple file structure
+setlocal cindent
+
+" Just make sure that the comments are not reset as defs would be.
+setlocal cinkeys-=0#
diff --git a/runtime/indent/occam.vim b/runtime/indent/occam.vim
index 4acd42e3c8..2979ac16ac 100644
--- a/runtime/indent/occam.vim
+++ b/runtime/indent/occam.vim
@@ -1,6 +1,7 @@
" Vim indent file
" Language: occam
-" Maintainer: Mario Schweigler <ms44@kent.ac.uk>
+" Maintainer: Mario Schweigler <ms44@kent.ac.uk> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
" Last Change: 23 April 2003
" Only load this indent file when no other was loaded.
diff --git a/runtime/indent/pascal.vim b/runtime/indent/pascal.vim
index 1f39fd1cad..b21b7256b2 100644
--- a/runtime/indent/pascal.vim
+++ b/runtime/indent/pascal.vim
@@ -2,11 +2,9 @@
" Language: Pascal
" Maintainer: Neil Carter <n.carter@swansea.ac.uk>
" Created: 2004 Jul 13
-" Last Change: 2021 Jul 01
+" Last Change: 2021 Sep 22
"
-" This is version 2.0, a complete rewrite.
-"
-" For further documentation, see http://psy.swansea.ac.uk/staff/carter/vim/
+" For further documentation, see https://psy.swansea.ac.uk/staff/carter/vim/
if exists("b:did_indent")
@@ -20,13 +18,14 @@ setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
setlocal indentkeys+==program,==function,==procedure,==object,==private
setlocal indentkeys+==record,==if,==else,==case
-let b:undo_indent = "setl indentkeys< indentexpr<"
+let b:undo_indent = 'setlocal indentexpr< indentkeys<'
if exists("*GetPascalIndent")
finish
endif
+" ________________________________________________________________
function! s:GetPrevNonCommentLineNum( line_num )
" Skip lines starting with a comment
@@ -44,6 +43,7 @@ function! s:GetPrevNonCommentLineNum( line_num )
endfunction
+" ________________________________________________________________
function! s:PurifyCode( line_num )
" Strip any trailing comments and whitespace
let pureline = 'TODO'
@@ -51,6 +51,7 @@ function! s:PurifyCode( line_num )
endfunction
+" ________________________________________________________________
function! GetPascalIndent( line_num )
" Line 0 always goes at column 0
@@ -184,7 +185,7 @@ function! GetPascalIndent( line_num )
endif
-" ____________________________________________________________________
+" ________________________________________________________________
" Object/Borland Pascal/Delphi Extensions
"
" Note that extended-pascal is handled here, unless it is simpler to
@@ -222,8 +223,6 @@ function! GetPascalIndent( line_num )
endif
-" ____________________________________________________________________
-
" If nothing changed, return same indent.
return indnt
endfunction
diff --git a/runtime/indent/postscr.vim b/runtime/indent/postscr.vim
index 2592bcf62f..0691cd237c 100644
--- a/runtime/indent/postscr.vim
+++ b/runtime/indent/postscr.vim
@@ -1,7 +1,8 @@
" PostScript indent file
-" Language: PostScript
-" Maintainer: Mike Williams <mrw@netcomuk.co.uk>
-" Last Change: 2nd July 2001
+" Language: PostScript
+" Maintainer: Mike Williams <mrw@netcomuk.co.uk> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2nd July 2001
"
" Only load this indent file when no other was loaded.
diff --git a/runtime/indent/prolog.vim b/runtime/indent/prolog.vim
index ecd0894166..ac03c28064 100644
--- a/runtime/indent/prolog.vim
+++ b/runtime/indent/prolog.vim
@@ -1,7 +1,8 @@
" vim: set sw=4 sts=4:
-" Maintainer : Gergely Kontra <kgergely@mcl.hu>
-" Revised on : 2002.02.18. 23:34:05
-" Language : Prolog
+" Language: Prolog
+" Maintainer: Gergely Kontra <kgergely@mcl.hu> (Invalid email address)
+" Doug Kearns <dougkearns@gmail.com>
+" Revised on: 2002.02.18. 23:34:05
" Last change by: Takuya Fujiwara, 2018 Sep 23
" TODO:
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
index 307b7f656b..668122993e 100644
--- a/runtime/indent/python.vim
+++ b/runtime/indent/python.vim
@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
-" Last Change: 2021 May 26
+" Last Change: 2021 Sep 26
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -17,6 +17,8 @@ setlocal autoindent " indentexpr isn't much help otherwise
setlocal indentexpr=GetPythonIndent(v:lnum)
setlocal indentkeys+=<:>,=elif,=except
+let b:undo_indent = "setl ai< inde< indk< lisp<"
+
" Only define the function once.
if exists("*GetPythonIndent")
finish
diff --git a/runtime/indent/readline.vim b/runtime/indent/readline.vim
index e202ddfd89..0ab0f822c3 100644
--- a/runtime/indent/readline.vim
+++ b/runtime/indent/readline.vim
@@ -1,7 +1,8 @@
" Vim indent file
-" Language: readline configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-12-20
+" Language: readline configuration file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ setlocal indentexpr=GetReadlineIndent()
setlocal indentkeys=!^F,o,O,=$else,=$endif
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetReadlineIndent")
finish
endif
diff --git a/runtime/indent/sdl.vim b/runtime/indent/sdl.vim
index 6ce30b6797..40fe63fa7c 100644
--- a/runtime/indent/sdl.vim
+++ b/runtime/indent/sdl.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: SDL
" Maintainer: Michael Piefel <entwurf@piefel.de>
-" Last Change: 10 December 2011
+" Last Change: 2021 Oct 03
" Shamelessly stolen from the Vim-Script indent file
@@ -14,6 +14,8 @@ let b:did_indent = 1
setlocal indentexpr=GetSDLIndent()
setlocal indentkeys+==~end,=~state,*<Return>
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*GetSDLIndent")
" finish
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/tcl.vim b/runtime/indent/tcl.vim
index eafb8dd568..c35150d0e0 100644
--- a/runtime/indent/tcl.vim
+++ b/runtime/indent/tcl.vim
@@ -1,8 +1,8 @@
" Vim indent file
-" Language: Tcl
-" Latest Update: Chris Heithoff <chrisheithoff@gmail.com>
+" Language: Tcl
+" Maintainer: Chris Heithoff <chrisheithoff@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2018-12-05
+" Last Change: 24 Sep 2021
if exists("b:did_indent")
finish
@@ -13,6 +13,8 @@ setlocal indentexpr=GetTclIndent()
setlocal indentkeys=0{,0},!^F,o,O,0]
setlocal nosmartindent
+let b:undo_indent = "setl inde< indk< si<"
+
if exists("*GetTclIndent")
finish
endif
diff --git a/runtime/indent/tcsh.vim b/runtime/indent/tcsh.vim
index ed08e6c6e2..93d96e7789 100644
--- a/runtime/indent/tcsh.vim
+++ b/runtime/indent/tcsh.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: C-shell (tcsh)
-" Maintainer: GI <a@b.c>, where a='gi1242+vim', b='gmail', c='com'
-" Last Modified: Sat 10 Dec 2011 09:23:00 AM EST
+" 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,10 @@ 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.
if exists("*TcshGetIndent")
@@ -39,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/indent/zimbu.vim b/runtime/indent/zimbu.vim
index 5451877ea7..0e6e2ab1d1 100644
--- a/runtime/indent/zimbu.vim
+++ b/runtime/indent/zimbu.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2016 Jan 25
+" Last Change: 2021 Sep 26
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -16,7 +16,7 @@ setlocal indentkeys=0{,0},!^F,o,O,0=ELSE,0=ELSEIF,0=CASE,0=DEFAULT,0=FINALLY
" We impose recommended defaults: no Tabs, 'shiftwidth' = 2
setlocal sw=2 et
-let b:undo_indent = "setl et< sw< ai< indentkeys< indentexpr="
+let b:undo_indent = "setl ai< cin< et< indentkeys< indentexpr< lisp< sw<"
" Only define the function once.
if exists("*GetZimbuIndent")
diff --git a/runtime/lua/health.lua b/runtime/lua/health.lua
new file mode 100644
index 0000000000..142a353bf2
--- /dev/null
+++ b/runtime/lua/health.lua
@@ -0,0 +1,23 @@
+local M = {}
+
+function M.report_start(msg)
+ vim.fn['health#report_start'](msg)
+end
+
+function M.report_info(msg)
+ vim.fn['health#report_info'](msg)
+end
+
+function M.report_ok(msg)
+ vim.fn['health#report_ok'](msg)
+end
+
+function M.report_warn(msg, ...)
+ vim.fn['health#report_warn'](msg, ...)
+end
+
+function M.report_error(msg, ...)
+ vim.fn['health#report_error'](msg, ...)
+end
+
+return M
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index c977fe0109..4cf22282a2 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -19,6 +19,7 @@ local global_diagnostic_options = {
signs = true,
underline = true,
virtual_text = true,
+ float = true,
update_in_insert = false,
severity_sort = false,
}
@@ -27,7 +28,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
@@ -48,25 +52,46 @@ local function filter_by_severity(severity, diagnostics)
end
---@private
-local function resolve_optional_value(option, namespace, bufnr)
- local enabled_val = {}
+local function prefix_source(source, diagnostics)
+ vim.validate { source = {source, function(v)
+ return v == "always" or v == "if_many"
+ end, "Invalid value for option 'source'" } }
+
+ if source == "if_many" then
+ local sources = {}
+ for _, d in pairs(diagnostics) do
+ if d.source then
+ sources[d.source] = true
+ end
+ end
+ if #vim.tbl_keys(sources) <= 1 then
+ return diagnostics
+ end
+ end
- 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
+ return vim.tbl_map(function(d)
+ if not d.source then
+ return d
end
- elseif type(option) == 'table' then
- return option
- else
- error("Unexpected option type: " .. vim.inspect(option))
+
+ local t = vim.deepcopy(d)
+ t.message = string.format("%s: %s", d.source, d.message)
+ return t
+ end, diagnostics)
+end
+
+---@private
+local function reformat_diagnostics(format, diagnostics)
+ vim.validate {
+ format = {format, 'f'},
+ diagnostics = {diagnostics, 't'},
+ }
+
+ local formatted = vim.deepcopy(diagnostics)
+ for _, diagnostic in ipairs(formatted) do
+ diagnostic.message = format(diagnostic)
end
+ return formatted
end
local all_namespaces = {}
@@ -82,9 +107,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,
@@ -96,12 +119,47 @@ local function get_namespace(ns)
end
---@private
+local function enabled_value(option, namespace)
+ local ns = namespace and get_namespace(namespace) or {}
+ if ns.opts and 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)
+ local ns = namespace and get_namespace(namespace) or {}
+ -- Do not use tbl_deep_extend so that an empty table can be used to reset to default values
+ local resolved = vim.tbl_extend('keep', opts or {}, ns.opts or {}, 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
@@ -206,7 +264,7 @@ end
---@private
local function diagnostic_lines(diagnostics)
if not diagnostics then
- return
+ return {}
end
local diagnostics_by_line = {}
@@ -222,26 +280,14 @@ local function diagnostic_lines(diagnostics)
end
---@private
-local function set_diagnostic_cache(namespace, diagnostics, bufnr)
- local buf_line_count = vim.api.nvim_buf_line_count(bufnr)
+local function set_diagnostic_cache(namespace, bufnr, diagnostics)
for _, diagnostic in ipairs(diagnostics) do
- if diagnostic.severity == nil then
- diagnostic.severity = M.severity.ERROR
- end
-
+ diagnostic.severity = diagnostic.severity and to_severity(diagnostic.severity) or M.severity.ERROR
+ diagnostic.end_lnum = diagnostic.end_lnum or diagnostic.lnum
+ diagnostic.end_col = diagnostic.end_col or diagnostic.col
diagnostic.namespace = namespace
diagnostic.bufnr = bufnr
-
- if buf_line_count > 0 then
- diagnostic.lnum = math.max(math.min(
- diagnostic.lnum, buf_line_count - 1
- ), 0)
- diagnostic.end_lnum = math.max(math.min(
- diagnostic.end_lnum, buf_line_count - 1
- ), 0)
- end
end
-
diagnostic_cache[bufnr][namespace] = diagnostics
end
@@ -310,19 +356,15 @@ local function schedule_display(namespace, bufnr, args)
local key = make_augroup_key(namespace, bufnr)
if not registered_autocmds[key] then
- vim.cmd(string.format("augroup %s", key))
- vim.cmd(" au!")
- vim.cmd(
- string.format(
- [[autocmd %s <buffer=%s> lua vim.diagnostic._execute_scheduled_display(%s, %s)]],
- table.concat(insert_leave_auto_cmds, ","),
- bufnr,
- namespace,
- bufnr
- )
- )
- vim.cmd("augroup END")
-
+ vim.cmd(string.format([[augroup %s
+ au!
+ autocmd %s <buffer=%s> lua vim.diagnostic._execute_scheduled_display(%s, %s)
+ augroup END]],
+ key,
+ table.concat(insert_leave_auto_cmds, ","),
+ bufnr,
+ namespace,
+ bufnr))
registered_autocmds[key] = true
end
end
@@ -332,56 +374,14 @@ local function clear_scheduled_display(namespace, bufnr)
local key = make_augroup_key(namespace, bufnr)
if registered_autocmds[key] then
- vim.cmd(string.format("augroup %s", key))
- vim.cmd(" au!")
- vim.cmd("augroup END")
-
+ vim.cmd(string.format([[augroup %s
+ au!
+ augroup END]], key))
registered_autocmds[key] = nil
end
end
---@private
---- Open a floating window with the provided diagnostics
----@param opts table Configuration table
---- - show_header (boolean, default true): Show "Diagnostics:" header
---- - all opts for |vim.util.open_floating_preview()| can be used here
----@param diagnostics table: The diagnostics to display
----@return table {popup_bufnr, win_id}
-local function show_diagnostics(opts, diagnostics)
- if vim.tbl_isempty(diagnostics) then return end
- local lines = {}
- local highlights = {}
- local show_header = vim.F.if_nil(opts.show_header, true)
- if show_header then
- table.insert(lines, "Diagnostics:")
- table.insert(highlights, {0, "Bold"})
- end
-
- for i, diagnostic in ipairs(diagnostics) do
- local prefix = string.format("%d. ", i)
- local hiname = floating_highlight_map[diagnostic.severity]
- assert(hiname, 'unknown severity: ' .. tostring(diagnostic.severity))
-
- local message_lines = vim.split(diagnostic.message, '\n', true)
- table.insert(lines, prefix..message_lines[1])
- table.insert(highlights, {#prefix, hiname})
- for j = 2, #message_lines do
- table.insert(lines, string.rep(' ', #prefix) .. message_lines[j])
- table.insert(highlights, {0, hiname})
- end
- end
-
- local popup_bufnr, winnr = require('vim.lsp.util').open_floating_preview(lines, 'plaintext', opts)
- for i, hi in ipairs(highlights) do
- local prefixlen, hiname = unpack(hi)
- -- Start highlight after the prefix
- vim.api.nvim_buf_add_highlight(popup_bufnr, -1, hiname, i-1, prefixlen, -1)
- end
-
- return popup_bufnr, winnr
-end
-
----@private
local function set_list(loclist, opts)
opts = opts or {}
local open = vim.F.if_nil(opts.open, true)
@@ -404,12 +404,28 @@ local function set_list(loclist, opts)
end
---@private
+--- To (slightly) improve performance, modifies diagnostics in place.
+local function clamp_line_numbers(bufnr, diagnostics)
+ local buf_line_count = vim.api.nvim_buf_line_count(bufnr)
+ if buf_line_count == 0 then
+ return
+ end
+
+ for _, diagnostic in ipairs(diagnostics) do
+ diagnostic.lnum = math.max(math.min(diagnostic.lnum, buf_line_count - 1), 0)
+ diagnostic.end_lnum = math.max(math.min(diagnostic.end_lnum, buf_line_count - 1), 0)
+ end
+end
+
+---@private
local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
position[1] = position[1] - 1
- bufnr = bufnr or vim.api.nvim_get_current_buf()
+ bufnr = get_bufnr(bufnr)
local wrap = vim.F.if_nil(opts.wrap, true)
local line_count = vim.api.nvim_buf_line_count(bufnr)
- opts.namespace = namespace
+ local diagnostics = M.get(bufnr, vim.tbl_extend("keep", opts, {namespace = namespace}))
+ clamp_line_numbers(bufnr, diagnostics)
+ local line_diagnostics = diagnostic_lines(diagnostics)
for i = 0, line_count do
local offset = i * (search_forward and 1 or -1)
local lnum = position[1] + offset
@@ -419,9 +435,7 @@ local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
end
lnum = (lnum + line_count) % line_count
end
- opts.lnum = lnum
- local line_diagnostics = M.get(bufnr, opts)
- if line_diagnostics and not vim.tbl_isempty(line_diagnostics) then
+ if line_diagnostics[lnum] and not vim.tbl_isempty(line_diagnostics[lnum]) then
local sort_diagnostics, is_next
if search_forward then
sort_diagnostics = function(a, b) return a.col < b.col end
@@ -430,15 +444,15 @@ local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
sort_diagnostics = function(a, b) return a.col > b.col end
is_next = function(diagnostic) return diagnostic.col < position[2] end
end
- table.sort(line_diagnostics, sort_diagnostics)
+ table.sort(line_diagnostics[lnum], sort_diagnostics)
if i == 0 then
- for _, v in pairs(line_diagnostics) do
+ for _, v in pairs(line_diagnostics[lnum]) do
if is_next(v) then
return v
end
end
else
- return line_diagnostics[1]
+ return line_diagnostics[lnum][1]
end
end
end
@@ -448,7 +462,7 @@ end
local function diagnostic_move_pos(opts, pos)
opts = opts or {}
- local enable_popup = vim.F.if_nil(opts.enable_popup, true)
+ local float = vim.F.if_nil(opts.float, true)
local win_id = opts.win_id or vim.api.nvim_get_current_win()
if not pos then
@@ -456,17 +470,22 @@ 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
- -- This is a bit weird... I'm surprised that we need to wait til the next tick to do this.
+ if float then
+ local float_opts = type(float) == "table" and float or {}
vim.schedule(function()
- M.show_position_diagnostics(opts.popup_opts, vim.api.nvim_win_get_buf(win_id))
+ M.open_float(
+ vim.api.nvim_win_get_buf(win_id),
+ vim.tbl_extend("keep", float_opts, {scope="cursor"})
+ )
end)
end
end
-
-- }}}
-- Public API {{{
@@ -474,10 +493,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({virtual_text = true})
+--- </pre>
+---
+--- and a diagnostic producer sets diagnostics with
+--- <pre>
+--- vim.diagnostic.set(ns, 0, diagnostics, {virtual_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:
@@ -487,9 +523,32 @@ end
--- - virtual_text: (default true) Use virtual text for diagnostics. Options:
--- * severity: Only show virtual text for diagnostics matching the given
--- severity |diagnostic-severity|
+--- * source: (string) Include the diagnostic source in virtual
+--- text. One of "always" or "if_many".
+--- * format: (function) A function that takes a diagnostic as input and
+--- returns a string. The return value is the text used to display
+--- the diagnostic. Example:
+--- <pre>
+--- function(diagnostic)
+--- if diagnostic.severity == vim.diagnostic.severity.ERROR then
+--- return string.format("E: %s", diagnostic.message)
+--- end
+--- return diagnostic.message
+--- end
+--- </pre>
--- - signs: (default true) Use signs for diagnostics. Options:
--- * severity: Only show signs for diagnostics matching the given severity
--- |diagnostic-severity|
+--- * priority: (number, default 10) Base priority to use for signs. When
+--- {severity_sort} is used, the priority of a sign is adjusted based on
+--- its severity. Otherwise, all signs use the same priority.
+--- - float: Options for floating windows:
+--- * severity: See |diagnostic-severity|.
+--- * show_header: (boolean, default true) Show "Diagnostics:" header
+--- * source: (string) Include the diagnostic source in
+--- the message. One of "always" or "if_many".
+--- * format: (function) A function that takes a diagnostic as input and returns a
+--- string. The return value is the text used to display the diagnostic.
--- - update_in_insert: (default false) Update diagnostics in Insert mode (if false,
--- diagnostics are updated on InsertLeave)
--- - severity_sort: (default false) Sort diagnostics by severity. This affects the order in
@@ -551,32 +610,36 @@ function M.set(namespace, bufnr, diagnostics, opts)
}
if vim.tbl_isempty(diagnostics) then
- return M.reset(namespace, bufnr)
- end
-
- if not diagnostic_cleanup[bufnr][namespace] then
- diagnostic_cleanup[bufnr][namespace] = true
-
- -- Clean up our data when the buffer unloads.
- vim.api.nvim_buf_attach(bufnr, false, {
- on_detach = function(_, b)
- clear_diagnostic_cache(b, namespace)
- diagnostic_cleanup[b][namespace] = nil
- end
- })
+ clear_diagnostic_cache(namespace, bufnr)
+ else
+ if not diagnostic_cleanup[bufnr][namespace] then
+ diagnostic_cleanup[bufnr][namespace] = true
+
+ -- Clean up our data when the buffer unloads.
+ vim.api.nvim_buf_attach(bufnr, false, {
+ on_detach = function(_, b)
+ clear_diagnostic_cache(b, namespace)
+ diagnostic_cleanup[b][namespace] = nil
+ end
+ })
+ end
+ set_diagnostic_cache(namespace, bufnr, diagnostics)
end
- set_diagnostic_cache(namespace, diagnostics, bufnr)
-
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")
end
+--- Get current diagnostic namespaces.
+---
+---@return table A list of active diagnostic namespaces |vim.diagnostic|.
+function M.get_namespaces()
+ return vim.deepcopy(all_namespaces)
+end
+
--- Get current diagnostics.
---
---@param bufnr number|nil Buffer number to get diagnostics from. Use 0 for
@@ -708,10 +771,9 @@ end
--- |nvim_win_get_cursor()|. Defaults to the current cursor position.
--- - wrap: (boolean, default true) Whether to loop around file or not. Similar to 'wrapscan'.
--- - severity: See |diagnostic-severity|.
---- - enable_popup: (boolean, default true) Call |vim.diagnostic.show_line_diagnostics()|
---- on jump.
---- - popup_opts: (table) Table to pass as {opts} parameter to
---- |vim.diagnostic.show_line_diagnostics()|
+--- - float: (boolean or table, default true) If "true", call |vim.diagnostic.open_float()|
+--- after moving. If a table, pass the table as the {opts} parameter to
+--- |vim.diagnostic.open_float()|.
--- - win_id: (number, default 0) Window ID
function M.goto_next(opts)
return diagnostic_move_pos(
@@ -740,16 +802,35 @@ function M._set_signs(namespace, bufnr, diagnostics, opts)
}
bufnr = get_bufnr(bufnr)
- opts = get_resolved_options({ signs = opts }, namespace, bufnr).signs
+ opts = get_resolved_options({ signs = opts }, namespace, bufnr)
- if opts and opts.severity then
- diagnostics = filter_by_severity(opts.severity, diagnostics)
+ if opts.signs and opts.signs.severity then
+ diagnostics = filter_by_severity(opts.signs.severity, diagnostics)
end
local ns = get_namespace(namespace)
define_default_signs()
+ -- 10 is the default sign priority when none is explicitly specified
+ local priority = opts.signs and opts.signs.priority or 10
+ local get_priority
+ if opts.severity_sort then
+ if type(opts.severity_sort) == "table" and opts.severity_sort.reverse then
+ get_priority = function(severity)
+ return priority + (severity - vim.diagnostic.severity.ERROR)
+ end
+ else
+ get_priority = function(severity)
+ return priority + (vim.diagnostic.severity.HINT - severity)
+ end
+ end
+ else
+ get_priority = function()
+ return priority
+ end
+ end
+
for _, diagnostic in ipairs(diagnostics) do
vim.fn.sign_place(
0,
@@ -757,7 +838,7 @@ function M._set_signs(namespace, bufnr, diagnostics, opts)
sign_highlight_map[diagnostic.severity],
bufnr,
{
- priority = opts and opts.priority,
+ priority = get_priority(diagnostic.severity),
lnum = diagnostic.lnum + 1
}
)
@@ -814,6 +895,8 @@ end
---@param opts table|nil Configuration table with the following keys:
--- - prefix: (string) Prefix to display before virtual text on line.
--- - spacing: (number) Number of spaces to insert before virtual text.
+--- - source: (string) Include the diagnostic source in virtual text. One of "always" or
+--- "if_many".
---@private
function M._set_virtual_text(namespace, bufnr, diagnostics, opts)
vim.validate {
@@ -826,12 +909,20 @@ function M._set_virtual_text(namespace, bufnr, diagnostics, opts)
bufnr = get_bufnr(bufnr)
opts = get_resolved_options({ virtual_text = opts }, namespace, bufnr).virtual_text
+ if opts and opts.format then
+ diagnostics = reformat_diagnostics(opts.format, diagnostics)
+ end
+
+ if opts and opts.source then
+ diagnostics = prefix_source(opts.source, diagnostics)
+ end
+
local buffer_line_diagnostics = diagnostic_lines(diagnostics)
for line, line_diagnostics in pairs(buffer_line_diagnostics) do
if opts and opts.severity then
line_diagnostics = filter_by_severity(opts.severity, line_diagnostics)
end
- local virt_texts = M.get_virt_text_chunks(line_diagnostics, opts)
+ local virt_texts = M._get_virt_text_chunks(line_diagnostics, opts)
if virt_texts then
vim.api.nvim_buf_set_extmark(bufnr, namespace, line, 0, {
@@ -844,13 +935,11 @@ end
--- Get virtual text chunks to display using |nvim_buf_set_extmark()|.
---
----@param line_diags table The diagnostics associated with the line.
----@param opts table|nil Configuration table with the following keys:
---- - prefix: (string) Prefix to display before virtual text on line.
---- - spacing: (number) Number of spaces to insert before virtual text.
----@return array of ({text}, {hl_group}) tuples. This can be passed directly to
---- the {virt_text} option of |nvim_buf_set_extmark()|.
-function M.get_virt_text_chunks(line_diags, opts)
+--- Exported for backward compatibility with
+--- vim.lsp.diagnostic.get_virtual_text_chunks_for_line(). When that function is eventually removed,
+--- this can be made local.
+---@private
+function M._get_virt_text_chunks(line_diags, opts)
if #line_diags == 0 then
return nil
end
@@ -983,6 +1072,8 @@ function M.show(namespace, bufnr, diagnostics, opts)
end
end
+ clamp_line_numbers(bufnr, diagnostics)
+
if opts.underline then
M._set_underline(namespace, bufnr, diagnostics, opts.underline)
end
@@ -998,61 +1089,136 @@ function M.show(namespace, bufnr, diagnostics, opts)
save_extmarks(namespace, bufnr)
end
---- Open a floating window with the diagnostics at the given position.
+--- Show diagnostics in a floating window.
---
+---@param bufnr number|nil Buffer number. Defaults to the current buffer.
---@param opts table|nil Configuration table with the same keys as
--- |vim.lsp.util.open_floating_preview()| in addition to the following:
--- - namespace: (number) Limit diagnostics to the given namespace
---- - severity: See |diagnostic-severity|.
---- - show_header: (boolean, default true) Show "Diagnostics:" header
----@param bufnr number|nil Buffer number. Defaults to the current buffer.
----@param position table|nil The (0,0)-indexed position. Defaults to the current cursor position.
----@return tuple ({popup_bufnr}, {win_id})
-function M.show_position_diagnostics(opts, bufnr, position)
+--- - scope: (string, default "buffer") Show diagnostics from the whole buffer ("buffer"),
+--- the current cursor line ("line"), or the current cursor position ("cursor").
+--- - pos: (number or table) If {scope} is "line" or "cursor", use this position rather
+--- than the cursor position. If a number, interpreted as a line number;
+--- otherwise, a (row, col) tuple.
+--- - severity_sort: (default false) Sort diagnostics by severity. Overrides the setting
+--- from |vim.diagnostic.config()|.
+--- - severity: See |diagnostic-severity|. Overrides the setting from
+--- |vim.diagnostic.config()|.
+--- - show_header: (boolean, default true) Show "Diagnostics:" header. Overrides the
+--- setting from |vim.diagnostic.config()|.
+--- - source: (string) Include the diagnostic source in the message. One of "always" or
+--- "if_many". Overrides the setting from |vim.diagnostic.config()|.
+--- - format: (function) A function that takes a diagnostic as input and returns a
+--- string. The return value is the text used to display the diagnostic.
+--- Overrides the setting from |vim.diagnostic.config()|.
+---@return tuple ({float_bufnr}, {win_id})
+function M.open_float(bufnr, opts)
vim.validate {
- opts = { opts, 't', true },
bufnr = { bufnr, 'n', true },
- position = { position, 't', true },
+ opts = { opts, 't', true },
}
opts = opts or {}
-
- opts.focus_id = "position_diagnostics"
bufnr = get_bufnr(bufnr)
- if not position then
- local curr_position = vim.api.nvim_win_get_cursor(0)
- curr_position[1] = curr_position[1] - 1
- position = curr_position
- end
- local match_position_predicate = function(diag)
- return position[1] == diag.lnum and
- position[2] >= diag.col and
- (position[2] <= diag.end_col or position[1] < diag.end_lnum)
- end
- local position_diagnostics = vim.tbl_filter(match_position_predicate, M.get(bufnr, opts))
- table.sort(position_diagnostics, function(a, b) return a.severity < b.severity end)
- return show_diagnostics(opts, position_diagnostics)
-end
+ local scope = opts.scope or "buffer"
+ local lnum, col
+ if scope == "line" or scope == "cursor" then
+ if not opts.pos then
+ local pos = vim.api.nvim_win_get_cursor(0)
+ lnum = pos[1] - 1
+ col = pos[2]
+ elseif type(opts.pos) == "number" then
+ lnum = opts.pos
+ elseif type(opts.pos) == "table" then
+ lnum, col = unpack(opts.pos)
+ else
+ error("Invalid value for option 'pos'")
+ end
+ elseif scope ~= "buffer" then
+ error("Invalid value for option 'scope'")
+ end
---- Open a floating window with the diagnostics from the given line.
----
----@param opts table Configuration table. See |vim.diagnostic.show_position_diagnostics()|.
----@param bufnr number|nil Buffer number. Defaults to the current buffer.
----@param lnum number|nil Line number. Defaults to line number of cursor.
----@return tuple ({popup_bufnr}, {win_id})
-function M.show_line_diagnostics(opts, bufnr, lnum)
- vim.validate {
- opts = { opts, 't', true },
- bufnr = { bufnr, 'n', true },
- lnum = { lnum, 'n', true },
- }
+ local diagnostics = M.get(bufnr, opts)
+ clamp_line_numbers(bufnr, diagnostics)
+
+ if scope == "line" then
+ diagnostics = vim.tbl_filter(function(d)
+ return d.lnum == lnum
+ end, diagnostics)
+ elseif scope == "cursor" then
+ -- LSP servers can send diagnostics with `end_col` past the length of the line
+ local line_length = #vim.api.nvim_buf_get_lines(bufnr, lnum, lnum + 1, true)[1]
+ diagnostics = vim.tbl_filter(function(d)
+ return d.lnum == lnum
+ and math.min(d.col, line_length - 1) <= col
+ and (d.end_col >= col or d.end_lnum > lnum)
+ end, diagnostics)
+ end
- opts = opts or {}
- opts.focus_id = "line_diagnostics"
- opts.lnum = lnum or (vim.api.nvim_win_get_cursor(0)[1] - 1)
- bufnr = get_bufnr(bufnr)
- local line_diagnostics = M.get(bufnr, opts)
- return show_diagnostics(opts, line_diagnostics)
+ if vim.tbl_isempty(diagnostics) then
+ return
+ end
+
+ local severity_sort = vim.F.if_nil(opts.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
+
+ do
+ -- Resolve options with user settings from vim.diagnostic.config
+ -- Unlike the other decoration functions (e.g. set_virtual_text, set_signs, etc.) `open_float`
+ -- does not have a dedicated table for configuration options; instead, the options are mixed in
+ -- with its `opts` table which also includes "keyword" parameters. So we create a dedicated
+ -- options table that inherits missing keys from the global configuration before resolving.
+ local t = global_diagnostic_options.float
+ local float_opts = vim.tbl_extend("keep", opts, type(t) == "table" and t or {})
+ opts = get_resolved_options({ float = float_opts }, nil, bufnr).float
+ end
+
+ local lines = {}
+ local highlights = {}
+ local show_header = vim.F.if_nil(opts.show_header, true)
+ if show_header then
+ table.insert(lines, "Diagnostics:")
+ table.insert(highlights, {0, "Bold"})
+ end
+
+ if opts.format then
+ diagnostics = reformat_diagnostics(opts.format, diagnostics)
+ end
+
+ if opts.source then
+ diagnostics = prefix_source(opts.source, diagnostics)
+ end
+
+ for i, diagnostic in ipairs(diagnostics) do
+ local prefix = string.format("%d. ", i)
+ local hiname = floating_highlight_map[diagnostic.severity]
+ local message_lines = vim.split(diagnostic.message, '\n')
+ table.insert(lines, prefix..message_lines[1])
+ table.insert(highlights, {#prefix, hiname})
+ for j = 2, #message_lines do
+ table.insert(lines, string.rep(' ', #prefix) .. message_lines[j])
+ table.insert(highlights, {0, hiname})
+ end
+ end
+
+ -- Used by open_floating_preview to allow the float to be focused
+ if not opts.focus_id then
+ opts.focus_id = scope
+ end
+ local float_bufnr, winnr = require('vim.lsp.util').open_floating_preview(lines, 'plaintext', opts)
+ for i, hi in ipairs(highlights) do
+ local prefixlen, hiname = unpack(hi)
+ -- Start highlight after the prefix
+ vim.api.nvim_buf_add_highlight(float_bufnr, -1, hiname, i-1, prefixlen, -1)
+ end
+
+ return float_bufnr, winnr
end
--- Remove all diagnostics from the given namespace.
@@ -1151,6 +1317,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 90c5872f11..9a008ac965 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
@@ -121,24 +122,34 @@ local active_clients = {}
local all_buffer_active_clients = {}
local uninitialized_clients = {}
--- Tracks all buffers attached to a client.
-local all_client_active_buffers = {}
-
---@private
--- Invokes a function for each LSP client attached to the buffer {bufnr}.
---
---@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
@@ -728,7 +739,6 @@ function lsp.start_client(config)
lsp.diagnostic.reset(client_id, all_buffer_active_clients)
changetracking.reset(client_id)
- all_client_active_buffers[client_id] = nil
for _, client_ids in pairs(all_buffer_active_clients) do
client_ids[client_id] = nil
end
@@ -757,6 +767,7 @@ function lsp.start_client(config)
rpc = rpc;
offset_encoding = offset_encoding;
config = config;
+ attached_buffers = {};
handlers = handlers;
-- for $/progress report
@@ -830,7 +841,7 @@ function lsp.start_client(config)
rpc.request('initialize', initialize_params, function(init_err, result)
assert(not init_err, tostring(init_err))
assert(result, "server sent empty result")
- rpc.notify('initialized', {[vim.type_idx]=vim.types.dictionary})
+ rpc.notify('initialized', vim.empty_dict())
client.initialized = true
uninitialized_clients[client_id] = nil
client.workspaceFolders = initialize_params.workspaceFolders
@@ -896,7 +907,7 @@ function lsp.start_client(config)
local _ = log.debug() and log.debug(log_prefix, "client.request", client_id, method, params, handler, bufnr)
return rpc.request(method, params, function(err, result)
- handler(err, result, {method=method, client_id=client_id, bufnr=bufnr})
+ handler(err, result, {method=method, client_id=client_id, bufnr=bufnr, params=params})
end)
end
@@ -975,7 +986,6 @@ function lsp.start_client(config)
lsp.diagnostic.reset(client_id, all_buffer_active_clients)
changetracking.reset(client_id)
- all_client_active_buffers[client_id] = nil
for _, client_ids in pairs(all_buffer_active_clients) do
client_ids[client_id] = nil
end
@@ -1018,6 +1028,7 @@ function lsp.start_client(config)
-- TODO(ashkan) handle errors.
pcall(config.on_attach, client, bufnr)
end
+ client.attached_buffers[bufnr] = true
end
initialize()
@@ -1128,12 +1139,6 @@ function lsp.buf_attach_client(bufnr, client_id)
})
end
- if not all_client_active_buffers[client_id] then
- all_client_active_buffers[client_id] = {}
- end
-
- table.insert(all_client_active_buffers[client_id], bufnr)
-
if buffer_client_ids[client_id] then return end
-- This is our first time attaching this client to this buffer.
buffer_client_ids[client_id] = true
@@ -1158,7 +1163,7 @@ end
--- Gets a client by id, or nil if the id is invalid.
--- The returned client may not yet be fully initialized.
--
----@param client_id client id number
+---@param client_id number client id
---
---@returns |vim.lsp.client| object, or nil
function lsp.get_client_by_id(client_id)
@@ -1167,15 +1172,11 @@ end
--- Returns list of buffers attached to client_id.
--
----@param client_id client id
+---@param client_id number client id
---@returns list of buffer ids
function lsp.get_buffers_by_client_id(client_id)
- local active_client_buffers = all_client_active_buffers[client_id]
- if active_client_buffers then
- return active_client_buffers
- else
- return {}
- end
+ local client = lsp.get_client_by_id(client_id)
+ return client and vim.tbl_keys(client.attached_buffers) or {}
end
--- Stops a client(s).
@@ -1254,33 +1255,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 +1309,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 +1328,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 +1385,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|
@@ -1392,7 +1417,7 @@ end
---@param findstart 0 or 1, decides behavior
---@param base If findstart=0, text to match against
---
----@returns (number) Decided by `findstart`:
+---@returns (number) Decided by {findstart}:
--- - findstart=0: column where the completion starts, or -2 or -3
--- - findstart=1: list of matches (actually just calls |complete()|)
function lsp.omnifunc(findstart, base)
@@ -1418,17 +1443,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
@@ -1534,5 +1579,34 @@ function lsp._with_extend(name, options, user_config)
return resulting_config
end
+
+--- Registry for client side commands.
+--- This is an extension point for plugins to handle custom commands which are
+--- not part of the core language server protocol specification.
+---
+--- The registry is a table where the key is a unique command name,
+--- and the value is a function which is called if any LSP action
+--- (code action, code lenses, ...) triggers the command.
+---
+--- If a LSP response contains a command for which no matching entry is
+--- available in this registry, the command will be executed via the LSP server
+--- using `workspace/executeCommand`.
+---
+--- The first argument to the function will be the `Command`:
+-- Command
+-- title: String
+-- command: String
+-- arguments?: any[]
+--
+--- The second argument is the `ctx` of |lsp-handler|
+lsp.commands = setmetatable({}, {
+ __newindex = function(tbl, key, value)
+ assert(type(key) == 'string', "The key for commands in `vim.lsp.commands` must be a string")
+ assert(type(value) == 'function', "Command added to `vim.lsp.commands` must be a function")
+ rawset(tbl, key, value)
+ end;
+})
+
+
return lsp
-- vim:sw=2 ts=2 et
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index 8bfcd90f12..245f29943e 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -289,7 +289,6 @@ function M.references(context)
params.context = context or {
includeDeclaration = true;
}
- params[vim.type_idx] = vim.types.dictionary
request('textDocument/references', params)
end
@@ -321,13 +320,21 @@ end
---@private
local function call_hierarchy(method)
local params = util.make_position_params()
- request('textDocument/prepareCallHierarchy', params, function(err, _, result)
+ request('textDocument/prepareCallHierarchy', params, function(err, result, ctx)
if err then
vim.notify(err.message, vim.log.levels.WARN)
return
end
local call_hierarchy_item = pick_call_hierarchy_item(result)
- vim.lsp.buf_request(0, method, { item = call_hierarchy_item })
+ local client = vim.lsp.get_client_by_id(ctx.client_id)
+ if client then
+ client.request(method, { item = call_hierarchy_item }, nil, ctx.bufnr)
+ else
+ vim.notify(string.format(
+ 'Client with id=%d disappeared during call hierarchy request', ctx.client_id),
+ vim.log.levels.WARN
+ )
+ end
end)
end
@@ -443,6 +450,93 @@ function M.clear_references()
util.buf_clear_references()
end
+
+---@private
+--
+--- This is not public because the main extension point is
+--- vim.ui.select which can be overridden independently.
+---
+--- Can't call/use vim.lsp.handlers['textDocument/codeAction'] because it expects
+--- `(err, CodeAction[] | Command[], ctx)`, but we want to aggregate the results
+--- from multiple clients to have 1 single UI prompt for the user, yet we still
+--- need to be able to link a `CodeAction|Command` to the right client for
+--- `codeAction/resolve`
+local function on_code_action_results(results, ctx)
+ local action_tuples = {}
+ for client_id, result in pairs(results) do
+ for _, action in pairs(result.result or {}) do
+ table.insert(action_tuples, { client_id, action })
+ end
+ end
+ if #action_tuples == 0 then
+ vim.notify('No code actions available', vim.log.levels.INFO)
+ return
+ end
+
+ ---@private
+ local function apply_action(action, client)
+ if action.edit then
+ util.apply_workspace_edit(action.edit)
+ end
+ if action.command then
+ local command = type(action.command) == 'table' and action.command or action
+ local fn = vim.lsp.commands[command.command]
+ if fn then
+ local enriched_ctx = vim.deepcopy(ctx)
+ enriched_ctx.client_id = client.id
+ fn(command, ctx)
+ else
+ M.execute_command(command)
+ end
+ end
+ end
+
+ ---@private
+ local function on_user_choice(action_tuple)
+ if not action_tuple then
+ return
+ end
+ -- textDocument/codeAction can return either Command[] or CodeAction[]
+ --
+ -- CodeAction
+ -- ...
+ -- edit?: WorkspaceEdit -- <- must be applied before command
+ -- command?: Command
+ --
+ -- Command:
+ -- title: string
+ -- command: string
+ -- arguments?: any[]
+ --
+ local client = vim.lsp.get_client_by_id(action_tuple[1])
+ local action = action_tuple[2]
+ if not action.edit
+ and client
+ and type(client.resolved_capabilities.code_action) == 'table'
+ and client.resolved_capabilities.code_action.resolveProvider then
+
+ client.request('codeAction/resolve', action, function(err, resolved_action)
+ if err then
+ vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
+ return
+ end
+ apply_action(resolved_action, client)
+ end)
+ else
+ apply_action(action, client)
+ end
+ end
+
+ vim.ui.select(action_tuples, {
+ prompt = 'Code actions:',
+ format_item = function(action_tuple)
+ local title = action_tuple[2].title:gsub('\r\n', '\\r\\n')
+ return title:gsub('\n', '\\n')
+ end,
+ }, on_user_choice)
+end
+
+
--- Requests code actions from all clients and calls the handler exactly once
--- with all aggregated results
---@private
@@ -450,22 +544,28 @@ local function code_action_request(params)
local bufnr = vim.api.nvim_get_current_buf()
local method = 'textDocument/codeAction'
vim.lsp.buf_request_all(bufnr, method, params, function(results)
- local actions = {}
- for _, r in pairs(results) do
- vim.list_extend(actions, r.result or {})
- end
- vim.lsp.handlers[method](nil, actions, {bufnr=bufnr, method=method})
+ on_code_action_results(results, { bufnr = bufnr, method = method, params = params })
end)
end
---- Selects a code action from the input list that is available at the current
+--- Selects a code action available at the current
--- cursor position.
---
----@param context: (table, optional) Valid `CodeActionContext` object
+---@param context table|nil `CodeActionContext` of the LSP specification:
+--- - diagnostics: (table|nil)
+--- LSP `Diagnostic[]`. Inferred from the current
+--- position if not provided.
+--- - only: (string|nil)
+--- LSP `CodeActionKind` used to filter the code actions.
+--- Most language servers support values like `refactor`
+--- or `quickfix`.
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
function M.code_action(context)
validate { context = { context, 't', true } }
- context = context or { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
+ context = context or {}
+ if not context.diagnostics then
+ context.diagnostics = vim.lsp.diagnostic.get_line_diagnostics()
+ end
local params = util.make_range_params()
params.context = context
code_action_request(params)
@@ -473,14 +573,25 @@ end
--- Performs |vim.lsp.buf.code_action()| for a given range.
---
----@param context: (table, optional) Valid `CodeActionContext` object
+---
+---@param context table|nil `CodeActionContext` of the LSP specification:
+--- - diagnostics: (table|nil)
+--- LSP `Diagnostic[]`. Inferred from the current
+--- position if not provided.
+--- - only: (string|nil)
+--- LSP `CodeActionKind` used to filter the code actions.
+--- Most language servers support values like `refactor`
+--- or `quickfix`.
---@param start_pos ({number, number}, optional) mark-indexed position.
---Defaults to the start of the last visual selection.
---@param end_pos ({number, number}, optional) mark-indexed position.
---Defaults to the end of the last visual selection.
function M.range_code_action(context, start_pos, end_pos)
validate { context = { context, 't', true } }
- context = context or { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
+ context = context or {}
+ if not context.diagnostics then
+ context.diagnostics = vim.lsp.diagnostic.get_line_diagnostics()
+ end
local params = util.make_given_range_params(start_pos, end_pos)
params.context = context
code_action_request(params)
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua
index 9cedb2f1db..63fcbe430b 100644
--- a/runtime/lua/vim/lsp/codelens.lua
+++ b/runtime/lua/vim/lsp/codelens.lua
@@ -31,10 +31,24 @@ local function execute_lens(lens, bufnr, client_id)
local line = lens.range.start.line
api.nvim_buf_clear_namespace(bufnr, namespaces[client_id], line, line + 1)
+ local command = lens.command
+ local fn = vim.lsp.commands[command.command]
+ if fn then
+ fn(command, { bufnr = bufnr, client_id = client_id })
+ return
+ end
-- Need to use the client that returned the lens → must not use buf_request
local client = vim.lsp.get_client_by_id(client_id)
assert(client, 'Client is required to execute lens, client_id=' .. client_id)
- client.request('workspace/executeCommand', lens.command, function(...)
+ local command_provider = client.server_capabilities.executeCommandProvider
+ local commands = type(command_provider) == 'table' and command_provider.commands or {}
+ if not vim.tbl_contains(commands, command.command) then
+ vim.notify(string.format(
+ "Language server does not support command `%s`. This command may require a client extension.", command.command),
+ vim.log.levels.WARN)
+ return
+ end
+ client.request('workspace/executeCommand', command, function(...)
local result = vim.lsp.handlers['workspace/executeCommand'](...)
M.refresh()
return result
@@ -77,16 +91,16 @@ function M.run()
local option = options[1]
execute_lens(option.lens, bufnr, option.client)
else
- local options_strings = {"Code lenses:"}
- for i, option in ipairs(options) do
- table.insert(options_strings, string.format('%d. %s', i, option.lens.command.title))
- end
- local choice = vim.fn.inputlist(options_strings)
- if choice < 1 or choice > #options then
- return
- end
- local option = options[choice]
- execute_lens(option.lens, bufnr, option.client)
+ vim.ui.select(options, {
+ prompt = 'Code lenses:',
+ format_item = function(option)
+ return option.lens.command.title
+ end,
+ }, function(option)
+ if option then
+ execute_lens(option.lens, bufnr, option.client)
+ end
+ end)
end
end
@@ -124,7 +138,8 @@ function M.display(lenses, bufnr, client_id)
end
end
if #chunks > 0 then
- api.nvim_buf_set_extmark(bufnr, ns, i, 0, { virt_text = chunks })
+ api.nvim_buf_set_extmark(bufnr, ns, i, 0, { virt_text = chunks,
+ hl_mode="combine" })
end
end
end
@@ -185,7 +200,8 @@ local function resolve_lenses(lenses, bufnr, client_id, callback)
ns,
lens.range.start.line,
0,
- { virt_text = {{ lens.command.title, 'LspCodeLens' }} }
+ { virt_text = {{ lens.command.title, 'LspCodeLens' }},
+ hl_mode="combine" }
)
end
countdown()
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index 148836a93a..bea0e44aca 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -102,7 +102,17 @@ local function diagnostic_lsp_to_vim(diagnostics, bufnr, client_id)
end_lnum = _end.line,
end_col = line_byte_from_position(buf_lines, _end.line, _end.character, offset_encoding),
severity = severity_lsp_to_vim(diagnostic.severity),
- message = diagnostic.message
+ message = diagnostic.message,
+ source = diagnostic.source,
+ user_data = {
+ lsp = {
+ code = diagnostic.code,
+ codeDescription = diagnostic.codeDescription,
+ tags = diagnostic.tags,
+ relatedInformation = diagnostic.relatedInformation,
+ data = diagnostic.data,
+ },
+ },
}
end, diagnostics)
end
@@ -110,7 +120,7 @@ end
---@private
local function diagnostic_vim_to_lsp(diagnostics)
return vim.tbl_map(function(diagnostic)
- return {
+ return vim.tbl_extend("error", {
range = {
start = {
line = diagnostic.lnum,
@@ -123,7 +133,8 @@ local function diagnostic_vim_to_lsp(diagnostics)
},
severity = severity_vim_to_lsp(diagnostic.severity),
message = diagnostic.message,
- }
+ source = diagnostic.source,
+ }, diagnostic.user_data and (diagnostic.user_data.lsp or {}) or {})
end, diagnostics)
end
@@ -200,9 +211,14 @@ function M.on_publish_diagnostics(_, result, ctx, config)
end
end
end
+
+ -- Persist configuration to ensure buffer reloads use the same
+ -- configuration. To make lsp.with configuration work (See :help
+ -- lsp-handler-configuration)
+ vim.diagnostic.config(config, namespace)
end
- vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id), config)
+ vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id))
-- Keep old autocmd for back compat. This should eventually be removed.
vim.api.nvim_command("doautocmd <nomodeline> User LspDiagnosticsChanged")
@@ -518,7 +534,7 @@ end
---@return an array of [text, hl_group] arrays. This can be passed directly to
--- the {virt_text} option of |nvim_buf_set_extmark()|.
function M.get_virtual_text_chunks_for_line(bufnr, _, line_diags, opts)
- return vim.diagnostic.get_virt_text_chunks(diagnostic_lsp_to_vim(line_diags, bufnr), opts)
+ return vim.diagnostic._get_virt_text_chunks(diagnostic_lsp_to_vim(line_diags, bufnr), opts)
end
--- Open a floating window with the diagnostics from {position}
@@ -535,14 +551,15 @@ end
---@param position table|nil The (0,0)-indexed position
---@return table {popup_bufnr, win_id}
function M.show_position_diagnostics(opts, buf_nr, position)
- if opts then
- if opts.severity then
- opts.severity = severity_lsp_to_vim(opts.severity)
- elseif opts.severity_limit then
- opts.severity = {min=severity_lsp_to_vim(opts.severity_limit)}
- end
+ opts = opts or {}
+ opts.scope = "cursor"
+ opts.pos = position
+ if opts.severity then
+ opts.severity = severity_lsp_to_vim(opts.severity)
+ elseif opts.severity_limit then
+ opts.severity = {min=severity_lsp_to_vim(opts.severity_limit)}
end
- return vim.diagnostic.show_position_diagnostics(opts, buf_nr, position)
+ return vim.diagnostic.open_float(buf_nr, opts)
end
--- Open a floating window with the diagnostics from {line_nr}
@@ -557,11 +574,13 @@ end
---@param client_id number|nil the client id
---@return table {popup_bufnr, win_id}
function M.show_line_diagnostics(opts, buf_nr, line_nr, client_id)
+ opts = opts or {}
+ opts.scope = "line"
+ opts.pos = line_nr
if client_id then
- opts = opts or {}
opts.namespace = M.get_namespace(client_id)
end
- return vim.diagnostic.show_line_diagnostics(opts, buf_nr, line_nr)
+ return vim.diagnostic.open_float(buf_nr, opts)
end
--- Redraw diagnostics for the given buffer and client
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 918666ab27..eff27807be 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -3,7 +3,6 @@ local protocol = require 'vim.lsp.protocol'
local util = require 'vim.lsp.util'
local vim = vim
local api = vim.api
-local buf = require 'vim.lsp.buf'
local M = {}
@@ -109,40 +108,6 @@ M['client/registerCapability'] = function(_, _, ctx)
return vim.NIL
end
---see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
-M['textDocument/codeAction'] = function(_, result)
- if result == nil or vim.tbl_isempty(result) then
- print("No code actions available")
- return
- end
-
- local option_strings = {"Code actions:"}
- for i, action in ipairs(result) do
- local title = action.title:gsub('\r\n', '\\r\\n')
- title = title:gsub('\n', '\\n')
- table.insert(option_strings, string.format("%d. %s", i, title))
- end
-
- local choice = vim.fn.inputlist(option_strings)
- if choice < 1 or choice > #result then
- return
- end
- local action_chosen = result[choice]
- -- textDocument/codeAction can return either Command[] or CodeAction[].
- -- If it is a CodeAction, it can have either an edit, a command or both.
- -- Edits should be executed first
- if action_chosen.edit or type(action_chosen.command) == "table" then
- if action_chosen.edit then
- util.apply_workspace_edit(action_chosen.edit)
- end
- if type(action_chosen.command) == "table" then
- buf.execute_command(action_chosen.command)
- end
- else
- buf.execute_command(action_chosen)
- end
-end
-
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit
M['workspace/applyEdit'] = function(_, workspace_edit)
if not workspace_edit then return end
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index 855679a2df..ed3eea59df 100644
--- a/runtime/lua/vim/lsp/health.lua
+++ b/runtime/lua/vim/lsp/health.lua
@@ -1,7 +1,7 @@
local M = {}
--- Performs a healthcheck for LSP
-function M.check_health()
+function M.check()
local report_info = vim.fn['health#report_info']
local report_warn = vim.fn['health#report_warn']
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 27703b4503..b3aa8b934f 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -645,6 +645,10 @@ function protocol.make_client_capabilities()
end)();
};
};
+ dataSupport = true;
+ resolveSupport = {
+ properties = { 'edit', }
+ };
};
completion = {
dynamicRegistration = false;
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index 7f31bbdf75..d9a684a738 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -4,34 +4,6 @@ local log = require('vim.lsp.log')
local protocol = require('vim.lsp.protocol')
local validate, schedule, schedule_wrap = vim.validate, vim.schedule, vim.schedule_wrap
--- TODO replace with a better implementation.
----@private
---- Encodes to JSON.
----
----@param data (table) Data to encode
----@returns (string) Encoded object
-local function json_encode(data)
- local status, result = pcall(vim.fn.json_encode, data)
- if status then
- return result
- else
- return nil, result
- end
-end
----@private
---- Decodes from JSON.
----
----@param data (string) Data to decode
----@returns (table) Decoded JSON object
-local function json_decode(data)
- local status, result = pcall(vim.fn.json_decode, data)
- if status then
- return result
- else
- return nil, result
- end
-end
-
---@private
--- Checks whether a given path exists and is a directory.
---@param filename (string) path to check
@@ -41,36 +13,6 @@ local function is_dir(filename)
return stat and stat.type == 'directory' or false
end
-local NIL = vim.NIL
-
----@private
-local recursive_convert_NIL
-recursive_convert_NIL = function(v, tbl_processed)
- if v == NIL then
- return nil
- elseif not tbl_processed[v] and type(v) == 'table' then
- tbl_processed[v] = true
- local inside_list = vim.tbl_islist(v)
- return vim.tbl_map(function(x)
- if not inside_list or (inside_list and type(x) == "table") then
- return recursive_convert_NIL(x, tbl_processed)
- else
- return x
- end
- end, v)
- end
-
- return v
-end
-
----@private
---- Returns its argument, but converts `vim.NIL` to Lua `nil`.
----@param v (any) Argument
----@returns (any)
-local function convert_NIL(v)
- return recursive_convert_NIL(v, {})
-end
-
---@private
--- Merges current process env with the given env and returns the result as
--- a list of "k=v" strings.
@@ -389,16 +331,13 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
--- Encodes {payload} into a JSON-RPC message and sends it to the remote
--- process.
---
- ---@param payload (table) Converted into a JSON string, see |json_encode()|
+ ---@param payload table
---@returns true if the payload could be scheduled, false if the main event-loop is in the process of closing.
local function encode_and_send(payload)
local _ = log.debug() and log.debug("rpc.send", payload)
if handle == nil or handle:is_closing() then return false end
- -- TODO(ashkan) remove this once we have a Lua json_encode
- schedule(function()
- local encoded = assert(json_encode(payload))
- stdin:write(format_message_with_content_length(encoded))
- end)
+ local encoded = vim.json.encode(payload)
+ stdin:write(format_message_with_content_length(encoded))
return true
end
@@ -488,16 +427,15 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
---@private
local function handle_body(body)
- local decoded, err = json_decode(body)
- if not decoded then
- -- on_error(client_errors.INVALID_SERVER_JSON, err)
+ local ok, decoded = pcall(vim.json.decode, body, { luanil = { object = true } })
+ if not ok then
+ on_error(client_errors.INVALID_SERVER_JSON, decoded)
return
end
local _ = log.debug() and log.debug("rpc.receive", decoded)
if type(decoded.method) == 'string' and decoded.id then
- -- Server Request
- decoded.params = convert_NIL(decoded.params)
+ local err
-- Schedule here so that the users functions don't trigger an error and
-- we can still use the result.
schedule(function()
@@ -524,22 +462,16 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
end)
-- This works because we are expecting vim.NIL here
elseif decoded.id and (decoded.result ~= vim.NIL or decoded.error ~= vim.NIL) then
- -- Server Result
- decoded.error = convert_NIL(decoded.error)
- decoded.result = convert_NIL(decoded.result)
-- 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
@@ -574,7 +506,6 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
end
elseif type(decoded.method) == 'string' then
-- Notification
- decoded.params = convert_NIL(decoded.params)
try_call(client_errors.NOTIFICATION_HANDLER_ERROR,
dispatchers.notification, decoded.method, decoded.params)
else
@@ -582,8 +513,6 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
on_error(client_errors.INVALID_SERVER_MESSAGE, decoded)
end
end
- -- TODO(ashkan) remove this once we have a Lua json_decode
- handle_body = schedule_wrap(handle_body)
local request_parser = coroutine.wrap(request_parser_loop)
request_parser()
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index e95f170427..952926b67e 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)
@@ -334,10 +335,12 @@ function M.apply_text_edits(text_edits, bufnr)
end
if is_cursor_fixed then
- vim.api.nvim_win_set_cursor(0, {
- cursor.row + 1,
- math.min(cursor.col, #(vim.api.nvim_buf_get_lines(bufnr, cursor.row, cursor.row + 1, false)[1] or ''))
- })
+ local is_valid_cursor = true
+ is_valid_cursor = is_valid_cursor and cursor.row < vim.api.nvim_buf_line_count(bufnr)
+ is_valid_cursor = is_valid_cursor and cursor.col <= #(vim.api.nvim_buf_get_lines(bufnr, cursor.row, cursor.row + 1, false)[1] or '')
+ if is_valid_cursor then
+ vim.api.nvim_win_set_cursor(0, { cursor.row + 1, cursor.col })
+ end
end
-- Remove final line if needed
@@ -951,6 +954,11 @@ end
---@param width (number) window width (in character cells)
---@param height (number) window height (in character cells)
---@param opts (table, optional)
+--- - offset_x (number) offset to add to `col`
+--- - offset_y (number) offset to add to `row`
+--- - border (string or table) override `border`
+--- - focusable (string or table) override `focusable`
+--- - zindex (string or table) override `zindex`, defaults to 50
---@returns (table) Options
function M.make_floating_popup_options(width, height, opts)
validate {
@@ -975,7 +983,7 @@ function M.make_floating_popup_options(width, height, opts)
else
anchor = anchor..'S'
height = math.min(lines_above, height)
- row = -get_border_size(opts).height
+ row = 0
end
if vim.fn.wincol() + width + (opts.offset_x or 0) <= api.nvim_get_option('columns') then
@@ -1124,8 +1132,6 @@ end
--- - wrap_at character to wrap at for computing height
--- - max_width maximal width of floating window
--- - max_height maximal height of floating window
---- - pad_left number of columns to pad contents at left
---- - pad_right number of columns to pad contents at right
--- - pad_top number of lines to pad contents at top
--- - pad_bottom number of lines to pad contents at bottom
--- - separator insert separator after code block
@@ -1376,8 +1382,6 @@ end
--- - wrap_at character to wrap at for computing height when wrap is enabled
--- - max_width maximal width of floating window
--- - max_height maximal height of floating window
---- - pad_left number of columns to pad contents at left
---- - pad_right number of columns to pad contents at right
--- - pad_top number of lines to pad contents at top
--- - pad_bottom number of lines to pad contents at bottom
--- - focus_id if a popup with this id is opened, then focus it
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 18c1e21049..b57b7ad4ad 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -98,17 +98,53 @@ end
--- <pre>
--- split(":aa::b:", ":") --> {'','aa','','b',''}
--- split("axaby", "ab?") --> {'','x','y'}
---- split(x*yz*o, "*", true) --> {'x','yz','o'}
+--- split("x*yz*o", "*", {plain=true}) --> {'x','yz','o'}
+--- split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
--- </pre>
---
+---
---@see |vim.gsplit()|
---
---@param s String to split
---@param sep Separator string or pattern
----@param plain If `true` use `sep` literally (passed to String.find)
+---@param kwargs Keyword arguments:
+--- - plain: (boolean) If `true` use `sep` literally (passed to string.find)
+--- - trimempty: (boolean) If `true` remove empty items from the front
+--- and back of the list
---@returns List-like table of the split components.
-function vim.split(s,sep,plain)
- local t={} for c in vim.gsplit(s, sep, plain) do table.insert(t,c) end
+function vim.split(s, sep, kwargs)
+ local plain
+ local trimempty = false
+ if type(kwargs) == 'boolean' then
+ -- Support old signature for backward compatibility
+ plain = kwargs
+ else
+ vim.validate { kwargs = {kwargs, 't', true} }
+ kwargs = kwargs or {}
+ plain = kwargs.plain
+ trimempty = kwargs.trimempty
+ end
+
+ local t = {}
+ local skip = trimempty
+ for c in vim.gsplit(s, sep, plain) do
+ if c ~= "" then
+ skip = false
+ end
+
+ if not skip then
+ table.insert(t, c)
+ end
+ end
+
+ if trimempty then
+ for i = #t, 1, -1 do
+ if t[i] ~= "" then
+ break
+ end
+ table.remove(t, i)
+ end
+ end
+
return t
end
diff --git a/runtime/lua/vim/treesitter/health.lua b/runtime/lua/vim/treesitter/health.lua
index e031ba1bd6..53ccc6e88d 100644
--- a/runtime/lua/vim/treesitter/health.lua
+++ b/runtime/lua/vim/treesitter/health.lua
@@ -9,7 +9,7 @@ function M.list_parsers()
end
--- Performs a healthcheck for treesitter integration
-function M.check_health()
+function M.check()
local report_info = vim.fn['health#report_info']
local report_ok = vim.fn['health#report_ok']
local report_error = vim.fn['health#report_error']
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
new file mode 100644
index 0000000000..5eab20fc54
--- /dev/null
+++ b/runtime/lua/vim/ui.lua
@@ -0,0 +1,36 @@
+local M = {}
+
+--- Prompts the user to pick a single item from a collection of entries
+---
+---@param items table Arbitrary items
+---@param opts table Additional options
+--- - prompt (string|nil)
+--- Text of the prompt. Defaults to `Select one of:`
+--- - format_item (function item -> text)
+--- Function to format an
+--- individual item from `items`. Defaults to `tostring`.
+---@param on_choice function ((item|nil, idx|nil) -> ())
+--- Called once the user made a choice.
+--- `idx` is the 1-based index of `item` within `item`.
+--- `nil` if the user aborted the dialog.
+function M.select(items, opts, on_choice)
+ vim.validate {
+ items = { items, 'table', false },
+ on_choice = { on_choice, 'function', false },
+ }
+ opts = opts or {}
+ local choices = {opts.prompt or 'Select one of:'}
+ local format_item = opts.format_item or tostring
+ for i, item in pairs(items) do
+ table.insert(choices, string.format('%d: %s', i, format_item(item)))
+ end
+ local choice = vim.fn.inputlist(choices)
+ if choice < 1 or choice > #items then
+ on_choice(nil, nil)
+ else
+ on_choice(items[choice], choice)
+ end
+end
+
+
+return M
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/plugin/diagnostic.vim b/runtime/plugin/diagnostic.vim
deleted file mode 100644
index 2183623ac8..0000000000
--- a/runtime/plugin/diagnostic.vim
+++ /dev/null
@@ -1,26 +0,0 @@
-" :help vim.diagnostic
-
-hi default DiagnosticError ctermfg=1 guifg=Red
-hi default DiagnosticWarn ctermfg=3 guifg=Orange
-hi default DiagnosticInfo ctermfg=4 guifg=LightBlue
-hi default DiagnosticHint ctermfg=7 guifg=LightGrey
-
-hi default DiagnosticUnderlineError cterm=underline gui=underline guisp=Red
-hi default DiagnosticUnderlineWarn cterm=underline gui=underline guisp=Orange
-hi default DiagnosticUnderlineInfo cterm=underline gui=underline guisp=LightBlue
-hi default DiagnosticUnderlineHint cterm=underline gui=underline guisp=LightGrey
-
-hi default link DiagnosticVirtualTextError DiagnosticError
-hi default link DiagnosticVirtualTextWarn DiagnosticWarn
-hi default link DiagnosticVirtualTextInfo DiagnosticInfo
-hi default link DiagnosticVirtualTextHint DiagnosticHint
-
-hi default link DiagnosticFloatingError DiagnosticError
-hi default link DiagnosticFloatingWarn DiagnosticWarn
-hi default link DiagnosticFloatingInfo DiagnosticInfo
-hi default link DiagnosticFloatingHint DiagnosticHint
-
-hi default link DiagnosticSignError DiagnosticError
-hi default link DiagnosticSignWarn DiagnosticWarn
-hi default link DiagnosticSignInfo DiagnosticInfo
-hi default link DiagnosticSignHint DiagnosticHint
diff --git a/runtime/syntax/8th.vim b/runtime/syntax/8th.vim
index d543489b72..ce27d10a44 100644
--- a/runtime/syntax/8th.vim
+++ b/runtime/syntax/8th.vim
@@ -1,6 +1,7 @@
" Vim syntax file
" Language: 8th
-" Version: 19.01d
+" Version: 21.08
+" Last Change: 2021 Sep 20
" Maintainer: Ron Aaron <ron@aaron-tech.com>
" URL: https://8th-dev.com/
" Filetypes: *.8th
@@ -30,246 +31,318 @@ syn match eighthClassWord "\<\S\+:.\+" contains=eighthClasses
syn keyword eighthEndOfColonDef ; i;
syn keyword eighthDefine var var,
-" Built in words
+" Built in words:
com! -nargs=+ Builtin syn keyword eighthBuiltin <args>
-"Builtin ^ < <# <#> = > - -- ,# ; ;; ! ??? / . .# ' () @ * */ \
-Builtin ! G:! #! G:#! ## G:## #> G:#> #if G:#if ' G:' ( G:( (* G:(* (:) G:(:) (code) G:(code) (getc) G:(getc)
-Builtin (gets) G:(gets) (interp) G:(interp) (needs) G:(needs) (putc) G:(putc) (puts) G:(puts) (putslim) G:(putslim)
-Builtin (say) G:(say) (stat) G:(stat) ) G:) +listener G:+listener +ref G:+ref ,# G:,# -- G:-- -----BEGIN G:-----BEGIN
-Builtin -Inf G:-Inf -Inf? G:-Inf? -listener G:-listener -ref G:-ref -rot G:-rot . G:. .# G:.# .needs G:.needs
-Builtin .r G:.r .s G:.s .stats G:.stats .ver G:.ver .with G:.with 0; G:0; 2dip G:2dip 2drop G:2drop
-Builtin 2dup G:2dup 2over G:2over 2swap G:2swap 3drop G:3drop 4drop G:4drop 8thdt? G:8thdt? 8thver? G:8thver?
-Builtin : G:: ; G:; ;; G:;; ;;; G:;;; ;then G:;then ;with G:;with <# G:<# <#> G:<#> >clip G:>clip >json G:>json
-Builtin >kind G:>kind >n G:>n >r G:>r >s G:>s ?: G:?: ??? G:??? @ G:@ Inf G:Inf Inf? G:Inf? NaN G:NaN
-Builtin NaN? G:NaN? SED-CHECK G:SED-CHECK SED: G:SED: SED: G:SED: \ G:\ ` G:` `` G:`` actor: G:actor:
-Builtin again G:again ahead G:ahead and G:and appname G:appname apropos G:apropos argc G:argc args G:args
-Builtin array? G:array? assert G:assert base G:base bi G:bi bits G:bits break G:break break? G:break?
-Builtin build? G:build? buildver? G:buildver? bye G:bye c# G:c# c/does G:c/does case G:case caseof G:caseof
-Builtin chdir G:chdir clip> G:clip> clone G:clone clone-shallow G:clone-shallow cold G:cold compat-level G:compat-level
-Builtin compile G:compile compile? G:compile? conflict G:conflict const G:const container? G:container?
-Builtin cr G:cr curlang G:curlang curry G:curry curry: G:curry: decimal G:decimal defer: G:defer: deg>rad G:deg>rad
-Builtin depth G:depth die G:die dip G:dip drop G:drop dstack G:dstack dump G:dump dup G:dup dup? G:dup?
-Builtin else G:else enum: G:enum: eval G:eval eval! G:eval! eval0 G:eval0 execnull G:execnull expect G:expect
-Builtin extra! G:extra! extra@ G:extra@ false G:false fnv G:fnv fourth G:fourth free G:free func: G:func:
-Builtin getc G:getc getcwd G:getcwd getenv G:getenv gets G:gets handler G:handler header G:header help G:help
-Builtin hex G:hex i: G:i: i; G:i; if G:if if; G:if; isa? G:isa? items-used G:items-used jcall G:jcall
-Builtin jclass G:jclass jmethod G:jmethod json-nesting G:json-nesting json-pretty G:json-pretty json-throw G:json-throw
-Builtin json> G:json> k32 G:k32 keep G:keep l: G:l: last G:last lib G:lib libbin G:libbin libc G:libc
+Builtin args #:args b #:b dhm #:dhm exec# #:exec# id2ns #:id2ns id? #:id? idd #:idd key #:key oa #:oa
+Builtin oid #:oid okey #:okey with #:with with! #:with! zip #:zip gen-secret 2fa:gen-secret gen-url 2fa:gen-url
+Builtin validate-code 2fa:validate-code ! G:! #! G:#! ## G:## #> G:#> #if G:#if ' G:' ( G:( (* G:(*
+Builtin (:) G:(:) (code) G:(code) (defer) G:(defer) (dump) G:(dump) (getc) G:(getc) (gets) G:(gets)
+Builtin (interp) G:(interp) (log) G:(log) (needs) G:(needs) (parseln) G:(parseln) (putc) G:(putc) (puts) G:(puts)
+Builtin (putslim) G:(putslim) (stat) G:(stat) (with) G:(with) ) G:) +hook G:+hook +listener G:+listener
+Builtin +ref G:+ref ,# G:,# -- G:-- -----BEGIN G:-----BEGIN -Inf G:-Inf -Inf? G:-Inf? -hook G:-hook
+Builtin -listener G:-listener -ref G:-ref -rot G:-rot . G:. .# G:.# .hook G:.hook .needs G:.needs .r G:.r
+Builtin .s G:.s .s-truncate G:.s-truncate .stats G:.stats .ver G:.ver .with G:.with 0; G:0; 2dip G:2dip
+Builtin 2drop G:2drop 2dup G:2dup 2over G:2over 2swap G:2swap 3drop G:3drop 3rev G:3rev 4drop G:4drop
+Builtin 8thdt? G:8thdt? 8thsku G:8thsku 8thver? G:8thver? 8thvernum? G:8thvernum? : G:: ; G:; ;; G:;;
+Builtin ;;; G:;;; ;with G:;with <# G:<# <#> G:<#> >clip G:>clip >json G:>json >kind G:>kind >n G:>n
+Builtin >r G:>r >s G:>s ?: G:?: @ G:@ BITMAP: G:BITMAP: ENUM: G:ENUM: FLAG: G:FLAG: Inf G:Inf Inf? G:Inf?
+Builtin NaN G:NaN NaN? G:NaN? SED-CHECK G:SED-CHECK SED: G:SED: SED: G:SED: \ G:\ _dup G:_dup _swap G:_swap
+Builtin actor: G:actor: again G:again ahead G:ahead and G:and appname G:appname apropos G:apropos argc G:argc
+Builtin args G:args array? G:array? assert G:assert base G:base bi G:bi bits G:bits break G:break break? G:break?
+Builtin breakif G:breakif build? G:build? buildver? G:buildver? bye G:bye c# G:c# c/does G:c/does case: G:case:
+Builtin catch G:catch chdir G:chdir clip> G:clip> clone G:clone clone-shallow G:clone-shallow cold G:cold
+Builtin compile G:compile compile? G:compile? compiling? G:compiling? conflict G:conflict const G:const
+Builtin container? G:container? counting-allocations G:counting-allocations cr G:cr curlang G:curlang
+Builtin curry G:curry curry: G:curry: decimal G:decimal default: G:default: defer: G:defer: deferred: G:deferred:
+Builtin deg>rad G:deg>rad depth G:depth die G:die dip G:dip drop G:drop dstack G:dstack dump G:dump
+Builtin dup G:dup dup>r G:dup>r dup? G:dup? e# G:e# enum: G:enum: error? G:error? eval G:eval eval! G:eval!
+Builtin eval0 G:eval0 execnull G:execnull expect G:expect extra! G:extra! extra@ G:extra@ false G:false
+Builtin fnv G:fnv fourth G:fourth free G:free func: G:func: getc G:getc getcwd G:getcwd getenv G:getenv
+Builtin gets G:gets handler G:handler header G:header help G:help hex G:hex i: G:i: i; G:i; isa? G:isa?
+Builtin items-used G:items-used jcall G:jcall jclass G:jclass jmethod G:jmethod json! G:json! json-8th> G:json-8th>
+Builtin json-nesting G:json-nesting json-pretty G:json-pretty json-throw G:json-throw json> G:json>
+Builtin json@ G:json@ k32 G:k32 keep G:keep l: G:l: last G:last lib G:lib libbin G:libbin libc G:libc
Builtin listener@ G:listener@ literal G:literal locals: G:locals: lock G:lock lock-to G:lock-to locked? G:locked?
-Builtin log G:log log-async G:log-async log-task G:log-task log-time G:log-time log-time-local G:log-time-local
-Builtin long-days G:long-days long-months G:long-months loop G:loop loop- G:loop- map? G:map? mark G:mark
-Builtin mark? G:mark? memfree G:memfree mobile? G:mobile? n# G:n# name>os G:name>os name>sem G:name>sem
-Builtin ndrop G:ndrop needs G:needs new G:new next-arg G:next-arg nip G:nip noop G:noop not G:not ns G:ns
-Builtin ns: G:ns: ns>ls G:ns>ls ns>s G:ns>s ns? G:ns? null G:null null; G:null; null? G:null? number? G:number?
-Builtin off G:off on G:on onexit G:onexit only G:only op! G:op! or G:or os G:os os-names G:os-names
-Builtin os>long-name G:os>long-name os>name G:os>name over G:over p: G:p: pack G:pack parse G:parse
-Builtin parsech G:parsech parseln G:parseln parsews G:parsews pick G:pick poke G:poke pool-clear G:pool-clear
-Builtin prior G:prior private G:private process-args G:process-args prompt G:prompt public G:public
-Builtin putc G:putc puts G:puts putslim G:putslim quote G:quote r! G:r! r> G:r> r@ G:r@ rad>deg G:rad>deg
-Builtin rand G:rand rand-pcg G:rand-pcg rand-pcg-seed G:rand-pcg-seed randbuf G:randbuf randbuf-pcg G:randbuf-pcg
-Builtin rdrop G:rdrop recurse G:recurse recurse-stack G:recurse-stack ref@ G:ref@ reg! G:reg! reg@ G:reg@
-Builtin regbin@ G:regbin@ remaining-args G:remaining-args repeat G:repeat reset G:reset roll G:roll
-Builtin rop! G:rop! rot G:rot rpick G:rpick rroll G:rroll rstack G:rstack rswap G:rswap rusage G:rusage
-Builtin s>ns G:s>ns same? G:same? scriptdir G:scriptdir scriptfile G:scriptfile sem G:sem sem-post G:sem-post
-Builtin sem-rm G:sem-rm sem-wait G:sem-wait sem-wait? G:sem-wait? sem>name G:sem>name semi-throw G:semi-throw
-Builtin set-wipe G:set-wipe setenv G:setenv settings! G:settings! settings![] G:settings![] settings@ G:settings@
-Builtin settings@? G:settings@? settings@[] G:settings@[] sh G:sh sh$ G:sh$ short-days G:short-days
-Builtin short-months G:short-months sleep G:sleep space G:space stack-check G:stack-check stack-size G:stack-size
-Builtin step G:step string? G:string? struct: G:struct: swap G:swap syslang G:syslang sysregion G:sysregion
+Builtin log G:log log-syslog G:log-syslog log-task G:log-task log-time G:log-time log-time-local G:log-time-local
+Builtin long-days G:long-days long-months G:long-months longjmp G:longjmp lookup G:lookup loop G:loop
+Builtin loop- G:loop- map? G:map? mark G:mark mark? G:mark? memfree G:memfree mobile? G:mobile? n# G:n#
+Builtin name>os G:name>os name>sem G:name>sem ndrop G:ndrop needs G:needs new G:new next-arg G:next-arg
+Builtin nip G:nip noop G:noop not G:not nothrow G:nothrow ns G:ns ns: G:ns: ns>ls G:ns>ls ns>s G:ns>s
+Builtin ns? G:ns? null G:null null; G:null; null? G:null? number? G:number? of: G:of: off G:off on G:on
+Builtin onexit G:onexit only G:only op! G:op! or G:or os G:os os-names G:os-names os>long-name G:os>long-name
+Builtin os>name G:os>name over G:over p: G:p: pack G:pack parse G:parse parse-csv G:parse-csv parsech G:parsech
+Builtin parseln G:parseln parsews G:parsews pick G:pick poke G:poke pool-clear G:pool-clear pool-clear-all G:pool-clear-all
+Builtin prior G:prior private G:private process-args G:process-args process-args-fancy G:process-args-fancy
+Builtin process-args-help G:process-args-help process-args-vars G:process-args-vars prompt G:prompt
+Builtin public G:public putc G:putc puts G:puts putslim G:putslim quote G:quote r! G:r! r> G:r> r@ G:r@
+Builtin rad>deg G:rad>deg rand-jit G:rand-jit rand-jsf G:rand-jsf rand-native G:rand-native rand-normal G:rand-normal
+Builtin rand-pcg G:rand-pcg rand-pcg-seed G:rand-pcg-seed rand-range G:rand-range rand-select G:rand-select
+Builtin randbuf-pcg G:randbuf-pcg random G:random rdrop G:rdrop recurse G:recurse recurse-stack G:recurse-stack
+Builtin ref@ G:ref@ reg! G:reg! reg@ G:reg@ regbin@ G:regbin@ remaining-args G:remaining-args repeat G:repeat
+Builtin required? G:required? requires G:requires reset G:reset roll G:roll rop! G:rop! rot G:rot rpick G:rpick
+Builtin rroll G:rroll rstack G:rstack rswap G:rswap rusage G:rusage s>ns G:s>ns same? G:same? scriptdir G:scriptdir
+Builtin scriptfile G:scriptfile sem G:sem sem-post G:sem-post sem-rm G:sem-rm sem-wait G:sem-wait sem-wait? G:sem-wait?
+Builtin sem>name G:sem>name semi-throw G:semi-throw set-wipe G:set-wipe setenv G:setenv setjmp G:setjmp
+Builtin settings! G:settings! settings![] G:settings![] settings@ G:settings@ settings@? G:settings@?
+Builtin settings@[] G:settings@[] sh G:sh sh$ G:sh$ short-days G:short-days short-months G:short-months
+Builtin sleep G:sleep sleep-until G:sleep-until slog G:slog space G:space stack-check G:stack-check
+Builtin stack-size G:stack-size step G:step sthrow G:sthrow string? G:string? struct: G:struct: swap G:swap
Builtin tab-hook G:tab-hook tell-conflict G:tell-conflict tempdir G:tempdir tempfilename G:tempfilename
-Builtin then G:then third G:third throw G:throw thrownull G:thrownull times G:times tlog G:tlog tri G:tri
-Builtin true G:true tuck G:tuck type-check G:type-check typeassert G:typeassert unlock G:unlock unpack G:unpack
-Builtin until G:until until! G:until! var G:var var, G:var, while G:while while! G:while! with: G:with:
+Builtin third G:third throw G:throw thrownull G:thrownull times G:times tlog G:tlog tri G:tri true G:true
+Builtin tuck G:tuck type-check G:type-check typeassert G:typeassert uid G:uid uname G:uname unlock G:unlock
+Builtin unpack G:unpack until G:until until! G:until! while G:while while! G:while! with: G:with: word? G:word?
Builtin words G:words words-like G:words-like words/ G:words/ xchg G:xchg xor G:xor >auth HTTP:>auth
-Builtin sh I:sh tpush I:tpush trace-word I:trace-word call JSONRPC:call auth-string OAuth:auth-string
-Builtin gen-nonce OAuth:gen-nonce params OAuth:params call SOAP:call ! a:! + a:+ - a:- 2each a:2each
-Builtin 2map a:2map 2map+ a:2map+ 2map= a:2map= = a:= >map a:>map @ a:@ @@ a:@@ bsearch a:bsearch clear a:clear
-Builtin close a:close diff a:diff dot a:dot each a:each each-slice a:each-slice exists? a:exists? filter a:filter
-Builtin generate a:generate group a:group indexof a:indexof insert a:insert intersect a:intersect join a:join
-Builtin len a:len map a:map map+ a:map+ map= a:map= mean a:mean mean&variance a:mean&variance new a:new
-Builtin op a:op op! a:op! op= a:op= open a:open pop a:pop push a:push qsort a:qsort randeach a:randeach
-Builtin reduce a:reduce reduce+ a:reduce+ rev a:rev shift a:shift shuffle a:shuffle slice a:slice slice+ a:slice+
-Builtin slide a:slide sort a:sort union a:union when a:when when! a:when! x a:x x-each a:x-each xchg a:xchg
-Builtin y a:y zip a:zip 8thdir app:8thdir asset app:asset atrun app:atrun atrun app:atrun atrun app:atrun
-Builtin basedir app:basedir current app:current datadir app:datadir exename app:exename isgui app:isgui
-Builtin main app:main oncrash app:oncrash orientation app:orientation pid app:pid restart app:restart
-Builtin resumed app:resumed shared? app:shared? standalone app:standalone subdir app:subdir suspended app:suspended
-Builtin sysquit app:sysquit (here) asm:(here) >n asm:>n avail asm:avail c, asm:c, here! asm:here! n> asm:n>
-Builtin used asm:used w, asm:w, ! b:! + b:+ / b:/ = b:= >base64 b:>base64 >hex b:>hex >mpack b:>mpack
-Builtin @ b:@ append b:append base64> b:base64> bit! b:bit! bit@ b:bit@ clear b:clear compress b:compress
-Builtin conv b:conv each b:each each-slice b:each-slice expand b:expand fill b:fill getb b:getb hex> b:hex>
-Builtin len b:len mem> b:mem> move b:move mpack-date b:mpack-date mpack-ignore b:mpack-ignore mpack> b:mpack>
-Builtin new b:new op b:op rev b:rev search b:search shmem b:shmem slice b:slice splice b:splice ungetb b:ungetb
-Builtin writable b:writable xor b:xor +block bc:+block .blocks bc:.blocks add-block bc:add-block block-hash bc:block-hash
+Builtin (curry) I:(curry) notimpl I:notimpl sh I:sh trace-word I:trace-word call JSONRPC:call auth-string OAuth:auth-string
+Builtin gen-nonce OAuth:gen-nonce params OAuth:params call SOAP:call ! a:! + a:+ - a:- / a:/ 2each a:2each
+Builtin 2map a:2map 2map+ a:2map+ 2map= a:2map= = a:= @ a:@ @? a:@? _@ a:_@ all a:all any a:any bsearch a:bsearch
+Builtin centroid a:centroid clear a:clear close a:close diff a:diff dot a:dot each a:each each! a:each!
+Builtin each-slice a:each-slice exists? a:exists? filter a:filter generate a:generate group a:group
+Builtin indexof a:indexof insert a:insert intersect a:intersect join a:join len a:len map a:map map+ a:map+
+Builtin map= a:map= mean a:mean mean&variance a:mean&variance merge a:merge new a:new op! a:op! open a:open
+Builtin pop a:pop push a:push qsort a:qsort randeach a:randeach reduce a:reduce reduce+ a:reduce+ remove a:remove
+Builtin rev a:rev shift a:shift shuffle a:shuffle slice a:slice slice+ a:slice+ slide a:slide smear a:smear
+Builtin sort a:sort union a:union x a:x x-each a:x-each xchg a:xchg y a:y zip a:zip 8thdir app:8thdir
+Builtin asset app:asset atrun app:atrun atrun app:atrun atrun app:atrun basedir app:basedir current app:current
+Builtin datadir app:datadir exename app:exename lowmem app:lowmem main app:main name app:name oncrash app:oncrash
+Builtin opts! app:opts! opts@ app:opts@ orientation app:orientation orientation! app:orientation! pid app:pid
+Builtin post-main app:post-main pre-main app:pre-main raise app:raise request-perm app:request-perm
+Builtin restart app:restart resumed app:resumed signal app:signal standalone app:standalone subdir app:subdir
+Builtin suspended app:suspended sysquit app:sysquit terminated app:terminated trap app:trap (here) asm:(here)
+Builtin >n asm:>n avail asm:avail c, asm:c, here! asm:here! n> asm:n> used asm:used w, asm:w, ! b:!
+Builtin + b:+ / b:/ 1+ b:1+ 1- b:1- = b:= >base16 b:>base16 >base32 b:>base32 >base64 b:>base64 >base85 b:>base85
+Builtin >hex b:>hex >mpack b:>mpack @ b:@ append b:append base16> b:base16> base32> b:base32> base64> b:base64>
+Builtin base85> b:base85> bit! b:bit! bit@ b:bit@ clear b:clear compress b:compress conv b:conv each b:each
+Builtin each! b:each! each-slice b:each-slice expand b:expand fill b:fill getb b:getb hex> b:hex> len b:len
+Builtin mem> b:mem> move b:move mpack-compat b:mpack-compat mpack-date b:mpack-date mpack-ignore b:mpack-ignore
+Builtin mpack> b:mpack> n! b:n! n+ b:n+ n@ b:n@ new b:new op b:op pad b:pad rev b:rev search b:search
+Builtin shmem b:shmem slice b:slice splice b:splice ungetb b:ungetb unpad b:unpad writable b:writable
+Builtin xor b:xor +block bc:+block .blocks bc:.blocks add-block bc:add-block block-hash bc:block-hash
Builtin block@ bc:block@ first-block bc:first-block hash bc:hash last-block bc:last-block load bc:load
Builtin new bc:new save bc:save set-sql bc:set-sql validate bc:validate validate-block bc:validate-block
Builtin add bloom:add filter bloom:filter in? bloom:in? accept bt:accept ch! bt:ch! ch@ bt:ch@ connect bt:connect
-Builtin disconnect bt:disconnect err? bt:err? leconnect bt:leconnect lescan bt:lescan listen bt:listen
+Builtin disconnect bt:disconnect init bt:init leconnect bt:leconnect lescan bt:lescan listen bt:listen
Builtin on? bt:on? read bt:read scan bt:scan service? bt:service? services? bt:services? write bt:write
Builtin * c:* * c:* + c:+ + c:+ = c:= = c:= >ri c:>ri >ri c:>ri abs c:abs abs c:abs arg c:arg arg c:arg
-Builtin conj c:conj conj c:conj im c:im n> c:n> new c:new new c:new re c:re >aes128gcm cr:>aes128gcm
-Builtin >aes256gcm cr:>aes256gcm >cp cr:>cp >cpe cr:>cpe >decrypt cr:>decrypt >edbox cr:>edbox >encrypt cr:>encrypt
-Builtin >nbuf cr:>nbuf >rsabox cr:>rsabox >uuid cr:>uuid CBC cr:CBC CFB cr:CFB CTR cr:CTR ECB cr:ECB
-Builtin GCM cr:GCM OFB cr:OFB aad? cr:aad? aes128box-sig cr:aes128box-sig aes128gcm> cr:aes128gcm>
-Builtin aes256box-sig cr:aes256box-sig aes256gcm> cr:aes256gcm> aesgcm cr:aesgcm blakehash cr:blakehash
-Builtin chacha20box-sig cr:chacha20box-sig chachapoly cr:chachapoly cipher! cr:cipher! cipher@ cr:cipher@
-Builtin cp> cr:cp> cpe> cr:cpe> decrypt cr:decrypt decrypt+ cr:decrypt+ decrypt> cr:decrypt> dh-genkey cr:dh-genkey
-Builtin dh-secret cr:dh-secret dh-sign cr:dh-sign dh-verify cr:dh-verify ebox-sig cr:ebox-sig ecc-genkey cr:ecc-genkey
-Builtin ecc-secret cr:ecc-secret ecc-sign cr:ecc-sign ecc-verify cr:ecc-verify edbox-sig cr:edbox-sig
-Builtin edbox> cr:edbox> encrypt cr:encrypt encrypt+ cr:encrypt+ encrypt> cr:encrypt> ensurekey cr:ensurekey
-Builtin err? cr:err? gcm-tag-size cr:gcm-tag-size genkey cr:genkey hash cr:hash hash! cr:hash! hash+ cr:hash+
-Builtin hash>b cr:hash>b hash>s cr:hash>s hash@ cr:hash@ hmac cr:hmac hotp cr:hotp iv? cr:iv? mode cr:mode
-Builtin mode@ cr:mode@ randkey cr:randkey restore cr:restore root-certs cr:root-certs rsa_decrypt cr:rsa_decrypt
-Builtin rsa_encrypt cr:rsa_encrypt rsa_sign cr:rsa_sign rsa_verify cr:rsa_verify rsabox-sig cr:rsabox-sig
-Builtin rsabox> cr:rsabox> rsagenkey cr:rsagenkey save cr:save sbox-sig cr:sbox-sig sha1-hmac cr:sha1-hmac
-Builtin shard cr:shard tag? cr:tag? totp cr:totp totp-epoch cr:totp-epoch totp-time-step cr:totp-time-step
-Builtin unshard cr:unshard uuid cr:uuid uuid> cr:uuid> validate-pgp-sig cr:validate-pgp-sig (.hebrew) d:(.hebrew)
-Builtin (.islamic) d:(.islamic) + d:+ +day d:+day +hour d:+hour +min d:+min +msec d:+msec - d:- .hebrew d:.hebrew
-Builtin .islamic d:.islamic .time d:.time / d:/ = d:= >fixed d:>fixed >hebepoch d:>hebepoch >msec d:>msec
-Builtin >unix d:>unix >ymd d:>ymd Adar d:Adar Adar2 d:Adar2 Adar2 d:Adar2 Av d:Av Elul d:Elul Fri d:Fri
-Builtin Heshvan d:Heshvan Iyar d:Iyar Kislev d:Kislev Mon d:Mon Nissan d:Nissan Sat d:Sat Shevat d:Shevat
-Builtin Sivan d:Sivan Sun d:Sun Tammuz d:Tammuz Tevet d:Tevet Thu d:Thu Tishrei d:Tishrei Tue d:Tue
-Builtin Wed d:Wed adjust-dst d:adjust-dst between d:between d. d:d. dawn d:dawn days-in-hebrew-year d:days-in-hebrew-year
-Builtin displaying-hebrew d:displaying-hebrew do-dawn d:do-dawn do-dusk d:do-dusk do-rise d:do-rise
-Builtin doy d:doy dst? d:dst? dstquery d:dstquery dstzones? d:dstzones? dusk d:dusk elapsed-timer d:elapsed-timer
-Builtin elapsed-timer-seconds d:elapsed-timer-seconds first-dow d:first-dow fixed> d:fixed> fixed>dow d:fixed>dow
-Builtin fixed>hebrew d:fixed>hebrew fixed>islamic d:fixed>islamic format d:format hanukkah d:hanukkah
-Builtin hebrew-epoch d:hebrew-epoch hebrew>fixed d:hebrew>fixed hebrewtoday d:hebrewtoday hmonth-name d:hmonth-name
-Builtin islamic.epoch d:islamic.epoch islamic>fixed d:islamic>fixed islamictoday d:islamictoday join d:join
-Builtin last-day-of-hebrew-month d:last-day-of-hebrew-month last-dow d:last-dow last-month d:last-month
-Builtin last-week d:last-week last-year d:last-year latitude d:latitude longitude d:longitude longitude d:longitude
-Builtin msec d:msec msec> d:msec> new d:new next-dow d:next-dow next-month d:next-month next-week d:next-week
-Builtin next-year d:next-year number>hebrew d:number>hebrew omer d:omer parse d:parse pesach d:pesach
+Builtin conj c:conj conj c:conj im c:im n> c:n> new c:new new c:new re c:re >redir con:>redir accept con:accept
+Builtin accept-pwd con:accept-pwd ansi? con:ansi? black con:black blue con:blue clreol con:clreol cls con:cls
+Builtin cyan con:cyan down con:down free con:free getxy con:getxy gotoxy con:gotoxy green con:green
+Builtin key con:key key? con:key? left con:left load-history con:load-history magenta con:magenta onBlack con:onBlack
+Builtin onBlue con:onBlue onCyan con:onCyan onGreen con:onGreen onMagenta con:onMagenta onRed con:onRed
+Builtin onWhite con:onWhite onYellow con:onYellow print con:print red con:red redir> con:redir> redir? con:redir?
+Builtin right con:right save-history con:save-history size? con:size? up con:up white con:white yellow con:yellow
+Builtin >aes128gcm cr:>aes128gcm >aes256gcm cr:>aes256gcm >cp cr:>cp >cpe cr:>cpe >decrypt cr:>decrypt
+Builtin >edbox cr:>edbox >encrypt cr:>encrypt >nbuf cr:>nbuf >rsabox cr:>rsabox >uuid cr:>uuid CBC cr:CBC
+Builtin CFB cr:CFB CTR cr:CTR ECB cr:ECB GCM cr:GCM OFB cr:OFB aad? cr:aad? aes128box-sig cr:aes128box-sig
+Builtin aes128gcm> cr:aes128gcm> aes256box-sig cr:aes256box-sig aes256gcm> cr:aes256gcm> aesgcm cr:aesgcm
+Builtin blakehash cr:blakehash chacha20box-sig cr:chacha20box-sig chachapoly cr:chachapoly cipher! cr:cipher!
+Builtin cipher@ cr:cipher@ cp> cr:cp> cpe> cr:cpe> decrypt cr:decrypt decrypt+ cr:decrypt+ decrypt> cr:decrypt>
+Builtin dh-genkey cr:dh-genkey dh-secret cr:dh-secret dh-sign cr:dh-sign dh-verify cr:dh-verify ebox-sig cr:ebox-sig
+Builtin ecc-genkey cr:ecc-genkey ecc-secret cr:ecc-secret ecc-sign cr:ecc-sign ecc-verify cr:ecc-verify
+Builtin edbox-sig cr:edbox-sig edbox> cr:edbox> encrypt cr:encrypt encrypt+ cr:encrypt+ encrypt> cr:encrypt>
+Builtin ensurekey cr:ensurekey gcm-tag-size cr:gcm-tag-size genkey cr:genkey hash cr:hash hash! cr:hash!
+Builtin hash+ cr:hash+ hash>b cr:hash>b hash>s cr:hash>s hash@ cr:hash@ hmac cr:hmac hotp cr:hotp iv? cr:iv?
+Builtin mode cr:mode mode@ cr:mode@ rand cr:rand randbuf cr:randbuf randkey cr:randkey restore cr:restore
+Builtin root-certs cr:root-certs rsa_decrypt cr:rsa_decrypt rsa_encrypt cr:rsa_encrypt rsa_sign cr:rsa_sign
+Builtin rsa_verify cr:rsa_verify rsabox-sig cr:rsabox-sig rsabox> cr:rsabox> rsagenkey cr:rsagenkey
+Builtin save cr:save sbox-sig cr:sbox-sig sha1-hmac cr:sha1-hmac shard cr:shard tag? cr:tag? totp cr:totp
+Builtin totp-epoch cr:totp-epoch totp-time-step cr:totp-time-step unshard cr:unshard uuid cr:uuid uuid> cr:uuid>
+Builtin validate-pgp-sig cr:validate-pgp-sig (.hebrew) d:(.hebrew) (.islamic) d:(.islamic) + d:+ +day d:+day
+Builtin +hour d:+hour +min d:+min +msec d:+msec - d:- .hebrew d:.hebrew .islamic d:.islamic .time d:.time
+Builtin / d:/ = d:= >fixed d:>fixed >hebepoch d:>hebepoch >jdn d:>jdn >msec d:>msec >unix d:>unix >ymd d:>ymd
+Builtin ?= d:?= Adar d:Adar Adar2 d:Adar2 Adar2 d:Adar2 Av d:Av Elul d:Elul Fri d:Fri Heshvan d:Heshvan
+Builtin Iyar d:Iyar Kislev d:Kislev Mon d:Mon Nissan d:Nissan Sat d:Sat Shevat d:Shevat Sivan d:Sivan
+Builtin Sun d:Sun Tammuz d:Tammuz Tevet d:Tevet Thu d:Thu Tishrei d:Tishrei Tue d:Tue Wed d:Wed adjust-dst d:adjust-dst
+Builtin approx! d:approx! approx? d:approx? approximates! d:approximates! between d:between d. d:d.
+Builtin dawn d:dawn days-in-hebrew-year d:days-in-hebrew-year displaying-hebrew d:displaying-hebrew
+Builtin do-dawn d:do-dawn do-dusk d:do-dusk do-rise d:do-rise doy d:doy dst? d:dst? dstquery d:dstquery
+Builtin dstzones? d:dstzones? dusk d:dusk elapsed-timer d:elapsed-timer elapsed-timer-seconds d:elapsed-timer-seconds
+Builtin first-dow d:first-dow fixed> d:fixed> fixed>dow d:fixed>dow fixed>hebrew d:fixed>hebrew fixed>islamic d:fixed>islamic
+Builtin format d:format hanukkah d:hanukkah hebrew-epoch d:hebrew-epoch hebrew>fixed d:hebrew>fixed
+Builtin hebrewtoday d:hebrewtoday hmonth-name d:hmonth-name islamic.epoch d:islamic.epoch islamic>fixed d:islamic>fixed
+Builtin islamictoday d:islamictoday jdn> d:jdn> join d:join last-day-of-hebrew-month d:last-day-of-hebrew-month
+Builtin last-dow d:last-dow last-month d:last-month last-week d:last-week last-year d:last-year latitude d:latitude
+Builtin longitude d:longitude longitude d:longitude msec d:msec msec> d:msec> new d:new next-dow d:next-dow
+Builtin next-month d:next-month next-week d:next-week next-year d:next-year number>hebrew d:number>hebrew
+Builtin omer d:omer parse d:parse parse-approx d:parse-approx parse-range d:parse-range pesach d:pesach
Builtin prev-dow d:prev-dow purim d:purim rosh-chodesh? d:rosh-chodesh? rosh-hashanah d:rosh-hashanah
Builtin shavuot d:shavuot start-timer d:start-timer sunrise d:sunrise taanit-esther d:taanit-esther
-Builtin ticks d:ticks ticks/sec d:ticks/sec timer d:timer tisha-beav d:tisha-beav tzadjust d:tzadjust
-Builtin unix> d:unix> updatetz d:updatetz year@ d:year@ ymd d:ymd ymd> d:ymd> yom-haatsmaut d:yom-haatsmaut
-Builtin yom-kippur d:yom-kippur add-func db:add-func bind db:bind close db:close col db:col col[] db:col[]
-Builtin col{} db:col{} err? db:err? errmsg db:errmsg exec db:exec exec-cb db:exec-cb key db:key mysql? db:mysql?
-Builtin odbc? db:odbc? open db:open open? db:open? prepare db:prepare query db:query query-all db:query-all
-Builtin rekey db:rekey sqlerrmsg db:sqlerrmsg bp dbg:bp except-task@ dbg:except-task@ go dbg:go line-info dbg:line-info
-Builtin prompt dbg:prompt stop dbg:stop trace dbg:trace trace-enter dbg:trace-enter trace-leave dbg:trace-leave
-Builtin abspath f:abspath append f:append associate f:associate atime f:atime canwrite? f:canwrite?
-Builtin chmod f:chmod close f:close copy f:copy copydir f:copydir create f:create ctime f:ctime dir? f:dir?
-Builtin dname f:dname eachbuf f:eachbuf eachline f:eachline enssep f:enssep eof? f:eof? err? f:err?
-Builtin exists? f:exists? flush f:flush fname f:fname getb f:getb getc f:getc getline f:getline getmod f:getmod
-Builtin glob f:glob glob-nocase f:glob-nocase include f:include launch f:launch link f:link link> f:link>
-Builtin link? f:link? mkdir f:mkdir mmap f:mmap mmap-range f:mmap-range mmap-range? f:mmap-range? mtime f:mtime
-Builtin mv f:mv open f:open open-ro f:open-ro popen f:popen print f:print read f:read relpath f:relpath
-Builtin rglob f:rglob rm f:rm rmdir f:rmdir seek f:seek sep f:sep show f:show size f:size slurp f:slurp
-Builtin stderr f:stderr stdin f:stdin stdout f:stdout tell f:tell times f:times trash f:trash ungetb f:ungetb
-Builtin ungetc f:ungetc unzip f:unzip unzip-entry f:unzip-entry watch f:watch write f:write writen f:writen
-Builtin zip+ f:zip+ zip@ f:zip@ zipentry f:zipentry zipnew f:zipnew zipopen f:zipopen zipsave f:zipsave
-Builtin bold font:bold face? font:face? glyph-path font:glyph-path glyph-pos font:glyph-pos info font:info
-Builtin italic font:italic ls font:ls measure font:measure new font:new pixels font:pixels pixels? font:pixels?
-Builtin points font:points points? font:points? styles font:styles styles? font:styles? underline font:underline
-Builtin +child g:+child +kind g:+kind +path g:+path -child g:-child /path g:/path >img g:>img >progress g:>progress
-Builtin add-items g:add-items adjustwidth g:adjustwidth allow-orient g:allow-orient arc g:arc arc2 g:arc2
-Builtin autohide g:autohide back g:back bezier g:bezier bg g:bg bg? g:bg? bounds g:bounds bounds? g:bounds?
-Builtin box-label g:box-label btn-font g:btn-font bubble g:bubble button-size g:button-size buttons-visible g:buttons-visible
-Builtin c-text g:c-text callout g:callout center g:center child g:child clear g:clear clearpath g:clearpath
-Builtin clr>n g:clr>n coleven g:coleven colordlg g:colordlg colwidth g:colwidth connectededges g:connectededges
-Builtin contrasting g:contrasting cp g:cp curmouse? g:curmouse? default-font g:default-font deselect-row g:deselect-row
-Builtin dismiss g:dismiss do g:do draw-fitted-text g:draw-fitted-text draw-text g:draw-text draw-text-at g:draw-text-at
-Builtin each g:each edit-on-double-click g:edit-on-double-click editable g:editable editdlg g:editdlg
-Builtin empty-text g:empty-text enable g:enable enabled? g:enabled? fade g:fade fb-files g:fb-files
-Builtin fcolor g:fcolor fg g:fg fg? g:fg? file-filter g:file-filter file-name g:file-name filedlg g:filedlg
-Builtin fill g:fill fillall g:fillall fit-text g:fit-text flex! g:flex! focus g:focus fontdlg g:fontdlg
-Builtin forward g:forward fullscreen g:fullscreen get-lasso-items g:get-lasso-items get-tab g:get-tab
-Builtin getclr g:getclr getfont g:getfont getimage g:getimage getpath g:getpath getroot g:getroot gradient g:gradient
-Builtin gui? g:gui? handle g:handle headerheight g:headerheight hide g:hide image g:image image-at g:image-at
-Builtin invalidate g:invalidate ix? g:ix? justify g:justify keyinfo g:keyinfo l-text g:l-text laf g:laf
-Builtin laf! g:laf! laf? g:laf? len g:len line-width g:line-width lineto g:lineto list+ g:list+ list- g:list-
-Builtin loadcontent g:loadcontent localize g:localize m! g:m! m@ g:m@ menu-font g:menu-font menu-update g:menu-update
-Builtin menuenabled g:menuenabled mouse? g:mouse? mousepos? g:mousepos? moveto g:moveto msgdlg g:msgdlg
-Builtin multi g:multi name g:name named-skin g:named-skin new g:new new-laf g:new-laf next g:next obj g:obj
-Builtin on g:on on? g:on? ontop g:ontop oshandle g:oshandle outlinethickness g:outlinethickness panel-size g:panel-size
-Builtin panel-size? g:panel-size? parent g:parent path g:path path>s g:path>s pie g:pie pix! g:pix!
-Builtin pop g:pop popmenu g:popmenu pos? g:pos? prev g:prev propval! g:propval! propval@ g:propval@
-Builtin push g:push qbezier g:qbezier quit g:quit r-text g:r-text readonly g:readonly rect g:rect refresh g:refresh
-Builtin restore g:restore root g:root root-item-visible g:root-item-visible rotate g:rotate rowheight g:rowheight
-Builtin rrect g:rrect s>path g:s>path save g:save say g:say scale g:scale scolor g:scolor scrollthickness g:scrollthickness
-Builtin sectionenable g:sectionenable select! g:select! select@ g:select@ selected-rows g:selected-rows
-Builtin set-lasso g:set-lasso set-long-press g:set-long-press set-popup-font g:set-popup-font set-range g:set-range
-Builtin set-swipe g:set-swipe set-value g:set-value setcursor g:setcursor setfont g:setfont setheader g:setheader
-Builtin sethtml g:sethtml setimage g:setimage setname g:setname setroot g:setroot settab g:settab show g:show
-Builtin show-line-numbers g:show-line-numbers show-pct g:show-pct showmenu g:showmenu showtooltip g:showtooltip
-Builtin size g:size size? g:size? skin g:skin skin-class g:skin-class stackix g:stackix state g:state
-Builtin state? g:state? stepsize g:stepsize stroke g:stroke stroke-fill g:stroke-fill style g:style
-Builtin tabname g:tabname text g:text text-box-style g:text-box-style text? g:text? textcolor g:textcolor
-Builtin textsize g:textsize timer! g:timer! timer@ g:timer@ toback g:toback tofront g:tofront toggle-row g:toggle-row
-Builtin tooltip g:tooltip top g:top transition g:transition translate g:translate tree-open g:tree-open
-Builtin triangle g:triangle update g:update updateitems g:updateitems url g:url user g:user user! g:user!
-Builtin vertical g:vertical view g:view visible? g:visible? vpos! g:vpos! vpos@ g:vpos@ waitcursor g:waitcursor
-Builtin winding g:winding xy g:xy xy? g:xy? +edge gr:+edge +edge+w gr:+edge+w +node gr:+node connect gr:connect
-Builtin edges gr:edges m! gr:m! m@ gr:m@ neighbors gr:neighbors new gr:new node-edges gr:node-edges
-Builtin nodes gr:nodes traverse gr:traverse + h:+ clear h:clear len h:len new h:new peek h:peek pop h:pop
-Builtin push h:push unique h:unique arm? hw:arm? camera hw:camera camera-fmt hw:camera-fmt camera-img hw:camera-img
-Builtin camera? hw:camera? cpu? hw:cpu? device? hw:device? displays? hw:displays? displaysize? hw:displaysize?
-Builtin err? hw:err? gpio hw:gpio gpio! hw:gpio! gpio-mmap hw:gpio-mmap gpio@ hw:gpio@ i2c hw:i2c i2c! hw:i2c!
-Builtin i2c!reg hw:i2c!reg i2c@ hw:i2c@ i2c@reg hw:i2c@reg isround? hw:isround? iswatch? hw:iswatch?
-Builtin mac? hw:mac? mem? hw:mem? poll hw:poll sensor hw:sensor start hw:start stop hw:stop fetch-full imap:fetch-full
-Builtin fetch-uid-mail imap:fetch-uid-mail login imap:login new imap:new select-inbox imap:select-inbox
-Builtin >file img:>file copy img:copy crop img:crop data img:data desat img:desat fill img:fill filter img:filter
-Builtin flip img:flip from-svg img:from-svg new img:new pix! img:pix! pix@ img:pix@ qr-gen img:qr-gen
-Builtin qr-parse img:qr-parse rotate img:rotate scale img:scale scroll img:scroll size img:size countries iso:countries
-Builtin find loc:find sort loc:sort ! m:! !? m:!? + m:+ +? m:+? - m:- @ m:@ @? m:@? @@ m:@@ clear m:clear
-Builtin data m:data each m:each exists? m:exists? iter m:iter iter-all m:iter-all keys m:keys len m:len
-Builtin map m:map new m:new op! m:op! open m:open vals m:vals xchg m:xchg ! mat:! * mat:* + mat:+ = mat:=
-Builtin @ mat:@ col mat:col data mat:data det mat:det dim? mat:dim? get-n mat:get-n ident mat:ident
-Builtin m. mat:m. minor mat:minor n* mat:n* new mat:new row mat:row same-size? mat:same-size? trans mat:trans
-Builtin ! n:! * n:* */ n:*/ + n:+ +! n:+! - n:- / n:/ /mod n:/mod 1+ n:1+ 1- n:1- < n:< = n:= > n:>
-Builtin BIGE n:BIGE BIGPI n:BIGPI E n:E PI n:PI ^ n:^ abs n:abs acos n:acos acos n:acos asin n:asin
-Builtin asin n:asin atan n:atan atan n:atan atan2 n:atan2 band n:band between n:between bfloat n:bfloat
-Builtin bic n:bic bint n:bint binv n:binv bnot n:bnot bor n:bor bxor n:bxor ceil n:ceil clamp n:clamp
-Builtin cmp n:cmp comb n:comb cos n:cos cosd n:cosd exp n:exp expmod n:expmod float n:float floor n:floor
+Builtin ticks d:ticks ticks/sec d:ticks/sec timer d:timer timer-ctrl d:timer-ctrl tisha-beav d:tisha-beav
+Builtin tzadjust d:tzadjust unix> d:unix> unknown d:unknown unknown? d:unknown? updatetz d:updatetz
+Builtin year@ d:year@ ymd d:ymd ymd> d:ymd> yom-haatsmaut d:yom-haatsmaut yom-kippur d:yom-kippur add-func db:add-func
+Builtin aes! db:aes! begin db:begin bind db:bind bind-exec db:bind-exec bind-exec[] db:bind-exec[]
+Builtin close db:close col db:col col[] db:col[] col{} db:col{} commit db:commit each db:each exec db:exec
+Builtin exec-cb db:exec-cb exec-name db:exec-name get db:get get-sub db:get-sub key db:key kind? db:kind?
+Builtin last-rowid db:last-rowid mysql? db:mysql? odbc? db:odbc? open db:open open? db:open? prep-name db:prep-name
+Builtin prepare db:prepare query db:query query-all db:query-all rekey db:rekey rollback db:rollback
+Builtin set db:set set-sub db:set-sub sql@ db:sql@ bp dbg:bp except-task@ dbg:except-task@ go dbg:go
+Builtin line-info dbg:line-info prompt dbg:prompt stop dbg:stop trace dbg:trace trace-enter dbg:trace-enter
+Builtin trace-leave dbg:trace-leave / f:/ abspath f:abspath absrel f:absrel append f:append associate f:associate
+Builtin atime f:atime canwrite? f:canwrite? chmod f:chmod close f:close copy f:copy copydir f:copydir
+Builtin create f:create ctime f:ctime dir? f:dir? dname f:dname eachbuf f:eachbuf eachline f:eachline
+Builtin enssep f:enssep eof? f:eof? exists? f:exists? flush f:flush fname f:fname getb f:getb getc f:getc
+Builtin getline f:getline getmod f:getmod glob f:glob glob-nocase f:glob-nocase homedir f:homedir homedir! f:homedir!
+Builtin include f:include ioctl f:ioctl join f:join launch f:launch link f:link link> f:link> link? f:link?
+Builtin mkdir f:mkdir mmap f:mmap mmap-range f:mmap-range mmap-range? f:mmap-range? mtime f:mtime mv f:mv
+Builtin name@ f:name@ open f:open open-ro f:open-ro popen f:popen print f:print read f:read read? f:read?
+Builtin relpath f:relpath rglob f:rglob rm f:rm rmdir f:rmdir seek f:seek sep f:sep size f:size slurp f:slurp
+Builtin sparse? f:sparse? spit f:spit stderr f:stderr stdin f:stdin stdout f:stdout tell f:tell times f:times
+Builtin tmpspit f:tmpspit trash f:trash truncate f:truncate ungetb f:ungetb ungetc f:ungetc unzip f:unzip
+Builtin unzip-entry f:unzip-entry watch f:watch write f:write writen f:writen zip+ f:zip+ zip@ f:zip@
+Builtin zipentry f:zipentry zipnew f:zipnew zipopen f:zipopen zipsave f:zipsave atlas! font:atlas!
+Builtin atlas@ font:atlas@ default-size font:default-size info font:info ls font:ls measure font:measure
+Builtin new font:new oversample font:oversample pixels font:pixels pixels? font:pixels? +edge gr:+edge
+Builtin +edge+w gr:+edge+w +node gr:+node connect gr:connect edges gr:edges edges! gr:edges! m! gr:m!
+Builtin m@ gr:m@ neighbors gr:neighbors new gr:new node-edges gr:node-edges nodes gr:nodes traverse gr:traverse
+Builtin weight! gr:weight! + h:+ clear h:clear cmp! h:cmp! len h:len max! h:max! new h:new peek h:peek
+Builtin pop h:pop push h:push unique h:unique arm? hw:arm? camera hw:camera camera-img hw:camera-img
+Builtin camera-limits hw:camera-limits camera? hw:camera? cpu? hw:cpu? device? hw:device? displays? hw:displays?
+Builtin displaysize? hw:displaysize? finger-match hw:finger-match finger-support hw:finger-support
+Builtin gpio hw:gpio gpio! hw:gpio! gpio-mmap hw:gpio-mmap gpio@ hw:gpio@ i2c hw:i2c i2c! hw:i2c! i2c!reg hw:i2c!reg
+Builtin i2c@ hw:i2c@ i2c@reg hw:i2c@reg isround? hw:isround? iswatch? hw:iswatch? mac? hw:mac? mem? hw:mem?
+Builtin model? hw:model? poll hw:poll sensor hw:sensor start hw:start stop hw:stop uid? hw:uid? fetch-full imap:fetch-full
+Builtin fetch-uid-mail imap:fetch-uid-mail login imap:login logout imap:logout new imap:new search imap:search
+Builtin select-inbox imap:select-inbox >file img:>file >fmt img:>fmt copy img:copy crop img:crop data img:data
+Builtin desat img:desat fill img:fill fillrect img:fillrect filter img:filter flip img:flip from-svg img:from-svg
+Builtin new img:new pix! img:pix! pix@ img:pix@ qr-gen img:qr-gen qr-parse img:qr-parse rotate img:rotate
+Builtin scale img:scale scroll img:scroll size img:size countries iso:countries find loc:find sort loc:sort
+Builtin ! m:! !? m:!? + m:+ +? m:+? - m:- >arr m:>arr @ m:@ @? m:@? _! m:_! _@ m:_@ arr> m:arr> bitmap m:bitmap
+Builtin clear m:clear data m:data each m:each exists? m:exists? filter m:filter iter m:iter iter-all m:iter-all
+Builtin keys m:keys len m:len map m:map merge m:merge new m:new op! m:op! open m:open slice m:slice
+Builtin vals m:vals xchg m:xchg zip m:zip ! mat:! * mat:* + mat:+ = mat:= @ mat:@ affine mat:affine
+Builtin col mat:col data mat:data det mat:det dim? mat:dim? get-n mat:get-n ident mat:ident inv mat:inv
+Builtin m. mat:m. minor mat:minor n* mat:n* new mat:new new-minor mat:new-minor rotate mat:rotate row mat:row
+Builtin same-size? mat:same-size? scale mat:scale shear mat:shear trans mat:trans translate mat:translate
+Builtin xform mat:xform 2console md:2console 2html md:2html 2nk md:2nk bounds meta:bounds color meta:color
+Builtin console meta:console end meta:end ffi meta:ffi ! n:! * n:* */ n:*/ + n:+ +! n:+! - n:- / n:/
+Builtin /mod n:/mod 1+ n:1+ 1- n:1- < n:< = n:= > n:> BIGE n:BIGE BIGPI n:BIGPI E n:E PI n:PI ^ n:^
+Builtin _mod n:_mod abs n:abs acos n:acos acos n:acos asin n:asin asin n:asin atan n:atan atan n:atan
+Builtin atan2 n:atan2 band n:band between n:between bfloat n:bfloat bic n:bic bint n:bint binv n:binv
+Builtin bnot n:bnot bor n:bor bxor n:bxor cast n:cast ceil n:ceil clamp n:clamp cmp n:cmp comb n:comb
+Builtin cos n:cos cosd n:cosd emod n:emod exp n:exp expm1 n:expm1 expmod n:expmod float n:float floor n:floor
Builtin fmod n:fmod frac n:frac gcd n:gcd int n:int invmod n:invmod kind? n:kind? lcm n:lcm ln n:ln
-Builtin max n:max median n:median min n:min mod n:mod neg n:neg odd? n:odd? perm n:perm prime? n:prime?
-Builtin quantize n:quantize quantize! n:quantize! r+ n:r+ range n:range rot32l n:rot32l rot32r n:rot32r
-Builtin round n:round round2 n:round2 running-variance n:running-variance running-variance-finalize n:running-variance-finalize
-Builtin sgn n:sgn shl n:shl shr n:shr sin n:sin sind n:sind sqr n:sqr sqrt n:sqrt tan n:tan tand n:tand
-Builtin trunc n:trunc ~= n:~= ! net:! >url net:>url @ net:@ DGRAM net:DGRAM INET4 net:INET4 INET6 net:INET6
-Builtin PROTO_TCP net:PROTO_TCP PROTO_UDP net:PROTO_UDP STREAM net:STREAM accept net:accept addrinfo>o net:addrinfo>o
-Builtin again? net:again? alloc-and-read net:alloc-and-read alloc-buf net:alloc-buf bind net:bind browse net:browse
-Builtin close net:close connect net:connect err>s net:err>s err? net:err? get net:get getaddrinfo net:getaddrinfo
-Builtin getpeername net:getpeername head net:head ifaces? net:ifaces? listen net:listen net-socket net:net-socket
-Builtin opts net:opts port-is-ssl? net:port-is-ssl? post net:post proxy! net:proxy! read net:read recvfrom net:recvfrom
-Builtin s>url net:s>url sendto net:sendto server net:server setsockopt net:setsockopt socket net:socket
-Builtin tlshello net:tlshello url> net:url> user-agent net:user-agent wait net:wait write net:write
-Builtin MAX ns:MAX cast ptr:cast len ptr:len pack ptr:pack unpack ptr:unpack unpack_orig ptr:unpack_orig
+Builtin ln1p n:ln1p max n:max median n:median min n:min mod n:mod neg n:neg odd? n:odd? perm n:perm
+Builtin prime? n:prime? quantize n:quantize quantize! n:quantize! r+ n:r+ range n:range rot32l n:rot32l
+Builtin rot32r n:rot32r round n:round round2 n:round2 rounding n:rounding running-variance n:running-variance
+Builtin running-variance-finalize n:running-variance-finalize sgn n:sgn shl n:shl shr n:shr sin n:sin
+Builtin sind n:sind sqr n:sqr sqrt n:sqrt tan n:tan tand n:tand trunc n:trunc ~= n:~= ! net:! !? net:!?
+Builtin - net:- >url net:>url @ net:@ @? net:@? DGRAM net:DGRAM INET4 net:INET4 INET6 net:INET6 PROTO_TCP net:PROTO_TCP
+Builtin PROTO_UDP net:PROTO_UDP STREAM net:STREAM accept net:accept addrinfo>o net:addrinfo>o again? net:again?
+Builtin alloc-and-read net:alloc-and-read alloc-buf net:alloc-buf bind net:bind close net:close closed? net:closed?
+Builtin connect net:connect debug? net:debug? delete net:delete get net:get getaddrinfo net:getaddrinfo
+Builtin getpeername net:getpeername head net:head ifaces? net:ifaces? listen net:listen map>url net:map>url
+Builtin net-socket net:net-socket opts net:opts port-is-ssl? net:port-is-ssl? post net:post proxy! net:proxy!
+Builtin put net:put read net:read read-all net:read-all recvfrom net:recvfrom s>url net:s>url sendto net:sendto
+Builtin server net:server setsockopt net:setsockopt socket net:socket tlshello net:tlshello url> net:url>
+Builtin user-agent net:user-agent wait net:wait write net:write (begin) nk:(begin) (chart-begin) nk:(chart-begin)
+Builtin (chart-begin-colored) nk:(chart-begin-colored) (chart-end) nk:(chart-end) (end) nk:(end) (group-begin) nk:(group-begin)
+Builtin (group-end) nk:(group-end) (property) nk:(property) >img nk:>img addfont nk:addfont anti-alias nk:anti-alias
+Builtin any-clicked? nk:any-clicked? bounds nk:bounds bounds! nk:bounds! button nk:button button-color nk:button-color
+Builtin button-label nk:button-label button-set-behavior nk:button-set-behavior button-symbol nk:button-symbol
+Builtin button-symbol-label nk:button-symbol-label chart-add-slot nk:chart-add-slot chart-add-slot-colored nk:chart-add-slot-colored
+Builtin chart-push nk:chart-push chart-push-slot nk:chart-push-slot checkbox nk:checkbox clicked? nk:clicked?
+Builtin close-this! nk:close-this! close-this? nk:close-this? close? nk:close? color-picker nk:color-picker
+Builtin combo nk:combo combo-begin-color nk:combo-begin-color combo-begin-label nk:combo-begin-label
+Builtin combo-cb nk:combo-cb combo-end nk:combo-end contextual-begin nk:contextual-begin contextual-close nk:contextual-close
+Builtin contextual-end nk:contextual-end contextual-item-image-text nk:contextual-item-image-text contextual-item-symbol-text nk:contextual-item-symbol-text
+Builtin contextual-item-text nk:contextual-item-text cp! nk:cp! cp@ nk:cp@ display-info nk:display-info
+Builtin display@ nk:display@ do nk:do down? nk:down? draw-image nk:draw-image draw-image-at nk:draw-image-at
+Builtin draw-image-centered nk:draw-image-centered draw-sub-image nk:draw-sub-image draw-text nk:draw-text
+Builtin draw-text-high nk:draw-text-high draw-text-wrap nk:draw-text-wrap edit-focus nk:edit-focus
+Builtin edit-string nk:edit-string event nk:event event-boost nk:event-boost event-msec nk:event-msec
+Builtin event-wait nk:event-wait fill-arc nk:fill-arc fill-circle nk:fill-circle fill-poly nk:fill-poly
+Builtin fill-rect nk:fill-rect fill-rect-color nk:fill-rect-color fill-triangle nk:fill-triangle flags! nk:flags!
+Builtin flags@ nk:flags@ fullscreen nk:fullscreen get nk:get get-row-height nk:get-row-height getfont nk:getfont
+Builtin getmap nk:getmap gl? nk:gl? grid nk:grid grid-push nk:grid-push group-scroll-ofs nk:group-scroll-ofs
+Builtin group-scroll-ofs! nk:group-scroll-ofs! hovered? nk:hovered? image nk:image init nk:init input-button nk:input-button
+Builtin input-key nk:input-key input-motion nk:input-motion input-scroll nk:input-scroll input-string nk:input-string
+Builtin key-down? nk:key-down? key-pressed? nk:key-pressed? key-released? nk:key-released? label nk:label
+Builtin label-colored nk:label-colored label-wrap nk:label-wrap label-wrap-colored nk:label-wrap-colored
+Builtin layout-bounds nk:layout-bounds layout-grid-begin nk:layout-grid-begin layout-grid-end nk:layout-grid-end
+Builtin layout-push-dynamic nk:layout-push-dynamic layout-push-static nk:layout-push-static layout-push-variable nk:layout-push-variable
+Builtin layout-ratio-from-pixel nk:layout-ratio-from-pixel layout-reset-row-height nk:layout-reset-row-height
+Builtin layout-row nk:layout-row layout-row-begin nk:layout-row-begin layout-row-dynamic nk:layout-row-dynamic
+Builtin layout-row-end nk:layout-row-end layout-row-height nk:layout-row-height layout-row-push nk:layout-row-push
+Builtin layout-row-static nk:layout-row-static layout-row-template-begin nk:layout-row-template-begin
+Builtin layout-row-template-end nk:layout-row-template-end layout-space-begin nk:layout-space-begin
+Builtin layout-space-end nk:layout-space-end layout-space-push nk:layout-space-push layout-widget-bounds nk:layout-widget-bounds
+Builtin list-begin nk:list-begin list-end nk:list-end list-new nk:list-new list-range nk:list-range
+Builtin m! nk:m! m@ nk:m@ make-style nk:make-style max-vertex-element nk:max-vertex-element measure nk:measure
+Builtin measure-font nk:measure-font menu-begin nk:menu-begin menu-close nk:menu-close menu-end nk:menu-end
+Builtin menu-item-image nk:menu-item-image menu-item-label nk:menu-item-label menu-item-symbol nk:menu-item-symbol
+Builtin menubar-begin nk:menubar-begin menubar-end nk:menubar-end mouse-pos nk:mouse-pos msgdlg nk:msgdlg
+Builtin option nk:option plot nk:plot plot-fn nk:plot-fn pop-font nk:pop-font popup-begin nk:popup-begin
+Builtin popup-close nk:popup-close popup-end nk:popup-end popup-scroll-ofs nk:popup-scroll-ofs popup-scroll-ofs! nk:popup-scroll-ofs!
+Builtin progress nk:progress prop-int nk:prop-int pt>local nk:pt>local pt>screen nk:pt>screen pts>rect nk:pts>rect
+Builtin push-font nk:push-font rect-center nk:rect-center rect-intersect nk:rect-intersect rect-ofs nk:rect-ofs
+Builtin rect-pad nk:rect-pad rect-shrink nk:rect-shrink rect-union nk:rect-union rect/high nk:rect/high
+Builtin rect/wide nk:rect/wide rect>center nk:rect>center rect>local nk:rect>local rect>pos nk:rect>pos
+Builtin rect>pts nk:rect>pts rect>screen nk:rect>screen rect>size nk:rect>size released? nk:released?
+Builtin render nk:render restore nk:restore rotate nk:rotate save nk:save scale nk:scale scancode? nk:scancode?
+Builtin screen-saver nk:screen-saver screen-size nk:screen-size screen-win-close nk:screen-win-close
+Builtin selectable nk:selectable set nk:set set-font nk:set-font set-num-vertices nk:set-num-vertices
+Builtin setpos nk:setpos setwin nk:setwin slider nk:slider slider-int nk:slider-int space nk:space
+Builtin spacing nk:spacing stroke-arc nk:stroke-arc stroke-circle nk:stroke-circle stroke-curve nk:stroke-curve
+Builtin stroke-line nk:stroke-line stroke-polygon nk:stroke-polygon stroke-polyline nk:stroke-polyline
+Builtin stroke-rect nk:stroke-rect stroke-tri nk:stroke-tri style-from-table nk:style-from-table sw-gl nk:sw-gl
+Builtin text? nk:text? tooltip nk:tooltip translate nk:translate tree-pop nk:tree-pop tree-state-push nk:tree-state-push
+Builtin use-style nk:use-style vsync nk:vsync widget nk:widget widget-bounds nk:widget-bounds widget-fitting nk:widget-fitting
+Builtin widget-high nk:widget-high widget-hovered? nk:widget-hovered? widget-mouse-click-down? nk:widget-mouse-click-down?
+Builtin widget-mouse-clicked? nk:widget-mouse-clicked? widget-pos nk:widget-pos widget-size nk:widget-size
+Builtin widget-wide nk:widget-wide win nk:win win-bounds nk:win-bounds win-bounds! nk:win-bounds! win-close nk:win-close
+Builtin win-closed? nk:win-closed? win-collapse nk:win-collapse win-collapsed? nk:win-collapsed? win-content-bounds nk:win-content-bounds
+Builtin win-focus nk:win-focus win-focused? nk:win-focused? win-hidden? nk:win-hidden? win-high nk:win-high
+Builtin win-hovered? nk:win-hovered? win-pos nk:win-pos win-scroll-ofs nk:win-scroll-ofs win-scroll-ofs! nk:win-scroll-ofs!
+Builtin win-show nk:win-show win-size nk:win-size win-wide nk:win-wide win? nk:win? MAX ns:MAX ! o:!
+Builtin + o:+ +? o:+? ??? o:??? @ o:@ class o:class exec o:exec isa o:isa method o:method mutate o:mutate
+Builtin new o:new super o:super devname os:devname env os:env lang os:lang mem-arenas os:mem-arenas
+Builtin notify os:notify region os:region cast ptr:cast len ptr:len null? ptr:null? pack ptr:pack unpack ptr:unpack
+Builtin unpack_orig ptr:unpack_orig publish pubsub:publish qsize pubsub:qsize subscribe pubsub:subscribe
Builtin + q:+ clear q:clear len q:len new q:new notify q:notify overwrite q:overwrite peek q:peek pick q:pick
-Builtin pop q:pop push q:push shift q:shift size q:size slide q:slide throwing q:throwing wait q:wait
-Builtin ++match r:++match +/ r:+/ +match r:+match / r:/ @ r:@ err? r:err? len r:len match r:match new r:new
-Builtin rx r:rx str r:str ! s:! * s:* + s:+ - s:- / s:/ /scripts s:/scripts <+ s:<+ = s:= =ic s:=ic
-Builtin >base64 s:>base64 >ucs2 s:>ucs2 @ s:@ append s:append base64> s:base64> clear s:clear cmp s:cmp
-Builtin cmpi s:cmpi compress s:compress days! s:days! each s:each eachline s:eachline expand s:expand
-Builtin fill s:fill fmt s:fmt gershayim s:gershayim globmatch s:globmatch hexupr s:hexupr insert s:insert
-Builtin intl s:intl intl! s:intl! lang s:lang lc s:lc len s:len lsub s:lsub ltrim s:ltrim map s:map
-Builtin months! s:months! new s:new replace s:replace replace! s:replace! rev s:rev rsearch s:rsearch
-Builtin rsub s:rsub rtrim s:rtrim script? s:script? search s:search size s:size slice s:slice strfmap s:strfmap
-Builtin strfmt s:strfmt trim s:trim tsub s:tsub uc s:uc ucs2> s:ucs2> utf8? s:utf8? zt s:zt close sio:close
-Builtin enum sio:enum open sio:open opts! sio:opts! opts@ sio:opts@ read sio:read write sio:write new smtp:new
-Builtin send smtp:send apply-filter snd:apply-filter devices? snd:devices? end-record snd:end-record
-Builtin filter snd:filter formats? snd:formats? freq snd:freq gain snd:gain gain? snd:gain? len snd:len
-Builtin loop snd:loop mix snd:mix new snd:new pause snd:pause play snd:play played snd:played rate snd:rate
-Builtin record snd:record seek snd:seek stop snd:stop stopall snd:stopall unmix snd:unmix volume snd:volume
-Builtin volume? snd:volume? + st:+ . st:. clear st:clear len st:len ndrop st:ndrop new st:new op! st:op!
-Builtin peek st:peek pick st:pick pop st:pop push st:push roll st:roll shift st:shift size st:size
-Builtin slide st:slide swap st:swap throwing st:throwing >buf struct:>buf arr> struct:arr> buf struct:buf
-Builtin buf> struct:buf> byte struct:byte double struct:double field! struct:field! field@ struct:field@
-Builtin float struct:float ignore struct:ignore int struct:int long struct:long struct; struct:struct;
-Builtin word struct:word ! t:! @ t:@ assign t:assign curtask t:curtask def-queue t:def-queue def-stack t:def-stack
-Builtin done? t:done? err! t:err! err? t:err? getq t:getq guitask t:guitask handler t:handler kill t:kill
-Builtin list t:list main t:main name! t:name! name@ t:name@ notify t:notify pop t:pop priority t:priority
-Builtin push t:push push< t:push< q-notify t:q-notify q-wait t:q-wait qlen t:qlen result t:result task t:task
-Builtin task-n t:task-n task-stop t:task-stop wait t:wait ! w:! @ w:@ alias: w:alias: cb w:cb deprecate w:deprecate
-Builtin exec w:exec exec? w:exec? ffifail w:ffifail find w:find forget w:forget is w:is undo w:undo
-Builtin >s xml:>s >txt xml:>txt parse xml:parse parse-html xml:parse-html parse-stream xml:parse-stream
+Builtin pop q:pop push q:push remove q:remove shift q:shift size q:size slide q:slide throwing q:throwing
+Builtin wait q:wait ++match r:++match +/ r:+/ +match r:+match / r:/ @ r:@ len r:len match r:match new r:new
+Builtin rx r:rx str r:str * rat:* + rat:+ - rat:- / rat:/ >n rat:>n >s rat:>s new rat:new proper rat:proper
+Builtin ! s:! * s:* + s:+ - s:- / s:/ /scripts s:/scripts <+ s:<+ = s:= =ic s:=ic >base64 s:>base64
+Builtin >ucs2 s:>ucs2 @ s:@ append s:append base64> s:base64> clear s:clear cmp s:cmp cmpi s:cmpi compress s:compress
+Builtin days! s:days! dist s:dist each s:each each! s:each! eachline s:eachline escape s:escape expand s:expand
+Builtin fill s:fill fmt s:fmt fold s:fold gershayim s:gershayim globmatch s:globmatch hexupr s:hexupr
+Builtin insert s:insert intl s:intl intl! s:intl! lang s:lang lc s:lc lc? s:lc? len s:len lsub s:lsub
+Builtin ltrim s:ltrim map s:map months! s:months! new s:new norm s:norm reduce s:reduce repinsert s:repinsert
+Builtin replace s:replace replace! s:replace! rev s:rev rsearch s:rsearch rsub s:rsub rtrim s:rtrim
+Builtin script? s:script? search s:search size s:size slice s:slice soundex s:soundex strfmap s:strfmap
+Builtin strfmt s:strfmt text-wrap s:text-wrap trim s:trim tsub s:tsub uc s:uc uc? s:uc? ucs2> s:ucs2>
+Builtin utf8? s:utf8? zt s:zt close sio:close enum sio:enum open sio:open opts! sio:opts! opts@ sio:opts@
+Builtin read sio:read write sio:write @ slv:@ auto slv:auto build slv:build constraint slv:constraint
+Builtin dump slv:dump edit slv:edit named-variable slv:named-variable new slv:new relation slv:relation
+Builtin reset slv:reset suggest slv:suggest term slv:term update slv:update v[] slv:v[] variable slv:variable
+Builtin v{} slv:v{} new smtp:new send smtp:send apply-filter snd:apply-filter devices? snd:devices?
+Builtin end-record snd:end-record filter snd:filter formats? snd:formats? freq snd:freq gain snd:gain
+Builtin gain? snd:gain? init snd:init len snd:len loop snd:loop loop? snd:loop? mix snd:mix new snd:new
+Builtin pause snd:pause play snd:play played snd:played rate snd:rate ready? snd:ready? record snd:record
+Builtin resume snd:resume seek snd:seek stop snd:stop stopall snd:stopall volume snd:volume volume? snd:volume?
+Builtin + st:+ . st:. clear st:clear len st:len ndrop st:ndrop new st:new op! st:op! peek st:peek pick st:pick
+Builtin pop st:pop push st:push roll st:roll shift st:shift size st:size slide st:slide swap st:swap
+Builtin throwing st:throwing >buf struct:>buf arr> struct:arr> buf struct:buf buf> struct:buf> byte struct:byte
+Builtin double struct:double field! struct:field! field@ struct:field@ float struct:float ignore struct:ignore
+Builtin int struct:int long struct:long struct; struct:struct; word struct:word ! t:! @ t:@ by-name t:by-name
+Builtin cor t:cor cor-drop t:cor-drop curtask t:curtask def-queue t:def-queue def-stack t:def-stack
+Builtin done? t:done? err! t:err! err? t:err? errno? t:errno? getq t:getq handler t:handler handler@ t:handler@
+Builtin kill t:kill list t:list main t:main max-exceptions t:max-exceptions name! t:name! name@ t:name@
+Builtin notify t:notify parent t:parent pop t:pop priority t:priority push t:push q-notify t:q-notify
+Builtin q-wait t:q-wait qlen t:qlen result t:result set-affinity t:set-affinity setq t:setq start t:start
+Builtin task t:task task-n t:task-n task-stop t:task-stop wait t:wait yield t:yield yield! t:yield!
+Builtin add tree:add binary tree:binary bk tree:bk btree tree:btree cmp! tree:cmp! data tree:data del tree:del
+Builtin find tree:find iter tree:iter next tree:next nodes tree:nodes parent tree:parent parse tree:parse
+Builtin prev tree:prev root tree:root search tree:search trie tree:trie ! w:! (is) w:(is) @ w:@ alias: w:alias:
+Builtin cb w:cb deprecate w:deprecate dlcall w:dlcall dlopen w:dlopen dlsym w:dlsym exec w:exec exec? w:exec?
+Builtin ffifail w:ffifail find w:find forget w:forget is w:is name w:name undo w:undo >s xml:>s >txt xml:>txt
+Builtin md-init xml:md-init md-parse xml:md-parse parse xml:parse parse-html xml:parse-html parse-stream xml:parse-stream
Builtin getmsg[] zmq:getmsg[] sendmsg[] zmq:sendmsg[]
+
" numbers
syn keyword eighthMath decimal hex base@ base!
syn match eighthInteger '\<-\=[0-9.]*[0-9.]\+\>'
+
" recognize hex and binary numbers, the '$' and '%' notation is for eighth
syn match eighthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess
syn match eighthInteger '\<\x*\d\x*\>' " *2* --- this order!
@@ -280,20 +353,17 @@ syn match eighthInteger "\<'.\>"
syn region eighthString start=+\.\?\"+ skip=+"+ end=+$+
syn keyword jsonNull null
syn keyword jsonBool /\(true\|false\)/
- syn region eighthString start=/\<"/ end=/"\>/
+syn region eighthString start=/\<"/ end=/"\>/
syn match jsonObjEntry /"\"[^"]\+\"\ze\s*:/
-"syn region jsonObject start=/{/ end=/}/ contained contains=jsonObjEntry,jsonArray,jsonObject, jsonBool, eighthString
-"syn region jsonArray start=/\[/ end=/\]/ contained contains=jsonArray,jsonObject, jsonBool, eighthString
-
" Include files
-" syn match eighthInclude '\<\(libinclude\|include\|needs\)\s\+\S\+'
syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
" Define the default highlighting.
if !exists("did_eighth_syntax_inits")
let did_eighth_syntax_inits=1
- " The default methods for highlighting. Can be overridden later.
+
+ " The default methods for highlighting. Can be overriden later.
hi def link eighthTodo Todo
hi def link eighthOperators Operator
hi def link eighthMath Number
@@ -320,16 +390,15 @@ if !exists("did_eighth_syntax_inits")
hi def link eighthBuiltin Define
hi def link eighthClasses Define
hi def link eighthClassWord Keyword
-
hi def link jsonObject Delimiter
hi def link jsonObjEntry Label
hi def link jsonArray Special
- hi def link jsonNull Function
- hi def link jsonBool Boolean
+ hi def link jsonNull Function
+ hi def link jsonBool Boolean
endif
let b:current_syntax = "8th"
let &cpo = s:cpo_save
unlet s:cpo_save
-" vim: ts=8:sw=4:nocindent:smartindent:
+" vim: ft=vim:ts=8:sw=4:nocindent:smartindent:
diff --git a/runtime/syntax/chicken.vim b/runtime/syntax/chicken.vim
index 806d08fbb7..f53d872e74 100644
--- a/runtime/syntax/chicken.vim
+++ b/runtime/syntax/chicken.vim
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: Scheme (CHICKEN)
-" Last Change: 2021 Jul 30
+" Last Change: 2021 Oct 01
" Author: Evan Hanson <evhan@foldling.org>
" Maintainer: Evan Hanson <evhan@foldling.org>
" Repository: https://git.foldling.org/vim-scheme.git
@@ -37,7 +37,7 @@ if len(s:c)
syn region c matchgroup=schemeComment start=/#>/ end=/<#/ contains=@c
endif
-# SRFI 26
+" SRFI 26
syn match schemeSyntax /\(([ \t\n]*\)\@<=\(cut\|cute\)\>/
syn keyword schemeSyntax and-let*
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/go.vim b/runtime/syntax/go.vim
index 1439487f69..0c326254b8 100644
--- a/runtime/syntax/go.vim
+++ b/runtime/syntax/go.vim
@@ -5,7 +5,7 @@
" go.vim: Vim syntax file for Go.
" Language: Go
" Maintainer: Billie Cleek <bhcleek@gmail.com>
-" Latest Revision: 2021-06-26
+" Latest Revision: 2021-09-18
" License: BSD-style. See LICENSE file in source repository.
" Repository: https://github.com/fatih/vim-go
@@ -250,7 +250,7 @@ syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
-syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
+syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
@@ -430,7 +430,7 @@ endif
" Build Constraints
if s:HighlightBuildConstraints()
- syn match goBuildKeyword display contained "+build"
+ syn match goBuildKeyword display contained "+build\|go:build"
" Highlight the known values of GOOS, GOARCH, and other +build options.
syn keyword goBuildDirectives contained
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
diff --git a/runtime/syntax/gprof.vim b/runtime/syntax/gprof.vim
index 880452a84b..d2c5cb4cab 100644
--- a/runtime/syntax/gprof.vim
+++ b/runtime/syntax/gprof.vim
@@ -1,15 +1,16 @@
" Vim syntax file
" Language: Syntax for Gprof Output
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
-" Last Change: 2021 Apr 08
+" Last Change: 2021 Sep 19
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
- finish
+ finish
endif
let s:keepcpo= &cpo
set cpo&vim
+syn spell notoplevel
syn case match
syn sync minlines=100
diff --git a/runtime/syntax/nginx.vim b/runtime/syntax/nginx.vim
new file mode 100644
index 0000000000..18dd50cbb2
--- /dev/null
+++ b/runtime/syntax/nginx.vim
@@ -0,0 +1,2307 @@
+" Vim syntax file
+" Language: nginx.conf
+" Maintainer: Chris Aumann <me@chr4.org>
+" Last Change: Apr 15, 2017
+
+if exists("b:current_syntax")
+ finish
+end
+
+let b:current_syntax = "nginx"
+
+syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
+syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
+syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
+syn region ngxBlock start=+^+ end=+{+ skip=+\${\|{{\|{%+ contains=ngxComment,ngxInteger,ngxIPaddr,ngxDirectiveBlock,ngxVariableBlock,ngxString,ngxThirdPartyLuaBlock oneline
+syn region ngxString start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString,ngxSSLCipherInsecure
+syn match ngxComment ' *#.*$'
+
+" These regular expressions where taken (and adapted) from
+" http://vim.1045645.n5.nabble.com/IPv6-support-for-quot-dns-quot-zonefile-syntax-highlighting-td1197292.html
+syn match ngxInteger '\W\zs\(\d[0-9.]*\|[0-9.]*\d\)\w\?\ze\W'
+syn match ngxIPaddr '\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{6}\(\x\{1,4}:\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[::\(\(\x\{1,4}:\)\{,6}\x\{1,4}\|\(\x\{1,4}:\)\{,5}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{1}:\(\(\x\{1,4}:\)\{,5}\x\{1,4}\|\(\x\{1,4}:\)\{,4}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{2}:\(\(\x\{1,4}:\)\{,4}\x\{1,4}\|\(\x\{1,4}:\)\{,3}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{3}:\(\(\x\{1,4}:\)\{,3}\x\{1,4}\|\(\x\{1,4}:\)\{,2}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{4}:\(\(\x\{1,4}:\)\{,2}\x\{1,4}\|\(\x\{1,4}:\)\{,1}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{5}:\(\(\x\{1,4}:\)\{,1}\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]'
+syn match ngxIPaddr '\[\(\x\{1,4}:\)\{6}:\x\{1,4}\]'
+
+" Highlight wildcard listening signs also as IPaddr
+syn match ngxIPaddr '\s\zs\[::]'
+syn match ngxIPaddr '\s\zs\*'
+
+syn keyword ngxBoolean on
+syn keyword ngxBoolean off
+
+syn keyword ngxDirectiveBlock http contained
+syn keyword ngxDirectiveBlock mail contained
+syn keyword ngxDirectiveBlock events contained
+syn keyword ngxDirectiveBlock server contained
+syn keyword ngxDirectiveBlock match contained
+syn keyword ngxDirectiveBlock types contained
+syn keyword ngxDirectiveBlock location contained
+syn keyword ngxDirectiveBlock upstream contained
+syn keyword ngxDirectiveBlock charset_map contained
+syn keyword ngxDirectiveBlock limit_except contained
+syn keyword ngxDirectiveBlock if contained
+syn keyword ngxDirectiveBlock geo contained
+syn keyword ngxDirectiveBlock map contained
+syn keyword ngxDirectiveBlock split_clients contained
+
+syn keyword ngxDirectiveImportant include
+syn keyword ngxDirectiveImportant root
+syn keyword ngxDirectiveImportant server contained
+syn region ngxDirectiveImportantServer matchgroup=ngxDirectiveImportant start=+^\s*\zsserver\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxUpstreamServerOptions,ngxString,ngxIPaddr,ngxBoolean,ngxInteger,ngxTemplateVar
+syn keyword ngxDirectiveImportant server_name
+syn keyword ngxDirectiveImportant listen contained
+syn region ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=+listen+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxListenOptions,ngxString,ngxIPaddr,ngxBoolean,ngxInteger,ngxTemplateVar
+syn keyword ngxDirectiveImportant internal
+syn keyword ngxDirectiveImportant proxy_pass
+syn keyword ngxDirectiveImportant memcached_pass
+syn keyword ngxDirectiveImportant fastcgi_pass
+syn keyword ngxDirectiveImportant scgi_pass
+syn keyword ngxDirectiveImportant uwsgi_pass
+syn keyword ngxDirectiveImportant try_files
+syn keyword ngxDirectiveImportant error_page
+syn keyword ngxDirectiveImportant post_action
+
+syn keyword ngxUpstreamServerOptions weight contained
+syn keyword ngxUpstreamServerOptions max_conns contained
+syn keyword ngxUpstreamServerOptions max_fails contained
+syn keyword ngxUpstreamServerOptions fail_timeout contained
+syn keyword ngxUpstreamServerOptions backup contained
+syn keyword ngxUpstreamServerOptions down contained
+syn keyword ngxUpstreamServerOptions resolve contained
+syn keyword ngxUpstreamServerOptions route contained
+syn keyword ngxUpstreamServerOptions service contained
+syn keyword ngxUpstreamServerOptions default_server contained
+syn keyword ngxUpstreamServerOptions slow_start contained
+
+syn keyword ngxListenOptions default_server contained
+syn keyword ngxListenOptions ssl contained
+syn keyword ngxListenOptions http2 contained
+syn keyword ngxListenOptions spdy contained
+syn keyword ngxListenOptions proxy_protocol contained
+syn keyword ngxListenOptions setfib contained
+syn keyword ngxListenOptions fastopen contained
+syn keyword ngxListenOptions backlog contained
+syn keyword ngxListenOptions rcvbuf contained
+syn keyword ngxListenOptions sndbuf contained
+syn keyword ngxListenOptions accept_filter contained
+syn keyword ngxListenOptions deferred contained
+syn keyword ngxListenOptions bind contained
+syn keyword ngxListenOptions ipv6only contained
+syn keyword ngxListenOptions reuseport contained
+syn keyword ngxListenOptions so_keepalive contained
+syn keyword ngxListenOptions keepidle contained
+
+syn keyword ngxDirectiveControl break
+syn keyword ngxDirectiveControl return
+syn keyword ngxDirectiveControl rewrite
+syn keyword ngxDirectiveControl set
+
+syn keyword ngxDirectiveDeprecated connections
+syn keyword ngxDirectiveDeprecated imap
+syn keyword ngxDirectiveDeprecated limit_zone
+syn keyword ngxDirectiveDeprecated mysql_test
+syn keyword ngxDirectiveDeprecated open_file_cache_retest
+syn keyword ngxDirectiveDeprecated optimize_server_names
+syn keyword ngxDirectiveDeprecated satisfy_any
+syn keyword ngxDirectiveDeprecated so_keepalive
+
+syn keyword ngxDirective absolute_redirect
+syn keyword ngxDirective accept_mutex
+syn keyword ngxDirective accept_mutex_delay
+syn keyword ngxDirective acceptex_read
+syn keyword ngxDirective access_log
+syn keyword ngxDirective add_after_body
+syn keyword ngxDirective add_before_body
+syn keyword ngxDirective add_header
+syn keyword ngxDirective addition_types
+syn keyword ngxDirective aio
+syn keyword ngxDirective aio_write
+syn keyword ngxDirective alias
+syn keyword ngxDirective allow
+syn keyword ngxDirective ancient_browser
+syn keyword ngxDirective ancient_browser_value
+syn keyword ngxDirective auth_basic
+syn keyword ngxDirective auth_basic_user_file
+syn keyword ngxDirective auth_http
+syn keyword ngxDirective auth_http_header
+syn keyword ngxDirective auth_http_pass_client_cert
+syn keyword ngxDirective auth_http_timeout
+syn keyword ngxDirective auth_jwt
+syn keyword ngxDirective auth_jwt_key_file
+syn keyword ngxDirective auth_request
+syn keyword ngxDirective auth_request_set
+syn keyword ngxDirective autoindex
+syn keyword ngxDirective autoindex_exact_size
+syn keyword ngxDirective autoindex_format
+syn keyword ngxDirective autoindex_localtime
+syn keyword ngxDirective charset
+syn keyword ngxDirective charset_map
+syn keyword ngxDirective charset_types
+syn keyword ngxDirective chunked_transfer_encoding
+syn keyword ngxDirective client_body_buffer_size
+syn keyword ngxDirective client_body_in_file_only
+syn keyword ngxDirective client_body_in_single_buffer
+syn keyword ngxDirective client_body_temp_path
+syn keyword ngxDirective client_body_timeout
+syn keyword ngxDirective client_header_buffer_size
+syn keyword ngxDirective client_header_timeout
+syn keyword ngxDirective client_max_body_size
+syn keyword ngxDirective connection_pool_size
+syn keyword ngxDirective create_full_put_path
+syn keyword ngxDirective daemon
+syn keyword ngxDirective dav_access
+syn keyword ngxDirective dav_methods
+syn keyword ngxDirective debug_connection
+syn keyword ngxDirective debug_points
+syn keyword ngxDirective default_type
+syn keyword ngxDirective degradation
+syn keyword ngxDirective degrade
+syn keyword ngxDirective deny
+syn keyword ngxDirective devpoll_changes
+syn keyword ngxDirective devpoll_events
+syn keyword ngxDirective directio
+syn keyword ngxDirective directio_alignment
+syn keyword ngxDirective disable_symlinks
+syn keyword ngxDirective empty_gif
+syn keyword ngxDirective env
+syn keyword ngxDirective epoll_events
+syn keyword ngxDirective error_log
+syn keyword ngxDirective etag
+syn keyword ngxDirective eventport_events
+syn keyword ngxDirective expires
+syn keyword ngxDirective f4f
+syn keyword ngxDirective f4f_buffer_size
+syn keyword ngxDirective fastcgi_bind
+syn keyword ngxDirective fastcgi_buffer_size
+syn keyword ngxDirective fastcgi_buffering
+syn keyword ngxDirective fastcgi_buffers
+syn keyword ngxDirective fastcgi_busy_buffers_size
+syn keyword ngxDirective fastcgi_cache
+syn keyword ngxDirective fastcgi_cache_bypass
+syn keyword ngxDirective fastcgi_cache_key
+syn keyword ngxDirective fastcgi_cache_lock
+syn keyword ngxDirective fastcgi_cache_lock_age
+syn keyword ngxDirective fastcgi_cache_lock_timeout
+syn keyword ngxDirective fastcgi_cache_max_range_offset
+syn keyword ngxDirective fastcgi_cache_methods
+syn keyword ngxDirective fastcgi_cache_min_uses
+syn keyword ngxDirective fastcgi_cache_path
+syn keyword ngxDirective fastcgi_cache_purge
+syn keyword ngxDirective fastcgi_cache_revalidate
+syn keyword ngxDirective fastcgi_cache_use_stale
+syn keyword ngxDirective fastcgi_cache_valid
+syn keyword ngxDirective fastcgi_catch_stderr
+syn keyword ngxDirective fastcgi_connect_timeout
+syn keyword ngxDirective fastcgi_force_ranges
+syn keyword ngxDirective fastcgi_hide_header
+syn keyword ngxDirective fastcgi_ignore_client_abort
+syn keyword ngxDirective fastcgi_ignore_headers
+syn keyword ngxDirective fastcgi_index
+syn keyword ngxDirective fastcgi_intercept_errors
+syn keyword ngxDirective fastcgi_keep_conn
+syn keyword ngxDirective fastcgi_limit_rate
+syn keyword ngxDirective fastcgi_max_temp_file_size
+syn keyword ngxDirective fastcgi_next_upstream
+syn keyword ngxDirective fastcgi_next_upstream_timeout
+syn keyword ngxDirective fastcgi_next_upstream_tries
+syn keyword ngxDirective fastcgi_no_cache
+syn keyword ngxDirective fastcgi_param
+syn keyword ngxDirective fastcgi_pass_header
+syn keyword ngxDirective fastcgi_pass_request_body
+syn keyword ngxDirective fastcgi_pass_request_headers
+syn keyword ngxDirective fastcgi_read_timeout
+syn keyword ngxDirective fastcgi_request_buffering
+syn keyword ngxDirective fastcgi_send_lowat
+syn keyword ngxDirective fastcgi_send_timeout
+syn keyword ngxDirective fastcgi_split_path_info
+syn keyword ngxDirective fastcgi_store
+syn keyword ngxDirective fastcgi_store_access
+syn keyword ngxDirective fastcgi_temp_file_write_size
+syn keyword ngxDirective fastcgi_temp_path
+syn keyword ngxDirective flv
+syn keyword ngxDirective geoip_city
+syn keyword ngxDirective geoip_country
+syn keyword ngxDirective geoip_org
+syn keyword ngxDirective geoip_proxy
+syn keyword ngxDirective geoip_proxy_recursive
+syn keyword ngxDirective google_perftools_profiles
+syn keyword ngxDirective gunzip
+syn keyword ngxDirective gunzip_buffers
+syn keyword ngxDirective gzip nextgroup=ngxGzipOn,ngxGzipOff skipwhite
+syn keyword ngxGzipOn on contained
+syn keyword ngxGzipOff off contained
+syn keyword ngxDirective gzip_buffers
+syn keyword ngxDirective gzip_comp_level
+syn keyword ngxDirective gzip_disable
+syn keyword ngxDirective gzip_hash
+syn keyword ngxDirective gzip_http_version
+syn keyword ngxDirective gzip_min_length
+syn keyword ngxDirective gzip_no_buffer
+syn keyword ngxDirective gzip_proxied
+syn keyword ngxDirective gzip_static
+syn keyword ngxDirective gzip_types
+syn keyword ngxDirective gzip_vary
+syn keyword ngxDirective gzip_window
+syn keyword ngxDirective hash
+syn keyword ngxDirective health_check
+syn keyword ngxDirective health_check_timeout
+syn keyword ngxDirective hls
+syn keyword ngxDirective hls_buffers
+syn keyword ngxDirective hls_forward_args
+syn keyword ngxDirective hls_fragment
+syn keyword ngxDirective hls_mp4_buffer_size
+syn keyword ngxDirective hls_mp4_max_buffer_size
+syn keyword ngxDirective http2_chunk_size
+syn keyword ngxDirective http2_body_preread_size
+syn keyword ngxDirective http2_idle_timeout
+syn keyword ngxDirective http2_max_concurrent_streams
+syn keyword ngxDirective http2_max_field_size
+syn keyword ngxDirective http2_max_header_size
+syn keyword ngxDirective http2_max_requests
+syn keyword ngxDirective http2_recv_buffer_size
+syn keyword ngxDirective http2_recv_timeout
+syn keyword ngxDirective if_modified_since
+syn keyword ngxDirective ignore_invalid_headers
+syn keyword ngxDirective image_filter
+syn keyword ngxDirective image_filter_buffer
+syn keyword ngxDirective image_filter_interlace
+syn keyword ngxDirective image_filter_jpeg_quality
+syn keyword ngxDirective image_filter_sharpen
+syn keyword ngxDirective image_filter_transparency
+syn keyword ngxDirective image_filter_webp_quality
+syn keyword ngxDirective imap_auth
+syn keyword ngxDirective imap_capabilities
+syn keyword ngxDirective imap_client_buffer
+syn keyword ngxDirective index
+syn keyword ngxDirective iocp_threads
+syn keyword ngxDirective ip_hash
+syn keyword ngxDirective js_access
+syn keyword ngxDirective js_content
+syn keyword ngxDirective js_filter
+syn keyword ngxDirective js_include
+syn keyword ngxDirective js_preread
+syn keyword ngxDirective js_set
+syn keyword ngxDirective keepalive
+syn keyword ngxDirective keepalive_disable
+syn keyword ngxDirective keepalive_requests
+syn keyword ngxDirective keepalive_timeout
+syn keyword ngxDirective kqueue_changes
+syn keyword ngxDirective kqueue_events
+syn keyword ngxDirective large_client_header_buffers
+syn keyword ngxDirective least_conn
+syn keyword ngxDirective least_time
+syn keyword ngxDirective limit_conn
+syn keyword ngxDirective limit_conn_dry_run
+syn keyword ngxDirective limit_conn_log_level
+syn keyword ngxDirective limit_conn_status
+syn keyword ngxDirective limit_conn_zone
+syn keyword ngxDirective limit_except
+syn keyword ngxDirective limit_rate
+syn keyword ngxDirective limit_rate_after
+syn keyword ngxDirective limit_req
+syn keyword ngxDirective limit_req_dry_run
+syn keyword ngxDirective limit_req_log_level
+syn keyword ngxDirective limit_req_status
+syn keyword ngxDirective limit_req_zone
+syn keyword ngxDirective lingering_close
+syn keyword ngxDirective lingering_time
+syn keyword ngxDirective lingering_timeout
+syn keyword ngxDirective load_module
+syn keyword ngxDirective lock_file
+syn keyword ngxDirective log_format
+syn keyword ngxDirective log_not_found
+syn keyword ngxDirective log_subrequest
+syn keyword ngxDirective map_hash_bucket_size
+syn keyword ngxDirective map_hash_max_size
+syn keyword ngxDirective master_process
+syn keyword ngxDirective max_ranges
+syn keyword ngxDirective memcached_bind
+syn keyword ngxDirective memcached_buffer_size
+syn keyword ngxDirective memcached_connect_timeout
+syn keyword ngxDirective memcached_force_ranges
+syn keyword ngxDirective memcached_gzip_flag
+syn keyword ngxDirective memcached_next_upstream
+syn keyword ngxDirective memcached_next_upstream_timeout
+syn keyword ngxDirective memcached_next_upstream_tries
+syn keyword ngxDirective memcached_read_timeout
+syn keyword ngxDirective memcached_send_timeout
+syn keyword ngxDirective merge_slashes
+syn keyword ngxDirective min_delete_depth
+syn keyword ngxDirective modern_browser
+syn keyword ngxDirective modern_browser_value
+syn keyword ngxDirective mp4
+syn keyword ngxDirective mp4_buffer_size
+syn keyword ngxDirective mp4_max_buffer_size
+syn keyword ngxDirective mp4_limit_rate
+syn keyword ngxDirective mp4_limit_rate_after
+syn keyword ngxDirective msie_padding
+syn keyword ngxDirective msie_refresh
+syn keyword ngxDirective multi_accept
+syn keyword ngxDirective ntlm
+syn keyword ngxDirective open_file_cache
+syn keyword ngxDirective open_file_cache_errors
+syn keyword ngxDirective open_file_cache_events
+syn keyword ngxDirective open_file_cache_min_uses
+syn keyword ngxDirective open_file_cache_valid
+syn keyword ngxDirective open_log_file_cache
+syn keyword ngxDirective output_buffers
+syn keyword ngxDirective override_charset
+syn keyword ngxDirective pcre_jit
+syn keyword ngxDirective perl
+syn keyword ngxDirective perl_modules
+syn keyword ngxDirective perl_require
+syn keyword ngxDirective perl_set
+syn keyword ngxDirective pid
+syn keyword ngxDirective pop3_auth
+syn keyword ngxDirective pop3_capabilities
+syn keyword ngxDirective port_in_redirect
+syn keyword ngxDirective post_acceptex
+syn keyword ngxDirective postpone_gzipping
+syn keyword ngxDirective postpone_output
+syn keyword ngxDirective preread_buffer_size
+syn keyword ngxDirective preread_timeout
+syn keyword ngxDirective protocol nextgroup=ngxMailProtocol skipwhite
+syn keyword ngxMailProtocol imap pop3 smtp contained
+syn keyword ngxDirective proxy
+syn keyword ngxDirective proxy_bind
+syn keyword ngxDirective proxy_buffer
+syn keyword ngxDirective proxy_buffer_size
+syn keyword ngxDirective proxy_buffering
+syn keyword ngxDirective proxy_buffers
+syn keyword ngxDirective proxy_busy_buffers_size
+syn keyword ngxDirective proxy_cache
+syn keyword ngxDirective proxy_cache_bypass
+syn keyword ngxDirective proxy_cache_convert_head
+syn keyword ngxDirective proxy_cache_key
+syn keyword ngxDirective proxy_cache_lock
+syn keyword ngxDirective proxy_cache_lock_age
+syn keyword ngxDirective proxy_cache_lock_timeout
+syn keyword ngxDirective proxy_cache_max_range_offset
+syn keyword ngxDirective proxy_cache_methods
+syn keyword ngxDirective proxy_cache_min_uses
+syn keyword ngxDirective proxy_cache_path
+syn keyword ngxDirective proxy_cache_purge
+syn keyword ngxDirective proxy_cache_revalidate
+syn keyword ngxDirective proxy_cache_use_stale
+syn keyword ngxDirective proxy_cache_valid
+syn keyword ngxDirective proxy_connect_timeout
+syn keyword ngxDirective proxy_cookie_domain
+syn keyword ngxDirective proxy_cookie_path
+syn keyword ngxDirective proxy_download_rate
+syn keyword ngxDirective proxy_force_ranges
+syn keyword ngxDirective proxy_headers_hash_bucket_size
+syn keyword ngxDirective proxy_headers_hash_max_size
+syn keyword ngxDirective proxy_hide_header
+syn keyword ngxDirective proxy_http_version
+syn keyword ngxDirective proxy_ignore_client_abort
+syn keyword ngxDirective proxy_ignore_headers
+syn keyword ngxDirective proxy_intercept_errors
+syn keyword ngxDirective proxy_limit_rate
+syn keyword ngxDirective proxy_max_temp_file_size
+syn keyword ngxDirective proxy_method
+syn keyword ngxDirective proxy_next_upstream contained
+syn region ngxDirectiveProxyNextUpstream matchgroup=ngxDirective start=+^\s*\zsproxy_next_upstream\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxProxyNextUpstreamOptions,ngxString,ngxTemplateVar
+syn keyword ngxDirective proxy_next_upstream_timeout
+syn keyword ngxDirective proxy_next_upstream_tries
+syn keyword ngxDirective proxy_no_cache
+syn keyword ngxDirective proxy_pass_error_message
+syn keyword ngxDirective proxy_pass_header
+syn keyword ngxDirective proxy_pass_request_body
+syn keyword ngxDirective proxy_pass_request_headers
+syn keyword ngxDirective proxy_protocol
+syn keyword ngxDirective proxy_protocol_timeout
+syn keyword ngxDirective proxy_read_timeout
+syn keyword ngxDirective proxy_redirect
+syn keyword ngxDirective proxy_request_buffering
+syn keyword ngxDirective proxy_responses
+syn keyword ngxDirective proxy_send_lowat
+syn keyword ngxDirective proxy_send_timeout
+syn keyword ngxDirective proxy_set_body
+syn keyword ngxDirective proxy_set_header
+syn keyword ngxDirective proxy_ssl_certificate
+syn keyword ngxDirective proxy_ssl_certificate_key
+syn keyword ngxDirective proxy_ssl_ciphers
+syn keyword ngxDirective proxy_ssl_crl
+syn keyword ngxDirective proxy_ssl_name
+syn keyword ngxDirective proxy_ssl_password_file
+syn keyword ngxDirective proxy_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
+syn keyword ngxDirective proxy_ssl_server_name
+syn keyword ngxDirective proxy_ssl_session_reuse
+syn keyword ngxDirective proxy_ssl_trusted_certificate
+syn keyword ngxDirective proxy_ssl_verify
+syn keyword ngxDirective proxy_ssl_verify_depth
+syn keyword ngxDirective proxy_store
+syn keyword ngxDirective proxy_store_access
+syn keyword ngxDirective proxy_temp_file_write_size
+syn keyword ngxDirective proxy_temp_path
+syn keyword ngxDirective proxy_timeout
+syn keyword ngxDirective proxy_upload_rate
+syn keyword ngxDirective queue
+syn keyword ngxDirective random_index
+syn keyword ngxDirective read_ahead
+syn keyword ngxDirective real_ip_header
+syn keyword ngxDirective real_ip_recursive
+syn keyword ngxDirective recursive_error_pages
+syn keyword ngxDirective referer_hash_bucket_size
+syn keyword ngxDirective referer_hash_max_size
+syn keyword ngxDirective request_pool_size
+syn keyword ngxDirective reset_timedout_connection
+syn keyword ngxDirective resolver
+syn keyword ngxDirective resolver_timeout
+syn keyword ngxDirective rewrite_log
+syn keyword ngxDirective rtsig_overflow_events
+syn keyword ngxDirective rtsig_overflow_test
+syn keyword ngxDirective rtsig_overflow_threshold
+syn keyword ngxDirective rtsig_signo
+syn keyword ngxDirective satisfy
+syn keyword ngxDirective scgi_bind
+syn keyword ngxDirective scgi_buffer_size
+syn keyword ngxDirective scgi_buffering
+syn keyword ngxDirective scgi_buffers
+syn keyword ngxDirective scgi_busy_buffers_size
+syn keyword ngxDirective scgi_cache
+syn keyword ngxDirective scgi_cache_bypass
+syn keyword ngxDirective scgi_cache_key
+syn keyword ngxDirective scgi_cache_lock
+syn keyword ngxDirective scgi_cache_lock_age
+syn keyword ngxDirective scgi_cache_lock_timeout
+syn keyword ngxDirective scgi_cache_max_range_offset
+syn keyword ngxDirective scgi_cache_methods
+syn keyword ngxDirective scgi_cache_min_uses
+syn keyword ngxDirective scgi_cache_path
+syn keyword ngxDirective scgi_cache_purge
+syn keyword ngxDirective scgi_cache_revalidate
+syn keyword ngxDirective scgi_cache_use_stale
+syn keyword ngxDirective scgi_cache_valid
+syn keyword ngxDirective scgi_connect_timeout
+syn keyword ngxDirective scgi_force_ranges
+syn keyword ngxDirective scgi_hide_header
+syn keyword ngxDirective scgi_ignore_client_abort
+syn keyword ngxDirective scgi_ignore_headers
+syn keyword ngxDirective scgi_intercept_errors
+syn keyword ngxDirective scgi_limit_rate
+syn keyword ngxDirective scgi_max_temp_file_size
+syn keyword ngxDirective scgi_next_upstream
+syn keyword ngxDirective scgi_next_upstream_timeout
+syn keyword ngxDirective scgi_next_upstream_tries
+syn keyword ngxDirective scgi_no_cache
+syn keyword ngxDirective scgi_param
+syn keyword ngxDirective scgi_pass_header
+syn keyword ngxDirective scgi_pass_request_body
+syn keyword ngxDirective scgi_pass_request_headers
+syn keyword ngxDirective scgi_read_timeout
+syn keyword ngxDirective scgi_request_buffering
+syn keyword ngxDirective scgi_send_timeout
+syn keyword ngxDirective scgi_store
+syn keyword ngxDirective scgi_store_access
+syn keyword ngxDirective scgi_temp_file_write_size
+syn keyword ngxDirective scgi_temp_path
+syn keyword ngxDirective secure_link
+syn keyword ngxDirective secure_link_md5
+syn keyword ngxDirective secure_link_secret
+syn keyword ngxDirective send_lowat
+syn keyword ngxDirective send_timeout
+syn keyword ngxDirective sendfile
+syn keyword ngxDirective sendfile_max_chunk
+syn keyword ngxDirective server_name_in_redirect
+syn keyword ngxDirective server_names_hash_bucket_size
+syn keyword ngxDirective server_names_hash_max_size
+syn keyword ngxDirective server_tokens
+syn keyword ngxDirective session_log
+syn keyword ngxDirective session_log_format
+syn keyword ngxDirective session_log_zone
+syn keyword ngxDirective set_real_ip_from
+syn keyword ngxDirective slice
+syn keyword ngxDirective smtp_auth
+syn keyword ngxDirective smtp_capabilities
+syn keyword ngxDirective smtp_client_buffer
+syn keyword ngxDirective smtp_greeting_delay
+syn keyword ngxDirective source_charset
+syn keyword ngxDirective spdy_chunk_size
+syn keyword ngxDirective spdy_headers_comp
+syn keyword ngxDirective spdy_keepalive_timeout
+syn keyword ngxDirective spdy_max_concurrent_streams
+syn keyword ngxDirective spdy_pool_size
+syn keyword ngxDirective spdy_recv_buffer_size
+syn keyword ngxDirective spdy_recv_timeout
+syn keyword ngxDirective spdy_streams_index_size
+syn keyword ngxDirective ssi
+syn keyword ngxDirective ssi_ignore_recycled_buffers
+syn keyword ngxDirective ssi_last_modified
+syn keyword ngxDirective ssi_min_file_chunk
+syn keyword ngxDirective ssi_silent_errors
+syn keyword ngxDirective ssi_types
+syn keyword ngxDirective ssi_value_length
+syn keyword ngxDirective ssl
+syn keyword ngxDirective ssl_buffer_size
+syn keyword ngxDirective ssl_certificate
+syn keyword ngxDirective ssl_certificate_key
+syn keyword ngxDirective ssl_ciphers
+syn keyword ngxDirective ssl_client_certificate
+syn keyword ngxDirective ssl_crl
+syn keyword ngxDirective ssl_dhparam
+syn keyword ngxDirective ssl_ecdh_curve
+syn keyword ngxDirective ssl_engine
+syn keyword ngxDirective ssl_handshake_timeout
+syn keyword ngxDirective ssl_password_file
+syn keyword ngxDirective ssl_prefer_server_ciphers nextgroup=ngxSSLPreferServerCiphersOff,ngxSSLPreferServerCiphersOn skipwhite
+syn keyword ngxSSLPreferServerCiphersOn on contained
+syn keyword ngxSSLPreferServerCiphersOff off contained
+syn keyword ngxDirective ssl_preread
+syn keyword ngxDirective ssl_protocols nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+syn match ngxSSLProtocol 'TLSv1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+syn match ngxSSLProtocol 'TLSv1\.1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+syn match ngxSSLProtocol 'TLSv1\.2' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+syn match ngxSSLProtocol 'TLSv1\.3' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+
+" Do not enable highlighting of insecure protocols if sslecure is loaded
+if !exists('g:loaded_sslsecure')
+ syn keyword ngxSSLProtocolDeprecated SSLv2 SSLv3 contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+else
+ syn match ngxSSLProtocol 'SSLv2' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+ syn match ngxSSLProtocol 'SSLv3' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite
+endif
+
+syn keyword ngxDirective ssl_session_cache
+syn keyword ngxDirective ssl_session_ticket_key
+syn keyword ngxDirective ssl_session_tickets nextgroup=ngxSSLSessionTicketsOn,ngxSSLSessionTicketsOff skipwhite
+syn keyword ngxSSLSessionTicketsOn on contained
+syn keyword ngxSSLSessionTicketsOff off contained
+syn keyword ngxDirective ssl_session_timeout
+syn keyword ngxDirective ssl_stapling
+syn keyword ngxDirective ssl_stapling_file
+syn keyword ngxDirective ssl_stapling_responder
+syn keyword ngxDirective ssl_stapling_verify
+syn keyword ngxDirective ssl_trusted_certificate
+syn keyword ngxDirective ssl_verify_client
+syn keyword ngxDirective ssl_verify_depth
+syn keyword ngxDirective starttls
+syn keyword ngxDirective state
+syn keyword ngxDirective status
+syn keyword ngxDirective status_format
+syn keyword ngxDirective status_zone
+syn keyword ngxDirective sticky contained
+syn keyword ngxDirective sticky_cookie_insert contained
+syn region ngxDirectiveSticky matchgroup=ngxDirective start=+^\s*\zssticky\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxCookieOptions,ngxString,ngxBoolean,ngxInteger,ngxTemplateVar
+syn keyword ngxDirective stub_status
+syn keyword ngxDirective sub_filter
+syn keyword ngxDirective sub_filter_last_modified
+syn keyword ngxDirective sub_filter_once
+syn keyword ngxDirective sub_filter_types
+syn keyword ngxDirective tcp_nodelay
+syn keyword ngxDirective tcp_nopush
+syn keyword ngxDirective thread_pool
+syn keyword ngxDirective thread_stack_size
+syn keyword ngxDirective timeout
+syn keyword ngxDirective timer_resolution
+syn keyword ngxDirective types_hash_bucket_size
+syn keyword ngxDirective types_hash_max_size
+syn keyword ngxDirective underscores_in_headers
+syn keyword ngxDirective uninitialized_variable_warn
+syn keyword ngxDirective upstream_conf
+syn keyword ngxDirective use
+syn keyword ngxDirective user
+syn keyword ngxDirective userid
+syn keyword ngxDirective userid_domain
+syn keyword ngxDirective userid_expires
+syn keyword ngxDirective userid_mark
+syn keyword ngxDirective userid_name
+syn keyword ngxDirective userid_p3p
+syn keyword ngxDirective userid_path
+syn keyword ngxDirective userid_service
+syn keyword ngxDirective uwsgi_bind
+syn keyword ngxDirective uwsgi_buffer_size
+syn keyword ngxDirective uwsgi_buffering
+syn keyword ngxDirective uwsgi_buffers
+syn keyword ngxDirective uwsgi_busy_buffers_size
+syn keyword ngxDirective uwsgi_cache
+syn keyword ngxDirective uwsgi_cache_bypass
+syn keyword ngxDirective uwsgi_cache_key
+syn keyword ngxDirective uwsgi_cache_lock
+syn keyword ngxDirective uwsgi_cache_lock_age
+syn keyword ngxDirective uwsgi_cache_lock_timeout
+syn keyword ngxDirective uwsgi_cache_methods
+syn keyword ngxDirective uwsgi_cache_min_uses
+syn keyword ngxDirective uwsgi_cache_path
+syn keyword ngxDirective uwsgi_cache_purge
+syn keyword ngxDirective uwsgi_cache_revalidate
+syn keyword ngxDirective uwsgi_cache_use_stale
+syn keyword ngxDirective uwsgi_cache_valid
+syn keyword ngxDirective uwsgi_connect_timeout
+syn keyword ngxDirective uwsgi_force_ranges
+syn keyword ngxDirective uwsgi_hide_header
+syn keyword ngxDirective uwsgi_ignore_client_abort
+syn keyword ngxDirective uwsgi_ignore_headers
+syn keyword ngxDirective uwsgi_intercept_errors
+syn keyword ngxDirective uwsgi_limit_rate
+syn keyword ngxDirective uwsgi_max_temp_file_size
+syn keyword ngxDirective uwsgi_modifier1
+syn keyword ngxDirective uwsgi_modifier2
+syn keyword ngxDirective uwsgi_next_upstream
+syn keyword ngxDirective uwsgi_next_upstream_timeout
+syn keyword ngxDirective uwsgi_next_upstream_tries
+syn keyword ngxDirective uwsgi_no_cache
+syn keyword ngxDirective uwsgi_param
+syn keyword ngxDirective uwsgi_pass
+syn keyword ngxDirective uwsgi_pass_header
+syn keyword ngxDirective uwsgi_pass_request_body
+syn keyword ngxDirective uwsgi_pass_request_headers
+syn keyword ngxDirective uwsgi_read_timeout
+syn keyword ngxDirective uwsgi_request_buffering
+syn keyword ngxDirective uwsgi_send_timeout
+syn keyword ngxDirective uwsgi_ssl_certificate
+syn keyword ngxDirective uwsgi_ssl_certificate_key
+syn keyword ngxDirective uwsgi_ssl_ciphers
+syn keyword ngxDirective uwsgi_ssl_crl
+syn keyword ngxDirective uwsgi_ssl_name
+syn keyword ngxDirective uwsgi_ssl_password_file
+syn keyword ngxDirective uwsgi_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
+syn keyword ngxDirective uwsgi_ssl_server_name
+syn keyword ngxDirective uwsgi_ssl_session_reuse
+syn keyword ngxDirective uwsgi_ssl_trusted_certificate
+syn keyword ngxDirective uwsgi_ssl_verify
+syn keyword ngxDirective uwsgi_ssl_verify_depth
+syn keyword ngxDirective uwsgi_store
+syn keyword ngxDirective uwsgi_store_access
+syn keyword ngxDirective uwsgi_string
+syn keyword ngxDirective uwsgi_temp_file_write_size
+syn keyword ngxDirective uwsgi_temp_path
+syn keyword ngxDirective valid_referers
+syn keyword ngxDirective variables_hash_bucket_size
+syn keyword ngxDirective variables_hash_max_size
+syn keyword ngxDirective worker_aio_requests
+syn keyword ngxDirective worker_connections
+syn keyword ngxDirective worker_cpu_affinity
+syn keyword ngxDirective worker_priority
+syn keyword ngxDirective worker_processes
+syn keyword ngxDirective worker_rlimit_core
+syn keyword ngxDirective worker_rlimit_nofile
+syn keyword ngxDirective worker_rlimit_sigpending
+syn keyword ngxDirective worker_threads
+syn keyword ngxDirective working_directory
+syn keyword ngxDirective xclient
+syn keyword ngxDirective xml_entities
+syn keyword ngxDirective xslt_last_modified
+syn keyword ngxDirective xslt_param
+syn keyword ngxDirective xslt_string_param
+syn keyword ngxDirective xslt_stylesheet
+syn keyword ngxDirective xslt_types
+syn keyword ngxDirective zone
+
+" Do not enable highlighting of insecure ciphers if sslecure is loaded
+if !exists('g:loaded_sslsecure')
+ " Mark insecure SSL Ciphers (Note: List might not not complete)
+ " Reference: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html
+ syn match ngxSSLCipherInsecure '[^!]\zsSSLv3'
+ syn match ngxSSLCipherInsecure '[^!]\zsSSLv2'
+ syn match ngxSSLCipherInsecure '[^!]\zsHIGH'
+ syn match ngxSSLCipherInsecure '[^!]\zsMEDIUM'
+ syn match ngxSSLCipherInsecure '[^!]\zsLOW'
+ syn match ngxSSLCipherInsecure '[^!]\zsDEFAULT'
+ syn match ngxSSLCipherInsecure '[^!]\zsCOMPLEMENTOFDEFAULT'
+ syn match ngxSSLCipherInsecure '[^!]\zsALL'
+ syn match ngxSSLCipherInsecure '[^!]\zsCOMPLEMENTOFALL'
+
+ " SHA ciphers are only used in HMAC with all known OpenSSL/ LibreSSL cipher suites and MAC
+ " usage is still considered safe
+ " syn match ngxSSLCipherInsecure '[^!]\zsSHA\ze\D' " Match SHA1 without matching SHA256+
+ " syn match ngxSSLCipherInsecure '[^!]\zsSHA1'
+ syn match ngxSSLCipherInsecure '[^!]\zsMD5'
+ syn match ngxSSLCipherInsecure '[^!]\zsRC2'
+ syn match ngxSSLCipherInsecure '[^!]\zsRC4'
+ syn match ngxSSLCipherInsecure '[^!]\zs3DES'
+ syn match ngxSSLCipherInsecure '[^!3]\zsDES'
+ syn match ngxSSLCipherInsecure '[^!]\zsaDSS'
+ syn match ngxSSLCipherInsecure '[^!a]\zsDSS'
+ syn match ngxSSLCipherInsecure '[^!]\zsPSK'
+ syn match ngxSSLCipherInsecure '[^!]\zsIDEA'
+ syn match ngxSSLCipherInsecure '[^!]\zsSEED'
+ syn match ngxSSLCipherInsecure '[^!]\zsEXP\w*' " Match all EXPORT ciphers
+ syn match ngxSSLCipherInsecure '[^!]\zsaGOST\w*' " Match all GOST ciphers
+ syn match ngxSSLCipherInsecure '[^!]\zskGOST\w*'
+ syn match ngxSSLCipherInsecure '[^!ak]\zsGOST\w*'
+ syn match ngxSSLCipherInsecure '[^!]\zs[kae]\?FZA' " Not implemented
+ syn match ngxSSLCipherInsecure '[^!]\zsECB'
+ syn match ngxSSLCipherInsecure '[^!]\zs[aes]NULL'
+
+ " Anonymous cipher suites should never be used
+ syn match ngxSSLCipherInsecure '[^!ECa]\zsDH\ze[^E]' " Try to match DH without DHE, EDH, EECDH, etc.
+ syn match ngxSSLCipherInsecure '[^!EA]\zsECDH\ze[^E]' " Do not match EECDH, ECDHE
+ syn match ngxSSLCipherInsecure '[^!]\zsADH'
+ syn match ngxSSLCipherInsecure '[^!]\zskDHE'
+ syn match ngxSSLCipherInsecure '[^!]\zskEDH'
+ syn match ngxSSLCipherInsecure '[^!]\zskECDHE'
+ syn match ngxSSLCipherInsecure '[^!]\zskEECDH'
+ syn match ngxSSLCipherInsecure '[^!E]\zsAECDH'
+endif
+
+syn keyword ngxProxyNextUpstreamOptions error contained
+syn keyword ngxProxyNextUpstreamOptions timeout contained
+syn keyword ngxProxyNextUpstreamOptions invalid_header contained
+syn keyword ngxProxyNextUpstreamOptions http_500 contained
+syn keyword ngxProxyNextUpstreamOptions http_502 contained
+syn keyword ngxProxyNextUpstreamOptions http_503 contained
+syn keyword ngxProxyNextUpstreamOptions http_504 contained
+syn keyword ngxProxyNextUpstreamOptions http_403 contained
+syn keyword ngxProxyNextUpstreamOptions http_404 contained
+syn keyword ngxProxyNextUpstreamOptions http_429 contained
+syn keyword ngxProxyNextUpstreamOptions non_idempotent contained
+syn keyword ngxProxyNextUpstreamOptions off contained
+
+syn keyword ngxStickyOptions cookie contained
+syn region ngxStickyOptionsCookie matchgroup=ngxStickyOptions start=+^\s*\zssticky\s\s*cookie\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxCookieOptions,ngxString,ngxBoolean,ngxInteger,ngxTemplateVar
+syn keyword ngxStickyOptions route contained
+syn keyword ngxStickyOptions learn contained
+
+syn keyword ngxCookieOptions expires contained
+syn keyword ngxCookieOptions domain contained
+syn keyword ngxCookieOptions httponly contained
+syn keyword ngxCookieOptions secure contained
+syn keyword ngxCookieOptions path contained
+
+" 3rd party module list:
+" https://www.nginx.com/resources/wiki/modules/
+
+" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty set_from_accept_language
+
+" Access Key Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpAccessKeyModule>
+" Denies access unless the request URL contains an access key.
+syn keyword ngxDirectiveDeprecated accesskey
+syn keyword ngxDirectiveDeprecated accesskey_arg
+syn keyword ngxDirectiveDeprecated accesskey_hashmethod
+syn keyword ngxDirectiveDeprecated accesskey_signature
+
+" Asynchronous FastCGI Module <https://github.com/rsms/afcgi>
+" Primarily a modified version of the Nginx FastCGI module which implements multiplexing of connections, allowing a single FastCGI server to handle many concurrent requests.
+" syn keyword ngxDirectiveThirdParty fastcgi_bind
+" syn keyword ngxDirectiveThirdParty fastcgi_buffer_size
+" syn keyword ngxDirectiveThirdParty fastcgi_buffers
+" syn keyword ngxDirectiveThirdParty fastcgi_busy_buffers_size
+" syn keyword ngxDirectiveThirdParty fastcgi_cache
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_key
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_methods
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_min_uses
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_path
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_use_stale
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_valid
+" syn keyword ngxDirectiveThirdParty fastcgi_catch_stderr
+" syn keyword ngxDirectiveThirdParty fastcgi_connect_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_hide_header
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_client_abort
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_index
+" syn keyword ngxDirectiveThirdParty fastcgi_intercept_errors
+" syn keyword ngxDirectiveThirdParty fastcgi_max_temp_file_size
+" syn keyword ngxDirectiveThirdParty fastcgi_next_upstream
+" syn keyword ngxDirectiveThirdParty fastcgi_param
+" syn keyword ngxDirectiveThirdParty fastcgi_pass
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_header
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_body
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_read_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_send_lowat
+" syn keyword ngxDirectiveThirdParty fastcgi_send_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_split_path_info
+" syn keyword ngxDirectiveThirdParty fastcgi_store
+" syn keyword ngxDirectiveThirdParty fastcgi_store_access
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_file_write_size
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_path
+syn keyword ngxDirectiveDeprecated fastcgi_upstream_fail_timeout
+syn keyword ngxDirectiveDeprecated fastcgi_upstream_max_fails
+
+" Akamai G2O Module <https://github.com/kaltura/nginx_mod_akamai_g2o>
+" Nginx Module for Authenticating Akamai G2O requests
+syn keyword ngxDirectiveThirdParty g2o
+syn keyword ngxDirectiveThirdParty g2o_nonce
+syn keyword ngxDirectiveThirdParty g2o_key
+
+" Lua Module <https://github.com/alacner/nginx_lua_module>
+" You can be very simple to execute lua code for nginx
+syn keyword ngxDirectiveThirdParty lua_file
+
+" Array Variable Module <https://github.com/openresty/array-var-nginx-module>
+" Add support for array-typed variables to nginx config files
+syn keyword ngxDirectiveThirdParty array_split
+syn keyword ngxDirectiveThirdParty array_join
+syn keyword ngxDirectiveThirdParty array_map
+syn keyword ngxDirectiveThirdParty array_map_op
+
+" Nginx Audio Track for HTTP Live Streaming <https://github.com/flavioribeiro/nginx-audio-track-for-hls-module>
+" This nginx module generates audio track for hls streams on the fly.
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_rootpath
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_format
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_header
+
+" AWS Proxy Module <https://github.com/anomalizer/ngx_aws_auth>
+" Nginx module to proxy to authenticated AWS services
+syn keyword ngxDirectiveThirdParty aws_access_key
+syn keyword ngxDirectiveThirdParty aws_key_scope
+syn keyword ngxDirectiveThirdParty aws_signing_key
+syn keyword ngxDirectiveThirdParty aws_endpoint
+syn keyword ngxDirectiveThirdParty aws_s3_bucket
+syn keyword ngxDirectiveThirdParty aws_sign
+
+" Backtrace module <https://github.com/alibaba/nginx-backtrace>
+" A Nginx module to dump backtrace when a worker process exits abnormally
+syn keyword ngxDirectiveThirdParty backtrace_log
+syn keyword ngxDirectiveThirdParty backtrace_max_stack_size
+
+" Brotli Module <https://github.com/google/ngx_brotli>
+" Nginx module for Brotli compression
+syn keyword ngxDirectiveThirdParty brotli_static
+syn keyword ngxDirectiveThirdParty brotli
+syn keyword ngxDirectiveThirdParty brotli_types
+syn keyword ngxDirectiveThirdParty brotli_buffers
+syn keyword ngxDirectiveThirdParty brotli_comp_level
+syn keyword ngxDirectiveThirdParty brotli_window
+syn keyword ngxDirectiveThirdParty brotli_min_length
+
+" Cache Purge Module <https://github.com/FRiCKLE/ngx_cache_purge>
+" Adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.
+syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
+syn keyword ngxDirectiveThirdParty proxy_cache_purge
+" syn keyword ngxDirectiveThirdParty scgi_cache_purge
+" syn keyword ngxDirectiveThirdParty uwsgi_cache_purge
+
+" Chunkin Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpChunkinModule>
+" HTTP 1.1 chunked-encoding request body support for Nginx.
+syn keyword ngxDirectiveDeprecated chunkin
+syn keyword ngxDirectiveDeprecated chunkin_keepalive
+syn keyword ngxDirectiveDeprecated chunkin_max_chunks_per_buf
+syn keyword ngxDirectiveDeprecated chunkin_resume
+
+" Circle GIF Module <https://github.com/evanmiller/nginx_circle_gif>
+" Generates simple circle images with the colors and size specified in the URL.
+syn keyword ngxDirectiveThirdParty circle_gif
+syn keyword ngxDirectiveThirdParty circle_gif_max_radius
+syn keyword ngxDirectiveThirdParty circle_gif_min_radius
+syn keyword ngxDirectiveThirdParty circle_gif_step_radius
+
+" Nginx-Clojure Module <http://nginx-clojure.github.io/index.html>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty jvm_path
+syn keyword ngxDirectiveThirdParty jvm_var
+syn keyword ngxDirectiveThirdParty jvm_classpath
+syn keyword ngxDirectiveThirdParty jvm_classpath_check
+syn keyword ngxDirectiveThirdParty jvm_workers
+syn keyword ngxDirectiveThirdParty jvm_options
+syn keyword ngxDirectiveThirdParty jvm_handler_type
+syn keyword ngxDirectiveThirdParty jvm_init_handler_name
+syn keyword ngxDirectiveThirdParty jvm_init_handler_code
+syn keyword ngxDirectiveThirdParty jvm_exit_handler_name
+syn keyword ngxDirectiveThirdParty jvm_exit_handler_code
+syn keyword ngxDirectiveThirdParty handlers_lazy_init
+syn keyword ngxDirectiveThirdParty auto_upgrade_ws
+syn keyword ngxDirectiveThirdParty content_handler_type
+syn keyword ngxDirectiveThirdParty content_handler_name
+syn keyword ngxDirectiveThirdParty content_handler_code
+syn keyword ngxDirectiveThirdParty rewrite_handler_type
+syn keyword ngxDirectiveThirdParty rewrite_handler_name
+syn keyword ngxDirectiveThirdParty rewrite_handler_code
+syn keyword ngxDirectiveThirdParty access_handler_type
+syn keyword ngxDirectiveThirdParty access_handler_name
+syn keyword ngxDirectiveThirdParty access_handler_code
+syn keyword ngxDirectiveThirdParty header_filter_type
+syn keyword ngxDirectiveThirdParty header_filter_name
+syn keyword ngxDirectiveThirdParty header_filter_code
+syn keyword ngxDirectiveThirdParty content_handler_property
+syn keyword ngxDirectiveThirdParty rewrite_handler_property
+syn keyword ngxDirectiveThirdParty access_handler_property
+syn keyword ngxDirectiveThirdParty header_filter_property
+syn keyword ngxDirectiveThirdParty always_read_body
+syn keyword ngxDirectiveThirdParty shared_map
+syn keyword ngxDirectiveThirdParty write_page_size
+
+" Upstream Consistent Hash <https://www.nginx.com/resources/wiki/modules/consistent_hash/>
+" A load balancer that uses an internal consistent hash ring to select the right backend node.
+syn keyword ngxDirectiveThirdParty consistent_hash
+
+" Nginx Development Kit <https://github.com/simpl/ngx_devel_kit>
+" The NDK is an Nginx module that is designed to extend the core functionality of the excellent Nginx webserver in a way that can be used as a basis of other Nginx modules.
+" NDK_UPSTREAM_LIST
+" This submodule provides a directive that creates a list of upstreams, with optional weighting. This list can then be used by other modules to hash over the upstreams however they choose.
+syn keyword ngxDirectiveThirdParty upstream_list
+
+" Drizzle Module <https://www.nginx.com/resources/wiki/modules/drizzle/>
+" Upstream module for talking to MySQL and Drizzle directly
+syn keyword ngxDirectiveThirdParty drizzle_server
+syn keyword ngxDirectiveThirdParty drizzle_keepalive
+syn keyword ngxDirectiveThirdParty drizzle_query
+syn keyword ngxDirectiveThirdParty drizzle_pass
+syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
+syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
+syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
+syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
+syn keyword ngxDirectiveThirdParty drizzle_buffer_size
+syn keyword ngxDirectiveThirdParty drizzle_module_header
+syn keyword ngxDirectiveThirdParty drizzle_status
+
+" Dynamic ETags Module <https://github.com/kali/nginx-dynamic-etags>
+" Attempt at handling ETag / If-None-Match on proxied content.
+syn keyword ngxDirectiveThirdParty dynamic_etags
+
+" Echo Module <https://www.nginx.com/resources/wiki/modules/echo/>
+" Bringing the power of "echo", "sleep", "time" and more to Nginx's config file
+syn keyword ngxDirectiveThirdParty echo
+syn keyword ngxDirectiveThirdParty echo_duplicate
+syn keyword ngxDirectiveThirdParty echo_flush
+syn keyword ngxDirectiveThirdParty echo_sleep
+syn keyword ngxDirectiveThirdParty echo_blocking_sleep
+syn keyword ngxDirectiveThirdParty echo_reset_timer
+syn keyword ngxDirectiveThirdParty echo_read_request_body
+syn keyword ngxDirectiveThirdParty echo_location_async
+syn keyword ngxDirectiveThirdParty echo_location
+syn keyword ngxDirectiveThirdParty echo_subrequest_async
+syn keyword ngxDirectiveThirdParty echo_subrequest
+syn keyword ngxDirectiveThirdParty echo_foreach_split
+syn keyword ngxDirectiveThirdParty echo_end
+syn keyword ngxDirectiveThirdParty echo_request_body
+syn keyword ngxDirectiveThirdParty echo_exec
+syn keyword ngxDirectiveThirdParty echo_status
+syn keyword ngxDirectiveThirdParty echo_before_body
+syn keyword ngxDirectiveThirdParty echo_after_body
+
+" Encrypted Session Module <https://github.com/openresty/encrypted-session-nginx-module>
+" Encrypt and decrypt nginx variable values
+syn keyword ngxDirectiveThirdParty encrypted_session_key
+syn keyword ngxDirectiveThirdParty encrypted_session_iv
+syn keyword ngxDirectiveThirdParty encrypted_session_expires
+syn keyword ngxDirectiveThirdParty set_encrypt_session
+syn keyword ngxDirectiveThirdParty set_decrypt_session
+
+" Enhanced Memcached Module <https://github.com/bpaquet/ngx_http_enhanced_memcached_module>
+" This module is based on the standard Nginx Memcached module, with some additonal features
+syn keyword ngxDirectiveThirdParty enhanced_memcached_pass
+syn keyword ngxDirectiveThirdParty enhanced_memcached_hash_keys_with_md5
+syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_put
+syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_delete
+syn keyword ngxDirectiveThirdParty enhanced_memcached_stats
+syn keyword ngxDirectiveThirdParty enhanced_memcached_flush
+syn keyword ngxDirectiveThirdParty enhanced_memcached_flush_namespace
+syn keyword ngxDirectiveThirdParty enhanced_memcached_bind
+syn keyword ngxDirectiveThirdParty enhanced_memcached_connect_timeout
+syn keyword ngxDirectiveThirdParty enhanced_memcached_send_timeout
+syn keyword ngxDirectiveThirdParty enhanced_memcached_buffer_size
+syn keyword ngxDirectiveThirdParty enhanced_memcached_read_timeout
+
+" Events Module (DEPRECATED) <http://docs.dutov.org/nginx_modules_events_en.html>
+" Provides options for start/stop events.
+syn keyword ngxDirectiveDeprecated on_start
+syn keyword ngxDirectiveDeprecated on_stop
+
+" EY Balancer Module <https://github.com/ezmobius/nginx-ey-balancer>
+" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
+syn keyword ngxDirectiveThirdParty max_connections
+syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
+syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
+
+" Upstream Fair Balancer <https://www.nginx.com/resources/wiki/modules/fair_balancer/>
+" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
+syn keyword ngxDirectiveThirdParty fair
+syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
+
+" Fancy Indexes Module <https://github.com/aperezdc/ngx-fancyindex>
+" Like the built-in autoindex module, but fancier.
+syn keyword ngxDirectiveThirdParty fancyindex
+syn keyword ngxDirectiveThirdParty fancyindex_default_sort
+syn keyword ngxDirectiveThirdParty fancyindex_directories_first
+syn keyword ngxDirectiveThirdParty fancyindex_css_href
+syn keyword ngxDirectiveThirdParty fancyindex_exact_size
+syn keyword ngxDirectiveThirdParty fancyindex_name_length
+syn keyword ngxDirectiveThirdParty fancyindex_footer
+syn keyword ngxDirectiveThirdParty fancyindex_header
+syn keyword ngxDirectiveThirdParty fancyindex_show_path
+syn keyword ngxDirectiveThirdParty fancyindex_ignore
+syn keyword ngxDirectiveThirdParty fancyindex_hide_symlinks
+syn keyword ngxDirectiveThirdParty fancyindex_localtime
+syn keyword ngxDirectiveThirdParty fancyindex_time_format
+
+" Form Auth Module <https://github.com/veruu/ngx_form_auth>
+" Provides authentication and authorization with credentials submitted via POST request
+syn keyword ngxDirectiveThirdParty form_auth
+syn keyword ngxDirectiveThirdParty form_auth_pam_service
+syn keyword ngxDirectiveThirdParty form_auth_login
+syn keyword ngxDirectiveThirdParty form_auth_password
+syn keyword ngxDirectiveThirdParty form_auth_remote_user
+
+" Form Input Module <https://github.com/calio/form-input-nginx-module>
+" Reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded" and parses the arguments into nginx variables.
+syn keyword ngxDirectiveThirdParty set_form_input
+syn keyword ngxDirectiveThirdParty set_form_input_multi
+
+" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
+" Country code lookups via the MaxMind GeoIP API.
+syn keyword ngxDirectiveDeprecated geoip_country_file
+
+" GeoIP 2 Module <https://github.com/leev/ngx_http_geoip2_module>
+" Creates variables with values from the maxmind geoip2 databases based on the client IP
+syn keyword ngxDirectiveThirdParty geoip2
+
+" GridFS Module <https://github.com/mdirolf/nginx-gridfs>
+" Nginx module for serving files from MongoDB's GridFS
+syn keyword ngxDirectiveThirdParty gridfs
+
+" Headers More Module <https://github.com/openresty/headers-more-nginx-module>
+" Set and clear input and output headers...more than "add"!
+syn keyword ngxDirectiveThirdParty more_clear_headers
+syn keyword ngxDirectiveThirdParty more_clear_input_headers
+syn keyword ngxDirectiveThirdParty more_set_headers
+syn keyword ngxDirectiveThirdParty more_set_input_headers
+
+" Health Checks Upstreams Module <https://www.nginx.com/resources/wiki/modules/healthcheck/>
+" Polls backends and if they respond with HTTP 200 + an optional request body, they are marked good. Otherwise, they are marked bad.
+syn keyword ngxDirectiveThirdParty healthcheck_enabled
+syn keyword ngxDirectiveThirdParty healthcheck_delay
+syn keyword ngxDirectiveThirdParty healthcheck_timeout
+syn keyword ngxDirectiveThirdParty healthcheck_failcount
+syn keyword ngxDirectiveThirdParty healthcheck_send
+syn keyword ngxDirectiveThirdParty healthcheck_expected
+syn keyword ngxDirectiveThirdParty healthcheck_buffer
+syn keyword ngxDirectiveThirdParty healthcheck_status
+
+" HTTP Accounting Module <https://github.com/Lax/ngx_http_accounting_module>
+" Add traffic stat function to nginx. Useful for http accounting based on nginx configuration logic
+syn keyword ngxDirectiveThirdParty http_accounting
+syn keyword ngxDirectiveThirdParty http_accounting_log
+syn keyword ngxDirectiveThirdParty http_accounting_id
+syn keyword ngxDirectiveThirdParty http_accounting_interval
+syn keyword ngxDirectiveThirdParty http_accounting_perturb
+
+" Nginx Digest Authentication module <https://github.com/atomx/nginx-http-auth-digest>
+" Digest Authentication for Nginx
+syn keyword ngxDirectiveThirdParty auth_digest
+syn keyword ngxDirectiveThirdParty auth_digest_user_file
+syn keyword ngxDirectiveThirdParty auth_digest_timeout
+syn keyword ngxDirectiveThirdParty auth_digest_expires
+syn keyword ngxDirectiveThirdParty auth_digest_replays
+syn keyword ngxDirectiveThirdParty auth_digest_shm_size
+
+" Auth PAM Module <https://github.com/sto/ngx_http_auth_pam_module>
+" HTTP Basic Authentication using PAM.
+syn keyword ngxDirectiveThirdParty auth_pam
+syn keyword ngxDirectiveThirdParty auth_pam_service_name
+
+" HTTP Auth Request Module <http://nginx.org/en/docs/http/ngx_http_auth_request_module.html>
+" Implements client authorization based on the result of a subrequest
+" syn keyword ngxDirectiveThirdParty auth_request
+" syn keyword ngxDirectiveThirdParty auth_request_set
+
+" HTTP Concatenation module for Nginx <https://github.com/alibaba/nginx-http-concat>
+" A Nginx module for concatenating files in a given context: CSS and JS files usually
+syn keyword ngxDirectiveThirdParty concat
+syn keyword ngxDirectiveThirdParty concat_types
+syn keyword ngxDirectiveThirdParty concat_unique
+syn keyword ngxDirectiveThirdParty concat_max_files
+syn keyword ngxDirectiveThirdParty concat_delimiter
+syn keyword ngxDirectiveThirdParty concat_ignore_file_error
+
+" HTTP Dynamic Upstream Module <https://github.com/yzprofile/ngx_http_dyups_module>
+" Update upstreams' config by restful interface
+syn keyword ngxDirectiveThirdParty dyups_interface
+syn keyword ngxDirectiveThirdParty dyups_read_msg_timeout
+syn keyword ngxDirectiveThirdParty dyups_shm_zone_size
+syn keyword ngxDirectiveThirdParty dyups_upstream_conf
+syn keyword ngxDirectiveThirdParty dyups_trylock
+
+" HTTP Footer If Filter Module <https://github.com/flygoast/ngx_http_footer_if_filter>
+" The ngx_http_footer_if_filter_module is used to add given content to the end of the response according to the condition specified.
+syn keyword ngxDirectiveThirdParty footer_if
+
+" HTTP Footer Filter Module <https://github.com/alibaba/nginx-http-footer-filter>
+" This module implements a body filter that adds a given string to the page footer.
+syn keyword ngxDirectiveThirdParty footer
+syn keyword ngxDirectiveThirdParty footer_types
+
+" HTTP Internal Redirect Module <https://github.com/flygoast/ngx_http_internal_redirect>
+" Make an internal redirect to the uri specified according to the condition specified.
+syn keyword ngxDirectiveThirdParty internal_redirect_if
+syn keyword ngxDirectiveThirdParty internal_redirect_if_no_postponed
+
+" HTTP JavaScript Module <https://github.com/peter-leonov/ngx_http_js_module>
+" Embedding SpiderMonkey. Nearly full port on Perl module.
+syn keyword ngxDirectiveThirdParty js
+syn keyword ngxDirectiveThirdParty js_filter
+syn keyword ngxDirectiveThirdParty js_filter_types
+syn keyword ngxDirectiveThirdParty js_load
+syn keyword ngxDirectiveThirdParty js_maxmem
+syn keyword ngxDirectiveThirdParty js_require
+syn keyword ngxDirectiveThirdParty js_set
+syn keyword ngxDirectiveThirdParty js_utf8
+
+" HTTP Push Module (DEPRECATED) <http://pushmodule.slact.net/>
+" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
+syn keyword ngxDirectiveDeprecated push_buffer_size
+syn keyword ngxDirectiveDeprecated push_listener
+syn keyword ngxDirectiveDeprecated push_message_timeout
+syn keyword ngxDirectiveDeprecated push_queue_messages
+syn keyword ngxDirectiveDeprecated push_sender
+
+" HTTP Redis Module <https://www.nginx.com/resources/wiki/modules/redis/>
+" Redis <http://code.google.com/p/redis/> support.
+syn keyword ngxDirectiveThirdParty redis_bind
+syn keyword ngxDirectiveThirdParty redis_buffer_size
+syn keyword ngxDirectiveThirdParty redis_connect_timeout
+syn keyword ngxDirectiveThirdParty redis_next_upstream
+syn keyword ngxDirectiveThirdParty redis_pass
+syn keyword ngxDirectiveThirdParty redis_read_timeout
+syn keyword ngxDirectiveThirdParty redis_send_timeout
+
+" Iconv Module <https://github.com/calio/iconv-nginx-module>
+" A character conversion nginx module using libiconv
+syn keyword ngxDirectiveThirdParty set_iconv
+syn keyword ngxDirectiveThirdParty iconv_buffer_size
+syn keyword ngxDirectiveThirdParty iconv_filter
+
+" IP Blocker Module <https://github.com/tmthrgd/nginx-ip-blocker>
+" An efficient shared memory IP blocking system for nginx.
+syn keyword ngxDirectiveThirdParty ip_blocker
+
+" IP2Location Module <https://github.com/chrislim2888/ip2location-nginx>
+" Allows user to lookup for geolocation information using IP2Location database
+syn keyword ngxDirectiveThirdParty ip2location_database
+
+" JS Module <https://github.com/peter-leonov/ngx_http_js_module>
+" Reflect the nginx functionality in JS
+syn keyword ngxDirectiveThirdParty js
+syn keyword ngxDirectiveThirdParty js_access
+syn keyword ngxDirectiveThirdParty js_load
+syn keyword ngxDirectiveThirdParty js_set
+
+" Limit Upload Rate Module <https://github.com/cfsego/limit_upload_rate>
+" Limit client-upload rate when they are sending request bodies to you
+syn keyword ngxDirectiveThirdParty limit_upload_rate
+syn keyword ngxDirectiveThirdParty limit_upload_rate_after
+
+" Limit Upstream Module <https://github.com/cfsego/nginx-limit-upstream>
+" Limit the number of connections to upstream for NGINX
+syn keyword ngxDirectiveThirdParty limit_upstream_zone
+syn keyword ngxDirectiveThirdParty limit_upstream_conn
+syn keyword ngxDirectiveThirdParty limit_upstream_log_level
+
+" Log If Module <https://github.com/cfsego/ngx_log_if>
+" Conditional accesslog for nginx
+syn keyword ngxDirectiveThirdParty access_log_bypass_if
+
+" Log Request Speed (DEPRECATED) <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
+" Log the time it took to process each request.
+syn keyword ngxDirectiveDeprecated log_request_speed_filter
+syn keyword ngxDirectiveDeprecated log_request_speed_filter_timeout
+
+" Log ZeroMQ Module <https://github.com/alticelabs/nginx-log-zmq>
+" ZeroMQ logger module for nginx
+syn keyword ngxDirectiveThirdParty log_zmq_server
+syn keyword ngxDirectiveThirdParty log_zmq_endpoint
+syn keyword ngxDirectiveThirdParty log_zmq_format
+syn keyword ngxDirectiveThirdParty log_zmq_off
+
+" Lower/UpperCase Module <https://github.com/replay/ngx_http_lower_upper_case>
+" This module simply uppercases or lowercases a string and saves it into a new variable.
+syn keyword ngxDirectiveThirdParty lower
+syn keyword ngxDirectiveThirdParty upper
+
+" Lua Upstream Module <https://github.com/openresty/lua-upstream-nginx-module>
+" Nginx C module to expose Lua API to ngx_lua for Nginx upstreams
+
+" Lua Module <https://github.com/openresty/lua-nginx-module>
+" Embed the Power of Lua into NGINX HTTP servers
+syn keyword ngxDirectiveThirdParty lua_use_default_type
+syn keyword ngxDirectiveThirdParty lua_malloc_trim
+syn keyword ngxDirectiveThirdParty lua_code_cache
+syn keyword ngxDirectiveThirdParty lua_regex_cache_max_entries
+syn keyword ngxDirectiveThirdParty lua_regex_match_limit
+syn keyword ngxDirectiveThirdParty lua_package_path
+syn keyword ngxDirectiveThirdParty lua_package_cpath
+syn keyword ngxDirectiveThirdParty init_by_lua
+syn keyword ngxDirectiveThirdParty init_by_lua_file
+syn keyword ngxDirectiveThirdParty init_worker_by_lua
+syn keyword ngxDirectiveThirdParty init_worker_by_lua_file
+syn keyword ngxDirectiveThirdParty set_by_lua
+syn keyword ngxDirectiveThirdParty set_by_lua_file
+syn keyword ngxDirectiveThirdParty content_by_lua
+syn keyword ngxDirectiveThirdParty content_by_lua_file
+syn keyword ngxDirectiveThirdParty rewrite_by_lua
+syn keyword ngxDirectiveThirdParty rewrite_by_lua_file
+syn keyword ngxDirectiveThirdParty access_by_lua
+syn keyword ngxDirectiveThirdParty access_by_lua_file
+syn keyword ngxDirectiveThirdParty header_filter_by_lua
+syn keyword ngxDirectiveThirdParty header_filter_by_lua_file
+syn keyword ngxDirectiveThirdParty body_filter_by_lua
+syn keyword ngxDirectiveThirdParty body_filter_by_lua_file
+syn keyword ngxDirectiveThirdParty log_by_lua
+syn keyword ngxDirectiveThirdParty log_by_lua_file
+syn keyword ngxDirectiveThirdParty balancer_by_lua_file
+syn keyword ngxDirectiveThirdParty lua_need_request_body
+syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_file
+syn keyword ngxDirectiveThirdParty ssl_session_fetch_by_lua_file
+syn keyword ngxDirectiveThirdParty ssl_session_store_by_lua_file
+syn keyword ngxDirectiveThirdParty lua_shared_dict
+syn keyword ngxDirectiveThirdParty lua_socket_connect_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_send_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_send_lowat
+syn keyword ngxDirectiveThirdParty lua_socket_read_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_buffer_size
+syn keyword ngxDirectiveThirdParty lua_socket_pool_size
+syn keyword ngxDirectiveThirdParty lua_socket_keepalive_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_log_errors
+syn keyword ngxDirectiveThirdParty lua_ssl_ciphers
+syn keyword ngxDirectiveThirdParty lua_ssl_crl
+syn keyword ngxDirectiveThirdParty lua_ssl_protocols
+syn keyword ngxDirectiveThirdParty lua_ssl_trusted_certificate
+syn keyword ngxDirectiveThirdParty lua_ssl_verify_depth
+syn keyword ngxDirectiveThirdParty lua_http10_buffering
+syn keyword ngxDirectiveThirdParty rewrite_by_lua_no_postpone
+syn keyword ngxDirectiveThirdParty access_by_lua_no_postpone
+syn keyword ngxDirectiveThirdParty lua_transform_underscores_in_response_headers
+syn keyword ngxDirectiveThirdParty lua_check_client_abort
+syn keyword ngxDirectiveThirdParty lua_max_pending_timers
+syn keyword ngxDirectiveThirdParty lua_max_running_timers
+
+" MD5 Filter Module <https://github.com/kainswor/nginx_md5_filter>
+" A content filter for nginx, which returns the md5 hash of the content otherwise returned.
+syn keyword ngxDirectiveThirdParty md5_filter
+
+" Memc Module <https://github.com/openresty/memc-nginx-module>
+" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
+syn keyword ngxDirectiveThirdParty memc_buffer_size
+syn keyword ngxDirectiveThirdParty memc_cmds_allowed
+syn keyword ngxDirectiveThirdParty memc_connect_timeout
+syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
+syn keyword ngxDirectiveThirdParty memc_next_upstream
+syn keyword ngxDirectiveThirdParty memc_pass
+syn keyword ngxDirectiveThirdParty memc_read_timeout
+syn keyword ngxDirectiveThirdParty memc_send_timeout
+syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
+syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
+
+" Mod Security Module <https://github.com/SpiderLabs/ModSecurity>
+" ModSecurity is an open source, cross platform web application firewall (WAF) engine
+syn keyword ngxDirectiveThirdParty ModSecurityConfig
+syn keyword ngxDirectiveThirdParty ModSecurityEnabled
+syn keyword ngxDirectiveThirdParty pool_context
+syn keyword ngxDirectiveThirdParty pool_context_hash_size
+
+" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
+" MogileFS client for nginx web server.
+syn keyword ngxDirectiveThirdParty mogilefs_pass
+syn keyword ngxDirectiveThirdParty mogilefs_methods
+syn keyword ngxDirectiveThirdParty mogilefs_domain
+syn keyword ngxDirectiveThirdParty mogilefs_class
+syn keyword ngxDirectiveThirdParty mogilefs_tracker
+syn keyword ngxDirectiveThirdParty mogilefs_noverify
+syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
+syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
+syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
+
+" Mongo Module <https://github.com/simpl/ngx_mongo>
+" Upstream module that allows nginx to communicate directly with MongoDB database.
+syn keyword ngxDirectiveThirdParty mongo_auth
+syn keyword ngxDirectiveThirdParty mongo_pass
+syn keyword ngxDirectiveThirdParty mongo_query
+syn keyword ngxDirectiveThirdParty mongo_json
+syn keyword ngxDirectiveThirdParty mongo_bind
+syn keyword ngxDirectiveThirdParty mongo_connect_timeout
+syn keyword ngxDirectiveThirdParty mongo_send_timeout
+syn keyword ngxDirectiveThirdParty mongo_read_timeout
+syn keyword ngxDirectiveThirdParty mongo_buffering
+syn keyword ngxDirectiveThirdParty mongo_buffer_size
+syn keyword ngxDirectiveThirdParty mongo_buffers
+syn keyword ngxDirectiveThirdParty mongo_busy_buffers_size
+syn keyword ngxDirectiveThirdParty mongo_next_upstream
+
+" MP4 Streaming Lite Module <https://www.nginx.com/resources/wiki/modules/mp4_streaming/>
+" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
+" syn keyword ngxDirectiveThirdParty mp4
+
+" NAXSI Module <https://github.com/nbs-system/naxsi>
+" NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
+syn keyword ngxDirectiveThirdParty DeniedUrl denied_url
+syn keyword ngxDirectiveThirdParty LearningMode learning_mode
+syn keyword ngxDirectiveThirdParty SecRulesEnabled rules_enabled
+syn keyword ngxDirectiveThirdParty SecRulesDisabled rules_disabled
+syn keyword ngxDirectiveThirdParty CheckRule check_rule
+syn keyword ngxDirectiveThirdParty BasicRule basic_rule
+syn keyword ngxDirectiveThirdParty MainRule main_rule
+syn keyword ngxDirectiveThirdParty LibInjectionSql libinjection_sql
+syn keyword ngxDirectiveThirdParty LibInjectionXss libinjection_xss
+
+" Nchan Module <https://nchan.slact.net/>
+" Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE)
+syn keyword ngxDirectiveThirdParty nchan_channel_id
+syn keyword ngxDirectiveThirdParty nchan_channel_id_split_delimiter
+syn keyword ngxDirectiveThirdParty nchan_eventsource_event
+syn keyword ngxDirectiveThirdParty nchan_longpoll_multipart_response
+syn keyword ngxDirectiveThirdParty nchan_publisher
+syn keyword ngxDirectiveThirdParty nchan_publisher_channel_id
+syn keyword ngxDirectiveThirdParty nchan_publisher_upstream_request
+syn keyword ngxDirectiveThirdParty nchan_pubsub
+syn keyword ngxDirectiveThirdParty nchan_subscribe_request
+syn keyword ngxDirectiveThirdParty nchan_subscriber
+syn keyword ngxDirectiveThirdParty nchan_subscriber_channel_id
+syn keyword ngxDirectiveThirdParty nchan_subscriber_compound_etag_message_id
+syn keyword ngxDirectiveThirdParty nchan_subscriber_first_message
+syn keyword ngxDirectiveThirdParty nchan_subscriber_http_raw_stream_separator
+syn keyword ngxDirectiveThirdParty nchan_subscriber_last_message_id
+syn keyword ngxDirectiveThirdParty nchan_subscriber_message_id_custom_etag_header
+syn keyword ngxDirectiveThirdParty nchan_subscriber_timeout
+syn keyword ngxDirectiveThirdParty nchan_unsubscribe_request
+syn keyword ngxDirectiveThirdParty nchan_websocket_ping_interval
+syn keyword ngxDirectiveThirdParty nchan_authorize_request
+syn keyword ngxDirectiveThirdParty nchan_max_reserved_memory
+syn keyword ngxDirectiveThirdParty nchan_message_buffer_length
+syn keyword ngxDirectiveThirdParty nchan_message_timeout
+syn keyword ngxDirectiveThirdParty nchan_redis_idle_channel_cache_timeout
+syn keyword ngxDirectiveThirdParty nchan_redis_namespace
+syn keyword ngxDirectiveThirdParty nchan_redis_pass
+syn keyword ngxDirectiveThirdParty nchan_redis_ping_interval
+syn keyword ngxDirectiveThirdParty nchan_redis_server
+syn keyword ngxDirectiveThirdParty nchan_redis_storage_mode
+syn keyword ngxDirectiveThirdParty nchan_redis_url
+syn keyword ngxDirectiveThirdParty nchan_store_messages
+syn keyword ngxDirectiveThirdParty nchan_use_redis
+syn keyword ngxDirectiveThirdParty nchan_access_control_allow_origin
+syn keyword ngxDirectiveThirdParty nchan_channel_group
+syn keyword ngxDirectiveThirdParty nchan_channel_group_accounting
+syn keyword ngxDirectiveThirdParty nchan_group_location
+syn keyword ngxDirectiveThirdParty nchan_group_max_channels
+syn keyword ngxDirectiveThirdParty nchan_group_max_messages
+syn keyword ngxDirectiveThirdParty nchan_group_max_messages_disk
+syn keyword ngxDirectiveThirdParty nchan_group_max_messages_memory
+syn keyword ngxDirectiveThirdParty nchan_group_max_subscribers
+syn keyword ngxDirectiveThirdParty nchan_subscribe_existing_channels_only
+syn keyword ngxDirectiveThirdParty nchan_channel_event_string
+syn keyword ngxDirectiveThirdParty nchan_channel_events_channel_id
+syn keyword ngxDirectiveThirdParty nchan_stub_status
+syn keyword ngxDirectiveThirdParty nchan_max_channel_id_length
+syn keyword ngxDirectiveThirdParty nchan_max_channel_subscribers
+syn keyword ngxDirectiveThirdParty nchan_channel_timeout
+syn keyword ngxDirectiveThirdParty nchan_storage_engine
+
+" Nginx Notice Module <https://github.com/kr/nginx-notice>
+" Serve static file to POST requests.
+syn keyword ngxDirectiveThirdParty notice
+syn keyword ngxDirectiveThirdParty notice_type
+
+" OCSP Proxy Module <https://github.com/kyprizel/nginx_ocsp_proxy-module>
+" Nginx OCSP processing module designed for response caching
+syn keyword ngxDirectiveThirdParty ocsp_proxy
+syn keyword ngxDirectiveThirdParty ocsp_cache_timeout
+
+" Eval Module <https://github.com/openresty/nginx-eval-module>
+" Module for nginx web server evaluates response of proxy or memcached module into variables.
+syn keyword ngxDirectiveThirdParty eval
+syn keyword ngxDirectiveThirdParty eval_escalate
+syn keyword ngxDirectiveThirdParty eval_buffer_size
+syn keyword ngxDirectiveThirdParty eval_override_content_type
+syn keyword ngxDirectiveThirdParty eval_subrequest_in_memory
+
+" OpenSSL Version Module <https://github.com/apcera/nginx-openssl-version>
+" Nginx OpenSSL version check at startup
+syn keyword ngxDirectiveThirdParty openssl_version_minimum
+syn keyword ngxDirectiveThirdParty openssl_builddate_minimum
+
+" Owner Match Module <https://www.nginx.com/resources/wiki/modules/owner_match/>
+" Control access for specific owners and groups of files
+syn keyword ngxDirectiveThirdParty omallow
+syn keyword ngxDirectiveThirdParty omdeny
+
+" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty pagespeed
+
+" PHP Memcache Standard Balancer Module <https://github.com/replay/ngx_http_php_memcache_standard_balancer>
+" Loadbalancer that is compatible to the standard loadbalancer in the php-memcache module
+syn keyword ngxDirectiveThirdParty hash_key
+
+" PHP Session Module <https://github.com/replay/ngx_http_php_session>
+" Nginx module to parse php sessions
+syn keyword ngxDirectiveThirdParty php_session_parse
+syn keyword ngxDirectiveThirdParty php_session_strip_formatting
+
+" Phusion Passenger Module <https://www.phusionpassenger.com/library/config/nginx/>
+" Passenger is an open source web application server.
+syn keyword ngxDirectiveThirdParty passenger_root
+syn keyword ngxDirectiveThirdParty passenger_enabled
+syn keyword ngxDirectiveThirdParty passenger_base_uri
+syn keyword ngxDirectiveThirdParty passenger_document_root
+syn keyword ngxDirectiveThirdParty passenger_ruby
+syn keyword ngxDirectiveThirdParty passenger_python
+syn keyword ngxDirectiveThirdParty passenger_nodejs
+syn keyword ngxDirectiveThirdParty passenger_meteor_app_settings
+syn keyword ngxDirectiveThirdParty passenger_app_env
+syn keyword ngxDirectiveThirdParty passenger_app_root
+syn keyword ngxDirectiveThirdParty passenger_app_group_name
+syn keyword ngxDirectiveThirdParty passenger_app_type
+syn keyword ngxDirectiveThirdParty passenger_startup_file
+syn keyword ngxDirectiveThirdParty passenger_restart_dir
+syn keyword ngxDirectiveThirdParty passenger_spawn_method
+syn keyword ngxDirectiveThirdParty passenger_env_var
+syn keyword ngxDirectiveThirdParty passenger_load_shell_envvars
+syn keyword ngxDirectiveThirdParty passenger_rolling_restarts
+syn keyword ngxDirectiveThirdParty passenger_resist_deployment_errors
+syn keyword ngxDirectiveThirdParty passenger_user_switching
+syn keyword ngxDirectiveThirdParty passenger_user
+syn keyword ngxDirectiveThirdParty passenger_group
+syn keyword ngxDirectiveThirdParty passenger_default_user
+syn keyword ngxDirectiveThirdParty passenger_default_group
+syn keyword ngxDirectiveThirdParty passenger_show_version_in_header
+syn keyword ngxDirectiveThirdParty passenger_friendly_error_pages
+syn keyword ngxDirectiveThirdParty passenger_disable_security_update_check
+syn keyword ngxDirectiveThirdParty passenger_security_update_check_proxy
+syn keyword ngxDirectiveThirdParty passenger_max_pool_size
+syn keyword ngxDirectiveThirdParty passenger_min_instances
+syn keyword ngxDirectiveThirdParty passenger_max_instances
+syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
+syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
+syn keyword ngxDirectiveThirdParty passenger_max_preloader_idle_time
+syn keyword ngxDirectiveThirdParty passenger_force_max_concurrent_requests_per_process
+syn keyword ngxDirectiveThirdParty passenger_start_timeout
+syn keyword ngxDirectiveThirdParty passenger_concurrency_model
+syn keyword ngxDirectiveThirdParty passenger_thread_count
+syn keyword ngxDirectiveThirdParty passenger_max_requests
+syn keyword ngxDirectiveThirdParty passenger_max_request_time
+syn keyword ngxDirectiveThirdParty passenger_memory_limit
+syn keyword ngxDirectiveThirdParty passenger_stat_throttle_rate
+syn keyword ngxDirectiveThirdParty passenger_core_file_descriptor_ulimit
+syn keyword ngxDirectiveThirdParty passenger_app_file_descriptor_ulimit
+syn keyword ngxDirectiveThirdParty passenger_pre_start
+syn keyword ngxDirectiveThirdParty passenger_set_header
+syn keyword ngxDirectiveThirdParty passenger_max_request_queue_size
+syn keyword ngxDirectiveThirdParty passenger_request_queue_overflow_status_code
+syn keyword ngxDirectiveThirdParty passenger_sticky_sessions
+syn keyword ngxDirectiveThirdParty passenger_sticky_sessions_cookie_name
+syn keyword ngxDirectiveThirdParty passenger_abort_websockets_on_process_shutdown
+syn keyword ngxDirectiveThirdParty passenger_ignore_client_abort
+syn keyword ngxDirectiveThirdParty passenger_intercept_errors
+syn keyword ngxDirectiveThirdParty passenger_pass_header
+syn keyword ngxDirectiveThirdParty passenger_ignore_headers
+syn keyword ngxDirectiveThirdParty passenger_headers_hash_bucket_size
+syn keyword ngxDirectiveThirdParty passenger_headers_hash_max_size
+syn keyword ngxDirectiveThirdParty passenger_buffer_response
+syn keyword ngxDirectiveThirdParty passenger_response_buffer_high_watermark
+syn keyword ngxDirectiveThirdParty passenger_buffer_size, passenger_buffers, passenger_busy_buffers_size
+syn keyword ngxDirectiveThirdParty passenger_socket_backlog
+syn keyword ngxDirectiveThirdParty passenger_log_level
+syn keyword ngxDirectiveThirdParty passenger_log_file
+syn keyword ngxDirectiveThirdParty passenger_file_descriptor_log_file
+syn keyword ngxDirectiveThirdParty passenger_debugger
+syn keyword ngxDirectiveThirdParty passenger_instance_registry_dir
+syn keyword ngxDirectiveThirdParty passenger_data_buffer_dir
+syn keyword ngxDirectiveThirdParty passenger_fly_with
+syn keyword ngxDirectiveThirdParty union_station_support
+syn keyword ngxDirectiveThirdParty union_station_key
+syn keyword ngxDirectiveThirdParty union_station_proxy_address
+syn keyword ngxDirectiveThirdParty union_station_filter
+syn keyword ngxDirectiveThirdParty union_station_gateway_address
+syn keyword ngxDirectiveThirdParty union_station_gateway_port
+syn keyword ngxDirectiveThirdParty union_station_gateway_cert
+syn keyword ngxDirectiveDeprecated rails_spawn_method
+syn keyword ngxDirectiveDeprecated passenger_debug_log_file
+
+" Postgres Module <http://labs.frickle.com/nginx_ngx_postgres/>
+" Upstream module that allows nginx to communicate directly with PostgreSQL database.
+syn keyword ngxDirectiveThirdParty postgres_server
+syn keyword ngxDirectiveThirdParty postgres_keepalive
+syn keyword ngxDirectiveThirdParty postgres_pass
+syn keyword ngxDirectiveThirdParty postgres_query
+syn keyword ngxDirectiveThirdParty postgres_rewrite
+syn keyword ngxDirectiveThirdParty postgres_output
+syn keyword ngxDirectiveThirdParty postgres_set
+syn keyword ngxDirectiveThirdParty postgres_escape
+syn keyword ngxDirectiveThirdParty postgres_connect_timeout
+syn keyword ngxDirectiveThirdParty postgres_result_timeout
+
+" Pubcookie Module <https://www.vanko.me/book/page/pubcookie-module-nginx>
+" Authorizes users using encrypted cookies
+syn keyword ngxDirectiveThirdParty pubcookie_inactive_expire
+syn keyword ngxDirectiveThirdParty pubcookie_hard_expire
+syn keyword ngxDirectiveThirdParty pubcookie_app_id
+syn keyword ngxDirectiveThirdParty pubcookie_dir_depth
+syn keyword ngxDirectiveThirdParty pubcookie_catenate_app_ids
+syn keyword ngxDirectiveThirdParty pubcookie_app_srv_id
+syn keyword ngxDirectiveThirdParty pubcookie_login
+syn keyword ngxDirectiveThirdParty pubcookie_login_method
+syn keyword ngxDirectiveThirdParty pubcookie_post
+syn keyword ngxDirectiveThirdParty pubcookie_domain
+syn keyword ngxDirectiveThirdParty pubcookie_granting_cert_file
+syn keyword ngxDirectiveThirdParty pubcookie_session_key_file
+syn keyword ngxDirectiveThirdParty pubcookie_session_cert_file
+syn keyword ngxDirectiveThirdParty pubcookie_crypt_key_file
+syn keyword ngxDirectiveThirdParty pubcookie_end_session
+syn keyword ngxDirectiveThirdParty pubcookie_encryption
+syn keyword ngxDirectiveThirdParty pubcookie_session_reauth
+syn keyword ngxDirectiveThirdParty pubcookie_auth_type_names
+syn keyword ngxDirectiveThirdParty pubcookie_no_prompt
+syn keyword ngxDirectiveThirdParty pubcookie_on_demand
+syn keyword ngxDirectiveThirdParty pubcookie_addl_request
+syn keyword ngxDirectiveThirdParty pubcookie_no_obscure_cookies
+syn keyword ngxDirectiveThirdParty pubcookie_no_clean_creds
+syn keyword ngxDirectiveThirdParty pubcookie_egd_device
+syn keyword ngxDirectiveThirdParty pubcookie_no_blank
+syn keyword ngxDirectiveThirdParty pubcookie_super_debug
+syn keyword ngxDirectiveThirdParty pubcookie_set_remote_user
+
+" Push Stream Module <https://github.com/wandenberg/nginx-push-stream-module>
+" A pure stream http push technology for your Nginx setup
+syn keyword ngxDirectiveThirdParty push_stream_channels_statistics
+syn keyword ngxDirectiveThirdParty push_stream_publisher
+syn keyword ngxDirectiveThirdParty push_stream_subscriber
+syn keyword ngxDirectiveThirdParty push_stream_shared_memory_size
+syn keyword ngxDirectiveThirdParty push_stream_channel_deleted_message_text
+syn keyword ngxDirectiveThirdParty push_stream_channel_inactivity_time
+syn keyword ngxDirectiveThirdParty push_stream_ping_message_text
+syn keyword ngxDirectiveThirdParty push_stream_timeout_with_body
+syn keyword ngxDirectiveThirdParty push_stream_message_ttl
+syn keyword ngxDirectiveThirdParty push_stream_max_subscribers_per_channel
+syn keyword ngxDirectiveThirdParty push_stream_max_messages_stored_per_channel
+syn keyword ngxDirectiveThirdParty push_stream_max_channel_id_length
+syn keyword ngxDirectiveThirdParty push_stream_max_number_of_channels
+syn keyword ngxDirectiveThirdParty push_stream_max_number_of_wildcard_channels
+syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_prefix
+syn keyword ngxDirectiveThirdParty push_stream_events_channel_id
+syn keyword ngxDirectiveThirdParty push_stream_channels_path
+syn keyword ngxDirectiveThirdParty push_stream_store_messages
+syn keyword ngxDirectiveThirdParty push_stream_channel_info_on_publish
+syn keyword ngxDirectiveThirdParty push_stream_authorized_channels_only
+syn keyword ngxDirectiveThirdParty push_stream_header_template_file
+syn keyword ngxDirectiveThirdParty push_stream_header_template
+syn keyword ngxDirectiveThirdParty push_stream_message_template
+syn keyword ngxDirectiveThirdParty push_stream_footer_template
+syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_max_qtd
+syn keyword ngxDirectiveThirdParty push_stream_ping_message_interval
+syn keyword ngxDirectiveThirdParty push_stream_subscriber_connection_ttl
+syn keyword ngxDirectiveThirdParty push_stream_longpolling_connection_ttl
+syn keyword ngxDirectiveThirdParty push_stream_websocket_allow_publish
+syn keyword ngxDirectiveThirdParty push_stream_last_received_message_time
+syn keyword ngxDirectiveThirdParty push_stream_last_received_message_tag
+syn keyword ngxDirectiveThirdParty push_stream_last_event_id
+syn keyword ngxDirectiveThirdParty push_stream_user_agent
+syn keyword ngxDirectiveThirdParty push_stream_padding_by_user_agent
+syn keyword ngxDirectiveThirdParty push_stream_allowed_origins
+syn keyword ngxDirectiveThirdParty push_stream_allow_connections_to_events_channel
+
+" rDNS Module <https://github.com/flant/nginx-http-rdns>
+" Make a reverse DNS (rDNS) lookup for incoming connection and provides simple access control of incoming hostname by allow/deny rules
+syn keyword ngxDirectiveThirdParty rdns
+syn keyword ngxDirectiveThirdParty rdns_allow
+syn keyword ngxDirectiveThirdParty rdns_deny
+
+" RDS CSV Module <https://github.com/openresty/rds-csv-nginx-module>
+" Nginx output filter module to convert Resty-DBD-Streams (RDS) to Comma-Separated Values (CSV)
+syn keyword ngxDirectiveThirdParty rds_csv
+syn keyword ngxDirectiveThirdParty rds_csv_row_terminator
+syn keyword ngxDirectiveThirdParty rds_csv_field_separator
+syn keyword ngxDirectiveThirdParty rds_csv_field_name_header
+syn keyword ngxDirectiveThirdParty rds_csv_content_type
+syn keyword ngxDirectiveThirdParty rds_csv_buffer_size
+
+" RDS JSON Module <https://github.com/openresty/rds-json-nginx-module>
+" An output filter that formats Resty DBD Streams generated by ngx_drizzle and others to JSON
+syn keyword ngxDirectiveThirdParty rds_json
+syn keyword ngxDirectiveThirdParty rds_json_buffer_size
+syn keyword ngxDirectiveThirdParty rds_json_format
+syn keyword ngxDirectiveThirdParty rds_json_root
+syn keyword ngxDirectiveThirdParty rds_json_success_property
+syn keyword ngxDirectiveThirdParty rds_json_user_property
+syn keyword ngxDirectiveThirdParty rds_json_errcode_key
+syn keyword ngxDirectiveThirdParty rds_json_errstr_key
+syn keyword ngxDirectiveThirdParty rds_json_ret
+syn keyword ngxDirectiveThirdParty rds_json_content_type
+
+" Redis Module <https://www.nginx.com/resources/wiki/modules/redis/>
+" Use this module to perform simple caching
+syn keyword ngxDirectiveThirdParty redis_pass
+syn keyword ngxDirectiveThirdParty redis_bind
+syn keyword ngxDirectiveThirdParty redis_connect_timeout
+syn keyword ngxDirectiveThirdParty redis_read_timeout
+syn keyword ngxDirectiveThirdParty redis_send_timeout
+syn keyword ngxDirectiveThirdParty redis_buffer_size
+syn keyword ngxDirectiveThirdParty redis_next_upstream
+syn keyword ngxDirectiveThirdParty redis_gzip_flag
+
+" Redis 2 Module <https://github.com/openresty/redis2-nginx-module>
+" Nginx upstream module for the Redis 2.0 protocol
+syn keyword ngxDirectiveThirdParty redis2_query
+syn keyword ngxDirectiveThirdParty redis2_raw_query
+syn keyword ngxDirectiveThirdParty redis2_raw_queries
+syn keyword ngxDirectiveThirdParty redis2_literal_raw_query
+syn keyword ngxDirectiveThirdParty redis2_pass
+syn keyword ngxDirectiveThirdParty redis2_connect_timeout
+syn keyword ngxDirectiveThirdParty redis2_send_timeout
+syn keyword ngxDirectiveThirdParty redis2_read_timeout
+syn keyword ngxDirectiveThirdParty redis2_buffer_size
+syn keyword ngxDirectiveThirdParty redis2_next_upstream
+
+" Replace Filter Module <https://github.com/openresty/replace-filter-nginx-module>
+" Streaming regular expression replacement in response bodies
+syn keyword ngxDirectiveThirdParty replace_filter
+syn keyword ngxDirectiveThirdParty replace_filter_types
+syn keyword ngxDirectiveThirdParty replace_filter_max_buffered_size
+syn keyword ngxDirectiveThirdParty replace_filter_last_modified
+syn keyword ngxDirectiveThirdParty replace_filter_skip
+
+" Roboo Module <https://github.com/yuri-gushin/Roboo>
+" HTTP Robot Mitigator
+
+" RRD Graph Module <https://www.nginx.com/resources/wiki/modules/rrd_graph/>
+" This module provides an HTTP interface to RRDtool's graphing facilities.
+syn keyword ngxDirectiveThirdParty rrd_graph
+syn keyword ngxDirectiveThirdParty rrd_graph_root
+
+" RTMP Module <https://github.com/arut/nginx-rtmp-module>
+" NGINX-based Media Streaming Server
+syn keyword ngxDirectiveThirdParty rtmp
+" syn keyword ngxDirectiveThirdParty server
+" syn keyword ngxDirectiveThirdParty listen
+syn keyword ngxDirectiveThirdParty application
+" syn keyword ngxDirectiveThirdParty timeout
+syn keyword ngxDirectiveThirdParty ping
+syn keyword ngxDirectiveThirdParty ping_timeout
+syn keyword ngxDirectiveThirdParty max_streams
+syn keyword ngxDirectiveThirdParty ack_window
+syn keyword ngxDirectiveThirdParty chunk_size
+syn keyword ngxDirectiveThirdParty max_queue
+syn keyword ngxDirectiveThirdParty max_message
+syn keyword ngxDirectiveThirdParty out_queue
+syn keyword ngxDirectiveThirdParty out_cork
+" syn keyword ngxDirectiveThirdParty allow
+" syn keyword ngxDirectiveThirdParty deny
+syn keyword ngxDirectiveThirdParty exec_push
+syn keyword ngxDirectiveThirdParty exec_pull
+syn keyword ngxDirectiveThirdParty exec
+syn keyword ngxDirectiveThirdParty exec_options
+syn keyword ngxDirectiveThirdParty exec_static
+syn keyword ngxDirectiveThirdParty exec_kill_signal
+syn keyword ngxDirectiveThirdParty respawn
+syn keyword ngxDirectiveThirdParty respawn_timeout
+syn keyword ngxDirectiveThirdParty exec_publish
+syn keyword ngxDirectiveThirdParty exec_play
+syn keyword ngxDirectiveThirdParty exec_play_done
+syn keyword ngxDirectiveThirdParty exec_publish_done
+syn keyword ngxDirectiveThirdParty exec_record_done
+syn keyword ngxDirectiveThirdParty live
+syn keyword ngxDirectiveThirdParty meta
+syn keyword ngxDirectiveThirdParty interleave
+syn keyword ngxDirectiveThirdParty wait_key
+syn keyword ngxDirectiveThirdParty wait_video
+syn keyword ngxDirectiveThirdParty publish_notify
+syn keyword ngxDirectiveThirdParty drop_idle_publisher
+syn keyword ngxDirectiveThirdParty sync
+syn keyword ngxDirectiveThirdParty play_restart
+syn keyword ngxDirectiveThirdParty idle_streams
+syn keyword ngxDirectiveThirdParty record
+syn keyword ngxDirectiveThirdParty record_path
+syn keyword ngxDirectiveThirdParty record_suffix
+syn keyword ngxDirectiveThirdParty record_unique
+syn keyword ngxDirectiveThirdParty record_append
+syn keyword ngxDirectiveThirdParty record_lock
+syn keyword ngxDirectiveThirdParty record_max_size
+syn keyword ngxDirectiveThirdParty record_max_frames
+syn keyword ngxDirectiveThirdParty record_interval
+syn keyword ngxDirectiveThirdParty recorder
+syn keyword ngxDirectiveThirdParty record_notify
+syn keyword ngxDirectiveThirdParty play
+syn keyword ngxDirectiveThirdParty play_temp_path
+syn keyword ngxDirectiveThirdParty play_local_path
+syn keyword ngxDirectiveThirdParty pull
+syn keyword ngxDirectiveThirdParty push
+syn keyword ngxDirectiveThirdParty push_reconnect
+syn keyword ngxDirectiveThirdParty session_relay
+syn keyword ngxDirectiveThirdParty on_connect
+syn keyword ngxDirectiveThirdParty on_play
+syn keyword ngxDirectiveThirdParty on_publish
+syn keyword ngxDirectiveThirdParty on_done
+syn keyword ngxDirectiveThirdParty on_play_done
+syn keyword ngxDirectiveThirdParty on_publish_done
+syn keyword ngxDirectiveThirdParty on_record_done
+syn keyword ngxDirectiveThirdParty on_update
+syn keyword ngxDirectiveThirdParty notify_update_timeout
+syn keyword ngxDirectiveThirdParty notify_update_strict
+syn keyword ngxDirectiveThirdParty notify_relay_redirect
+syn keyword ngxDirectiveThirdParty notify_method
+syn keyword ngxDirectiveThirdParty hls
+syn keyword ngxDirectiveThirdParty hls_path
+syn keyword ngxDirectiveThirdParty hls_fragment
+syn keyword ngxDirectiveThirdParty hls_playlist_length
+syn keyword ngxDirectiveThirdParty hls_sync
+syn keyword ngxDirectiveThirdParty hls_continuous
+syn keyword ngxDirectiveThirdParty hls_nested
+syn keyword ngxDirectiveThirdParty hls_base_url
+syn keyword ngxDirectiveThirdParty hls_cleanup
+syn keyword ngxDirectiveThirdParty hls_fragment_naming
+syn keyword ngxDirectiveThirdParty hls_fragment_slicing
+syn keyword ngxDirectiveThirdParty hls_variant
+syn keyword ngxDirectiveThirdParty hls_type
+syn keyword ngxDirectiveThirdParty hls_keys
+syn keyword ngxDirectiveThirdParty hls_key_path
+syn keyword ngxDirectiveThirdParty hls_key_url
+syn keyword ngxDirectiveThirdParty hls_fragments_per_key
+syn keyword ngxDirectiveThirdParty dash
+syn keyword ngxDirectiveThirdParty dash_path
+syn keyword ngxDirectiveThirdParty dash_fragment
+syn keyword ngxDirectiveThirdParty dash_playlist_length
+syn keyword ngxDirectiveThirdParty dash_nested
+syn keyword ngxDirectiveThirdParty dash_cleanup
+" syn keyword ngxDirectiveThirdParty access_log
+" syn keyword ngxDirectiveThirdParty log_format
+syn keyword ngxDirectiveThirdParty max_connections
+syn keyword ngxDirectiveThirdParty rtmp_stat
+syn keyword ngxDirectiveThirdParty rtmp_stat_stylesheet
+syn keyword ngxDirectiveThirdParty rtmp_auto_push
+syn keyword ngxDirectiveThirdParty rtmp_auto_push_reconnect
+syn keyword ngxDirectiveThirdParty rtmp_socket_dir
+syn keyword ngxDirectiveThirdParty rtmp_control
+
+" RTMPT Module <https://github.com/kwojtek/nginx-rtmpt-proxy-module>
+" Module for nginx to proxy rtmp using http protocol
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_target
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_rtmp_timeout
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_http_timeout
+syn keyword ngxDirectiveThirdParty rtmpt_proxy
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_stat
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_stylesheet
+
+" Syntactically Awesome Module <https://github.com/mneudert/sass-nginx-module>
+" Providing on-the-fly compiling of Sass files as an NGINX module.
+syn keyword ngxDirectiveThirdParty sass_compile
+syn keyword ngxDirectiveThirdParty sass_error_log
+syn keyword ngxDirectiveThirdParty sass_include_path
+syn keyword ngxDirectiveThirdParty sass_indent
+syn keyword ngxDirectiveThirdParty sass_is_indented_syntax
+syn keyword ngxDirectiveThirdParty sass_linefeed
+syn keyword ngxDirectiveThirdParty sass_precision
+syn keyword ngxDirectiveThirdParty sass_output_style
+syn keyword ngxDirectiveThirdParty sass_source_comments
+syn keyword ngxDirectiveThirdParty sass_source_map_embed
+
+" Secure Download Module <https://www.nginx.com/resources/wiki/modules/secure_download/>
+" Enables you to create links which are only valid until a certain datetime is reached
+syn keyword ngxDirectiveThirdParty secure_download
+syn keyword ngxDirectiveThirdParty secure_download_secret
+syn keyword ngxDirectiveThirdParty secure_download_path_mode
+
+" Selective Cache Purge Module <https://github.com/wandenberg/nginx-selective-cache-purge-module>
+" A module to purge cache by GLOB patterns. The supported patterns are the same as supported by Redis.
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_unix_socket
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_host
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_port
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_database
+syn keyword ngxDirectiveThirdParty selective_cache_purge_query
+
+" Set cconv Module <https://github.com/liseen/set-cconv-nginx-module>
+" Cconv rewrite set commands
+syn keyword ngxDirectiveThirdParty set_cconv_to_simp
+syn keyword ngxDirectiveThirdParty set_cconv_to_trad
+syn keyword ngxDirectiveThirdParty set_pinyin_to_normal
+
+" Set Hash Module <https://github.com/simpl/ngx_http_set_hash>
+" Nginx module that allows the setting of variables to the value of a variety of hashes
+syn keyword ngxDirectiveThirdParty set_md5
+syn keyword ngxDirectiveThirdParty set_md5_upper
+syn keyword ngxDirectiveThirdParty set_murmur2
+syn keyword ngxDirectiveThirdParty set_murmur2_upper
+syn keyword ngxDirectiveThirdParty set_sha1
+syn keyword ngxDirectiveThirdParty set_sha1_upper
+
+" Set Lang Module <https://github.com/simpl/ngx_http_set_lang>
+" Provides a variety of ways for setting a variable denoting the langauge that content should be returned in.
+syn keyword ngxDirectiveThirdParty set_lang
+syn keyword ngxDirectiveThirdParty set_lang_method
+syn keyword ngxDirectiveThirdParty lang_cookie
+syn keyword ngxDirectiveThirdParty lang_get_var
+syn keyword ngxDirectiveThirdParty lang_list
+syn keyword ngxDirectiveThirdParty lang_post_var
+syn keyword ngxDirectiveThirdParty lang_host
+syn keyword ngxDirectiveThirdParty lang_referer
+
+" Set Misc Module <https://github.com/openresty/set-misc-nginx-module>
+" Various set_xxx directives added to nginx's rewrite module
+syn keyword ngxDirectiveThirdParty set_if_empty
+syn keyword ngxDirectiveThirdParty set_quote_sql_str
+syn keyword ngxDirectiveThirdParty set_quote_pgsql_str
+syn keyword ngxDirectiveThirdParty set_quote_json_str
+syn keyword ngxDirectiveThirdParty set_unescape_uri
+syn keyword ngxDirectiveThirdParty set_escape_uri
+syn keyword ngxDirectiveThirdParty set_hashed_upstream
+syn keyword ngxDirectiveThirdParty set_encode_base32
+syn keyword ngxDirectiveThirdParty set_base32_padding
+syn keyword ngxDirectiveThirdParty set_misc_base32_padding
+syn keyword ngxDirectiveThirdParty set_base32_alphabet
+syn keyword ngxDirectiveThirdParty set_decode_base32
+syn keyword ngxDirectiveThirdParty set_encode_base64
+syn keyword ngxDirectiveThirdParty set_decode_base64
+syn keyword ngxDirectiveThirdParty set_encode_hex
+syn keyword ngxDirectiveThirdParty set_decode_hex
+syn keyword ngxDirectiveThirdParty set_sha1
+syn keyword ngxDirectiveThirdParty set_md5
+syn keyword ngxDirectiveThirdParty set_hmac_sha1
+syn keyword ngxDirectiveThirdParty set_random
+syn keyword ngxDirectiveThirdParty set_secure_random_alphanum
+syn keyword ngxDirectiveThirdParty set_secure_random_lcalpha
+syn keyword ngxDirectiveThirdParty set_rotate
+syn keyword ngxDirectiveThirdParty set_local_today
+syn keyword ngxDirectiveThirdParty set_formatted_gmt_time
+syn keyword ngxDirectiveThirdParty set_formatted_local_time
+
+" SFlow Module <https://github.com/sflow/nginx-sflow-module>
+" A binary, random-sampling nginx module designed for: lightweight, centralized, continuous, real-time monitoring of very large and very busy web farms.
+syn keyword ngxDirectiveThirdParty sflow
+
+" Shibboleth Module <https://github.com/nginx-shib/nginx-http-shibboleth>
+" Shibboleth auth request module for nginx
+syn keyword ngxDirectiveThirdParty shib_request
+syn keyword ngxDirectiveThirdParty shib_request_set
+syn keyword ngxDirectiveThirdParty shib_request_use_headers
+
+" Slice Module <https://github.com/alibaba/nginx-http-slice>
+" Nginx module for serving a file in slices (reverse byte-range)
+" syn keyword ngxDirectiveThirdParty slice
+syn keyword ngxDirectiveThirdParty slice_arg_begin
+syn keyword ngxDirectiveThirdParty slice_arg_end
+syn keyword ngxDirectiveThirdParty slice_header
+syn keyword ngxDirectiveThirdParty slice_footer
+syn keyword ngxDirectiveThirdParty slice_header_first
+syn keyword ngxDirectiveThirdParty slice_footer_last
+
+" SlowFS Cache Module <https://github.com/FRiCKLE/ngx_slowfs_cache/>
+" Module adding ability to cache static files.
+syn keyword ngxDirectiveThirdParty slowfs_big_file_size
+syn keyword ngxDirectiveThirdParty slowfs_cache
+syn keyword ngxDirectiveThirdParty slowfs_cache_key
+syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
+syn keyword ngxDirectiveThirdParty slowfs_cache_path
+syn keyword ngxDirectiveThirdParty slowfs_cache_purge
+syn keyword ngxDirectiveThirdParty slowfs_cache_valid
+syn keyword ngxDirectiveThirdParty slowfs_temp_path
+
+" Small Light Module <https://github.com/cubicdaiya/ngx_small_light>
+" Dynamic Image Transformation Module For nginx.
+syn keyword ngxDirectiveThirdParty small_light
+syn keyword ngxDirectiveThirdParty small_light_getparam_mode
+syn keyword ngxDirectiveThirdParty small_light_material_dir
+syn keyword ngxDirectiveThirdParty small_light_pattern_define
+syn keyword ngxDirectiveThirdParty small_light_radius_max
+syn keyword ngxDirectiveThirdParty small_light_sigma_max
+syn keyword ngxDirectiveThirdParty small_light_imlib2_temp_dir
+syn keyword ngxDirectiveThirdParty small_light_buffer
+
+" Sorted Querystring Filter Module <https://github.com/wandenberg/nginx-sorted-querystring-module>
+" Nginx module to expose querystring parameters sorted in a variable to be used on cache_key as example
+syn keyword ngxDirectiveThirdParty sorted_querystring_filter_parameter
+
+" Sphinx2 Module <https://github.com/reeteshranjan/sphinx2-nginx-module>
+" Nginx upstream module for Sphinx 2.x
+syn keyword ngxDirectiveThirdParty sphinx2_pass
+syn keyword ngxDirectiveThirdParty sphinx2_bind
+syn keyword ngxDirectiveThirdParty sphinx2_connect_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_send_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_buffer_size
+syn keyword ngxDirectiveThirdParty sphinx2_read_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_next_upstream
+
+" HTTP SPNEGO auth Module <https://github.com/stnoonan/spnego-http-auth-nginx-module>
+" This module implements adds SPNEGO support to nginx(http://nginx.org). It currently supports only Kerberos authentication via GSSAPI
+syn keyword ngxDirectiveThirdParty auth_gss
+syn keyword ngxDirectiveThirdParty auth_gss_keytab
+syn keyword ngxDirectiveThirdParty auth_gss_realm
+syn keyword ngxDirectiveThirdParty auth_gss_service_name
+syn keyword ngxDirectiveThirdParty auth_gss_authorized_principal
+syn keyword ngxDirectiveThirdParty auth_gss_allow_basic_fallback
+
+" SR Cache Module <https://github.com/openresty/srcache-nginx-module>
+" Transparent subrequest-based caching layout for arbitrary nginx locations
+syn keyword ngxDirectiveThirdParty srcache_fetch
+syn keyword ngxDirectiveThirdParty srcache_fetch_skip
+syn keyword ngxDirectiveThirdParty srcache_store
+syn keyword ngxDirectiveThirdParty srcache_store_max_size
+syn keyword ngxDirectiveThirdParty srcache_store_skip
+syn keyword ngxDirectiveThirdParty srcache_store_statuses
+syn keyword ngxDirectiveThirdParty srcache_store_ranges
+syn keyword ngxDirectiveThirdParty srcache_header_buffer_size
+syn keyword ngxDirectiveThirdParty srcache_store_hide_header
+syn keyword ngxDirectiveThirdParty srcache_store_pass_header
+syn keyword ngxDirectiveThirdParty srcache_methods
+syn keyword ngxDirectiveThirdParty srcache_ignore_content_encoding
+syn keyword ngxDirectiveThirdParty srcache_request_cache_control
+syn keyword ngxDirectiveThirdParty srcache_response_cache_control
+syn keyword ngxDirectiveThirdParty srcache_store_no_store
+syn keyword ngxDirectiveThirdParty srcache_store_no_cache
+syn keyword ngxDirectiveThirdParty srcache_store_private
+syn keyword ngxDirectiveThirdParty srcache_default_expire
+syn keyword ngxDirectiveThirdParty srcache_max_expire
+
+" SSSD Info Module <https://github.com/veruu/ngx_sssd_info>
+" Retrives additional attributes from SSSD for current authentizated user
+syn keyword ngxDirectiveThirdParty sssd_info
+syn keyword ngxDirectiveThirdParty sssd_info_output_to
+syn keyword ngxDirectiveThirdParty sssd_info_groups
+syn keyword ngxDirectiveThirdParty sssd_info_group
+syn keyword ngxDirectiveThirdParty sssd_info_group_separator
+syn keyword ngxDirectiveThirdParty sssd_info_attributes
+syn keyword ngxDirectiveThirdParty sssd_info_attribute
+syn keyword ngxDirectiveThirdParty sssd_info_attribute_separator
+
+" Static Etags Module <https://github.com/mikewest/nginx-static-etags>
+" Generate etags for static content
+syn keyword ngxDirectiveThirdParty FileETag
+
+" Statsd Module <https://github.com/zebrafishlabs/nginx-statsd>
+" An nginx module for sending statistics to statsd
+syn keyword ngxDirectiveThirdParty statsd_server
+syn keyword ngxDirectiveThirdParty statsd_sample_rate
+syn keyword ngxDirectiveThirdParty statsd_count
+syn keyword ngxDirectiveThirdParty statsd_timing
+
+" Sticky Module <https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng>
+" Add a sticky cookie to be always forwarded to the same upstream server
+" syn keyword ngxDirectiveThirdParty sticky
+
+" Stream Echo Module <https://github.com/openresty/stream-echo-nginx-module>
+" TCP/stream echo module for NGINX (a port of ngx_http_echo_module)
+syn keyword ngxDirectiveThirdParty echo
+syn keyword ngxDirectiveThirdParty echo_duplicate
+syn keyword ngxDirectiveThirdParty echo_flush_wait
+syn keyword ngxDirectiveThirdParty echo_sleep
+syn keyword ngxDirectiveThirdParty echo_send_timeout
+syn keyword ngxDirectiveThirdParty echo_read_bytes
+syn keyword ngxDirectiveThirdParty echo_read_line
+syn keyword ngxDirectiveThirdParty echo_request_data
+syn keyword ngxDirectiveThirdParty echo_discard_request
+syn keyword ngxDirectiveThirdParty echo_read_buffer_size
+syn keyword ngxDirectiveThirdParty echo_read_timeout
+syn keyword ngxDirectiveThirdParty echo_client_error_log_level
+syn keyword ngxDirectiveThirdParty echo_lingering_close
+syn keyword ngxDirectiveThirdParty echo_lingering_time
+syn keyword ngxDirectiveThirdParty echo_lingering_timeout
+
+" Stream Lua Module <https://github.com/openresty/stream-lua-nginx-module>
+" Embed the power of Lua into Nginx stream/TCP Servers.
+syn keyword ngxDirectiveThirdParty lua_resolver
+syn keyword ngxDirectiveThirdParty lua_resolver_timeout
+syn keyword ngxDirectiveThirdParty lua_lingering_close
+syn keyword ngxDirectiveThirdParty lua_lingering_time
+syn keyword ngxDirectiveThirdParty lua_lingering_timeout
+
+" Stream Upsync Module <https://github.com/xiaokai-wang/nginx-stream-upsync-module>
+" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx.
+syn keyword ngxDirectiveThirdParty upsync
+syn keyword ngxDirectiveThirdParty upsync_dump_path
+syn keyword ngxDirectiveThirdParty upsync_lb
+syn keyword ngxDirectiveThirdParty upsync_show
+
+" Strip Module <https://github.com/evanmiller/mod_strip>
+" Whitespace remover.
+syn keyword ngxDirectiveThirdParty strip
+
+" Subrange Module <https://github.com/Qihoo360/ngx_http_subrange_module>
+" Split one big HTTP/Range request to multiple subrange requesets
+syn keyword ngxDirectiveThirdParty subrange
+
+" Substitutions Module <https://www.nginx.com/resources/wiki/modules/substitutions/>
+" A filter module which can do both regular expression and fixed string substitutions on response bodies.
+syn keyword ngxDirectiveThirdParty subs_filter
+syn keyword ngxDirectiveThirdParty subs_filter_types
+
+" Summarizer Module <https://github.com/reeteshranjan/summarizer-nginx-module>
+" Upstream nginx module to get summaries of documents using the summarizer daemon service
+syn keyword ngxDirectiveThirdParty smrzr_filename
+syn keyword ngxDirectiveThirdParty smrzr_ratio
+
+" Supervisord Module <https://github.com/FRiCKLE/ngx_supervisord/>
+" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
+syn keyword ngxDirectiveThirdParty supervisord
+syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
+syn keyword ngxDirectiveThirdParty supervisord_name
+syn keyword ngxDirectiveThirdParty supervisord_start
+syn keyword ngxDirectiveThirdParty supervisord_stop
+
+" Tarantool Upstream Module <https://github.com/tarantool/nginx_upstream_module>
+" Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
+syn keyword ngxDirectiveThirdParty tnt_pass
+syn keyword ngxDirectiveThirdParty tnt_http_methods
+syn keyword ngxDirectiveThirdParty tnt_http_rest_methods
+syn keyword ngxDirectiveThirdParty tnt_pass_http_request
+syn keyword ngxDirectiveThirdParty tnt_pass_http_request_buffer_size
+syn keyword ngxDirectiveThirdParty tnt_method
+syn keyword ngxDirectiveThirdParty tnt_http_allowed_methods - experemental
+syn keyword ngxDirectiveThirdParty tnt_send_timeout
+syn keyword ngxDirectiveThirdParty tnt_read_timeout
+syn keyword ngxDirectiveThirdParty tnt_buffer_size
+syn keyword ngxDirectiveThirdParty tnt_next_upstream
+syn keyword ngxDirectiveThirdParty tnt_connect_timeout
+syn keyword ngxDirectiveThirdParty tnt_next_upstream
+syn keyword ngxDirectiveThirdParty tnt_next_upstream_tries
+syn keyword ngxDirectiveThirdParty tnt_next_upstream_timeout
+
+" TCP Proxy Module <http://yaoweibin.github.io/nginx_tcp_proxy_module/>
+" Add the feature of tcp proxy with nginx, with health check and status monitor
+syn keyword ngxDirectiveBlock tcp
+" syn keyword ngxDirectiveThirdParty server
+" syn keyword ngxDirectiveThirdParty listen
+" syn keyword ngxDirectiveThirdParty allow
+" syn keyword ngxDirectiveThirdParty deny
+" syn keyword ngxDirectiveThirdParty so_keepalive
+" syn keyword ngxDirectiveThirdParty tcp_nodelay
+" syn keyword ngxDirectiveThirdParty timeout
+" syn keyword ngxDirectiveThirdParty server_name
+" syn keyword ngxDirectiveThirdParty resolver
+" syn keyword ngxDirectiveThirdParty resolver_timeout
+" syn keyword ngxDirectiveThirdParty upstream
+syn keyword ngxDirectiveThirdParty check
+syn keyword ngxDirectiveThirdParty check_http_send
+syn keyword ngxDirectiveThirdParty check_http_expect_alive
+syn keyword ngxDirectiveThirdParty check_smtp_send
+syn keyword ngxDirectiveThirdParty check_smtp_expect_alive
+syn keyword ngxDirectiveThirdParty check_shm_size
+syn keyword ngxDirectiveThirdParty check_status
+" syn keyword ngxDirectiveThirdParty ip_hash
+" syn keyword ngxDirectiveThirdParty proxy_pass
+" syn keyword ngxDirectiveThirdParty proxy_buffer
+" syn keyword ngxDirectiveThirdParty proxy_connect_timeout
+" syn keyword ngxDirectiveThirdParty proxy_read_timeout
+syn keyword ngxDirectiveThirdParty proxy_write_timeout
+
+" Testcookie Module <https://github.com/kyprizel/testcookie-nginx-module>
+" NGINX module for L7 DDoS attack mitigation
+syn keyword ngxDirectiveThirdParty testcookie
+syn keyword ngxDirectiveThirdParty testcookie_name
+syn keyword ngxDirectiveThirdParty testcookie_domain
+syn keyword ngxDirectiveThirdParty testcookie_expires
+syn keyword ngxDirectiveThirdParty testcookie_path
+syn keyword ngxDirectiveThirdParty testcookie_secret
+syn keyword ngxDirectiveThirdParty testcookie_session
+syn keyword ngxDirectiveThirdParty testcookie_arg
+syn keyword ngxDirectiveThirdParty testcookie_max_attempts
+syn keyword ngxDirectiveThirdParty testcookie_p3p
+syn keyword ngxDirectiveThirdParty testcookie_fallback
+syn keyword ngxDirectiveThirdParty testcookie_whitelist
+syn keyword ngxDirectiveThirdParty testcookie_pass
+syn keyword ngxDirectiveThirdParty testcookie_redirect_via_refresh
+syn keyword ngxDirectiveThirdParty testcookie_refresh_template
+syn keyword ngxDirectiveThirdParty testcookie_refresh_status
+syn keyword ngxDirectiveThirdParty testcookie_deny_keepalive
+syn keyword ngxDirectiveThirdParty testcookie_get_only
+syn keyword ngxDirectiveThirdParty testcookie_https_location
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie_key
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_iv
+syn keyword ngxDirectiveThirdParty testcookie_internal
+syn keyword ngxDirectiveThirdParty testcookie_httponly_flag
+syn keyword ngxDirectiveThirdParty testcookie_secure_flag
+
+" Types Filter Module <https://github.com/flygoast/ngx_http_types_filter>
+" Change the `Content-Type` output header depending on an extension variable according to a condition specified in the 'if' clause.
+syn keyword ngxDirectiveThirdParty types_filter
+syn keyword ngxDirectiveThirdParty types_filter_use_default
+
+" Unzip Module <https://github.com/youzee/nginx-unzip-module>
+" Enabling fetching of files that are stored in zipped archives.
+syn keyword ngxDirectiveThirdParty file_in_unzip_archivefile
+syn keyword ngxDirectiveThirdParty file_in_unzip_extract
+syn keyword ngxDirectiveThirdParty file_in_unzip
+
+" Upload Progress Module <https://www.nginx.com/resources/wiki/modules/upload_progress/>
+" An upload progress system, that monitors RFC1867 POST upload as they are transmitted to upstream servers
+syn keyword ngxDirectiveThirdParty upload_progress
+syn keyword ngxDirectiveThirdParty track_uploads
+syn keyword ngxDirectiveThirdParty report_uploads
+syn keyword ngxDirectiveThirdParty upload_progress_content_type
+syn keyword ngxDirectiveThirdParty upload_progress_header
+syn keyword ngxDirectiveThirdParty upload_progress_jsonp_parameter
+syn keyword ngxDirectiveThirdParty upload_progress_json_output
+syn keyword ngxDirectiveThirdParty upload_progress_jsonp_output
+syn keyword ngxDirectiveThirdParty upload_progress_template
+
+" Upload Module <https://www.nginx.com/resources/wiki/modules/upload/>
+" Parses request body storing all files being uploaded to a directory specified by upload_store directive
+syn keyword ngxDirectiveThirdParty upload_pass
+syn keyword ngxDirectiveThirdParty upload_resumable
+syn keyword ngxDirectiveThirdParty upload_store
+syn keyword ngxDirectiveThirdParty upload_state_store
+syn keyword ngxDirectiveThirdParty upload_store_access
+syn keyword ngxDirectiveThirdParty upload_set_form_field
+syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
+syn keyword ngxDirectiveThirdParty upload_pass_form_field
+syn keyword ngxDirectiveThirdParty upload_cleanup
+syn keyword ngxDirectiveThirdParty upload_buffer_size
+syn keyword ngxDirectiveThirdParty upload_max_part_header_len
+syn keyword ngxDirectiveThirdParty upload_max_file_size
+syn keyword ngxDirectiveThirdParty upload_limit_rate
+syn keyword ngxDirectiveThirdParty upload_max_output_body_len
+syn keyword ngxDirectiveThirdParty upload_tame_arrays
+syn keyword ngxDirectiveThirdParty upload_pass_args
+
+" Upstream Fair Module <https://github.com/gnosek/nginx-upstream-fair>
+" The fair load balancer module for nginx http://nginx.localdomain.pl
+syn keyword ngxDirectiveThirdParty fair
+syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
+
+" Upstream Hash Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
+" Provides simple upstream load distribution by hashing a configurable variable.
+" syn keyword ngxDirectiveDeprecated hash
+syn keyword ngxDirectiveDeprecated hash_again
+
+" Upstream Domain Resolve Module <https://www.nginx.com/resources/wiki/modules/domain_resolve/>
+" A load-balancer that resolves an upstream domain name asynchronously.
+syn keyword ngxDirectiveThirdParty jdomain
+
+" Upsync Module <https://github.com/weibocom/nginx-upsync-module>
+" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx
+syn keyword ngxDirectiveThirdParty upsync
+syn keyword ngxDirectiveThirdParty upsync_dump_path
+syn keyword ngxDirectiveThirdParty upsync_lb
+syn keyword ngxDirectiveThirdParty upstream_show
+
+" URL Module <https://github.com/vozlt/nginx-module-url>
+" Nginx url encoding converting module
+syn keyword ngxDirectiveThirdParty url_encoding_convert
+syn keyword ngxDirectiveThirdParty url_encoding_convert_from
+syn keyword ngxDirectiveThirdParty url_encoding_convert_to
+
+" User Agent Module <https://github.com/alibaba/nginx-http-user-agent>
+" Match browsers and crawlers
+syn keyword ngxDirectiveThirdParty user_agent
+
+" Upstrema Ketama Chash Module <https://github.com/flygoast/ngx_http_upstream_ketama_chash>
+" Nginx load-balancer module implementing ketama consistent hashing.
+syn keyword ngxDirectiveThirdParty ketama_chash
+
+" Video Thumbextractor Module <https://github.com/wandenberg/nginx-video-thumbextractor-module>
+" Extract thumbs from a video file
+syn keyword ngxDirectiveThirdParty video_thumbextractor
+syn keyword ngxDirectiveThirdParty video_thumbextractor_video_filename
+syn keyword ngxDirectiveThirdParty video_thumbextractor_video_second
+syn keyword ngxDirectiveThirdParty video_thumbextractor_image_width
+syn keyword ngxDirectiveThirdParty video_thumbextractor_image_height
+syn keyword ngxDirectiveThirdParty video_thumbextractor_only_keyframe
+syn keyword ngxDirectiveThirdParty video_thumbextractor_next_time
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_rows
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_cols
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_rows
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_cols
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_sample_interval
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_color
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_margin
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_padding
+syn keyword ngxDirectiveThirdParty video_thumbextractor_threads
+syn keyword ngxDirectiveThirdParty video_thumbextractor_processes_per_worker
+
+" Eval Module <http://www.grid.net.ru/nginx/eval.en.html>
+" Module for nginx web server evaluates response of proxy or memcached module into variables.
+syn keyword ngxDirectiveThirdParty eval
+syn keyword ngxDirectiveThirdParty eval_escalate
+syn keyword ngxDirectiveThirdParty eval_override_content_type
+
+" VTS Module <https://github.com/vozlt/nginx-module-vts>
+" Nginx virtual host traffic status module
+syn keyword ngxDirectiveThirdParty vhost_traffic_status
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_zone
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_format
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_jsonp
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_host
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_set_key
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_check_duplicate
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic_by_set_key
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_check_duplicate
+
+" XSS Module <https://github.com/openresty/xss-nginx-module>
+" Native support for cross-site scripting (XSS) in an nginx.
+syn keyword ngxDirectiveThirdParty xss_get
+syn keyword ngxDirectiveThirdParty xss_callback_arg
+syn keyword ngxDirectiveThirdParty xss_override_status
+syn keyword ngxDirectiveThirdParty xss_check_status
+syn keyword ngxDirectiveThirdParty xss_input_types
+
+" ZIP Module <https://www.nginx.com/resources/wiki/modules/zip/>
+" ZIP archiver for nginx
+
+" Contained LUA blocks for embedded syntax highlighting
+syn keyword ngxThirdPartyLuaBlock balancer_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock init_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock init_worker_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock set_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock content_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock rewrite_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock access_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock header_filter_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock body_filter_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock log_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock ssl_certificate_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock ssl_session_fetch_by_lua_block contained
+syn keyword ngxThirdPartyLuaBlock ssl_session_store_by_lua_block contained
+
+
+" Nested syntax in ERB templating statements
+" Subtype needs to be set to '', otherwise recursive errors occur when opening *.nginx files
+let b:eruby_subtype = ''
+unlet b:current_syntax
+syn include @ERB syntax/eruby.vim
+syn region ngxTemplate start=+<%[^\=]+ end=+%>+ oneline contains=@ERB
+syn region ngxTemplateVar start=+<%=+ end=+%>+ oneline
+let b:current_syntax = "nginx"
+
+" Nested syntax in Jinja templating statements
+" This dependend on https://github.com/lepture/vim-jinja
+unlet b:current_syntax
+try
+ syn include @JINJA syntax/jinja.vim
+ syn region ngxTemplate start=+{%+ end=+%}+ oneline contains=@JINJA
+ syn region ngxTemplateVar start=+{{+ end=+}}+ oneline
+catch
+endtry
+let b:current_syntax = "nginx"
+
+" Enable nested LUA syntax highlighting
+unlet b:current_syntax
+syn include @LUA syntax/lua.vim
+syn region ngxLua start=+^\s*\w\+_by_lua_block\s*{+ end=+}+me=s-1 contains=ngxBlock,@LUA
+let b:current_syntax = "nginx"
+
+
+" Highlight
+hi link ngxComment Comment
+hi link ngxVariable Identifier
+hi link ngxVariableBlock Identifier
+hi link ngxVariableString PreProc
+hi link ngxString String
+hi link ngxIPaddr Delimiter
+hi link ngxBoolean Boolean
+hi link ngxInteger Number
+hi link ngxDirectiveBlock Statement
+hi link ngxDirectiveImportant Type
+hi link ngxDirectiveControl Keyword
+hi link ngxDirectiveDeprecated Error
+hi link ngxDirective Function
+hi link ngxDirectiveThirdParty Function
+hi link ngxListenOptions PreProc
+hi link ngxUpstreamServerOptions PreProc
+hi link ngxProxyNextUpstreamOptions PreProc
+hi link ngxMailProtocol Keyword
+hi link ngxSSLProtocol PreProc
+hi link ngxSSLProtocolDeprecated Error
+hi link ngxStickyOptions ngxDirective
+hi link ngxCookieOptions PreProc
+hi link ngxTemplateVar Identifier
+
+hi link ngxSSLSessionTicketsOff ngxBoolean
+hi link ngxSSLSessionTicketsOn Error
+hi link ngxSSLPreferServerCiphersOn ngxBoolean
+hi link ngxSSLPreferServerCiphersOff Error
+hi link ngxGzipOff ngxBoolean
+hi link ngxGzipOn Error
+hi link ngxSSLCipherInsecure Error
+
+hi link ngxThirdPartyLuaBlock Function
diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim
index 7b0085cd6e..80662d6750 100644
--- a/runtime/syntax/php.vim
+++ b/runtime/syntax/php.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: php PHP 3/4/5/7/8
" Maintainer: Tyson Andre <tysonandre775@hotmail.com>
-" Last Change: Dec 22, 2020
+" Last Change: Sep 18, 2021
" URL: https://github.com/TysonAndre/php-vim-syntax
" Former Maintainers:
" Jason Woofenden <jason@jasonwoof.com>
@@ -13,10 +13,32 @@
" than the default colourscheme, because elflord's colours will better
" highlight the break-points (Statements) in your code.
"
+" Note: This embeds a modified copy of the html.vim with (mostly) different symbols,
+" in order to implement php_htmlInStrings=2 can work as expected and correctly parse
+" `<?php $phpStartTag = '<?php';`.
+"
+" Credits for the original version of html.vim prior to modifications
+"
+" Previous Maintainer Jorge Maldonado Ventura <jorgesumle@freakspot.net>
+" Previous Maintainer Claudio Fleiner <claudio@fleiner.com>
+" Repository https://notabug.org/jorgesumle/vim-html-syntax
+" Last Change 2021 Mar 02
+" Included patch #7900 to fix comments
+" Included patch #7916 to fix a few more things
+"
" Options:
" Set to anything to enable:
" php_sql_query SQL syntax highlighting inside strings
" php_htmlInStrings HTML syntax highlighting inside strings
+"
+" By setting this to 2, this will use a local copy of
+" HTML syntax highlighting instead of the official
+" HTML syntax highlighting, and properly highlight
+" `<?php $startTag = '<?php';`.
+" This may become the new default in the future.
+"
+" By setting this to 3 (or any unrecognized value),
+" this will use the official installed top level html syntax highlighting rules.
" php_baselib highlighting baselib functions
" php_asp_tags highlighting ASP-style short tags
" php_parent_error_close highlighting parent error ] or )
@@ -62,6 +84,214 @@ if !exists("main_syntax")
let main_syntax = 'php'
endif
+" Start of copy of html for embedding in strings with {{{
+" This is a clone of https://notabug.org/jorgesumle/vim-html-syntax
+" from 2021 Mar 02 with changed symbols and modifications to rules. See the Note in the file header.
+"
+" The default behavior of php_htmlInStrings causes a bug
+" when you're working with code that contains the string literal `'<?php'`.
+" E.g. code that reads php files or generates the contents of php files or
+" generates snippets to `eval()`.
+"
+" When php_htmlInStrings was set to any value,
+" it would cause the html syntax rules to be embedded inside of the string
+" contents.
+"
+" However, php.vim extends html.vim by allowing the php start tag to be
+" included, meaning that this is parsed as `<?php';`, i.e. the start of a
+" new string literal.
+"
+" Work around that by using a different set of rules that don't allow
+" embedding php in most places (phpInnerHtmlPreProc).
+"
+" The default behavior may be changed to this in the future for constants other
+" than 2 or 3 if there are no issues.
+"
+" Many, but not all syntax rules were changed from html* to phpInnerHtml*
+if exists("php_htmlInStrings") && php_htmlInStrings==2
+ " mark illegal characters
+ syn match phpInnerHtmlError contained "[<>&]"
+
+ " tags
+ syn region phpInnerHtmlString contained start=+"+ end=+"+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc
+ syn region phpInnerHtmlString contained start=+'+ end=+'+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc
+ syn match phpInnerHtmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@phpInnerHtmlPreproc
+ syn region phpInnerHtmlEndTag contained start=+</+ end=+>+ contains=phpInnerHtmlTagN,phpInnerHtmlTagError
+ syn region phpInnerHtmlTag contained start=+<[^/]+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,htmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent,phpInnerHtmlCssDefinition,@phpInnerHtmlPreproc,@phpInnerHtmlArgCluster
+ syn match phpInnerHtmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster
+ syn match phpInnerHtmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster
+ syn match phpInnerHtmlTagError contained "[^>]<"ms=s+1
+
+
+ " special characters
+ syn match phpInnerHtmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
+
+ " Comments (the real ones or the old netscape ones)
+ if exists("html_wrong_comments")
+ syn region phpInnerHtmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
+ else
+ " The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next &gt
+ syn region phpInnerHtmlComment start=+<!+ end=+>+ contains=phpInnerHtmlCommentError keepend
+ " Idem 8.2.4.42,51: Comment starts with <!-- and ends with -->
+ " Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors
+ " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment
+ syn region phpInnerHtmlComment matchgroup=phpInnerHtmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=phpInnerHtmlCommentNested,@phpInnerHtmlPreProc,@Spell keepend
+ " Idem 8.2.4.49: nested comment is parser error, except <!--> is all right
+ syn match phpInnerHtmlCommentNested contained "<!-->\@!"
+ syn match phpInnerHtmlCommentError contained "[^><!]"
+ endif
+ syn region phpInnerHtmlComment start=+<!DOCTYPE+ end=+>+ keepend
+
+ " server-parsed commands
+ syn region phpInnerHtmlPreProc start=+<!--#+ end=+-->+ contains=phpInnerHtmlPreStmt,phpInnerHtmlPreError,phpInnerHtmlPreAttr
+ syn match phpInnerHtmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
+ syn match phpInnerHtmlPreError contained "<!--#\S*"ms=s+4
+ syn match phpInnerHtmlPreAttr contained "\w\+=[^"]\S\+" contains=phpInnerHtmlPreProcAttrError,phpInnerHtmlPreProcAttrName
+ syn region phpInnerHtmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=phpInnerHtmlPreProcAttrName keepend
+ syn match phpInnerHtmlPreProcAttrError contained "\w\+="he=e-1
+ syn match phpInnerHtmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
+
+ if !exists("html_no_rendering")
+ " rendering
+ syn cluster phpInnerHtmlTop contains=@Spell,phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLink,javaScript,@phpInnerHtmlPreproc
+
+ syn region phpInnerHtmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@phpInnerHtmlTop
+
+ syn region phpInnerHtmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderline,phpInnerHtmlBoldItalic
+ syn region phpInnerHtmlBold start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderline,phpInnerHtmlBoldItalic
+ syn region phpInnerHtmlBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderlineItalic
+ syn region phpInnerHtmlBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldItalicUnderline
+ syn region phpInnerHtmlBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldItalicUnderline
+ syn region phpInnerHtmlBoldUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlBoldUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlBoldItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderlineItalic
+
+ syn region phpInnerHtmlUnderline start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBold,phpInnerHtmlUnderlineItalic
+ syn region phpInnerHtmlUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBoldItalic
+ syn region phpInnerHtmlUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBoldItalic
+ syn region phpInnerHtmlUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineItalicBold
+ syn region phpInnerHtmlUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineItalicBold
+ syn region phpInnerHtmlUnderlineItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlUnderlineItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlUnderlineBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlUnderlineBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
+
+ syn region phpInnerHtmlItalic start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBold,phpInnerHtmlItalicUnderline
+ syn region phpInnerHtmlItalic start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBoldUnderline
+ syn region phpInnerHtmlItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBoldUnderline
+ syn region phpInnerHtmlItalicBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicUnderlineBold
+ syn region phpInnerHtmlItalicUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlItalicUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop
+
+ syn match phpInnerHtmlLeadingSpace "^\s\+" contained
+ syn region phpInnerHtmlLink start="<a\>\_[^>]*\<href\>" end="</a\_s*>"me=s-1 contains=@Spell,phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLeadingSpace,phpInnerJavaScript,@phpInnerHtmlPreproc
+ syn region phpInnerHtmlH1 start="<h1\>" end="</h1\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlH2 start="<h2\>" end="</h2\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlH3 start="<h3\>" end="</h3\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlH4 start="<h4\>" end="</h4\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlH5 start="<h5\>" end="</h5\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlH6 start="<h6\>" end="</h6\_s*>"me=s-1 contains=@phpInnerHtmlTop
+ syn region phpInnerHtmlHead start="<head\>" end="</head\_s*>"me=s-1 end="<body\>"me=s-1 end="<h[1-6]\>"me=s-1 contains=phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLink,phpInnerHtmlTitle,phpInnerJavaScript,phpInnerCssStyle,@phpInnerHtmlPreproc
+ syn region phpInnerHtmlTitle start="<title\>" end="</title\_s*>"me=s-1 contains=phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerJavaScript,@phpInnerHtmlPreproc
+ endif
+
+ if main_syntax != 'java' || exists("javascript")
+ " JAVA SCRIPT
+ " For example, $phpVar = '<img onload="foo()" />';
+ syn include @phpInnerHtmlJavaScript syntax/javascript.vim
+ unlet b:current_syntax
+ syn region phpInnerHtmlScriptTag contained start=+<script+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,phpInnerHtmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent
+ hi def link phpInnerHtmlScriptTag phpInnerHtmlTag
+
+ " phpInnerHtml events (i.e. arguments that include phpInnerJavascript commands)
+ if exists("html_extended_events")
+ syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=phpInnerHtmlEventSQ
+ syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=phpInnerHtmlEventDQ
+ else
+ syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=phpInnerHtmlEventSQ
+ syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=phpInnerHtmlEventDQ
+ endif
+ syn region phpInnerHtmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@phpInnerHtmlJavaScript
+ syn region phpInnerHtmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@phpInnerHtmlJavaScript
+ hi def link phpInnerHtmlEventSQ phpInnerHtmlEvent
+ hi def link phpInnerHtmlEventDQ phpInnerHtmlEvent
+
+ " a phpInnerJavascript expression is used as an arg value
+ " syn region phpInnerJavaScriptExpression contained start=+&{+ keepend end=+};+ contains=@phpInnerHtmlJavaScript,@phpInnerHtmlPreproc
+ endif
+
+ syn cluster phpInnerHtmlJavaScript add=@phpInnerHtmlPreproc
+
+ " The default highlighting.
+ " NOTE: For now, this deliberately copies the definitions from html rather than link
+ " to the corresponding html tag name. If html is refactored to rename any
+ " keywords then html highlighting would unexpectedly be cleared.
+ hi def link phpInnerHtmlTag Function
+ hi def link phpInnerHtmlEndTag Identifier
+ hi def link phpInnerHtmlArg Type
+ hi def link phpInnerHtmlValue String
+ hi def link phpInnerHtmlSpecialChar Special
+
+ if !exists("html_no_rendering")
+ hi def link phpInnerHtmlH1 Title
+ hi def link phpInnerHtmlH2 phpInnerHtmlH1
+ hi def link phpInnerHtmlH3 phpInnerHtmlH2
+ hi def link phpInnerHtmlH4 phpInnerHtmlH3
+ hi def link phpInnerHtmlH5 phpInnerHtmlH4
+ hi def link phpInnerHtmlH6 phpInnerHtmlH5
+ hi def link phpInnerHtmlHead PreProc
+ hi def link phpInnerHtmlTitle Title
+ hi def link phpInnerHtmlBoldItalicUnderline phpInnerHtmlBoldUnderlineItalic
+ hi def link phpInnerHtmlUnderlineBold phpInnerHtmlBoldUnderline
+ hi def link phpInnerHtmlUnderlineItalicBold phpInnerHtmlBoldUnderlineItalic
+ hi def link phpInnerHtmlUnderlineBoldItalic phpInnerHtmlBoldUnderlineItalic
+ hi def link phpInnerHtmlItalicUnderline phpInnerHtmlUnderlineItalic
+ hi def link phpInnerHtmlItalicBold phpInnerHtmlBoldItalic
+ hi def link phpInnerHtmlItalicBoldUnderline phpInnerHtmlBoldUnderlineItalic
+ hi def link phpInnerHtmlItalicUnderlineBold phpInnerHtmlBoldUnderlineItalic
+ hi def link phpInnerHtmlLink Underlined
+ hi def link phpInnerHtmlLeadingSpace None
+ if !exists("html_my_rendering")
+ hi def phpInnerHtmlBold term=bold cterm=bold gui=bold
+ hi def phpInnerHtmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
+ hi def phpInnerHtmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
+ hi def phpInnerHtmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
+ hi def phpInnerHtmlUnderline term=underline cterm=underline gui=underline
+ hi def phpInnerHtmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
+ hi def phpInnerHtmlItalic term=italic cterm=italic gui=italic
+ if v:version > 800 || v:version == 800 && has("patch1038")
+ hi def phpInnerHtmlStrike term=strikethrough cterm=strikethrough gui=strikethrough
+ else
+ hi def phpInnerHtmlStrike term=underline cterm=underline gui=underline
+ endif
+ endif
+ endif
+
+ hi def link phpInnerHtmlPreStmt PreProc
+ hi def link phpInnerHtmlPreError Error
+ hi def link phpInnerHtmlPreProc PreProc
+ hi def link phpInnerHtmlPreAttr String
+ hi def link phpInnerHtmlPreProcAttrName PreProc
+ hi def link phpInnerHtmlPreProcAttrError Error
+ hi def link phpInnerHtmlString String
+ hi def link phpInnerHtmlStatement Statement
+ hi def link phpInnerHtmlComment Comment
+ hi def link phpInnerHtmlCommentNested phpInnerHtmlError
+ hi def link phpInnerHtmlCommentError phpInnerHtmlError
+ hi def link phpInnerHtmlTagError phpInnerHtmlError
+ hi def link phpInnerHtmlEvent phpInnerJavaScript
+ hi def link phpInnerHtmlError Error
+
+ hi def link phpInnerJavaScript Special
+ hi def link phpInnerJavaScriptExpression phpInnerJavaScript
+ hi def link phpInnerHtmlCssStyleComment Comment
+ hi def link phpInnerHtmlCssDefinition Special
+endif
+
+
runtime! syntax/html.vim
unlet b:current_syntax
@@ -79,6 +309,8 @@ if exists("php_parentError") && !exists("php_parent_error_open") && !exists("php
let php_parent_error_open=1
endif
+" End of copy of html syntax for embedding in php strings }}}
+
syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc
syn include @sqlTop syntax/sql.vim
@@ -90,7 +322,11 @@ if exists( "php_sql_query")
endif
if exists( "php_htmlInStrings")
- syn cluster phpAddStrings add=@htmlTop
+ if php_htmlInStrings==2
+ syn cluster phpAddStrings add=@phpInnerHtmlTop
+ else
+ syn cluster phpAddStrings add=@htmlTop
+ endif
endif
" make sure we can use \ at the beginning of the line to do a continuation
@@ -283,7 +519,7 @@ syn keyword phpStatement return break continue exit goto yield contained
syn keyword phpKeyword var const contained
" Type
-syn keyword phpType void bool boolean int integer real double float string array object NULL callable iterable mixed contained
+syn keyword phpType void bool boolean int integer real double float string array object NULL callable iterable mixed never contained
" Structure
syn keyword phpStructure namespace extends implements instanceof parent self contained
@@ -361,7 +597,7 @@ syn match phpFloatError "\%([eE.][0-9._+-]*\.\|__\|_\(\>\|[eE]\)\|\(\>\|[eE]\)_\
" Number
syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\(\x_\?\)*\x\)\>\%(\.\)\@!" contained display
-syn match phpNumber "\%(\.\)\@<!\<0\d\+\>\%(\.\)\@!" contained contains=phpOctalError display
+syn match phpNumber "\%(\.\)\@<!\<0\d\+\|0[oO]\d\+\>\%(\.\)\@!" contained contains=phpOctalError display
syn match phpBinaryError "[2-9]" contained display
syn match phpNumber "\%(\.\)\@<!\<0[bB]\(\d_\?\)*\d\>\%(\.\)\@!" contained contains=phpBinaryError display
@@ -446,7 +682,7 @@ syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFol
" Php Region
if exists("php_parent_error_open")
if exists("php_noShortTags")
- syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop
+ syn region phpRegion matchgroup=Delimiter start="<?\(php\|=\)" end="?>" contains=@phpClTop
else
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop
endif
@@ -456,7 +692,7 @@ if exists("php_parent_error_open")
endif
else
if exists("php_noShortTags")
- syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop keepend
+ syn region phpRegion matchgroup=Delimiter start="<?\(php\|=\)" end="?>" contains=@phpClTop keepend
else
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop keepend
endif
@@ -469,13 +705,13 @@ endif
" Fold
if exists("php_folding") && php_folding==1
" match one line constructs here and skip them at folding
- syn keyword phpSCKeyword abstract final private protected public static contained
+ syn keyword phpSCKeyword abstract final private protected public static readonly contained
syn keyword phpFCKeyword function contained
syn keyword phpDefine fn contained
syn keyword phpStorageClass global contained
syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained
- syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained
+ syn match phpStructure "\(\s\|^\)\(interface\|enum\)\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)finally\(\s\+.*}\)\@=" contained
@@ -484,15 +720,15 @@ if exists("php_folding") && php_folding==1
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend
syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend
- syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
+ syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\|enum\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
else
syn keyword phpDefine function fn contained
- syn keyword phpStructure abstract class trait interface contained
+ syn keyword phpStructure abstract class trait interface enum contained
syn keyword phpException catch throw try finally contained
- syn keyword phpStorageClass final global private protected public static contained
+ syn keyword phpStorageClass final global private protected public static readonly contained
if exists("php_folding") && php_folding==2
setlocal foldmethod=syntax
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
@@ -512,9 +748,9 @@ syntax keyword phpStructure list contained
syntax keyword phpConditional switch contained
syntax keyword phpStatement die contained
-" Highlighting for PHP5's user-definable magic class methods
+" Highlighting for PHP's user-definable magic class methods
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier
- \ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo
+ \ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo __serialize __unserialize
" Highlighting for __autoload slightly different from line above
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ __autoload
@@ -638,7 +874,7 @@ endif
" Sync
if php_sync_method==-1
if exists("php_noShortTags")
- syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$"
+ syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\|=\)\s*$"
else
syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\)\=\s*$"
endif
@@ -658,7 +894,7 @@ endif
syntax match phpDocCustomTags "@[a-zA-Z]*\(\s\+\|\n\|\r\)" containedin=phpComment
syntax region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment
-syntax match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment
+syntax match phpDocTags "@\(abstract\|access\|api\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\(-write\|-read\)\?\|return\|see\|since\|source\|static\|staticvar\|subpackage\|tutorial\|uses\|used-by\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment
syntax match phpDocTodo "@\(todo\|fixme\|xxx\)\(\s\+\)\?" containedin=phpComment
" Define the default highlighting.
@@ -729,7 +965,6 @@ else
hi def link phpIdentifierSimply Identifier
endif
-
let b:current_syntax = "php"
if main_syntax == 'php'
diff --git a/runtime/syntax/sml.vim b/runtime/syntax/sml.vim
index afff5304e6..53ff12a859 100644
--- a/runtime/syntax/sml.vim
+++ b/runtime/syntax/sml.vim
@@ -3,19 +3,18 @@
" Filenames: *.sml *.sig
" Maintainers: Markus Mottl <markus.mottl@gmail.com>
" Fabrizio Zeno Cornelli <zeno@filibusta.crema.unimi.it>
-" Last Change: 2019 Oct 01 - Only spell check strings & comments (Chuan Wei Foo)
+" Last Change: 2021 Oct 04
" 2015 Aug 31 - Fixed opening of modules (Ramana Kumar)
" 2006 Oct 23 - Fixed character highlighting bug (MM)
" quit when a syntax file was already loaded
if exists("b:current_syntax")
+ finish
+endif
" Disable spell checking of syntax.
syn spell notoplevel
- finish
-endif
-
" SML is case sensitive.
syn case match
diff --git a/runtime/syntax/tcl.vim b/runtime/syntax/tcl.vim
index 64efd6fec4..73b2b3fa11 100644
--- a/runtime/syntax/tcl.vim
+++ b/runtime/syntax/tcl.vim
@@ -6,9 +6,9 @@
" (previously Matt Neumann <mattneu@purpleturtle.com>)
" (previously Allan Kelly <allan@fruitloaf.co.uk>)
" Original: Robin Becker <robin@jessikat.demon.co.uk>
-" Last Change: 2014-02-12
+" Last Change: 2021 Oct 03
" Version: 1.14
-" URL: http://bitbucket.org/taylor_venable/metasyntax/src/tip/Config/vim/syntax/tcl.vim
+" URL: (removed, no longer worked)
" quit when a syntax file was already loaded
if exists("b:current_syntax")
diff --git a/runtime/syntax/tcsh.vim b/runtime/syntax/tcsh.vim
index b535d11df8..6837125129 100644
--- a/runtime/syntax/tcsh.vim
+++ b/runtime/syntax/tcsh.vim
@@ -1,7 +1,9 @@
-" tcsh.vim: Vim syntax file for tcsh scripts
-" Maintainer: Gautam Iyer <gi1242@gmail.com>
-" Modified: Thu 17 Dec 2009 06:05:07 PM EST
-"
+" 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
@@ -19,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
@@ -95,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
@@ -115,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
@@ -125,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
@@ -148,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
@@ -170,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\<|\>\>?\&?!?'
@@ -189,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
@@ -206,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
@@ -232,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
diff --git a/runtime/syntax/typescriptcommon.vim b/runtime/syntax/typescriptcommon.vim
index 4074f04a35..ef362fc721 100644
--- a/runtime/syntax/typescriptcommon.vim
+++ b/runtime/syntax/typescriptcommon.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: TypeScript and TypeScriptReact
" Maintainer: Bram Moolenaar, Herrington Darkholme
-" Last Change: 2020 Oct 27
+" Last Change: 2021 Sep 22
" Based On: Herrington Darkholme's yats.vim
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
" Credits: See yats.vim on github
@@ -625,7 +625,8 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
" extension
if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Error EvalError
+ " use of nextgroup Suggested by Doug Kearns
+ syntax keyword typescriptGlobal containedin=typescriptIdentifierName Error EvalError nextgroup=typescriptFuncCallArg
syntax keyword typescriptGlobal containedin=typescriptIdentifierName InternalError
syntax keyword typescriptGlobal containedin=typescriptIdentifierName RangeError ReferenceError
syntax keyword typescriptGlobal containedin=typescriptIdentifierName StopIteration
diff --git a/runtime/syntax/xpm.vim b/runtime/syntax/xpm.vim
index 0667ca28ad..be9f38723e 100644
--- a/runtime/syntax/xpm.vim
+++ b/runtime/syntax/xpm.vim
@@ -1,19 +1,22 @@
" Vim syntax file
" Language: X Pixmap
" Maintainer: Ronald Schild <rs@scutum.de>
-" Last Change: 2017 Feb 01
+" Last Change: 2021 Oct 04
" Version: 5.4n.1
" Jemma Nelson added termguicolors support
+" Dominique Pellé fixed spelling support
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
+syn spell notoplevel
+
syn keyword xpmType char
syn keyword xpmStorageClass static
syn keyword xpmTodo TODO FIXME XXX contained
-syn region xpmComment start="/\*" end="\*/" contains=xpmTodo
+syn region xpmComment start="/\*" end="\*/" contains=xpmTodo,@Spell
syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors
if has("gui_running") || has("termguicolors") && &termguicolors