From 93ef823f5e5347e685b4a69fff487278d0b4ed87 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 15 Aug 2017 16:32:06 +0300 Subject: lua/executor: Move stricmp to vim “module” and document it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/doc/if_lua.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index c4efd57b45..515864555b 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -246,6 +246,11 @@ 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.txt|. +vim.stricmp(a, b) *lua-vim.stricmp* + Function used for case-insensitive string comparison. Takes two + string arguments and returns 0, 1 or -1 if strings are equal, a is + greater then b or a is lesser then b respectively. + ============================================================================== 3. The luaeval function *lua-luaeval* *lua-eval* *luaeval()* -- cgit From dd1943a3a77793d3c1b8488ca70a09fefed6fb42 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 16 Aug 2017 00:44:52 +0300 Subject: doc: Describe everything what is in `vim` lua “module” MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ci skip] --- runtime/doc/if_lua.txt | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 515864555b..49b4c6dce1 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -243,14 +243,50 @@ position are restricted when the command is executed in the |sandbox|. 2. The vim module *lua-vim* 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.txt|. +submodule and some Neovim-specific utility values which is a table with all +API functions. Descriptions of the API functions may be found in |api.txt|. +Description of other utilities is below: vim.stricmp(a, b) *lua-vim.stricmp* Function used for case-insensitive string comparison. Takes two string arguments and returns 0, 1 or -1 if strings are equal, a is greater then b or a is lesser then b respectively. +vim.type_idx *lua-vim.type_idx* + Type index for use in |lua-special-tables|. Specifying one of the + values from |lua-vim.types| allows typing the empty table (it is + unclear whether empty lua table represents empty list or empty array) + and forcing integral numbers to be |Float|. See |lua-special-tbl| for + more details. + +vim.val_idx *lua-vim.val_idx* + Value index for tables representing |Float|s. A table representing + floating-point value 1.0 looks like this: > + { + [vim.type_idx] = vim.types.float, + [vim.val_idx] = 1.0, + } +< See also |lua-vim.type_idx| and |lua-special-tbl|. + +vim.types *lua-vim.types* + Table with possible values for |lua-vim.type_idx|. Contains two sets + of key-value pairs: first maps possible values for |lua-vim.type_idx| + to human-readable strings, second maps human-readable type names to + values for |lua-vim.type_idx|. Currently contains pairs for `float`, + `array` and `dictionary` types. + + Note: one must expect that values corresponding to `vim.types.float`, + `vim.types.array` and `vim.types.dictionary` fall under only two + following assumptions: + 1. Value may serve both as a key and as a value in a table. Given the + properties of lua tables this basically means “value is not `nil`”. + 2. For each value in `vim.types` table `vim.types[vim.types[value]]` + is the same as `value`. + No other restrictions are put on types, and it is not guaranteed that + values corresponding to `vim.types.float`, `vim.types.array` and + `vim.types.dictionary` will not change or that `vim.types` table will + only contain values for these three types. + ============================================================================== 3. The luaeval function *lua-luaeval* *lua-eval* *luaeval()* @@ -283,6 +319,7 @@ between these cases there is the following agreement: 3. Table with string keys, at least one of which contains NUL byte, is also considered to be a dictionary, but this time it is converted to a |msgpack-special-map|. + *lua-special-tbl* 4. Table with `vim.type_idx` key may be a dictionary, a list or floating-point value: - `{[vim.type_idx]=vim.types.float, [vim.val_idx]=1}` is converted to -- cgit From 56eda2aa17c80ba380b606f9466f288fb8162dd3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 16 Oct 2017 08:18:03 +0200 Subject: syntax: 'cursorline': revert priority change (#7400) ref #7383 reverts d1874ab2821d076397290cc154d87ec2dc352c79 ref #6380 --- runtime/doc/vim_diff.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 861fa65c3a..5df3852d8e 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -281,8 +281,8 @@ other arguments if used). |input()| and |inputdialog()| support user-defined cmdline highlighting. Highlight groups: - |hl-ColorColumn|, |hl-CursorColumn|, |hl-CursorLine| are lower priority than - (overridden by) most other highlight groups. + |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other + groups ============================================================================== 5. Missing legacy features *nvim-features-missing* -- cgit From d214df4e9b23b5f2d9f7e6c78624881a7d298cdb Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 15 Oct 2017 20:31:12 +0200 Subject: doc: replace ":CheckHealth" with ":checkhealth" --- runtime/autoload/health.vim | 2 +- runtime/autoload/provider/ruby.vim | 2 +- runtime/doc/pi_health.txt | 92 ++++++++++++++++---------------------- runtime/doc/provider.txt | 4 +- runtime/doc/vim_diff.txt | 2 +- 5 files changed, 43 insertions(+), 59 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index d0ad7729ab..028b6cca8e 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -18,7 +18,7 @@ function! s:enhance_syntax() abort syntax match healthBar "|" contained conceal highlight link healthHelp Identifier - " We do not care about markdown syntax errors in :CheckHealth output. + " We do not care about markdown syntax errors in :checkhealth output. highlight! link markdownError Normal endfunction diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim index 91b7fb9f2c..7df3500267 100644 --- a/runtime/autoload/provider/ruby.vim +++ b/runtime/autoload/provider/ruby.vim @@ -75,7 +75,7 @@ let s:prog = provider#ruby#Detect() let s:plugin_path = expand(':p:h') . '/script_host.rb' if empty(s:prog) - let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth' + let s:err = 'Cannot find the neovim RubyGem. Try :checkhealth' endif call remote#host#RegisterClone('legacy-ruby-provider', 'ruby') diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index f77267288c..3fd649f1f8 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -5,50 +5,36 @@ Author: TJ DeVries Type to see the table of contents. ============================================================================== -Introduction *healthcheck* *health.vim-intro* +Introduction *health* -Troubleshooting user configuration problems is a time-consuming task that -developers want to minimize. health.vim provides a simple framework for plugin -authors to hook into, and for users to invoke, to check and report the user's -configuration and environment. Type this command to try it: > +health.vim is a minimal framework to help with troubleshooting user +configuration. Nvim ships with healthchecks for configuration, performance, +python support, ruby support, clipboard support, and more. - :CheckHealth -< -For example, some users have broken or unusual Python setups, which breaks the -|:python| command. |:CheckHealth| detects several common Python configuration -problems and reports them. If the Neovim Python module is not installed, it -shows a warning: > +To run the healthchecks, use this command: > - You have not installed the Neovim Python module - You might want to try `pip install Neovim` -< -Plugin authors are encouraged to add healthchecks, see |health.vim-dev|. + :checkhealth +< +Plugin authors are encouraged to write new healthchecks. |health-dev| ============================================================================== -Commands and functions *health.vim-manual* - -Commands ------------------------------------------------------------------------------- - *:CheckHealth* -:CheckHealth Run all healthchecks and show the output in a new - tabpage. These healthchecks are included by default: - - python2 - - python3 - - ruby - - remote plugin - -:CheckHealth {plugins} - Run healthchecks for one or more plugins. E.g. to run +Commands *health-commands* + + *:checkhealth* *:CheckHealth* +:checkhealth Run all healthchecks. + +:checkhealth {plugins} + Run healthcheck(s) for one or more plugins. E.g. to run only the standard Nvim healthcheck: > - :CheckHealth nvim + :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): > - :CheckHealth foo bar + :checkhealth foo bar < -Functions ------------------------------------------------------------------------------- +============================================================================== +Functions *health-functions* health.vim functions are for creating new healthchecks. They mostly just do some layout and formatting, to give users a consistent presentation. @@ -59,51 +45,49 @@ health#report_start({name}) *health#report_start* per section. health#report_info({msg}) *health#report_info* - Displays an informational message. + Reports an informational message. health#report_ok({msg}) *health#report_ok* - Displays a "success" message. + Reports a "success" message. health#report_warn({msg}, [{advice}]) *health#report_warn* - Displays a warning. {advice} is an optional List of suggestions. + Reports a warning. {advice} is an optional List of suggestions. health#report_error({msg}, [{advice}]) *health#report_error* - Displays an error. {advice} is an optional List of suggestions. + Reports an error. {advice} is an optional List of suggestions. health#{plugin}#check() *health.user_checker* - This is the form of a healthcheck definition. Call the above functions - from this function, then |:CheckHealth| does the rest. Example: > + 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 < - The function will be found and called automatically when the user - invokes |:CheckHealth|. - 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.vim-dev* +Create a healthcheck *health-dev* -Healthchecks are functions that check the health of the system. Neovim has -built-in checkers, found in $VIMRUNTIME/autoload/health/. +Healthchecks are functions that check the user environment, configuration, +etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/. -To add a new checker for your own plugin, simply define a +To add a new healthcheck for your own plugin, simply define a health#{plugin}#check() function in autoload/health/{plugin}.vim. -|:CheckHealth| automatically finds and invokes such functions. +|:checkhealth| automatically finds and invokes such functions. -If your plugin is named "jslint", then its healthcheck function must be > - health#jslint#check() +If your plugin is named "foo", then its healthcheck function must be > + health#foo#check() defined in this file on 'runtimepath': > - autoload/health/jslint.vim + autoload/health/foo.vim -Here's a sample to get started: > - function! health#jslint#check() abort +Copy this sample code into autoload/health/foo.vim and replace "foo" with your +plugin name: > + function! health#foo#check() abort call health#report_start('sanity checks') " perform arbitrary checks " ... @@ -111,8 +95,8 @@ Here's a sample to get started: > if looks_good call health#report_ok('found required dependencies') else - call health#report_error('cannot find jslint', - \ ['npm install --save jslint']) + call health#report_error('cannot find foo', + \ ['npm install --save foo']) endif endfunction diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 50307ccbf3..60d0414edd 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -20,7 +20,7 @@ Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not. PYTHON QUICKSTART ~ If you used a package manager to install Nvim, you might already have the -required `neovim` Python package. Run |:CheckHealth| to see if your system is +required `neovim` Python package. Run |:checkhealth| to see if your system is up-to-date. Following are steps to install the package with Python's `pip` tool. @@ -88,7 +88,7 @@ Ruby integration *provider-ruby* Nvim supports the Vim legacy |ruby-vim| interface via external Ruby interpreters connected via |RPC|. -Run |:CheckHealth| to see if your system is up-to-date. +Run |:checkhealth| to see if your system is up-to-date. RUBY QUICKSTART ~ diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 5df3852d8e..16a63a2df4 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -127,7 +127,7 @@ Variables: |v:windowid| is always available (for use by external UIs) Commands: - |:CheckHealth| + |:checkhealth| |:drop| is available on all platforms |:Man| is available by default, with many improvements such as completion -- cgit From d5d7a9928da8d670e94a9e5e08d6814759b702b6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 15 Oct 2017 23:23:17 +0200 Subject: doc: E5009 "Invalid $VIMRUNTIME" --- runtime/doc/pi_health.txt | 6 +++++ runtime/doc/starting.txt | 68 +++++++++++++++++++---------------------------- 2 files changed, 33 insertions(+), 41 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index 3fd649f1f8..aee3a0f6e6 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -22,6 +22,12 @@ Commands *health-commands* *:checkhealth* *:CheckHealth* :checkhealth Run all healthchecks. + *E5009* + Nvim depends on the |$VIMRUNTIME| environment variable + to find the standard "runtime files" for syntax + highlighting, filetype-specific behavior, and standard + plugins such as :checkhealth. If $VIMRUNTIME is invalid + then those features will not work. :checkhealth {plugins} Run healthcheck(s) for one or more plugins. E.g. to run diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 4cfc98d5b6..aa55c80d4d 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -633,54 +633,40 @@ though. ============================================================================== 3. $VIM and $VIMRUNTIME *$VIM* -The environment variable "$VIM" is used to locate various user files for Vim, +The environment variable "$VIM" is used to locate various user files for Nvim, such as the user startup script |init.vim|. This depends on the system, see |startup|. -To avoid the need for every user to set the $VIM environment variable, Vim -will try to get the value for $VIM in this order: -1. The value defined by the $VIM environment variable. You can use this to - make Vim look in a specific directory for its support files. Example: > - setenv VIM /home/paul/vim -2. The path from 'helpfile' is used, unless it contains some environment - variable too (the default is "$VIMRUNTIME/doc/help.txt": chicken-egg - problem). The file name ("help.txt" or any other) is removed. Then - trailing directory names are removed, in this order: "doc", "runtime" and - "vim{version}" (e.g., "vim54"). -3. For MSDOS and Win32 Vim tries to use the directory name of the - executable. If it ends in "/src", this is removed. This is useful if you - unpacked the .zip file in some directory, and adjusted the search path to - find the vim executable. Trailing directory names are removed, in this - order: "runtime" and "vim{version}" (e.g., "vim54"). -4. For Unix the compile-time defined installation directory is used (see the - output of ":version"). - -Once Vim has done this once, it will set the $VIM environment variable. To -change it later, use a ":let" command like this: > - :let $VIM = "/home/paul/vim/" -< +Nvim will try to get the value for $VIM in this order: + +1. Environment variable $VIM, if it is set. +2. Path derived from the 'helpfile' option, unless it contains some + environment variable too (default is "$VIMRUNTIME/doc/help.txt"). File + name ("help.txt", etc.) is removed. Trailing directory names are removed, + in this order: "doc", "runtime". +3. Path derived from the location of the `nvim` executable. +4. Compile-time defined installation directory (see output of ":version"). + +After doing this once, Nvim sets the $VIM environment variable. + *$VIMRUNTIME* The environment variable "$VIMRUNTIME" is used to locate various support -files, such as the on-line documentation and files used for syntax -highlighting. For example, the main help file is normally -"$VIMRUNTIME/doc/help.txt". -You don't normally set $VIMRUNTIME yourself, but let Vim figure it out. This -is the order used to find the value of $VIMRUNTIME: -1. If the environment variable $VIMRUNTIME is set, it is used. You can use - this when the runtime files are in an unusual location. -2. If "$VIM/vim{version}" exists, it is used. {version} is the version - number of Vim, without any '-' or '.'. For example: "$VIM/vim54". This is - the normal value for $VIMRUNTIME. -3. If "$VIM/runtime" exists, it is used. -4. The value of $VIM is used. This is for backwards compatibility with older - versions. +files, such as the documentation and syntax-highlighting files. For example, +the main help file is normally "$VIMRUNTIME/doc/help.txt". + +Nvim will try to get the value for $VIMRUNTIME in this order: + +1. Environment variable $VIMRUNTIME, if it is set. +2. Directory path "$VIM/vim{version}", if it exists, where {version} is the + Vim version number without '-' or '.'. For example: "$VIM/vim54". +3. Directory path "$VIM/runtime", if it exists. +4. Value of $VIM environment variable. This is for backwards compatibility + with older Vim versions. 5. If "../share/nvim/runtime" exists relative to |v:progpath|, it is used. -6. When the 'helpfile' option is set and doesn't contain a '$', its value is - used, with "doc/help.txt" removed from the end. +6. Path derived from the 'helpfile' option (if it doesn't contain '$') with + "doc/help.txt" removed from the end. -Once Vim has done this once, it will set the $VIMRUNTIME environment variable. -To change it later, use a ":let" command like this: > - :let $VIMRUNTIME = "/home/piet/vim/vim54" +After doing this once, Nvim sets the $VIMRUNTIME environment variable. In case you need the value of $VIMRUNTIME in a shell (e.g., for a script that greps in the help files) you might be able to use this: > -- cgit From 014bd59957beb3f94cfb014a7acde3d2544bdfd9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 16 Oct 2017 00:05:35 +0200 Subject: ex_checkhealth: call health#check() directly This allows us to remove :CheckHealth later (avoids wildmenu noise). --- runtime/autoload/health.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 028b6cca8e..b076f2456b 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -159,7 +159,10 @@ endfunction " Translates a list of plugin names to healthcheck function names. function! s:to_fn_names(plugin_names) abort let healthchecks = [] - for p in a:plugin_names + 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') endfor return healthchecks -- cgit From 3bcee71cc8ef782fc89de7d72cb784cfb6d984d3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 17 Oct 2017 00:10:52 +0200 Subject: :checkhealth : validate $VIM --- runtime/autoload/health/nvim.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime') diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim index 6c6a5e8543..7f6e943dc9 100644 --- a/runtime/autoload/health/nvim.vim +++ b/runtime/autoload/health/nvim.vim @@ -4,12 +4,19 @@ function! s:check_config() abort let ok = v:true call health#report_start('Configuration') + " If $VIM is empty we don't care. Else make sure it is valid. + if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt') + let ok = v:false + call health#report_error("$VIM is invalid: ".$VIM) + endif + if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE') let ok = v:false call health#report_warn("$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+", \ [ "Use the 'guicursor' option to configure cursor shape. :help 'guicursor'", \ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ]) endif + if &paste let ok = v:false call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.", -- cgit From 70b574dab36a99e676b1845bdfe0fef4bfa63584 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 17 Oct 2017 12:55:12 -0400 Subject: vim-patch:8.0.0118 Runtime updates that were bundled into the otherwise NA commit: Problem: "make proto" adds extra function prototype. Solution: Add vim/vim#ifdef. https://github.com/vim/vim/commit/5162822914372fc916a93f85848c0c82209e7cec --- runtime/doc/change.txt | 1 + runtime/doc/editing.txt | 5 +++-- runtime/doc/motion.txt | 1 + runtime/doc/options.txt | 6 +++++- runtime/doc/windows.txt | 2 ++ runtime/syntax/c.vim | 18 +++++++++--------- 6 files changed, 21 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index f82d61370c..5384bbfc6f 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -648,6 +648,7 @@ g& Synonym for `:%s//~/&` (repeat last substitute with *:s_flags* The flags that you can use for the substitute commands: + *:&&* [&] Must be the first one: Keep the flags from the previous substitute command. Examples: > :&& diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 8974a5c64e..29ccd48b7b 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -901,11 +901,12 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write* *:wa* *:wall* :wa[ll] Write all changed buffers. Buffers without a file - name or which are readonly are not written. + name cause an error message. Buffers which are + readonly are not written. :wa[ll]! Write all changed buffers, even the ones that are readonly. Buffers without a file name are not - written. + written and cause an error message. Vim will warn you if you try to overwrite a file that has been changed diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 99aa76bfe5..fd156702f5 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -886,6 +886,7 @@ was made yet in the current file. then the position can be near the end of what the command changed. For example when inserting a word, the position will be on the last character. + To jump to older changes use |g;|. *'(* *`(* '( `( To the start of the current sentence, like the |(| diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d55eb7405c..f421d4022c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -187,7 +187,7 @@ opt+=val" the expansion is done before the adding or removing. Handling of local options *local-options* Some of the options only apply to a window or buffer. Each window or buffer -has its own copy of this option, thus can each have their own value. This +has its own copy of this option, thus each can have its own value. This allows you to set 'list' in one window but not in another. And set 'shiftwidth' to 3 in one buffer and 4 in another. @@ -3017,6 +3017,8 @@ A jump table for the options with a short description can be found at |Q_op|. The format of this option is like that of 'statusline'. 'guitabtooltip' is used for the tooltip, see below. + The expression will be evaluated in the |sandbox| when set from a + modeline, see |sandbox-option|. Only used when the GUI tab pages line is displayed. 'e' must be present in 'guioptions'. For the non-GUI tab pages line 'tabline' is @@ -4482,6 +4484,8 @@ A jump table for the options with a short description can be found at |Q_op|. and |+postscript| features} Expression used to print the PostScript produced with |:hardcopy|. See |pexpr-option|. + This option cannot be set from a |modeline| or in the |sandbox|, for + security reasons. *'printfont'* *'pfn'* 'printfont' 'pfn' string (default "courier") diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index f5d5321a5e..ceb7a7f003 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -677,6 +677,8 @@ can also get to them with the buffer list commands, like ":bnext". - If the file is not open in a window edit the file in the current window. If the current buffer can't be |abandon|ed, the window is split first. + - Windows that are not in the argument list or are not full + width will be closed if possible. The |argument-list| is set, like with the |:next| command. The purpose of this command is that it can be used from a program that wants Vim to edit another file, e.g., a debugger. diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index cc99f674a1..16c7ce4d92 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: C " Maintainer: Bram Moolenaar -" Last Change: 2016 Nov 17 +" Last Change: 2016 Nov 18 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -363,23 +363,23 @@ syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>" if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold - syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse + syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold else syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold - syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit + syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") - syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold else - syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell - syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip - syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip + syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc endif syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded display contained "<[^>]*>" -- cgit From 70683705603e8e0e225574f01bc8b6824d5320eb Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 21 Oct 2017 02:33:58 +0200 Subject: help, man.vim: change "outline" map to gO (#7405) --- runtime/doc/api.txt | 2 +- runtime/doc/autocmd.txt | 2 +- runtime/doc/change.txt | 2 +- runtime/doc/cmdline.txt | 2 +- runtime/doc/debug.txt | 2 +- runtime/doc/develop.txt | 2 +- runtime/doc/diff.txt | 2 +- runtime/doc/digraph.txt | 2 +- runtime/doc/editing.txt | 2 +- runtime/doc/eval.txt | 2 +- runtime/doc/filetype.txt | 4 ++-- runtime/doc/fold.txt | 2 +- runtime/doc/gui.txt | 2 +- runtime/doc/helphelp.txt | 4 ++-- runtime/doc/if_cscop.txt | 2 +- runtime/doc/if_lua.txt | 2 +- runtime/doc/if_pyth.txt | 2 +- runtime/doc/if_ruby.txt | 2 +- runtime/doc/indent.txt | 2 +- runtime/doc/index.txt | 2 +- runtime/doc/insert.txt | 2 +- runtime/doc/intro.txt | 2 +- runtime/doc/job_control.txt | 2 +- runtime/doc/map.txt | 2 +- runtime/doc/mbyte.txt | 2 +- runtime/doc/message.txt | 2 +- runtime/doc/mlang.txt | 2 +- runtime/doc/motion.txt | 2 +- runtime/doc/msgpack_rpc.txt | 2 +- runtime/doc/nvim.txt | 2 +- runtime/doc/nvim_terminal_emulator.txt | 2 +- runtime/doc/options.txt | 2 +- runtime/doc/pattern.txt | 2 +- runtime/doc/pi_health.txt | 2 +- runtime/doc/print.txt | 2 +- runtime/doc/provider.txt | 2 +- runtime/doc/quickfix.txt | 2 +- runtime/doc/recover.txt | 2 +- runtime/doc/remote.txt | 2 +- runtime/doc/remote_plugin.txt | 2 +- runtime/doc/repeat.txt | 2 +- runtime/doc/russian.txt | 2 +- runtime/doc/scroll.txt | 2 +- runtime/doc/sign.txt | 2 +- runtime/doc/spell.txt | 2 +- runtime/doc/starting.txt | 2 +- runtime/doc/syntax.txt | 2 +- runtime/doc/tabpage.txt | 2 +- runtime/doc/tagsrch.txt | 2 +- runtime/doc/term.txt | 2 +- runtime/doc/tips.txt | 2 +- runtime/doc/undo.txt | 2 +- runtime/doc/various.txt | 11 +++++++++-- runtime/doc/vi_diff.txt | 2 +- runtime/doc/vim_diff.txt | 4 ++-- runtime/doc/visual.txt | 2 +- runtime/doc/windows.txt | 2 +- runtime/ftplugin/help.vim | 2 +- runtime/ftplugin/man.vim | 2 +- 59 files changed, 70 insertions(+), 63 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index e12cd1cfa9..8aead087db 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -11,7 +11,7 @@ via |msgpack-rpc|, Lua and VimL (|eval-api|). Applications can also embed libnvim to work with the C API directly. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== API Types *api-types* diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index fd2a7c2641..2850c8058f 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -8,7 +8,7 @@ Automatic commands *autocommand* For a basic explanation, see section |40.3| in the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *autocmd-intro* diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 5384bbfc6f..9610d7359f 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -11,7 +11,7 @@ commands with the "." command. For inserting text see |insert.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Deleting text *deleting* *E470* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 652487d8ab..4222a5b6f7 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -13,7 +13,7 @@ Command-line mode is used to enter Ex commands (":"), search patterns Basic command line editing is explained in chapter 20 of the user manual |usr_20.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Command-line editing *cmdline-editing* diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index fd2c4fa54e..422255fa02 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -9,7 +9,7 @@ Debugging Vim *debug-vim* This is for debugging Vim itself, when it doesn't work properly. For debugging Vim scripts, functions, etc. see |debug-scripts| - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 5d5523e73f..298f64bbee 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -11,7 +11,7 @@ Nvim is open source software. Everybody is encouraged to contribute. See src/nvim/README.md for an overview of the source code. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Design goals *design-goals* diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 74a3d183a3..8cb049584a 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -10,7 +10,7 @@ eight versions of the same file. The basics are explained in section |08.7| of the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Starting diff mode diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 43f8ccab06..d3b03c6ef6 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -14,7 +14,7 @@ with CTRL-V (see |i_CTRL-V|). There is a brief introduction on digraphs in the user manual: |24.9| An alternative is using the 'keymap' option. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Defining digraphs *digraphs-define* diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 29ccd48b7b..a747058991 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -6,7 +6,7 @@ Editing files *edit-files* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *edit-intro* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b37b0e8836..300bdd061e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -12,7 +12,7 @@ Note: Expression evaluation can be disabled at compile time. If this has been done, the features in this document are not available. See |+eval| and |no-eval-feature|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Variables *variables* diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 64d9c6daa9..7f1e98fed4 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -8,7 +8,7 @@ Filetypes *filetype* *file-type* Also see |autocmd.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Filetypes *filetypes* *file-types* @@ -540,7 +540,7 @@ K or CTRL-] Jump to the manpage for the under the cursor. Takes a count for the section. CTRL-T Jump back to the location that the manpage was opened from. -META-] Show the manpage outline in the |location-list|. +gO Show the manpage outline. |gO| q :quit if invoked as $MANPAGER, otherwise :close. Variables: diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 88dde9f61d..42efb04d7a 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -9,7 +9,7 @@ Folding *Folding* *folding* *folds* You can find an introduction on folding in chapter 28 of the user manual. |usr_28.txt| - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Fold methods *fold-methods* diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index b66a60c860..fb05f178ad 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -6,7 +6,7 @@ Vim's Graphical User Interface *gui* *GUI* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Starting the GUI *gui-start* *E229* *E233* diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 5948b24667..d86a95e854 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -6,7 +6,7 @@ Help on help files *helphelp* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Help commands *online-help* @@ -23,7 +23,7 @@ Help on help files *helphelp* The 'helplang' option is used to select a language, if the main help file is available in several languages. - Type to see the table of contents. + Type |gO| to see the table of contents. *{subject}* *E149* *E661* :h[elp] {subject} Like ":help", additionally jump to the tag {subject}. diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt index 831b2c9840..e359f2144c 100644 --- a/runtime/doc/if_cscop.txt +++ b/runtime/doc/if_cscop.txt @@ -12,7 +12,7 @@ a cscope query is just like jumping to any tag; it is saved on the tag stack so that with the right keyboard mappings, you can jump back and forth between functions as you normally would with |tags|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Cscope introduction *cscope-intro* diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index c4efd57b45..d1b8cd4856 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -6,7 +6,7 @@ Lua Interface to Nvim *lua* *Lua* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Importing modules *lua-require* diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 8baa2d309b..8940e69092 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -8,7 +8,7 @@ The Python Interface to Vim *python* *Python* See |provider-python| for more information. {Nvim} - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Commands *python-commands* diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index 54d81a958d..a657d88a44 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -10,7 +10,7 @@ The Ruby Interface to Vim *ruby* *Ruby* The home page for ruby is http://www.ruby-lang.org/. You can find links for downloading Ruby there. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Commands *ruby-commands* diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 8e17de3fb0..cf45ec4f38 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -6,7 +6,7 @@ This file is about indenting C programs and other files. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Indenting C style programs *C-indenting* diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index c15587cffd..ad93dcb000 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -15,7 +15,7 @@ For an overview of built-in functions see |functions|. For a list of Vim variables see |vim-variable|. For a complete listing of all help items see |help-tags|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Insert mode *insert-index* diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 9219f45c83..9ef58fa54c 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -16,7 +16,7 @@ user manual |usr_24.txt|. Also see 'virtualedit', for moving the cursor to positions where there is no character. Useful for editing a table. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Special keys *ins-special-keys* diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index b9cc94ce5f..90b0ff7da3 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -6,7 +6,7 @@ Introduction to Vim *ref* *reference* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *intro* diff --git a/runtime/doc/job_control.txt b/runtime/doc/job_control.txt index edbc1bca81..2cf48f0f4f 100644 --- a/runtime/doc/job_control.txt +++ b/runtime/doc/job_control.txt @@ -6,7 +6,7 @@ Nvim's facilities for job control *job-control* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *job-control-intro* diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 944f7474be..e78b4cc942 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -9,7 +9,7 @@ Key mapping, abbreviations and user-defined commands. This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Key mapping *key-mapping* *mapping* *macro* diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 2e2ca92656..531629fddc 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -14,7 +14,7 @@ For an introduction to the most common features, see |usr_45.txt| in the user manual. For changing the language of messages and menus see |mlang.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Getting started *mbyte-first* diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index 58ababf229..904b9dfce4 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -8,7 +8,7 @@ This file contains an alphabetical list of messages and error messages that Vim produces. You can use this if you don't understand what the message means. It is not complete though. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Old messages *:messages* *:mes* *message-history* diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt index 717ec9530c..6453a96877 100644 --- a/runtime/doc/mlang.txt +++ b/runtime/doc/mlang.txt @@ -11,7 +11,7 @@ multi-byte text see |multibyte|. The basics are explained in the user manual: |usr_45.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Messages *multilang-messages* diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index fd156702f5..81137b6069 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -26,7 +26,7 @@ The 'virtualedit' option can be set to make it possible to move the cursor to positions where there is no character or within a multi-column character (like a tab). - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Motions and operators *operator* diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 856476c6ae..98a74ccfd6 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -6,7 +6,7 @@ RPC API for Nvim *RPC* *rpc* *msgpack-rpc* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *rpc-intro* diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt index f3f4305ad5..2420227f6c 100644 --- a/runtime/doc/nvim.txt +++ b/runtime/doc/nvim.txt @@ -15,7 +15,7 @@ Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is maintained where possible. See |vim_diff.txt| for the complete reference of differences from Vim. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Transitioning from Vim *nvim-from-vim* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index 4527a14710..9dae69ae26 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -18,7 +18,7 @@ Terminal buffers behave like normal buffers, except: closing the terminal buffer. - 'bufhidden' defaults to "hide". - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Start *terminal-start* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index f421d4022c..4df08ca5fb 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -14,7 +14,7 @@ achieve special effects. These options come in three forms: number has a numeric value string has a string value - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Setting options *set-option* *E764* diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index f7f561dfa5..8243a3ca7d 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -9,7 +9,7 @@ Patterns and search commands *pattern-searches* The very basics can be found in section |03.9| of the user manual. A few more explanations are in chapter 27 |usr_27.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Search commands *search-commands* diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index aee3a0f6e6..99ff519bb9 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -2,7 +2,7 @@ Author: TJ DeVries - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Introduction *health* diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index 01de3a5290..72625a450a 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -6,7 +6,7 @@ Printing *printing* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *print-intro* diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 60d0414edd..02f3fcab6c 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -8,7 +8,7 @@ Providers *provider* Nvim delegates some features to dynamic "providers". - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Python integration *provider-python* diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index cad5bf98b5..46ddaefbf4 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -6,7 +6,7 @@ This subject is introduced in section |30.1| of the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================= 1. Using QuickFix commands *quickfix* *Quickfix* *E42* diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 2b49af1c96..0533157072 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -15,7 +15,7 @@ You can recover most of your changes from the files that Vim uses to store the contents of the file. Mostly you can recover your work with one command: vim -r filename - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. The swap file *swap-file* diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index bdc763b85f..67bfb0b48e 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -6,7 +6,7 @@ Vim client-server communication *client-server* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Common functionality *clientserver* diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index cc2efd3d1f..eeb9cf8150 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -6,7 +6,7 @@ Nvim support for remote plugins *remote-plugin* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *remote-plugin-intro* diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 0b3edc9bba..421ebab100 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -8,7 +8,7 @@ Repeating commands, Vim scripts and debugging *repeating* Chapter 26 of the user manual introduces repeating |usr_26.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Single repeats *single-repeat* diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt index e2c44ce54f..8c6076146c 100644 --- a/runtime/doc/russian.txt +++ b/runtime/doc/russian.txt @@ -6,7 +6,7 @@ Russian language localization and support in Vim *russian* *Russian* - Type to see the table of contents. + Type |gO| to see the table of contents. =============================================================================== 1. Introduction *russian-intro* diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 52e5cc9f0c..56af9ab75e 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -16,7 +16,7 @@ upwards in the buffer, the text in the window moves downwards on your screen. See section |03.7| of the user manual for an introduction. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Scrolling downwards *scroll-down* diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index ced0608e8a..977d73b7b2 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -7,7 +7,7 @@ Sign Support Features *sign-support* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *sign-intro* *signs* diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 5c99db42ba..f2be25097c 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -6,7 +6,7 @@ Spell checking *spell* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Quick start *spell-quickstart* *E756* diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index aa55c80d4d..7aba84b454 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -6,7 +6,7 @@ Starting Vim *starting* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Vim arguments *vim-arguments* diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 73841edb09..cbaa2916e6 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -20,7 +20,7 @@ In the User Manual: |usr_06.txt| introduces syntax highlighting. |usr_44.txt| introduces writing a syntax file. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Quick start *:syn-qstart* diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 8f1eb9d8cd..6be7cf9746 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -10,7 +10,7 @@ The commands which have been added to use multiple tab pages are explained here. Additionally, there are explanations for commands that work differently when used in combination with more than one tab page. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *tab-page-intro* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index d5a4f4e627..1ceb602512 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -8,7 +8,7 @@ Tags and special searches *tags-and-searches* See section |29.1| of the user manual for an introduction. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Jump to a tag *tag-commands* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 39eb0673c4..a694185fc9 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -10,7 +10,7 @@ Nvim (except in |--headless| mode) uses information about the terminal you are using to present a built-in UI. If that information is not correct, the screen may be messed up or keys may not be recognized. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Startup *startup-terminal* diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 0ac9a8303d..011e0f0565 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -13,7 +13,7 @@ http://www.vim.org Don't forget to browse the user manual, it also contains lots of useful tips |usr_toc.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Editing C programs *C-editing* diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index cbce868cec..f8f6049119 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -8,7 +8,7 @@ Undo and redo *undo-redo* The basics are explained in section |02.5| of the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Undo and redo commands *undo-commands* diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 223a0135b2..9150f3a809 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -6,7 +6,7 @@ Various commands *various* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Various commands *various-cmds* @@ -608,6 +608,13 @@ which it was defined is reported. the keyword. Only works when the highlighted text is not more than one line. + *gO* +gO Show a filetype-specific, navigable "outline" of the + current buffer. For example, in a |help| buffer this + shows the table of contents. + + Currently works in |help| and |:Man| buffers. + [N]gs *gs* *:sl* *:sleep* :[N]sl[eep] [N] [m] Do nothing for [N] seconds. When [m] is included, sleep for [N] milliseconds. The count for "gs" always @@ -646,4 +653,4 @@ LessInitFunc in your vimrc, for example: > endfunc < - vim:tw=78:ts=8:ft=help:norl: + vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index b8bfcaa586..917e0e6f80 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -6,7 +6,7 @@ Differences between Vim and Vi *vi-differences* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Limits *limits* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 16a63a2df4..c92fcd8994 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -9,7 +9,7 @@ Differences between Nvim and Vim *vim-differences* Nvim differs from Vim in many ways, big and small. This document is a complete and centralized reference of those differences. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Configuration *nvim-configuration* @@ -100,7 +100,7 @@ by Nvim developers. FEATURES ~ -"Outline": Type in |:Man| and |:help| pages to see a document outline. +"Outline": Type |gO| in |:Man| and |:help| pages to see a document outline. |META| (ALT) chords are recognized, even in the terminal. Any |, , , , , , diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index cf804444e5..6c4d44edb6 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -11,7 +11,7 @@ operator. It is the only way to select a block of text. This is introduced in section |04.4| of the user manual. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Using Visual mode *visual-use* diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index ceb7a7f003..c37362a497 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -13,7 +13,7 @@ differently when used in combination with more than one window. The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt| |usr_08.txt|. - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *windows-intro* *window* diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index 9d2361b413..e6d48454d9 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -90,7 +90,7 @@ if !exists('g:no_plugin_maps') let w:qf_toc = bufname endfunction - nnoremap :call show_toc() + nnoremap gO :call show_toc() endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 27c8b88e44..e36dfc5a90 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -31,7 +31,7 @@ setlocal nolist setlocal nofoldenable if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') - nnoremap :call man#show_toc() + nnoremap gO :call man#show_toc() nnoremap :Man nnoremap K :Man nnoremap :call man#pop_tag() -- cgit From 9db42d4ce99c5b5747e9d83045b37e93d55c4249 Mon Sep 17 00:00:00 2001 From: Josh Leeb-du Toit Date: Fri, 29 Sep 2017 01:12:56 +1000 Subject: :cquit : take an error code argument #7336 closes #2699 ex_cmds.lua: use flags consistent with similar commands such as `cnext`. upstream discussion: "[patch] :qcuit can take exit code" https://groups.google.com/d/msg/vim_dev/_PjyNbUKyRc/oPgr5_ZXc6AJ --- runtime/doc/quickfix.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 46ddaefbf4..a647318347 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -138,11 +138,15 @@ processing a quickfix or location list command, it will be aborted. current window is used instead of the quickfix list. *:cq* *:cquit* -:cq[uit][!] Quit Vim with an error code, so that the compiler - will not compile the same file again. - WARNING: All changes in files are lost! Also when the - [!] is not used. It works like ":qall!" |:qall|, - except that Vim returns a non-zero exit code. +:[count]cq[uit] Quit Nvim with an error code, or the code specified in + [count]. Useful when Nvim is called from another + program: e.g. `git commit` will abort the comitting + process, `fc` (built-in for shells like bash and zsh) + will not execute the command. + + WARNING: All changes in files are lost. It works like + ":qall!" |:qall|, except that Nvim exits non-zero or + [count]. *:cf* *:cfile* :cf[ile][!] [errorfile] Read the error file and jump to the first error. @@ -1534,4 +1538,4 @@ by Vim. - vim:tw=78:ts=8:ft=help:norl: + vim:noet:tw=78:ts=8:ft=help:norl: -- cgit From 439c39a2cfb0712eb68ad76354b1fd7e92bb71fe Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Thu, 23 Feb 2017 05:33:14 +0000 Subject: ext_cmdline: allow external ui to draw cmdline --- runtime/doc/msgpack_rpc.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 98a74ccfd6..4a82b3a1bd 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -260,12 +260,23 @@ a dictionary with these (optional) keys: colors. Set to false to use terminal color codes (at most 256 different colors). + `ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu| `ext_tabline` Externalize the tabline. |ui-ext-tabline| Externalized widgets will not be drawn by Nvim; only high-level data will be published in new UI event kinds. + `popupmenu_external`: Instead of drawing the completion popupmenu on + the grid, Nvim will send higher-level events to + the ui and let it draw the popupmenu. + Defaults to false. + cmdline_external: Instead of drawing the cmdline on + the grid, Nvim will send higher-level events to + the ui and let it draw the cmdline. + Defaults to false. + + Nvim will then send msgpack-rpc notifications, with the method name "redraw" and a single argument, an array of screen updates (described below). These should be processed in order. Preferably the user should only be able to see @@ -441,5 +452,27 @@ states might be represented as separate modes. curtab: Current Tabpage tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] +["cmdline_enter"] + Enter the cmdline. + +["cmdline_leave"] + Leave the cmdline. + +["cmdline_firstc", firstc] + The first character of the command, which could be : / ? etc. With + the firstc, you know wheither it's a command or a search. + +["cmdline", content, pos] + When cmdline_external is set to true, nvim will not draw the cmdline + on the grad, instead nvim will send ui events of the cmdline content + and cursor position to the remote ui. The content is the full content + that should be displayed in the cmdline, and the pos is the position + of the cursor that in the cmdline. This event will be triggered when + you type in the cmdline. + +["cmdline_pos", pos] + When you move your cursor, nvim will send out this event which tells + you the current position of the cursor in the cmdline. + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: -- cgit From 6e90bc7200c87f0af448a8cf0998715db9175f15 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Thu, 23 Feb 2017 09:53:12 +0000 Subject: ext_cmdline: Added cmdline prompt --- runtime/doc/msgpack_rpc.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 4a82b3a1bd..b7c790bb64 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -462,6 +462,9 @@ states might be represented as separate modes. The first character of the command, which could be : / ? etc. With the firstc, you know wheither it's a command or a search. +["cmdline_prompt", prompt] + The prompt of the cmdline. + ["cmdline", content, pos] When cmdline_external is set to true, nvim will not draw the cmdline on the grad, instead nvim will send ui events of the cmdline content -- cgit From 550651c130c014e6c668644273db31dd96be475e Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Fri, 28 Apr 2017 06:51:16 +0100 Subject: ext_cmdline: use standard external ui functions --- runtime/doc/msgpack_rpc.txt | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index b7c790bb64..46fc6f19c2 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -260,23 +260,13 @@ a dictionary with these (optional) keys: colors. Set to false to use terminal color codes (at most 256 different colors). - `ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu| `ext_tabline` Externalize the tabline. |ui-ext-tabline| + `ext_cmdline` Externalize the cmdline. |ui-ext-cmdline| Externalized widgets will not be drawn by Nvim; only high-level data will be published in new UI event kinds. - `popupmenu_external`: Instead of drawing the completion popupmenu on - the grid, Nvim will send higher-level events to - the ui and let it draw the popupmenu. - Defaults to false. - cmdline_external: Instead of drawing the cmdline on - the grid, Nvim will send higher-level events to - the ui and let it draw the cmdline. - Defaults to false. - - Nvim will then send msgpack-rpc notifications, with the method name "redraw" and a single argument, an array of screen updates (described below). These should be processed in order. Preferably the user should only be able to see @@ -452,20 +442,14 @@ states might be represented as separate modes. curtab: Current Tabpage tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] + *ui-ext-cmdline* ["cmdline_enter"] Enter the cmdline. ["cmdline_leave"] Leave the cmdline. -["cmdline_firstc", firstc] - The first character of the command, which could be : / ? etc. With - the firstc, you know wheither it's a command or a search. - -["cmdline_prompt", prompt] - The prompt of the cmdline. - -["cmdline", content, pos] +["cmdline_show", content, pos, firstc, prompt] When cmdline_external is set to true, nvim will not draw the cmdline on the grad, instead nvim will send ui events of the cmdline content and cursor position to the remote ui. The content is the full content -- cgit From daec81ab5179c7ce8e3813af556b1e2f05fc59c6 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Fri, 28 Apr 2017 07:49:45 +0100 Subject: ext_cmdline: change the content format --- runtime/doc/msgpack_rpc.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 46fc6f19c2..ef4a22db0b 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -450,6 +450,8 @@ states might be represented as separate modes. Leave the cmdline. ["cmdline_show", content, pos, firstc, prompt] + content: List of [highlight group, string] + [["Normal", "t"], ["Search", "est"], ...] When cmdline_external is set to true, nvim will not draw the cmdline on the grad, instead nvim will send ui events of the cmdline content and cursor position to the remote ui. The content is the full content -- cgit From e164ba41c8460d4e5b2e7e2b929d8479a0310738 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Thu, 11 May 2017 04:48:59 +0100 Subject: ext_cmdline: fix firstc, change cmdline_leave to cmdline_hide --- runtime/doc/msgpack_rpc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index ef4a22db0b..77938fbd82 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -446,8 +446,8 @@ states might be represented as separate modes. ["cmdline_enter"] Enter the cmdline. -["cmdline_leave"] - Leave the cmdline. +["cmdline_hide"] + Hide the cmdline. ["cmdline_show", content, pos, firstc, prompt] content: List of [highlight group, string] -- cgit From 87a723963e720612d16c7cfb577d529f58a3d4d1 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 16 Aug 2017 15:38:23 +0200 Subject: ext_cmdline: documentation --- runtime/doc/msgpack_rpc.txt | 62 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 14 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 77938fbd82..9601e239f2 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -302,6 +302,8 @@ kind. Set the default foreground, background and special colors respectively. + + *ui-event-highlight_set* ["highlight_set", attrs] Set the attributes that the next text put on the screen will have. `attrs` is a dict with the keys below. Any absent key is reset @@ -443,25 +445,57 @@ states might be represented as separate modes. tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] *ui-ext-cmdline* -["cmdline_enter"] - Enter the cmdline. +["cmdline_show", content, pos, firstc, prompt, indent, level] + content: List of [attrs, string] + [[{}, "t"], [attrs, "est"], ...] + When cmdline_external is set to true, nvim will not draw the cmdline + on the grid, instead nvim will send ui events of the cmdline content + and cursor position to the remote ui. The `content` is the full content + that should be displayed in the cmdline, and the `pos` is the position + of the cursor that in the cmdline. This event will be triggered when + you type in the cmdline. The content is divided into chunks with + different highlight attributes represented as a dict, see + |ui-event-highlight_set|. + + `firstc` and `prompt` are text, that if non-empty should be + displayed in front of the command line. `firstc` always indicates + built in command lines such as `:` (ex command) and `/` `?` (search), + while `prompt` is an |input()| prompt. `indent` tells how many spaces + the content should be indented + + The command line in nvim can be invoked recursively, for instance by + typing `=` at the command line prompt. The `level` field is used + to distinguish different command lines active at the same time. The + first invoked command line will always have level 1, and the next + recursively invoked prompt will have level 2. Also, a command line + invoked while in command line window will have a higher level than + than the edited command line. + +["cmdline_pos", pos, level] + Change the cursor position in the cmdline. + +["cmdline_special_char", c, shift, level] + Display a special char in the cmdline at the cursor position. This is + typically used to indicate a pending state, like right after Ctrl-V. + if shift is true the text after the cursor should be shifted, + otherwise it should overshadow the char at the cursor. + Should be hidden at next cmdline_char + ["cmdline_hide"] Hide the cmdline. -["cmdline_show", content, pos, firstc, prompt] - content: List of [highlight group, string] - [["Normal", "t"], ["Search", "est"], ...] - When cmdline_external is set to true, nvim will not draw the cmdline - on the grad, instead nvim will send ui events of the cmdline content - and cursor position to the remote ui. The content is the full content - that should be displayed in the cmdline, and the pos is the position - of the cursor that in the cmdline. This event will be triggered when - you type in the cmdline. +["cmdline_block_show", lines] + Show a block of context to the current command line. This occurs for + instance if a function is interactively defined at the command line. + `lines` is a list of lines where each line is represented as a list of + highlighted chunks, just like `contents` of |ui-event-cmdline_show|. + +["cmdline_block_append", line] + Append a line at the end of the currently shown block. -["cmdline_pos", pos] - When you move your cursor, nvim will send out this event which tells - you the current position of the cursor in the cmdline. +["cmdline_block_hide"] + Hide the block. ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: -- cgit From f640ae0d6e788bb3ca06508d216a397c1ff190d5 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 10 Sep 2017 10:01:18 +0200 Subject: docs: breakout ui.txt from msgpack_rpc.txt --- runtime/doc/api.txt | 2 +- runtime/doc/msgpack_rpc.txt | 255 --------------------------------------- runtime/doc/ui.txt | 284 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 285 insertions(+), 256 deletions(-) create mode 100644 runtime/doc/ui.txt (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 8aead087db..159dd93c5e 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -48,7 +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| +ui_events UI event signatures |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/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 9601e239f2..7af6e401da 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -243,259 +243,4 @@ Even for statically compiled clients it is good practice to avoid hardcoding the type codes, because a client may be built against one Nvim version but connect to another with different type codes. -============================================================================== -6. Remote UIs *rpc-remote-ui* - -GUIs can be implemented as external processes communicating with Nvim over the -RPC API. The UI model consists of a terminal-like grid with a single, -monospace font size. Some elements (UI "widgets") can be drawn separately from -the grid ("externalized"). - -After connecting to Nvim (usually a spawned, embedded instance) use the -|nvim_ui_attach| API method to tell Nvim that your program wants to draw the -Nvim screen on a grid of width × height cells. `options` must be -a dictionary with these (optional) keys: - `rgb` Controls what color format to use. - Set to true (default) to use 24-bit rgb - colors. - Set to false to use terminal color codes (at - most 256 different colors). - `ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu| - `ext_tabline` Externalize the tabline. |ui-ext-tabline| - `ext_cmdline` Externalize the cmdline. |ui-ext-cmdline| - Externalized widgets will not be drawn by - Nvim; only high-level data will be published - in new UI event kinds. - -Nvim will then send msgpack-rpc notifications, with the method name "redraw" -and a single argument, an array of screen updates (described below). These -should be processed in order. Preferably the user should only be able to see -the screen state after all updates in the same "redraw" event are processed -(not any intermediate state after processing only a part of the array). - -Future versions of Nvim may add new update kinds and may append new parameters -to existing update kinds. Clients must be prepared to ignore such extensions -to be forward-compatible. |api-contract| - -Screen updates are tuples whose first element is the string name of the update -kind. - -["resize", width, height] - The grid is resized to `width` and `height` cells. - -["clear"] - Clear the screen. - -["eol_clear"] - Clear from the cursor position to the end of the current line. - -["cursor_goto", row, col] - Move the cursor to position (row, col). Currently, the same cursor is - used to define the position for text insertion and the visible cursor. - However, only the last cursor position, after processing the entire - array in the "redraw" event, is intended to be a visible cursor - position. - -["update_fg", color] -["update_bg", color] -["update_sp", color] - Set the default foreground, background and special colors - respectively. - - - *ui-event-highlight_set* -["highlight_set", attrs] - Set the attributes that the next text put on the screen will have. - `attrs` is a dict with the keys below. Any absent key is reset - to its default value. Color defaults are set by the `update_fg` etc - updates. All boolean keys default to false. - - `foreground`: foreground color. - `background`: backround color. - `special`: color to use for underline and undercurl, when present. - `reverse`: reverse video. Foreground and background colors are - switched. - `italic`: italic text. - `bold`: bold text. - `underline`: underlined text. The line has `special` color. - `undercurl`: undercurled text. The curl has `special` color. - -["put", text] - The (utf-8 encoded) string `text` is put at the cursor position - (and the cursor is advanced), with the highlights as set by the - last `highlight_set` update. - -["set_scroll_region", top, bot, left, right] - Define the scroll region used by `scroll` below. - -["scroll", count] - Scroll the text in the scroll region. The diagrams below illustrate - what will happen, depending on the scroll direction. "=" is used to - represent the SR(scroll region) boundaries and "-" the moved rectangles. - Note that dst and src share a common region. - - If count is bigger than 0, move a rectangle in the SR up, this can - happen while scrolling down. -> - +-------------------------+ - | (clipped above SR) | ^ - |=========================| dst_top | - | dst (still in SR) | | - +-------------------------+ src_top | - | src (moved up) and dst | | - |-------------------------| dst_bot | - | src (cleared) | | - +=========================+ src_bot -< - If count is less than zero, move a rectangle in the SR down, this can - happen while scrolling up. -> - +=========================+ src_top - | src (cleared) | | - |------------------------ | dst_top | - | src (moved down) and dst| | - +-------------------------+ src_bot | - | dst (still in SR) | | - |=========================| dst_bot | - | (clipped below SR) | v - +-------------------------+ -< -["set_title", title] -["set_icon", icon] - Set the window title, and icon (minimized) window title, respectively. - In windowing systems not distinguishing between the two, "set_icon" - can be ignored. - -["mouse_on"] -["mouse_off"] - Tells the client whether mouse support, as determined by |'mouse'| - option, is considered to be active in the current mode. This is mostly - useful for a terminal frontend, or other situations where nvim mouse - would conflict with other usages of the mouse. It is safe for a client - to ignore this and always send mouse events. - -["busy_on"] -["busy_off"] - Nvim started or stopped being busy, and possibly not responsible to user - input. This could be indicated to the user by hiding the cursor. - -["suspend"] - |:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other - client where it makes sense) could suspend itself. Other clients can - safely ignore it. - -["bell"] -["visual_bell"] - Notify the user with an audible or visual bell, respectively. - -["update_menu"] - The menu mappings changed. - -["mode_info_set", cursor_style_enabled, mode_info] -`cursor_style_enabled` is a boolean indicating if the UI should set the cursor -style. `mode_info` is a list of mode property maps. The current mode is given -by the `mode_idx` field of the `mode_change` event. - -Each mode property map may contain these keys: - KEY DESCRIPTION ~ - `cursor_shape`: "block", "horizontal", "vertical" - `cell_percentage`: Cell % occupied by the cursor. - `blinkwait`, `blinkon`, `blinkoff`: See |cursor-blinking|. - `hl_id`: Cursor highlight group. - `hl_lm`: Cursor highlight group if 'langmap' is active. - `short_name`: Mode code name, see 'guicursor'. - `name`: Mode descriptive name. - `mouse_shape`: (To be implemented.) - -Some keys are missing in some modes. - -["mode_change", mode, mode_idx] -The mode changed. The first parameter `mode` is a string representing the -current mode. `mode_idx` is an index into the array received in the -`mode_info_set` event. UIs should change the cursor style according to the -properties specified in the corresponding item. The set of modes reported will -change in new versions of Nvim, for instance more submodes and temporary -states might be represented as separate modes. - - *ui-ext-popupmenu* -["popupmenu_show", items, selected, row, col] - When `popupmenu_external` is set to true, nvim will not draw the - popupmenu on the grid, instead when the popupmenu is to be displayed - this update is sent. `items` is an array of the items to show, the - items are themselves arrays of the form [word, kind, menu, info] - as defined at |complete-items|, except that `word` is replaced by - `abbr` if present. `selected` is the initially selected item, either a - zero-based index into the array of items, or -1 if no item is - selected. `row` and `col` is the anchor position, where the first - character of the completed word will be. - -["popupmenu_select", selected] - An item in the currently displayed popupmenu is selected. `selected` - is either a zero-based index into the array of items from the last - `popupmenu_show` event, or -1 if no item is selected. - -["popupmenu_hide"] - The popupmenu is hidden. - - *ui-ext-tabline* -["tabline_update", curtab, tabs] - Tabline was updated. UIs should present this data in a custom tabline - widget. - curtab: Current Tabpage - tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] - - *ui-ext-cmdline* -["cmdline_show", content, pos, firstc, prompt, indent, level] - content: List of [attrs, string] - [[{}, "t"], [attrs, "est"], ...] - When cmdline_external is set to true, nvim will not draw the cmdline - on the grid, instead nvim will send ui events of the cmdline content - and cursor position to the remote ui. The `content` is the full content - that should be displayed in the cmdline, and the `pos` is the position - of the cursor that in the cmdline. This event will be triggered when - you type in the cmdline. The content is divided into chunks with - different highlight attributes represented as a dict, see - |ui-event-highlight_set|. - - `firstc` and `prompt` are text, that if non-empty should be - displayed in front of the command line. `firstc` always indicates - built in command lines such as `:` (ex command) and `/` `?` (search), - while `prompt` is an |input()| prompt. `indent` tells how many spaces - the content should be indented - - The command line in nvim can be invoked recursively, for instance by - typing `=` at the command line prompt. The `level` field is used - to distinguish different command lines active at the same time. The - first invoked command line will always have level 1, and the next - recursively invoked prompt will have level 2. Also, a command line - invoked while in command line window will have a higher level than - than the edited command line. - -["cmdline_pos", pos, level] - Change the cursor position in the cmdline. - -["cmdline_special_char", c, shift, level] - Display a special char in the cmdline at the cursor position. This is - typically used to indicate a pending state, like right after Ctrl-V. - if shift is true the text after the cursor should be shifted, - otherwise it should overshadow the char at the cursor. - Should be hidden at next cmdline_char - - -["cmdline_hide"] - Hide the cmdline. - -["cmdline_block_show", lines] - Show a block of context to the current command line. This occurs for - instance if a function is interactively defined at the command line. - `lines` is a list of lines where each line is represented as a list of - highlighted chunks, just like `contents` of |ui-event-cmdline_show|. - -["cmdline_block_append", line] - Append a line at the end of the currently shown block. - -["cmdline_block_hide"] - Hide the block. -============================================================================== - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt new file mode 100644 index 0000000000..b875c1b183 --- /dev/null +++ b/runtime/doc/ui.txt @@ -0,0 +1,284 @@ +*ui.txt* Nvim + + + NVIM REFERENCE MANUAL by Thiago de Arruda + + +UI protocol *ui* + + Type to see the table of contents. + +============================================================================== +Introduction *ui-intro* + +GUIs can be implemented as external processes communicating with Nvim over the +RPC API. The UI model consists of a terminal-like grid with a single, +monospace font size. Some elements (UI "widgets") can be drawn separately from +the grid ("externalized"). + + *ui-options* +After connecting to Nvim (usually a spawned, embedded instance) use the +|nvim_ui_attach| API method to tell Nvim that your program wants to draw the +Nvim screen grid with a size of width × height cells. `options` must be +a dictionary with these (optional) keys: + `rgb` Controls what color format to use. + Set to true (default) to use 24-bit rgb + colors. + Set to false to use terminal color codes (at + most 256 different colors). + `ext_popupmenu` Externalize the popupmenu. |ui-popupmenu| + `ext_tabline` Externalize the tabline. |ui-tabline| + `ext_cmdline` Externalize the cmdline. |ui-cmdline| + +Nvim will then send msgpack-rpc notifications, with the method name "redraw" +and a single argument, an array of screen update events. +Update events are tuples whose first element is the string name of the update +kind. The rest are parameters for each update, described in the sections below. +These should be processed in order. Preferably the user should only be able to +see the screen state after all update events in the same "redraw" event are +processed (not any intermediate state after processing only a part of the +array). + +Section 2 and 3 describes grid and mode events that are send unconditionally, +and suffice to implement a terminal-like interface. Nvim also allows a number +of screen elements to be sent as descriptive events for the GUI to draw +itself, rather than Nvim drawing itself on the grid. This is controlled by the +`ext_` options. + +Future versions of Nvim may add new update kinds and may append new parameters +to existing update kinds. Clients must be prepared to ignore such extensions +to be forward-compatible. |api-contract| + +============================================================================== +Global Events *ui-global* + +["set_title", title] +["set_icon", icon] + Set the window title, and icon (minimized) window title, respectively. + In windowing systems not distinguishing between the two, "set_icon" + can be ignored. + +["mode_info_set", cursor_style_enabled, mode_info] + `cursor_style_enabled` is a boolean indicating if the UI should set + the cursor style. `mode_info` is a list of mode property maps. The + current mode is given by the `mode_idx` field of the `mode_change` + event. + +Each mode property map may contain these keys: + KEY DESCRIPTION ~ + `cursor_shape`: "block", "horizontal", "vertical" + `cell_percentage`: Cell % occupied by the cursor. + `blinkwait`, `blinkon`, `blinkoff`: See |cursor-blinking|. + `hl_id`: Cursor highlight group. + `hl_lm`: Cursor highlight group if 'langmap' is active. + `short_name`: Mode code name, see 'guicursor'. + `name`: Mode descriptive name. + `mouse_shape`: (To be implemented.) + +Some keys are missing in some modes. + +["mode_change", mode, mode_idx] + The mode changed. The first parameter `mode` is a string representing + the current mode. `mode_idx` is an index into the array received in + the `mode_info_set` event. UIs should change the cursor style + according to the properties specified in the corresponding item. The + set of modes reported will change in new versions of Nvim, for + instance more submodes and temporary states might be represented as + separate modes. + + +["mouse_on"] +["mouse_off"] + Tells the client whether mouse support, as determined by |'mouse'| + option, is considered to be active in the current mode. This is mostly + useful for a terminal frontend, or other situations where nvim mouse + would conflict with other usages of the mouse. It is safe for a client + to ignore this and always send mouse events. + +["busy_on"] +["busy_off"] + Nvim started or stopped being busy, and possibly not responsible to user + input. This could be indicated to the user by hiding the cursor. + +["suspend"] + |:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other + client where it makes sense) could suspend itself. Other clients can + safely ignore it. + +["update_menu"] + The menu mappings changed. + +["bell"] +["visual_bell"] + Notify the user with an audible or visual bell, respectively. + +============================================================================== +Grid Events *ui-grid* + +["resize", width, height] + The grid is resized to `width` and `height` cells. + +["clear"] + Clear the grid. + +["eol_clear"] + Clear from the cursor position to the end of the current line. + +["cursor_goto", row, col] + Move the cursor to position (row, col). Currently, the same cursor is + used to define the position for text insertion and the visible cursor. + However, only the last cursor position, after processing the entire + array in the "redraw" event, is intended to be a visible cursor + position. + +["update_fg", color] +["update_bg", color] +["update_sp", color] + Set the default foreground, background and special colors + respectively. + + *ui-event-highlight_set* +["highlight_set", attrs] + Set the attributes that the next text put on the grid will have. + `attrs` is a dict with the keys below. Any absent key is reset + to its default value. Color defaults are set by the `update_fg` etc + updates. All boolean keys default to false. + + `foreground`: foreground color. + `background`: backround color. + `special`: color to use for underline and undercurl, when present. + `reverse`: reverse video. Foreground and background colors are + switched. + `italic`: italic text. + `bold`: bold text. + `underline`: underlined text. The line has `special` color. + `undercurl`: undercurled text. The curl has `special` color. + +["put", text] + The (utf-8 encoded) string `text` is put at the cursor position + (and the cursor is advanced), with the highlights as set by the + last `highlight_set` update. + +["set_scroll_region", top, bot, left, right] + Define the scroll region used by `scroll` below. + +["scroll", count] + Scroll the text in the scroll region. The diagrams below illustrate + what will happen, depending on the scroll direction. "=" is used to + represent the SR(scroll region) boundaries and "-" the moved rectangles. + Note that dst and src share a common region. + + If count is bigger than 0, move a rectangle in the SR up, this can + happen while scrolling down. +> + +-------------------------+ + | (clipped above SR) | ^ + |=========================| dst_top | + | dst (still in SR) | | + +-------------------------+ src_top | + | src (moved up) and dst | | + |-------------------------| dst_bot | + | src (cleared) | | + +=========================+ src_bot +< + If count is less than zero, move a rectangle in the SR down, this can + happen while scrolling up. +> + +=========================+ src_top + | src (cleared) | | + |------------------------ | dst_top | + | src (moved down) and dst| | + +-------------------------+ src_bot | + | dst (still in SR) | | + |=========================| dst_bot | + | (clipped below SR) | v + +-------------------------+ +< +============================================================================== +Popupmenu Events *ui-popupmenu* + +Only sent if `ext_popupmenu` option is set in |ui-options| + +["popupmenu_show", items, selected, row, col] + `items` is an array of the items to show, the + items are themselves arrays of the form [word, kind, menu, info] + as defined at |complete-items|, except that `word` is replaced by + `abbr` if present. `selected` is the initially selected item, either a + zero-based index into the array of items, or -1 if no item is + selected. `row` and `col` is the anchor position, where the first + character of the completed word will be. + +["popupmenu_select", selected] + An item in the currently displayed popupmenu is selected. `selected` + is either a zero-based index into the array of items from the last + `popupmenu_show` event, or -1 if no item is selected. + +["popupmenu_hide"] + The popupmenu is hidden. + +============================================================================== +Tabline Events *ui-tabline* + +Only sent if `ext_tabline` option is set in |ui-options| + +["tabline_update", curtab, tabs] + Tabline was updated. UIs should present this data in a custom tabline + widget. + curtab: Current Tabpage + tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] + +============================================================================== +Cmdline Events *ui-cmdline* + +Only sent if `ext_cmdline` option is set in |ui-options| + +["cmdline_show", content, pos, firstc, prompt, indent, level] + content: List of [attrs, string] + [[{}, "t"], [attrs, "est"], ...] + The `content` is the full content that should be displayed in the + cmdline, and the `pos` is the position of the cursor that in the + cmdline. This event will be triggered when you type in the cmdline. + The content is divided into chunks with different highlight attributes + represented as a dict, see |ui-event-highlight_set|. + + `firstc` and `prompt` are text, that if non-empty should be + displayed in front of the command line. `firstc` always indicates + built in command lines such as `:` (ex command) and `/` `?` (search), + while `prompt` is an |input()| prompt. `indent` tells how many spaces + the content should be indented + + The command line in nvim can be invoked recursively, for instance by + typing `=` at the command line prompt. The `level` field is used + to distinguish different command lines active at the same time. The + first invoked command line will always have level 1, and the next + recursively invoked prompt will have level 2. Also, a command line + invoked while in command line window will have a higher level than + than the edited command line. + +["cmdline_pos", pos, level] + Change the cursor position in the cmdline. + +["cmdline_special_char", c, shift, level] + Display a special char in the cmdline at the cursor position. This is + typically used to indicate a pending state, like right after Ctrl-V. + if shift is true the text after the cursor should be shifted, + otherwise it should overshadow the char at the cursor. + Should be hidden at next cmdline_char + +["cmdline_hide"] + Hide the cmdline. + +["cmdline_block_show", lines] + Show a block of context to the current command line. This occurs for + instance if a function is interactively defined at the command line. + `lines` is a list of lines where each line is represented as a list of + highlighted chunks, just like `contents` of |ui-event-cmdline_show|. + +["cmdline_block_append", line] + Append a line at the end of the currently shown block. + +["cmdline_block_hide"] + Hide the block. + +============================================================================== + vim:tw=78:ts=8:noet:ft=help:norl: -- cgit From 8526902790680b9eea5462c19bd7d45caa40f16d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 28 Oct 2017 23:49:41 +0200 Subject: doc/ui.txt --- runtime/doc/ui.txt | 96 +++++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 45 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index b875c1b183..deac1609c0 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -1,12 +1,12 @@ *ui.txt* Nvim - NVIM REFERENCE MANUAL by Thiago de Arruda + NVIM REFERENCE MANUAL -UI protocol *ui* +Nvim UI protocol *ui* - Type to see the table of contents. + Type |gO| to see the table of contents. ============================================================================== Introduction *ui-intro* @@ -16,34 +16,35 @@ RPC API. The UI model consists of a terminal-like grid with a single, monospace font size. Some elements (UI "widgets") can be drawn separately from the grid ("externalized"). - *ui-options* + *ui-options* After connecting to Nvim (usually a spawned, embedded instance) use the |nvim_ui_attach| API method to tell Nvim that your program wants to draw the Nvim screen grid with a size of width × height cells. `options` must be a dictionary with these (optional) keys: - `rgb` Controls what color format to use. - Set to true (default) to use 24-bit rgb - colors. - Set to false to use terminal color codes (at - most 256 different colors). + `rgb` Decides the color format. + Set true (default) for 24-bit RGB colors. + Set false for terminal colors (max of 256). + *ui-ext-options* `ext_popupmenu` Externalize the popupmenu. |ui-popupmenu| `ext_tabline` Externalize the tabline. |ui-tabline| `ext_cmdline` Externalize the cmdline. |ui-cmdline| Nvim will then send msgpack-rpc notifications, with the method name "redraw" and a single argument, an array of screen update events. -Update events are tuples whose first element is the string name of the update -kind. The rest are parameters for each update, described in the sections below. -These should be processed in order. Preferably the user should only be able to -see the screen state after all update events in the same "redraw" event are -processed (not any intermediate state after processing only a part of the -array). - -Section 2 and 3 describes grid and mode events that are send unconditionally, -and suffice to implement a terminal-like interface. Nvim also allows a number -of screen elements to be sent as descriptive events for the GUI to draw -itself, rather than Nvim drawing itself on the grid. This is controlled by the -`ext_` options. +Update events are tuples whose first element is the event name and remaining +elements the event parameters. + +Events must be handled in order. The user should only see the updated screen +state after all events in the same "redraw" batch are processed (not any +intermediate state after processing only part of the array). + +Nvim sends |ui-global| and |ui-grid| events unconditionally; these suffice to +implement a terminal-like interface. + +Nvim optionally sends screen elements "semantically" as structured events +instead of raw grid-lines. Then the UI must decide how to present those +elements itself; Nvim will not draw those elements on the grid. This is +controlled by the |ui-ext-options|. Future versions of Nvim may add new update kinds and may append new parameters to existing update kinds. Clients must be prepared to ignore such extensions @@ -64,7 +65,8 @@ Global Events *ui-global* current mode is given by the `mode_idx` field of the `mode_change` event. -Each mode property map may contain these keys: + Each mode property map may contain these keys: + KEY DESCRIPTION ~ `cursor_shape`: "block", "horizontal", "vertical" `cell_percentage`: Cell % occupied by the cursor. @@ -75,7 +77,7 @@ Each mode property map may contain these keys: `name`: Mode descriptive name. `mouse_shape`: (To be implemented.) -Some keys are missing in some modes. + Some keys are missing in some modes. ["mode_change", mode, mode_idx] The mode changed. The first parameter `mode` is a string representing @@ -86,7 +88,6 @@ Some keys are missing in some modes. instance more submodes and temporary states might be represented as separate modes. - ["mouse_on"] ["mouse_off"] Tells the client whether mouse support, as determined by |'mouse'| @@ -97,8 +98,8 @@ Some keys are missing in some modes. ["busy_on"] ["busy_off"] - Nvim started or stopped being busy, and possibly not responsible to user - input. This could be indicated to the user by hiding the cursor. + Nvim started or stopped being busy, and possibly not responsive to + user input. This could be indicated to the user by hiding the cursor. ["suspend"] |:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other @@ -137,7 +138,7 @@ Grid Events *ui-grid* Set the default foreground, background and special colors respectively. - *ui-event-highlight_set* + *ui-event-highlight_set* ["highlight_set", attrs] Set the attributes that the next text put on the grid will have. `attrs` is a dict with the keys below. Any absent key is reset @@ -235,44 +236,49 @@ Only sent if `ext_cmdline` option is set in |ui-options| ["cmdline_show", content, pos, firstc, prompt, indent, level] content: List of [attrs, string] [[{}, "t"], [attrs, "est"], ...] + + Triggered when the user types in the cmdline. The `content` is the full content that should be displayed in the cmdline, and the `pos` is the position of the cursor that in the - cmdline. This event will be triggered when you type in the cmdline. - The content is divided into chunks with different highlight attributes - represented as a dict, see |ui-event-highlight_set|. + cmdline. The content is divided into chunks with different highlight + attributes represented as a dict (see |ui-event-highlight_set|). `firstc` and `prompt` are text, that if non-empty should be displayed in front of the command line. `firstc` always indicates - built in command lines such as `:` (ex command) and `/` `?` (search), + built-in command lines such as `:` (ex command) and `/` `?` (search), while `prompt` is an |input()| prompt. `indent` tells how many spaces - the content should be indented + the content should be indented. - The command line in nvim can be invoked recursively, for instance by + The Nvim command line can be invoked recursively, for instance by typing `=` at the command line prompt. The `level` field is used to distinguish different command lines active at the same time. The - first invoked command line will always have level 1, and the next - recursively invoked prompt will have level 2. Also, a command line - invoked while in command line window will have a higher level than - than the edited command line. + first invoked command line has level 1, the next recursively-invoked + prompt has level 2. A command line invoked from the |cmd-line-window| + has a higher level than than the edited command line. ["cmdline_pos", pos, level] Change the cursor position in the cmdline. ["cmdline_special_char", c, shift, level] Display a special char in the cmdline at the cursor position. This is - typically used to indicate a pending state, like right after Ctrl-V. - if shift is true the text after the cursor should be shifted, - otherwise it should overshadow the char at the cursor. - Should be hidden at next cmdline_char + typically used to indicate a pending state, e.g. after |c_CTRL-V|. If + `shift` is true the text after the cursor should be shifted, otherwise + it should overwrite the char at the cursor. + + Should be hidden at next cmdline_pos. ["cmdline_hide"] Hide the cmdline. ["cmdline_block_show", lines] - Show a block of context to the current command line. This occurs for - instance if a function is interactively defined at the command line. - `lines` is a list of lines where each line is represented as a list of - highlighted chunks, just like `contents` of |ui-event-cmdline_show|. + Show a block of context to the current command line. For example if + the user defines a |:function| interactively: > + :function Foo() + : echo "foo" + : +< + `lines` is a list of lines of highlighted chunks, in the same form as + the "cmdline_show" `contents` parameter. ["cmdline_block_append", line] Append a line at the end of the currently shown block. -- cgit From 2a3bcd1ff883429a3dd17e7ae5ddc1396abbad17 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 29 Oct 2017 03:06:53 +0100 Subject: rpc: Don't delay notifications when request is pending (#6544) With the old behavior, if a GUI makes a blocking request that requires user interaction (like nvim_input()), it would not get any screen updates. The client, not nvim, should decide how to handle notifications during a pending request. If an rplugin wants to avoid async calls while a sync call is busy, it likely wants to avoid processing async calls while another async call also is handled as well. This may break the expectation of some existing rplugins. For compatibility, remote/define.vim reimplements the old behavior. Clients can opt-out by specifying `sync=urgent`. - Legacy hosts should be updated to use `sync=urgent`. They could add a flag indicating which async methods are always safe to call and which must wait until the main loop returns. - New hosts can expose the full asyncness, they don't need to offer both behaviors. ref #6532 ref #1398 d83868fe9071af1b4866594eac12f7aa0fa71b53 --- runtime/autoload/remote/define.vim | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/remote/define.vim b/runtime/autoload/remote/define.vim index b5c976c823..2688a62a82 100644 --- a/runtime/autoload/remote/define.vim +++ b/runtime/autoload/remote/define.vim @@ -169,14 +169,40 @@ function! remote#define#FunctionOnChannel(channel, method, sync, name, opts) exe function_def endfunction +let s:busy = {} +let s:pending_notifications = {} function! s:GetRpcFunction(sync) - if a:sync - return 'rpcrequest' + if a:sync ==# 'urgent' + return 'rpcnotify' + elseif a:sync + return 'remote#define#request' endif - return 'rpcnotify' + return 'remote#define#notify' endfunction +function! remote#define#notify(chan, ...) + if get(s:busy, a:chan, 0) > 0 + let pending = get(s:pending_notifications, a:chan, []) + call add(pending, deepcopy(a:000)) + let s:pending_notifications[a:chan] = pending + else + call call('rpcnotify', [a:chan] + a:000) + endif +endfunction + +function! remote#define#request(chan, ...) + let s:busy[a:chan] = get(s:busy, a:chan, 0)+1 + let val = call('rpcrequest', [a:chan]+a:000) + let s:busy[a:chan] -= 1 + if s:busy[a:chan] == 0 + for msg in get(s:pending_notifications, a:chan, []) + call call('rpcnotify', [a:chan] + msg) + endfor + let s:pending_notifications[a:chan] = [] + endif + return val +endfunction function! s:GetCommandPrefix(name, opts) return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range', -- cgit