diff options
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/autoload/health.vim | 1 | ||||
| -rw-r--r-- | runtime/autoload/health/provider.vim | 25 | ||||
| -rw-r--r-- | runtime/doc/api.txt | 1 | ||||
| -rw-r--r-- | runtime/doc/if_lua.txt | 21 | ||||
| -rw-r--r-- | runtime/doc/nvim_terminal_emulator.txt | 34 | ||||
| -rw-r--r-- | runtime/doc/vim_diff.txt | 16 |
6 files changed, 54 insertions, 44 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 8f45adcff1..1d8cae7d19 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -66,6 +66,7 @@ function! health#check(plugin_names) abort " needed for plasticboy/vim-markdown, because it uses fdm=expr normal! zR setlocal nomodified + setlocal bufhidden=hide redraw|echo '' endfunction diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index c5826217c5..6183182b73 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -38,6 +38,16 @@ function! s:system_handler(jobid, data, event) dict abort endif endfunction +" Attempts to construct a shell command from an args list. +" Only for display, to help users debug a failed command. +function! s:shellify(cmd) abort + if type(a:cmd) != type([]) + return a:cmd + endif + return join(map(copy(a:cmd), + \'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ') +endfunction + " Run a system command and timeout after 30 seconds. function! s:system(cmd, ...) abort let stdin = a:0 ? a:1 : '' @@ -54,8 +64,7 @@ function! s:system(cmd, ...) abort let jobid = jobstart(a:cmd, opts) if jobid < 1 - call health#report_error(printf('Command error %d: %s', jobid, - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)) + call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd))) let s:shell_error = 1 return opts.output endif @@ -66,13 +75,11 @@ function! s:system(cmd, ...) abort let res = jobwait([jobid], 30000) if res[0] == -1 - call health#report_error(printf('Command timed out: %s', - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)) + call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd))) call jobstop(jobid) elseif s:shell_error != 0 && !ignore_error - call health#report_error(printf('Command error (%d) %s: %s', jobid, - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd, - \ opts.output)) + call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid, + \ s:shellify(a:cmd), opts.output)) endif return opts.output @@ -157,7 +164,7 @@ function! s:version_info(python) abort \ ])) if empty(python_version) - let python_version = 'unable to parse python response' + let python_version = 'unable to parse '.a:python.' response' endif let nvim_path = s:trim(s:system([ @@ -176,7 +183,7 @@ function! s:version_info(python) abort endfunction " Try to get neovim.VERSION (added in 0.1.11dev). - let nvim_version = s:system(['python', '-c', + let nvim_version = s:system([a:python, '-c', \ 'from neovim import VERSION as v; '. \ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'], \ '', 1, 1) diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 8db35c4590..ebc2a40561 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -48,6 +48,7 @@ version.api_compatible API is backwards-compatible with this level version.api_prerelease Declares the current API level as unstable > (version.api_prerelease && fn.since == version.api_level) functions API function signatures +ui_events UI event signatures |rpc-remote-ui| {fn}.since API level where function {fn} was introduced {fn}.deprecated_since API level where function {fn} was deprecated types Custom handle types defined by Nvim diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 932564170d..470f3bde7a 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -1,21 +1,19 @@ -*if_lua.txt* For Neovim +*if_lua.txt* Nvim VIM REFERENCE MANUAL by Luis Carvalho -The Lua Interface to Vim *lua* *Lua* +Lua Interface to Nvim *lua* *Lua* -1. Commands |lua-commands| -2. The vim module |lua-vim| -3. The luaeval function |lua-luaeval| + Type <M-]> to see the table of contents. ============================================================================== 1. Commands *lua-commands* *:lua* :[range]lua {chunk} - Execute Lua chunk {chunk}. {not in Vi} + Execute Lua chunk {chunk}. Examples: > @@ -25,7 +23,7 @@ Examples: :[range]lua << {endmarker} {script} {endmarker} - Execute Lua script {script}. {not in Vi} + Execute Lua script {script}. Note: This command doesn't work when the Lua feature wasn't compiled in. To avoid errors, see |script-here|. @@ -48,8 +46,8 @@ Example: EOF endfunction -Note that in example variables are prefixed with local: they will disappear -when block finishes. This is not the case for globals. +Note that the variables are prefixed with `local`: they will disappear when +block finishes. This is not the case for globals. To see what version of Lua you have: > :lua print(_VERSION) @@ -66,7 +64,6 @@ If you use LuaJIT you can also use this: > If the value returned by the function is a string it becomes the text of the line in the current turn. The default for [range] is the whole file: "1,$". - {not in Vi} Examples: > @@ -80,7 +77,7 @@ Examples: *:luafile* :[range]luafile {file} - Execute Lua script in {file}. {not in Vi} + Execute Lua script in {file}. The whole argument is used as a single file name. Examples: @@ -107,7 +104,7 @@ position are restricted when the command is executed in the |sandbox|. Lua interfaces Vim through the "vim" module. Currently it only has `api` submodule which is a table with all API functions. Descriptions of these -functions may be found in |api-funcs.txt|. +functions may be found in |api.txt|. ============================================================================== 3. The luaeval function *lua-luaeval* *lua-eval* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index 9f448ae3ba..129a2dfed3 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -43,29 +43,35 @@ restarting the {cmd} when the session is loaded. ============================================================================== Input *terminal-emulator-input* -To send input, enter terminal mode using any command that would enter "insert +To send input, enter terminal-mode using any command that would enter "insert mode" in a normal buffer, such as |i| or |:startinsert|. In this mode all keys except <C-\><C-N> are sent to the underlying program. Use <C-\><C-N> to return -to normal mode. |CTRL-\_CTRL-N| +to normal-mode. |CTRL-\_CTRL-N| -Terminal mode has its own |:tnoremap| namespace for mappings, this can be used -to automate any terminal interaction. To map <Esc> to exit terminal mode: > +Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used +to automate any terminal interaction. + +To map <Esc> to exit terminal-mode: > :tnoremap <Esc> <C-\><C-n> -< -Navigating to other windows is only possible in normal mode. For convenience, -you could use these mappings: > - :tnoremap <A-h> <C-\><C-n><C-w>h - :tnoremap <A-j> <C-\><C-n><C-w>j - :tnoremap <A-k> <C-\><C-n><C-w>k - :tnoremap <A-l> <C-\><C-n><C-w>l + +To simulate |i_CTRL-R| in terminal-mode: > + :tnoremap <expr> <C-R> '<C-\><C-N>"'.nr2char(getchar()).'pi' + +To use `ALT+{h,j,k,l}` to navigate windows from any mode: > + :tnoremap <A-h> <C-\><C-N><C-w>h + :tnoremap <A-j> <C-\><C-N><C-w>j + :tnoremap <A-k> <C-\><C-N><C-w>k + :tnoremap <A-l> <C-\><C-N><C-w>l + :inoremap <A-h> <C-\><C-N><C-w>h + :inoremap <A-j> <C-\><C-N><C-w>j + :inoremap <A-k> <C-\><C-N><C-w>k + :inoremap <A-l> <C-\><C-N><C-w>l :nnoremap <A-h> <C-w>h :nnoremap <A-j> <C-w>j :nnoremap <A-k> <C-w>k :nnoremap <A-l> <C-w>l -< -Then you can use `Alt+{h,j,k,l}` to navigate between windows from any mode. -Mouse input is supported, and has the following behavior: +Mouse input has the following behavior: - If the program has enabled mouse events, the corresponding events will be forwarded to the program. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index ca2ab836b8..7f456bf473 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -241,8 +241,8 @@ Lua interface (|if_lua.txt|): - `:lua error('TEST')` will print “TEST” as the error in Vim and “E5105: Error while calling lua chunk: [string "<VimL compiled string>"]:1: TEST” in Neovim. -- Lua has direct access to Neovim api via `vim.api`. -- Currently most of features are missing. +- Lua has direct access to Nvim |API| via `vim.api`. +- Currently, most legacy Vim features are missing. |input()| and |inputdialog()| gained support for each other’s features (return on cancel and completion respectively) via dictionary argument (replaces all @@ -250,16 +250,14 @@ other arguments if used). ============================================================================== 5. Missing legacy features *nvim-features-missing* - *if_lua* *if_perl* *if_mzscheme* *if_tcl* -These legacy Vim features may be implemented in the future, but they are not -planned for the current milestone. +Some legacy Vim features are not implemented: - |if_py|: vim.bindeval() and vim.Function() are not supported -- |if_lua| -- |if_perl| -- |if_mzscheme| -- |if_tcl| +- |if_lua|: the `vim` object currently only supports `vim.api` +- *if_perl* +- *if_mzscheme* +- *if_tcl* ============================================================================== 6. Removed features *nvim-features-removed* |