diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/api.txt | 47 | ||||
-rw-r--r-- | runtime/doc/builtin.txt | 52 | ||||
-rw-r--r-- | runtime/doc/change.txt | 2 | ||||
-rw-r--r-- | runtime/doc/cmdline.txt | 2 | ||||
-rw-r--r-- | runtime/doc/diagnostic.txt | 12 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | runtime/doc/ft_sql.txt | 8 | ||||
-rw-r--r-- | runtime/doc/index.txt | 5 | ||||
-rw-r--r-- | runtime/doc/insert.txt | 20 | ||||
-rw-r--r-- | runtime/doc/intro.txt | 9 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 154 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 69 | ||||
-rw-r--r-- | runtime/doc/map.txt | 21 | ||||
-rw-r--r-- | runtime/doc/nvim_terminal_emulator.txt | 6 | ||||
-rw-r--r-- | runtime/doc/options.txt | 20 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 2 | ||||
-rw-r--r-- | runtime/doc/spell.txt | 2 | ||||
-rw-r--r-- | runtime/doc/undo.txt | 10 | ||||
-rw-r--r-- | runtime/doc/usr_06.txt | 1 | ||||
-rw-r--r-- | runtime/doc/various.txt | 3 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 | ||||
-rw-r--r-- | runtime/doc/visual.txt | 3 |
22 files changed, 269 insertions, 183 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index c67187d857..be42b7c14e 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -348,7 +348,7 @@ callbacks. These callbacks are called frequently in various contexts; |nvim_buf_attach()| will take keyword args for the callbacks. "on_lines" will receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline}, -{new_lastline}, {old_byte_size}[, {old_utf32_size}, {old_utf16_size}]). +{new_lastline}, {old_byte_size} [, {old_utf32_size}, {old_utf16_size}]). Unlike remote channel events the text contents are not passed. The new text can be accessed inside the callback as @@ -536,12 +536,6 @@ created for extmark changes. ============================================================================== Global Functions *api-global* -nvim__get_hl_defs({ns_id}) *nvim__get_hl_defs()* - TODO: Documentation - -nvim__get_lib_dir() *nvim__get_lib_dir()* - TODO: Documentation - nvim__get_runtime({pat}, {all}, {*opts}) *nvim__get_runtime()* Find files in runtime directories @@ -608,15 +602,6 @@ nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()* NB: if your UI doesn't use hlstate, this will not return hlstate first time. -nvim__runtime_inspect() *nvim__runtime_inspect()* - TODO: Documentation - -nvim__screenshot({path}) *nvim__screenshot()* - TODO: Documentation - - Attributes: ~ - |api-fast| - nvim__set_hl_ns({ns_id}) *nvim__set_hl_ns()* Set active namespace for highlights. @@ -638,12 +623,6 @@ nvim__stats() *nvim__stats()* Return: ~ Map of various internal stats. -nvim__unpack({str}) *nvim__unpack()* - TODO: Documentation - - Attributes: ~ - |api-fast| - nvim_call_atomic({calls}) *nvim_call_atomic()* Calls many API methods atomically. @@ -995,7 +974,7 @@ nvim_get_keymap({mode}) *nvim_get_keymap()* {mode} Mode short-name ("n", "i", "v", ...) Return: ~ - Array of maparg()-like dictionaries describing mappings. + Array of |maparg()|-like dictionaries describing mappings. The "buffer" key is always zero. nvim_get_mark({name}, {opts}) *nvim_get_mark()* @@ -1529,7 +1508,12 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* used to give a description to the mapping. When called from Lua, also accepts a "callback" key that takes a Lua function to call when the mapping - is executed. + is executed. When "expr" is true, + "replace_keycodes" (boolean) can be used to + replace keycodes in the resulting string (see + |nvim_replace_termcodes()|), and a Lua callback + returning `nil` is equivalent to returning an + empty string. nvim_set_var({name}, {value}) *nvim_set_var()* Sets a global (g:) variable. @@ -1989,7 +1973,7 @@ nvim_buf_get_option({buffer}, {name}) *nvim_buf_get_option()* Option value nvim_buf_set_option({buffer}, {name}, {value}) *nvim_buf_set_option()* - Sets a buffer option value. Passing 'nil' as value deletes the + Sets a buffer option value. Passing `nil` as value deletes the option (only works if there's a global fallback) Parameters: ~ @@ -2096,8 +2080,8 @@ nvim_win_get_option({window}, {name}) *nvim_win_get_option()* Option value nvim_win_set_option({window}, {name}, {value}) *nvim_win_set_option()* - Sets a window option value. Passing 'nil' as value deletes the - option(only works if there's a global fallback) + Sets a window option value. Passing `nil` as value deletes the + option (only works if there's a global fallback) Parameters: ~ {window} Window handle, or 0 for current window @@ -2124,13 +2108,6 @@ affected. You can use |nvim_buf_is_loaded()| or |nvim_buf_line_count()| to check whether a buffer is loaded. - *nvim__buf_redraw_range()* -nvim__buf_redraw_range({buffer}, {first}, {last}) - TODO: Documentation - -nvim__buf_stats({buffer}) *nvim__buf_stats()* - TODO: Documentation - nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* Activates buffer-update events on a channel, or as Lua callbacks. @@ -2325,7 +2302,7 @@ nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()* {buffer} Buffer handle, or 0 for current buffer Return: ~ - Array of maparg()-like dictionaries describing mappings. + Array of |maparg()|-like dictionaries describing mappings. The "buffer" key holds the associated buffer handle. *nvim_buf_get_lines()* diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index df5a636070..f0f47cddf4 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -295,6 +295,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) rhs of mapping {name} in mode {mode} mapcheck({name} [, {mode} [, {abbr}]]) String check for mappings matching {name} +mapset({mode}, {abbr}, {dict}) + none restore mapping from |maparg()| result match({expr}, {pat} [, {start} [, {count}]]) Number position where {pat} matches in {expr} matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) @@ -1885,7 +1887,9 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is To check for a supported command always check the return value to be 2. :2match The |:2match| command. - :3match The |:3match| command. + :3match The |:3match| command (but you + probably should not use it, it is + reserved for internal usage) #event autocommand defined for this event #event#pattern autocommand defined for this event and pattern (the pattern is taken @@ -4714,6 +4718,7 @@ map({expr1}, {expr2}) *map()* Can also be used as a |method|: > mylist->map(expr2) + maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* When {dict} is omitted or zero: Return the rhs of mapping {name} in mode {mode}. The returned String has special @@ -4747,7 +4752,10 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* When {dict} is there and it is |TRUE| return a dictionary containing all the information of the mapping with the following items: - "lhs" The {lhs} of the mapping. + "lhs" The {lhs} of the mapping as it would be typed + "lhsraw" The {lhs} of the mapping as raw bytes + "lhsrawalt" The {lhs} of the mapping as raw bytes, alternate + form, only present when it differs from "lhsraw" "rhs" The {rhs} of the mapping as typed. "silent" 1 for a |:map-silent| mapping, else 0. "noremap" 1 if the {rhs} of the mapping is not remappable. @@ -4766,6 +4774,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* "nowait" Do not wait for other, longer mappings. (|:map-<nowait>|). + The dictionary can be used to restore a mapping with + |mapset()|. + The mappings local to the current buffer are checked first, then the global mappings. This function can be used to map a key even when it's already @@ -4811,6 +4822,22 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* Can also be used as a |method|: > GetKey()->mapcheck('n') +mapset({mode}, {abbr}, {dict}) *mapset()* + Restore a mapping from a dictionary returned by |maparg()|. + {mode} and {abbr} should be the same as for the call to + |maparg()|. *E460* + {mode} is used to define the mode in which the mapping is set, + not the "mode" entry in {dict}. + Example for saving and restoring a mapping: > + let save_map = maparg('K', 'n', 0, 1) + nnoremap K somethingelse + ... + call mapset('n', 0, save_map) +< Note that if you are going to replace a map in several modes, + e.g. with `:map!`, you need to save the mapping for all of + them, since they can differe. + + match({expr}, {pat} [, {start} [, {count}]]) *match()* When {expr} is a |List| then this returns the index of the first item where {pat} matches. Each item is used as a @@ -4905,8 +4932,10 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) message will appear and the match will not be added. An ID is specified as a positive integer (zero excluded). IDs 1, 2 and 3 are reserved for |:match|, |:2match| and |:3match|, - respectively. If the {id} argument is not specified or -1, - |matchadd()| automatically chooses a free ID. + respectively. 3 is reserved for use by the |matchparen| + plugin. + If the {id} argument is not specified or -1, |matchadd()| + automatically chooses a free ID. The optional {dict} argument allows for further custom values. Currently this is used to specify a match specific @@ -5282,6 +5311,7 @@ mode([expr]) Return a string that indicates the current mode. niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| nt Normal in |terminal-emulator| (insert goes to Terminal mode) + ntT Normal using |t_CTRL-\_CTRL-O| in |Terminal-mode| v Visual by character vs Visual by character using |v_CTRL-O| in Select mode V Visual by line @@ -6397,7 +6427,7 @@ searchcount([{options}]) *searchcount()* " to 1) let result = searchcount() < - The function is useful to add the count to |statusline|: > + The function is useful to add the count to 'statusline': > function! LastSearchCount() abort let result = searchcount(#{recompute: 0}) if empty(result) @@ -6670,7 +6700,6 @@ setbufline({buf}, {lnum}, {text}) *setbufline()* |bufload()| if needed. To insert lines use |appendbufline()|. - Any text properties in {lnum} are cleared. {text} can be a string to set one line, or a list of strings to set multiple lines. If the list extends below the last @@ -8008,10 +8037,10 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* The result is a String, which is the {what} attribute of syntax ID {synID}. This can be used to obtain information about a syntax item. - {mode} can be "gui", "cterm" or "term", to get the attributes + {mode} can be "gui" or "cterm", to get the attributes for that mode. When {mode} is omitted, or an invalid value is used, the attributes for the currently active highlighting are - used (GUI, cterm or term). + used (GUI or cterm). Use synIDtrans() to follow linked highlight groups. {what} result "name" the name of the syntax item @@ -8036,14 +8065,15 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* "underdouble" "1" if double underlined "underdotted" "1" if dotted underlined "underdashed" "1" if dashed underlined - "strikethrough" "1" if struckthrough + "strikethrough" "1" if struckthrough + "nocombine" "1" if nocombine + + Returns an empty string on error. Example (echoes the color of the syntax item under the cursor): > :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg") < - Returns an empty string on error. - Can also be used as a |method|: > :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index b905f53db7..a4ff4474e6 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -765,6 +765,8 @@ When the {string} starts with "\=" it is evaluated as an expression, see |sub-replace-expression|. You can use that for complex replacement or special characters. +The substitution is limited in recursion to 4 levels. *E1290* + Otherwise these characters in {string} have a special meaning: magic nomagic action ~ diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 3f3f1e6ba3..5d82f5985b 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -240,7 +240,7 @@ CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc* Note: If your <Esc> key is hard to hit on your keyboard, train yourself to use CTRL-[. *c_META* *c_ALT* - ALT (|META|) acts like <Esc> if the chord is not mapped. + ALT (|META|) may act like <Esc> if the chord is not mapped. For example <A-x> acts like <Esc>x if <A-x> does not have a command-line mode mapping. *c_CTRL-C* diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 2446506dec..7fb10f2a66 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -74,7 +74,7 @@ Functions that take a severity as an optional parameter (e.g. 2. A table with a "min" or "max" key (or both): > - vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN} }) + vim.diagnostic.get(0, { severity = { min = vim.diagnostic.severity.WARN } }) The latter form allows users to specify a range of severities. @@ -298,7 +298,7 @@ EVENTS *diagnostic-events* DiagnosticChanged After diagnostics have changed. Example: > - autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({open = false }) + autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({ open = false }) < ============================================================================== Lua module: vim.diagnostic *diagnostic-api* @@ -315,12 +315,12 @@ config({opts}, {namespace}) *vim.diagnostic.config()* For example, if a user enables virtual text globally with > - vim.diagnostic.config({virtual_text = true}) + vim.diagnostic.config({ virtual_text = true }) < and a diagnostic producer sets diagnostics with > - vim.diagnostic.set(ns, 0, diagnostics, {virtual_text = false}) + vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false }) < then virtual text will not be enabled for those diagnostics. @@ -570,8 +570,8 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults}) local s = "WARNING filename:27:3: Variable 'foo' does not exist" local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$" - local groups = {"severity", "lnum", "col", "message"} - vim.diagnostic.match(s, pattern, groups, {WARNING = vim.diagnostic.WARN}) + local groups = { "severity", "lnum", "col", "message" } + vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN }) < Parameters: ~ diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 17af40bdb9..376adfec7f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1736,6 +1736,8 @@ v:completed_item Dictionary containing the most recent |complete-items| after |CompleteDone|. Empty if the completion failed, or after leaving and re-entering insert mode. + Note: Plugins can modify the value to emulate the builtin + |CompleteDone| event behavior. *v:count* *count-variable* v:count The count given for the last Normal mode command. Can be used diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 6972fe0768..335faf266e 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -502,7 +502,7 @@ documentation. Assuming you have followed the dbext-tutorial you can press <C-C>t to display a list of tables. There is a delay while dbext is creating the table list. After the list is displayed press <C-W>. This will remove both the -popup window and the table name already chosen when the list became active. > +popup window and the table name already chosen when the list became active. 4.3.1 Table Completion: *sql-completion-tables* @@ -510,7 +510,7 @@ Press <C-C>t to display a list of tables from within the database you have connected via the dbext plugin. NOTE: All of the SQL completion popups support typing a prefix before pressing the key map. This will limit the contents of the popup window to just items -beginning with those characters. > +beginning with those characters. 4.3.2 Column Completion: *sql-completion-columns* @@ -583,13 +583,13 @@ popup a list of columns for the customer table. It does this by looking back to the beginning of the select statement and finding a list of the tables specified in the FROM clause. In this case it notes that in the string "customer c", "c" is an alias for the customer table. The optional "AS" -keyword is also supported, "customer AS c". > +keyword is also supported, "customer AS c". 4.3.3 Procedure Completion: *sql-completion-procedures* Similar to the table list, <C-C>p, will display a list of stored -procedures stored within the database. > +procedures stored within the database. 4.3.4 View Completion: *sql-completion-views* diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 25b98ae4ab..7d8a89887a 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1101,8 +1101,11 @@ tag command action in Command-line editing mode ~ 5. Terminal mode *terminal-mode-index* In a |terminal| buffer all keys except CTRL-\ are forwarded to the terminal -job. If CTRL-\ is pressed, the next key is forwarded unless it is CTRL-N. +job. If CTRL-\ is pressed, the next key is forwarded unless it is CTRL-N +or CTRL-O. Use |CTRL-\_CTRL-N| to go to Normal mode. +Use |t_CTRL-\_CTRL-O| to execute one normal mode command and then return +to terminal mode. You found it, Arthur! *holy-grail* diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index a16d88b4e9..6b0899334b 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -39,7 +39,7 @@ char action ~ abbreviation. Note: If your <Esc> key is hard to hit, try CTRL-[ instead. *i_META* *i_ALT* - ALT (|META|) acts like <Esc> if the chord is not mapped. + ALT (|META|) may act like <Esc> if the chord is not mapped. For example <A-x> acts like <Esc>x if <A-x> does not have an insert-mode mapping. *i_CTRL-C* @@ -374,10 +374,10 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J* <S-ScrollWheelRight> move window one page right *i_<S-ScrollWheelRight>* CTRL-O execute one command, return to Insert mode *i_CTRL-O* CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O* -CTRL-G u break undo sequence, start new change *i_CTRL-G_u* -CTRL-G U don't break undo with next left/right cursor *i_CTRL-G_U* - movement, if the cursor stays within the - same the line +CTRL-G u close undo sequence, start new change *i_CTRL-G_u* +CTRL-G U don't start a new undo block with the next *i_CTRL-G_U* + left/right cursor movement, if the cursor + stays within the same line ----------------------------------------------------------------------- The CTRL-O command sometimes has a side effect: If the cursor was beyond the @@ -411,8 +411,8 @@ that, with CTRL-O u. Another example: > :inoremap <CR> <C-]><C-G>u<CR> -This breaks undo at each line break. It also expands abbreviations before -this. +This starts a new undo block at each line break. It also expands +abbreviations before this. An example for using CTRL-G U: > @@ -426,9 +426,9 @@ An example for using CTRL-G U: > inoremap <expr> <End> repeat('<C-G>U<Right>', col('$') - col('.')) inoremap ( ()<C-G>U<Left> -This makes it possible to use the cursor keys in Insert mode, without breaking -the undo sequence and therefore using |.| (redo) will work as expected. -Also entering a text like (with the "(" mapping from above): +This makes it possible to use the cursor keys in Insert mode, without starting +a new undo block and therefore using |.| (redo) will work as expected. Also +entering a text like (with the "(" mapping from above): Lorem ipsum (dolor diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 51e823b75f..ae80935032 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -383,8 +383,8 @@ Note: <k1>, ..., <k9> and <kPoint> will not work. - Nvim supports mapping multibyte chars with modifiers such as `<M-ä>`. Which combinations actually work depends on the the UI or host terminal. -- When a key is pressed using a meta or alt modifier and no mapping exists - for that keypress, Nvim behaves as though <Esc> was pressed before the key. +- When a key is pressed using a meta or alt modifier and no mapping exists for + that keypress, Nvim may behave as though <Esc> was pressed before the key. - It is possible to notate combined modifiers (e.g. <C-A-T> for CTRL-ALT-T), but your terminal must encode the input for that to work. |tui-input| @@ -458,7 +458,7 @@ Ex mode Like Command-line mode, but after entering a command Terminal mode In Terminal mode all input (except CTRL-\) is sent to the process running in the current |terminal| buffer. If CTRL-\ is pressed, the next key is sent unless it - is CTRL-N (|CTRL-\_CTRL-N|). + is CTRL-N (|CTRL-\_CTRL-N|) or CTRL-O (|t_CTRL-\_CTRL-O|). If the 'showmode' option is on "-- TERMINAL --" is shown at the bottom of the window. @@ -550,7 +550,8 @@ Ex :vi -- -- -- -- -- *6 Go from Select mode to Insert mode by typing a printable character. The selection is deleted and the character is inserted. - *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N* + *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* + *v_CTRL-\_CTRL-N* *t_CTRL-\_CTRL-N* Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to Normal mode from any other mode. This can be used to make sure Vim is in Normal mode, without causing a beep like <Esc> would. However, this does not diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 78100d5277..11f96db8c9 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -412,6 +412,31 @@ For the format of the response message, see: For the format of the notification message, see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#notificationMessage + *on-list-handler* + +`on_list` receives a table with: + + - `items` table[], structured like |setqflist-what| + - `title` string, title for the list. + - `context` table|nil. `ctx` from |lsp-handler| + +This table can be used with vim.fn.setqflist or vim.fn.setloclist. E.g.: + + local function on_list(options) + vim.fn.setqflist({}, ' ', options) + vim.api.nvim_command('cfirst') + end + + vim.lsp.buf.definition{on_list=on_list} + vim.lsp.buf.references(nil, {on_list=on_list}) + +If you prefer loclist do something like this: + + local function on_list(options) + vim.fn.setloclist(0, {}, ' ', options) + vim.api.nvim_command('lopen') + end + ================================================================================ LSP HIGHLIGHT *lsp-highlight* @@ -1071,7 +1096,7 @@ code_action({options}) *vim.lsp.buf.code_action()* Parameters: ~ {options} (table|nil) Optional table which holds the following optional fields: - • context (table|nil): Corresponds to `CodeActionContext` of the LSP specification: + • context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification: • diagnostics (table|nil): LSP`Diagnostic[]` . Inferred from the current position if not provided. • only (table|nil): List of LSP @@ -1079,13 +1104,18 @@ code_action({options}) *vim.lsp.buf.code_action()* actions. Most language servers support values like `refactor` or `quickfix`. - • filter (function|nil): Predicate function - taking an `CodeAction` and returning a - boolean. - • apply (boolean|nil): When set to `true`, and + • filter: (function|nil) Predicate taking an + `CodeAction` and returning a boolean. + • apply: (boolean|nil) When set to `true`, and there is just one remaining action (after filtering), the action is applied without user query. + • range: (table|nil) Range for which code + actions should be requested. If in visual + mode this defaults to the active selection. + Table must contain `start` and `end` keys + with {row, col} tuples using mark-like + indexing. See |api-indexing| See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction @@ -1114,6 +1144,8 @@ declaration({options}) *vim.lsp.buf.declaration()* {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. + • on_list: (function) handler for list results. + See |on-list-handler| definition({options}) *vim.lsp.buf.definition()* Jumps to the definition of the symbol under the cursor. @@ -1122,6 +1154,8 @@ definition({options}) *vim.lsp.buf.definition()* {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. + • on_list: (function) handler for list results. + See |on-list-handler| document_highlight() *vim.lsp.buf.document_highlight()* Send request to the server to resolve document highlights for @@ -1139,10 +1173,15 @@ document_highlight() *vim.lsp.buf.document_highlight()* to see the actual highlights. |LspReferenceText| |LspReferenceRead| |LspReferenceWrite| -document_symbol() *vim.lsp.buf.document_symbol()* +document_symbol({options}) *vim.lsp.buf.document_symbol()* Lists all symbols in the current buffer in the quickfix window. + Parameters: ~ + {options} (table|nil) additional options + • on_list: (function) handler for list results. + See |on-list-handler| + execute_command({command_params}) *vim.lsp.buf.execute_command()* Executes an LSP server command. @@ -1163,32 +1202,33 @@ format({options}) *vim.lsp.buf.format()* • formatting_options (table|nil): Can be used to specify FormattingOptions. Some unspecified options will be automatically - derived from the current Neovim options. - - See also: ~ - https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting - • timeout_ms (integer|nil, default 1000): Time in - milliseconds to block for formatting requests. No effect - if async=true - • bufnr (number|nil): Restrict formatting to the clients - attached to the given buffer, defaults to the current - buffer (0). - • filter (function|nil): Predicate used to filter clients. - Receives a client as argument and must return a boolean. - Clients matching the predicate are included. Example: • > + derived from the current Neovim options. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions + • timeout_ms (integer|nil, default 1000): Time + in milliseconds to block for formatting + requests. No effect if async=true + • bufnr (number|nil): Restrict formatting to + the clients attached to the given buffer, + defaults to the current buffer (0). + • filter (function|nil): Predicate used to + filter clients. Receives a client as argument + and must return a boolean. Clients matching + the predicate are included. Example: • > -- Never request typescript-language-server for formatting vim.lsp.buf.format { filter = function(client) return client.name ~= "tsserver" end } < - • async boolean|nil If true the method won't block. - Defaults to false. Editing the buffer while formatting - asynchronous can lead to unexpected changes. - • id (number|nil): Restrict formatting to the client with - ID (client.id) matching this field. - • name (string|nil): Restrict formatting to the client - with name (client.name) matching this field. + • async boolean|nil If true the method won't + block. Defaults to false. Editing the buffer + while formatting asynchronous can lead to + unexpected changes. + • id (number|nil): Restrict formatting to the + client with ID (client.id) matching this + field. + • name (string|nil): Restrict formatting to the + client with name (client.name) matching this + field. formatting({options}) *vim.lsp.buf.formatting()* Formats the current buffer. @@ -1251,10 +1291,15 @@ hover() *vim.lsp.buf.hover()* in a floating window. Calling the function twice will jump into the floating window. -implementation() *vim.lsp.buf.implementation()* +implementation({options}) *vim.lsp.buf.implementation()* Lists all the implementations for the symbol under the cursor in the quickfix window. + Parameters: ~ + {options} (table|nil) additional options + • on_list: (function) handler for list results. + See |on-list-handler| + incoming_calls() *vim.lsp.buf.incoming_calls()* Lists all the call sites of the symbol under the cursor in the |quickfix| window. If the symbol can resolve to multiple @@ -1300,12 +1345,15 @@ range_formatting({options}, {start_pos}, {end_pos}) position. Defaults to the end of the last visual selection. -references({context}) *vim.lsp.buf.references()* +references({context}, {options}) *vim.lsp.buf.references()* Lists all the references to the symbol under the cursor in the quickfix window. Parameters: ~ {context} (table) Context for the request + {options} (table|nil) additional options + • on_list: (function) handler for list results. + See |on-list-handler| See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references @@ -1351,8 +1399,10 @@ type_definition({options}) *vim.lsp.buf.type_definition()* {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. + • on_list: (function) handler for list results. + See |on-list-handler| -workspace_symbol({query}) *vim.lsp.buf.workspace_symbol()* +workspace_symbol({query}, {options}) *vim.lsp.buf.workspace_symbol()* Lists all symbols in the current workspace in the quickfix window. @@ -1362,7 +1412,10 @@ workspace_symbol({query}) *vim.lsp.buf.workspace_symbol()* done. Parameters: ~ - {query} (string, optional) + {query} (string, optional) + {options} (table|nil) additional options + • on_list: (function) handler for list results. + See |on-list-handler| ============================================================================== @@ -1559,7 +1612,7 @@ character_offset({buf}, {row}, {col}, {offset_encoding}) certain buffer. Parameters: ~ - {buf} buffer id (0 for current) + {buf} (number) buffer number (0 for current) {row} 0-indexed line {col} 0-indexed byte offset in line {offset_encoding} (string) utf-8|utf-16|utf-32|nil @@ -1721,17 +1774,17 @@ make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding}) that is similar to |vim.lsp.util.make_range_params()|. Parameters: ~ - {start_pos} ({number, number}, optional) - mark-indexed position. Defaults to the - start of the last visual selection. - {end_pos} ({number, number}, optional) - mark-indexed position. Defaults to the - end of the last visual selection. - {bufnr} (optional, number): buffer handle or 0 - for current, defaults to current - {offset_encoding} (string) utf-8|utf-16|utf-32|nil - defaults to `offset_encoding` of first - client of `bufnr` + {start_pos} number[]|nil {row, col} mark-indexed + position. Defaults to the start of the + last visual selection. + {end_pos} number[]|nil {row, col} mark-indexed + position. Defaults to the end of the + last visual selection. + {bufnr} (number|nil) buffer handle or 0 for + current, defaults to current + {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults + to `offset_encoding` of first client of + `bufnr` Return: ~ { textDocument = { uri = `current_file_uri` }, range = { @@ -1743,8 +1796,8 @@ make_position_params({window}, {offset_encoding}) buffer and cursor position. Parameters: ~ - {window} (optional, number): window handle or 0 - for current, defaults to current + {window} number|nil: window handle or 0 for + current, defaults to current {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of buffer of `window` @@ -1764,11 +1817,11 @@ make_range_params({window}, {offset_encoding}) `textDocument/rangeFormatting`. Parameters: ~ - {window} (optional, number): window handle or 0 - for current, defaults to current - {offset_encoding} (string) utf-8|utf-16|utf-32|nil - defaults to `offset_encoding` of first - client of buffer of `window` + {window} number|nil: window handle or 0 for + current, defaults to current + {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults + to `offset_encoding` of first client of + buffer of `window` Return: ~ { textDocument = { uri = `current_file_uri` }, range = { @@ -1780,8 +1833,7 @@ make_text_document_params({bufnr}) buffer. Parameters: ~ - {bufnr} (optional, number): Buffer handle, defaults to - current + {bufnr} number|nil: Buffer handle, defaults to current Return: ~ `TextDocumentIdentifier` diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 089cf0ce9d..4062a35735 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -704,7 +704,7 @@ regex:match_str({str}) *regex:match_str()* As any integer is truth-y, `regex:match()` can be directly used as a condition in an if-statement. -regex:match_line({bufnr}, {line_idx}[, {start}, {end}]) *regex:match_line()* +regex:match_line({bufnr}, {line_idx} [, {start}, {end}]) *regex:match_line()* Match line {line_idx} (zero-based) in buffer {bufnr}. If {start} and {end} are supplied, match only this byte index range. Otherwise see |regex:match_str()|. If {start} is used, then the returned byte @@ -855,13 +855,13 @@ vim.empty_dict() *vim.empty_dict()* Note: If numeric keys are present in the table, Nvim ignores the metatable marker and converts the dict to a list/array anyway. -vim.rpcnotify({channel}, {method}[, {args}...]) *vim.rpcnotify()* +vim.rpcnotify({channel}, {method} [, {args}...]) *vim.rpcnotify()* Sends {event} to {channel} via |RPC| and returns immediately. If {channel} is 0, the event is broadcast to all channels. This function also works in a fast callback |lua-loop-callbacks|. -vim.rpcrequest({channel}, {method}[, {args}...]) *vim.rpcrequest()* +vim.rpcrequest({channel}, {method} [, {args}...]) *vim.rpcrequest()* Sends a request to {channel} to invoke {method} via |RPC| and blocks until a response is received. @@ -873,7 +873,7 @@ vim.stricmp({a}, {b}) *vim.stricmp()* are equal, {a} is greater than {b} or {a} is lesser than {b}, respectively. -vim.str_utfindex({str}[, {index}]) *vim.str_utfindex()* +vim.str_utfindex({str} [, {index}]) *vim.str_utfindex()* Convert byte index to UTF-32 and UTF-16 indices. If {index} is not supplied, the length of the string is used. All indices are zero-based. Returns two values: the UTF-32 and UTF-16 indices respectively. @@ -883,7 +883,7 @@ vim.str_utfindex({str}[, {index}]) *vim.str_utfindex()* point each. An {index} in the middle of a UTF-8 sequence is rounded upwards to the end of that sequence. -vim.str_byteindex({str}, {index}[, {use_utf16}]) *vim.str_byteindex()* +vim.str_byteindex({str}, {index} [, {use_utf16}]) *vim.str_byteindex()* Convert UTF-32 or UTF-16 {index} to byte index. If {use_utf16} is not supplied, it defaults to false (use UTF-32). Returns the byte index. @@ -1291,6 +1291,9 @@ Lua module: vim *lua-vim* cmd({command}) *vim.cmd()* Execute Vim script commands. + Note that `vim.cmd` can be indexed with a command name to + return a callable function to the command. + Example: > vim.cmd('echo 42') @@ -1300,7 +1303,23 @@ cmd({command}) *vim.cmd()* autocmd FileType c setlocal cindent augroup END ]]) - vim.cmd({ cmd = 'echo', args = { '"foo"' } }) + + -- Ex command :echo "foo" + -- Note string literals need to be double quoted. + vim.cmd('echo "foo"') + vim.cmd { cmd = 'echo', args = { '"foo"' } } + vim.cmd.echo({ args = { '"foo"' } }) + vim.cmd.echo('"foo"') + + -- Ex command :write! myfile.txt + vim.cmd('write! myfile.txt') + vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true } + vim.cmd.write { args = { "myfile.txt" }, bang = true } + vim.cmd.write { "myfile.txt", bang = true } + + -- Ex command :colorscheme blue + vim.cmd('colorscheme blue') + vim.cmd.colorscheme('blue') < Parameters: ~ @@ -2029,30 +2048,30 @@ add({filetypes}) *vim.filetype.add()* vim.filetype.add({ extension = { - foo = "fooscript", + foo = 'fooscript', bar = function(path, bufnr) if some_condition() then - return "barscript", function(bufnr) + return 'barscript', function(bufnr) -- Set a buffer variable vim.b[bufnr].barscript_version = 2 end end - return "bar" + return 'bar' end, }, filename = { - [".foorc"] = "toml", - ["/etc/foo/config"] = "toml", + ['.foorc'] = 'toml', + ['/etc/foo/config'] = 'toml', }, pattern = { - [".*‍/etc/foo/.*"] = "fooscript", + ['.*/etc/foo/.*'] = 'fooscript', -- Using an optional priority - [".*‍/etc/foo/.*%.conf"] = { "dosini", { priority = 10 } }, - ["README.(%a+)$"] = function(path, bufnr, ext) - if ext == "md" then - return "markdown" - elseif ext == "rst" then - return "rst" + ['.*/etc/foo/.*%.conf'] = { 'dosini', { priority = 10 } }, + ['README.(a+)$'] = function(path, bufnr, ext) + if ext == 'md' then + return 'markdown' + elseif ext == 'rst' then + return 'rst' end end, }, @@ -2068,9 +2087,9 @@ add({filetypes}) *vim.filetype.add()* priority = -math.huge, function(path, bufnr) local content = vim.filetype.getlines(bufnr, 1) - if vim.filetype.matchregex(content, { [[^#!.*\<mine\>]] }) then + if vim.filetype.matchregex(content, [[^#!.*\<mine\>]]) then return 'mine' - elseif vim.filetype.matchregex(content, { [[\<drawing\>]] }) then + elseif vim.filetype.matchregex(content, [[\<drawing\>]]) then return 'drawing' end end, @@ -2199,9 +2218,7 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()* create mapping on multiple modes. {lhs} (string) Left-hand side |{lhs}| of the mapping. {rhs} string|function Right-hand side |{rhs}| of the - mapping. Can also be a Lua function. If a Lua - function and `opts.expr == true`, returning `nil` - is equivalent to an empty string. + mapping. Can also be a Lua function. {opts} (table) A table of |:map-arguments| such as "silent". In addition to the options listed in |nvim_set_keymap()|, this table also accepts the @@ -2209,13 +2226,11 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()* • buffer: (number or boolean) Add a mapping to the given buffer. When "true" or 0, use the current buffer. - • replace_keycodes: (boolean, default true) When - both this and expr is "true", - |nvim_replace_termcodes()| is applied to the - result of Lua expr maps. • remap: (boolean) Make the mapping recursive. This is the inverse of the "noremap" option from |nvim_set_keymap()|. Default `false`. + • replace_keycodes: (boolean) defaults to true if + "expr" is true. See also: ~ |nvim_set_keymap()| diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 7e94167e07..1e1f4e46af 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -610,19 +610,20 @@ two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then or otherwise it would be impossible to type the á character. *<Leader>* *mapleader* -To define a mapping which uses the "mapleader" variable, the special string -"<Leader>" can be used. It is replaced with the string value of "mapleader". -If "mapleader" is not set or empty, a backslash is used instead. Example: > - :map <Leader>A oanother line<Esc> +To define a mapping which uses the "g:mapleader" variable, the special string +"<Leader>" can be used. It is replaced with the string value of +"g:mapleader". If "g:mapleader" is not set or empty, a backslash is used +instead. Example: > + map <Leader>A oanother line<Esc> Works like: > - :map \A oanother line<Esc> -But after: > - :let mapleader = "," + map \A oanother line<Esc> +But after: + let mapleader = "," It works like: > - :map ,A oanother line<Esc> + map ,A oanother line<Esc> -Note that the value of "mapleader" is used at the moment the mapping is -defined. Changing "mapleader" after that has no effect for already defined +Note that the value of "g:mapleader" is used at the moment the mapping is +defined. Changing "g:mapleader" after that has no effect for already defined mappings. *<LocalLeader>* *maplocalleader* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index a7be9ff98f..546f92e92f 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -47,8 +47,10 @@ Input *terminal-input* To send input, enter |Terminal-mode| with |i|, |I|, |a|, |A| or |:startinsert|. In this mode all keys except <C-\> are sent to the underlying -program. If <C-\> is pressed, the next key is sent unless it is <C-N>. Use -<C-\><C-N> to return to normal-mode. |CTRL-\_CTRL-N| +program. If <C-\> is pressed, the next key is sent unless it is <C-N> or <C-O>. +Use <C-\><C-N> to return to normal mode. |CTRL-\_CTRL-N| +Use <C-\><C-O> to execute one normal mode command and then return to terminal +mode. *t_CTRL-\_CTRL-O* Terminal-mode forces these local options: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index eda596bf71..279f0878f1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1314,14 +1314,14 @@ A jump table for the options with a short description can be found at |Q_op|. *'cmdheight'* *'ch'* 'cmdheight' 'ch' number (default 1) - global + global or local to tab page Number of screen lines to use for the command-line. Helps avoiding |hit-enter| prompts. The value of this option is stored with the tab page, so that each tab page can have a different value. - When 'cmdheight' is zero, it disables echo area and all outputs need - |hit-enter| prompt. + When 'cmdheight' is zero, there is no command-line unless it is being + used. Any messages will cause the |hit-enter| prompt. *'cmdwinheight'* *'cwh'* 'cmdwinheight' 'cwh' number (default 7) @@ -3575,7 +3575,7 @@ A jump table for the options with a short description can be found at |Q_op|. help. (Note that previously setting the global option to the empty value did this, which is now deprecated.) When the first character is ":", the command is invoked as a Vim - command prefixed with [count]. + Ex command prefixed with [count]. When "man" or "man -s" is used, Vim will automatically translate a [count] for the "K" command to a section number. See |option-backslash| about including spaces and backslashes. @@ -4214,14 +4214,14 @@ A jump table for the options with a short description can be found at |Q_op|. The 'mousemodel' option is set by the |:behave| command. - *mousescroll* + *'mousescroll'* 'mousescroll' string (default "ver:3,hor:6") global This option controls the number of lines / columns to scroll by when scrolling with a mouse. The option is a comma separated list of parts. Each part consists of a direction and a count as follows: direction:count,direction:count - Direction is one of either "hor" or "ver", "hor" controls horizontal + Direction is one of either "hor" or "ver". "hor" controls horizontal scrolling and "ver" controls vertical scrolling. Count sets the amount to scroll by for the given direction, it should be a non negative integer. Each direction should be set at most once. If a direction @@ -4854,7 +4854,7 @@ A jump table for the options with a short description can be found at |Q_op|. If 'rulerformat' is set, it will determine the contents of the ruler. Each window has its own ruler. If a window has a status line, the ruler is shown there. If a window doesn't have a status line and - 'cmdheight' is 0, the ruler is not shown. Otherwise it is shown in + 'cmdheight' is zero, the ruler is not shown. Otherwise it is shown in the last line of the screen. If the statusline is given by 'statusline' (i.e. not empty), this option takes precedence over 'ruler' and 'rulerformat'. @@ -5116,7 +5116,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'sessionoptions'* *'ssop'* 'sessionoptions' 'ssop' string (default: "blank,buffers,curdir,folds, - help,tabpages,winsize") + help,tabpages,winsize,terminal") global Changes the effect of the |:mksession| command. It is a comma- separated list of words. Each word enables saving and restoring @@ -5563,7 +5563,7 @@ A jump table for the options with a short description can be found at |Q_op|. global Show (partial) command in the last line of the screen. Set this option off if your terminal is slow. - The option is disabled if 'cmdheight' is 0. + The option has no effect when 'cmdheight' is zero. In Visual mode the size of the selected area is shown: - When selecting characters within a line, the number of characters. If the number of bytes is different it is also displayed: "2-6" @@ -5610,7 +5610,7 @@ A jump table for the options with a short description can be found at |Q_op|. global If in Insert, Replace or Visual mode put a message on the last line. The |hl-ModeMsg| highlight group determines the highlighting. - The option is disabled if 'cmdheight' is 0. + The option has no effect when 'cmdheight' is zero. *'showtabline'* *'stal'* 'showtabline' 'stal' number (default 1) diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 6f7b53722c..1eaa76264f 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3917,7 +3917,7 @@ netrw: * Installed |g:netrw_clipboard| setting * Installed option bypass for |'guioptions'| a/A settings - * Changed popup_beval() to |popup_atcursor|() + * Changed popup_beval() to |popup_atcursor()| in netrw#ErrorMsg (lacygoill). Apparently popup_beval doesn't reliably close the popup when the mouse is moved. diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index bc45b0e511..23d5905ec3 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -92,7 +92,7 @@ zuW *zuG* *zuW* zuG Undo |zW| and |zG|, remove the word from the internal word list. Count used as with |zg|. - *:spe* *:spellgood* + *:spe* *:spellgood* *E1280* :[count]spe[llgood] {word} Add {word} as a good word to 'spellfile', like with |zg|. Without count the first name is used, with a diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 67f24103cd..98ab60c7e7 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -108,13 +108,13 @@ change again. But you can do something like this: > After this a "u" command will undo the delete command and the previous change. - *undo-break* -To do the opposite, break a change into two undo blocks, in Insert mode use -CTRL-G u. This is useful if you want an insert command to be undoable in + *undo-break* *undo-close-block* +To do the opposite, use a new undo block for the next change, in Insert mode +use CTRL-G u. This is useful if you want an insert command to be undoable in parts. E.g., for each sentence. |i_CTRL-G_u| -Setting the value of 'undolevels' also breaks undo. Even when the new value -is equal to the old value: > +Setting the value of 'undolevels' also closes the undo block. Even when the +new value is equal to the old value: > let &undolevels = &undolevels ============================================================================== diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index b99e0fb482..8eda33b4f0 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -135,7 +135,6 @@ You could also write your own color scheme. This is how you do it: 2. Edit the color scheme file. These entries are useful: - term attributes in a B&W terminal cterm attributes in a color terminal ctermfg foreground color in a color terminal ctermbg background color in a color terminal diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 9eb6470962..cae9c76030 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -239,7 +239,8 @@ g8 Print the hex values of the bytes used in the Type |i| to enter |Terminal-mode|, then keys are sent to the job running in the terminal. Type <C-\><C-N> to - leave Terminal-mode. |CTRL-\_CTRL-N| + leave Terminal-mode. |CTRL-\_CTRL-N|. Type <C-\><C-O> + to execute a single normal mode command |t_CTRL-\_CTRL-O| Fails if changes have been made to the current buffer, unless 'hidden' is set. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index a74149d050..27c953a460 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -250,7 +250,7 @@ Input/Mappings: <M-1>, <M-BS>, <M-Del>, <M-Ins>, <M-/>, <M-\>, <M-Space>, <M-Enter>, etc. Case-sensitive: <M-a> and <M-A> are two different keycodes. - ALT behaves like <Esc> if not mapped. |i_ALT| |v_ALT| |c_ALT| + ALT may behave like <Esc> if not mapped. |i_ALT| |v_ALT| |c_ALT| Normal commands: |gO| shows a filetype-defined "outline" of the current buffer. diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index 905ae49887..5383ea4f72 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -161,9 +161,10 @@ If you want to highlight exactly the same area as the last time, you can use *v_<Esc>* <Esc> In Visual mode: Stop Visual mode. *v_META* *v_ALT* - ALT (|META|) acts like <Esc> if the chord is not mapped. + ALT (|META|) may act like <Esc> if the chord is not mapped. For example <A-x> acts like <Esc>x if <A-x> does not have a visual-mode mapping. + *v_CTRL-C* CTRL-C In Visual mode: Stop Visual mode. When insert mode is pending (the mode message shows |