diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/api.txt | 106 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 9 | ||||
-rw-r--r-- | runtime/doc/change.txt | 4 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 64 | ||||
-rw-r--r-- | runtime/doc/if_ruby.txt | 12 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 35 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 7 | ||||
-rw-r--r-- | runtime/doc/map.txt | 20 | ||||
-rw-r--r-- | runtime/doc/quickfix.txt | 7 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 3 |
10 files changed, 221 insertions, 46 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index b80ca9edd7..0c726ddd86 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -529,14 +529,6 @@ nvim__id_float({flt}) *nvim__id_float()* nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()* TODO: Documentation - *nvim__put_attr()* -nvim__put_attr({id}, {start_row}, {start_col}, {end_row}, {end_col}) - Set attrs in nvim__buf_set_lua_hl callbacks - - TODO(bfredl): This is rather pedestrian. The final interface - should probably be derived from a reformed bufhl/virttext - interface with full support for multi-line ranges etc - nvim__screenshot({path}) *nvim__screenshot()* TODO: Documentation @@ -1480,6 +1472,53 @@ nvim_set_current_win({window}) *nvim_set_current_win()* Parameters: ~ {window} Window handle + *nvim_set_decoration_provider()* +nvim_set_decoration_provider({ns_id}, {opts}) + Set or change decoration provider for a namespace + + This is a very general purpose interface for having lua + callbacks being triggered during the redraw code. + + The expected usage is to set extmarks for the currently + redrawn buffer. |nvim_buf_set_extmark| can be called to add + marks on a per-window or per-lines basis. Use the `ephemeral` + key to only use the mark for the current screen redraw (the + callback will be called again for the next redraw ). + + Note: this function should not be called often. Rather, the + callbacks themselves can be used to throttle unneeded + callbacks. the `on_start` callback can return `false` to + disable the provider until the next redraw. Similarily, return + `false` in `on_win` will skip the `on_lines` calls for that + window (but any extmarks set in `on_win` will still be used). + A plugin managing multiple sources of decorations should + ideally only set one provider, and merge the sources + internally. You can use multiple `ns_id` for the extmarks + set/modified inside the callback anyway. + + Note: doing anything other than setting extmarks is considered + experimental. Doing things like changing options are not + expliticly forbidden, but is likely to have unexpected + consequences (such as 100% CPU consumption). doing + `vim.rpcnotify` should be OK, but `vim.rpcrequest` is quite + dubious for the moment. + + Parameters: ~ + {ns_id} Namespace id from |nvim_create_namespace()| + {opts} Callbacks invoked during redraw: + • on_start: called first on each screen redraw + ["start", tick] + • on_buf: called for each buffer being redrawn + (before window callbacks) ["buf", bufnr, tick] + • on_win: called when starting to redraw a + specific window. ["win", winid, bufnr, topline, + botline_guess] + • on_line: called for each buffer line being + redrawn. (The interation with fold lines is + subject to change) ["win", winid, bufnr, row] + • on_end: called at the end of a redraw cycle + ["end", tick] + nvim_set_keymap({mode}, {lhs}, {rhs}, {opts}) *nvim_set_keymap()* Sets a global |mapping| for the given mode. @@ -1575,18 +1614,6 @@ to check whether a buffer is loaded. nvim__buf_redraw_range({buffer}, {first}, {last}) TODO: Documentation -nvim__buf_set_luahl({buffer}, {opts}) *nvim__buf_set_luahl()* - Unstabilized interface for defining syntax hl in lua. - - This is not yet safe for general use, lua callbacks will need - to be restricted, like textlock and probably other stuff. - - The API on_line/nvim__put_attr is quite raw and not intended - to be the final shape. Ideally this should operate on chunks - larger than a single line to reduce interpreter overhead, and - generate annotation objects (bufhl/virttext) on the fly but - using the same representation. - nvim__buf_stats({buffer}) *nvim__buf_stats()* TODO: Documentation @@ -1690,6 +1717,29 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* |nvim_buf_detach()| |api-buffer-updates-lua| +nvim_buf_call({buffer}, {fun}) *nvim_buf_call()* + call a function with buffer as temporary current buffer + + This temporarily switches current buffer to "buffer". If the + current window already shows "buffer", the window is not + switched If a window inside the current tabpage (including a + float) already shows the buffer One of these windows will be + set as current window temporarily. Otherwise a temporary + scratch window (calleed the "autocmd window" for historical + reasons) will be used. + + This is useful e.g. to call vimL functions that only work with + the current buffer/window currently, like |termopen()|. + + Parameters: ~ + {buffer} Buffer handle, or 0 for current buffer + {fun} Function to call inside the buffer (currently + lua callable only) + + Return: ~ + Return value of function. NB: will deepcopy lua values + currently, use upvalues to send lua references in and out. + *nvim_buf_clear_namespace()* nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end}) Clears namespaced objects (highlights, extmarks, virtual text) @@ -1733,6 +1783,17 @@ nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()* {buffer} Buffer handle, or 0 for current buffer {name} Variable name +nvim_buf_delete({buffer}, {opts}) *nvim_buf_delete()* + Deletes the buffer. See |:bwipeout| + + Parameters: ~ + {buffer} Buffer handle, or 0 for current buffer + {opts} Optional parameters. Keys: + • force: Force deletion and ignore unsaved + changes. + • unload: Unloaded only, do not delete. See + |:bunload| + nvim_buf_detach({buffer}) *nvim_buf_detach()* Deactivates buffer-update events on the channel. @@ -1986,6 +2047,11 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts}) • hl_group : name of the highlight group used to highlight this mark. • virt_text : virtual text to link to this mark. + • ephemeral : for use with + |nvim_set_decoration_provider| callbacks. The + mark will only be used for the current redraw + cycle, and not be permantently stored in the + buffer. Return: ~ Id of the created/updated extmark diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index a6872d0af5..a728593c40 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -700,9 +700,14 @@ InsertEnter Just before starting Insert mode. Also for The cursor is restored afterwards. If you do not want that set |v:char| to a non-empty string. + *InsertLeavePre* +InsertLeavePre Just before leaving Insert mode. Also when + using CTRL-O |i_CTRL-O|. Be caseful not to + change mode or use `:normal`, it will likely + cause trouble. *InsertLeave* -InsertLeave When leaving Insert mode. Also when using - CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. +InsertLeave Just after leaving Insert mode. Also when + using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. *MenuPopup* MenuPopup Just before showing the popup menu (under the right mouse button). Useful for adjusting the diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index dcebbc524c..5c67359002 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1615,6 +1615,10 @@ B When joining lines, don't insert a space between two multi-byte characters. Overruled by the 'M' flag. 1 Don't break a line after a one-letter word. It's broken before it instead (if possible). +] Respect textwidth rigorously. With this flag set, no line can be + longer than textwidth, unless line-break-prohibition rules make this + impossible. Mainly for CJK scripts and works only if 'encoding' is + "utf-8". j Where it makes sense, remove a comment leader when joining lines. For example, joining: int i; // the index ~ diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 0f848d0c27..800de63a55 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2336,6 +2336,7 @@ repeat({expr}, {count}) String repeat {expr} {count} times resolve({filename}) String get filename a shortcut points to reverse({list}) List reverse {list} in-place round({expr}) Float round off {expr} +rubyeval({expr}) any evaluate |Ruby| expression rpcnotify({channel}, {event}[, {args}...]) Sends an |RPC| notification to {channel} rpcrequest({channel}, {method}[, {args}...]) @@ -2468,7 +2469,8 @@ tolower({expr}) String the String {expr} switched to lowercase toupper({expr}) String the String {expr} switched to uppercase tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} to chars in {tostr} -trim({text} [, {mask}]) String trim characters in {mask} from {text} +trim({text} [, {mask} [, {dir}]]) + String trim characters in {mask} from {text} trunc({expr}) Float truncate Float {expr} type({name}) Number type of variable {name} undofile({name}) String undo file name for {name} @@ -3839,7 +3841,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* stuck, waiting for a character to be typed before the script continues. Note that if you manage to call feedkeys() while - executing commands, thus calling it recursively, the + executing commands, thus calling it recursively, then all typehead will be consumed by the last call. '!' When used with 'x' will not end Insert mode. Can be used in a test when a timer is set to exit Insert mode @@ -4642,7 +4644,7 @@ getloclist({nr},[, {what}]) *getloclist()* If {what} contains 'filewinid', then returns the id of the window used to display files from the location list. This field is applicable only when called from a location list - window. + window. See |location-list-file-window| for more details. getmatches([{win}]) *getmatches()* Returns a |List| with all matches previously defined for the @@ -4733,7 +4735,9 @@ getqflist([{what}]) *getqflist()* id get information for the quickfix list with |quickfix-ID|; zero means the id for the current list or the list specified by "nr" - idx index of the current entry in the list + idx index of the current entry in the quickfix + list specified by 'id' or 'nr'. + See |quickfix-index| items quickfix list entries lines parse a list of lines using 'efm' and return the resulting entries. Only a |List| type is @@ -4926,6 +4930,19 @@ getwinpos([{timeout}]) *getwinpos()* {timeout} can be used to specify how long to wait in msec for a response from the terminal. When omitted 100 msec is used. + Use a longer time for a remote terminal. + When using a value less than 10 and no response is received + within that time, a previously reported position is returned, + if available. This can be used to poll for the position and + do some work in the meantime: > + while 1 + let res = getwinpos(1) + if res[0] >= 0 + break + endif + " Do some work here + endwhile +< *getwinposx()* getwinposx() The result is a Number, which is the X coordinate in pixels of the left hand side of the GUI Vim window. The result will be @@ -6263,6 +6280,7 @@ mode([expr]) Return a string that indicates the current mode. nov Operator-pending (forced charwise |o_v|) noV Operator-pending (forced linewise |o_V|) noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|) + CTRL-V is one character niI Normal using |i_CTRL-O| in |Insert-mode| niR Normal using |i_CTRL-O| in |Replace-mode| niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| @@ -7053,6 +7071,17 @@ rpcstart({prog}[, {argv}]) *rpcstart()* < with > :let id = jobstart(['prog', 'arg1', 'arg2'], {'rpc': v:true}) +rubyeval({expr}) *rubyeval()* + Evaluate Ruby expression {expr} and return its result + converted to Vim data structures. + Numbers, floats and strings are returned as they are (strings + are copied though). + Arrays are represented as Vim |List| type. + Hashes are represented as Vim |Dictionary| type. + Other objects are represented as strings resulted from their + "Object#to_s" method. + {only available when compiled with the |+ruby| feature} + screenattr({row}, {col}) *screenattr()* Like |screenchar()|, but return the attribute. This is a rather arbitrary number that can only be used to compare to the @@ -7622,16 +7651,22 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* efm errorformat to use when parsing text from "lines". If this is not present, then the 'errorformat' option value is used. + See |quickfix-parse| id quickfix list identifier |quickfix-ID| + idx index of the current entry in the quickfix + list specified by 'id' or 'nr'. If set to '$', + then the last entry in the list is set as the + current entry. See |quickfix-index| items list of quickfix entries. Same as the {list} argument. lines use 'errorformat' to parse a list of lines and add the resulting entries to the quickfix list {nr} or {id}. Only a |List| value is supported. + See |quickfix-parse| nr list number in the quickfix stack; zero means the current quickfix list and "$" means - the last quickfix list - title quickfix list title text + the last quickfix list. + title quickfix list title text. See |quickfix-title| Unsupported keys in {what} are ignored. If the "nr" item is not present, then the current quickfix list is modified. When creating a new quickfix list, "nr" can be @@ -9015,21 +9050,28 @@ tr({src}, {fromstr}, {tostr}) *tr()* echo tr("<blob>", "<>", "{}") < returns "{blob}" -trim({text} [, {mask}]) *trim()* +trim({text} [, {mask} [, {dir}]]) *trim()* Return {text} as a String where any character in {mask} is - removed from the beginning and end of {text}. + removed from the beginning and/or end of {text}. If {mask} is not given, {mask} is all characters up to 0x20, which includes Tab, space, NL and CR, plus the non-breaking space character 0xa0. - This code deals with multibyte characters properly. - + The optional {dir} argument specifies where to remove the + characters: + 0 remove from the beginning and end of {text} + 1 remove only at the beginning of {text} + 2 remove only at the end of {text} + When omitted both ends are trimmed. + This function deals with multibyte characters properly. Examples: > echo trim(" some text ") < returns "some text" > echo trim(" \r\t\t\r RESERVE \t\n\x0B\xA0") . "_TAIL" < returns "RESERVE_TAIL" > echo trim("rm<Xrm<>X>rrm", "rm<>") -< returns "Xrm<>X" (characters in the middle are not removed) +< returns "Xrm<>X" (characters in the middle are not removed) > + echo trim(" vim ", " ", 2) +< returns " vim" trunc({expr}) *trunc()* Return the largest integral value with magnitude less than or diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index 6468e4c81e..c8d2409549 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -136,7 +136,7 @@ self[{n}] Returns the buffer object for the number {n}. The first number Methods: -name Returns the name of the buffer. +name Returns the full name of the buffer. number Returns the number of the buffer. count Returns the number of lines. length Returns the number of lines. @@ -172,6 +172,7 @@ height = {n} Sets the window height to {n}. width Returns the width of the window. width = {n} Sets the window width to {n}. cursor Returns a [row, col] array for the cursor position. + First line number is 1 and first column number is 0. cursor = [{row}, {col}] Sets the cursor position to {row} and {col}. @@ -184,4 +185,13 @@ $curwin The current window object. $curbuf The current buffer object. ============================================================================== +6. rubyeval() Vim function *ruby-rubyeval* + +To facilitate bi-directional interface, you can use |rubyeval()| function to +evaluate Ruby expressions and pass their values to Vim script. + +The Ruby value "true", "false" and "nil" are converted to v:true, v:false and +v:null, respectively. + +============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 44b611c2cf..33d65406a1 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -488,8 +488,8 @@ get_active_clients() *vim.lsp.get_active_clients()* Table of |vim.lsp.client| objects get_client_by_id({client_id}) *vim.lsp.get_client_by_id()* - Gets an active client by id, or nil if the id is invalid or - the client is not yet initialized. + Gets a client by id, or nil if the id is invalid. + The returned client may not yet be fully initialized. Parameters: ~ {client_id} client id number @@ -792,6 +792,20 @@ outgoing_calls() *vim.lsp.buf.outgoing_calls()* cursor in the |quickfix| window. If the symbol can resolve to multiple items, the user can pick one in the |inputlist|. + *vim.lsp.buf.range_code_action()* +range_code_action({context}, {start_pos}, {end_pos}) + Performs |vim.lsp.buf.code_action()| for a given range. + + Parameters: ~ + {context} (table, optional) Valid `CodeActionContext` + object + {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. + *vim.lsp.buf.range_formatting()* range_formatting({options}, {start_pos}, {end_pos}) Formats a given range. @@ -1285,6 +1299,23 @@ make_formatting_params({options}) See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + *vim.lsp.util.make_given_range_params()* +make_given_range_params({start_pos}, {end_pos}) + Using the given range in the current buffer, creates an object + 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. + + Return: ~ + { textDocument = { uri = `current_file_uri` }, range = { + start = `start_position` , end = `end_position` } } + make_position_params() *vim.lsp.util.make_position_params()* Creates a `TextDocumentPositionParams` object for the current buffer and cursor position. diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a53024d420..334bb33c1e 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1031,6 +1031,9 @@ is_callable({f}) *vim.is_callable()* Return: ~ true if `f` is callable, else false +is_valid({opt}) *vim.is_valid()* + TODO: Documentation + list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()* Extends a list-like table with the values of another list-like table. @@ -1286,7 +1289,9 @@ validate({opt}) *vim.validate()* • arg_value: argument value • fn: any function accepting one argument, returns true if and only if the argument is - valid + valid. Can optionally return an additional + informative error message as the second + returned value. • msg: (optional) error string if validation fails diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 1514f03c55..edec4a8de7 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1136,9 +1136,10 @@ scripts. :com[mand] *:com* *:command* List all user-defined commands. When listing commands, - the characters in the first two columns are + the characters in the first columns are: ! Command has the -bang attribute " Command has the -register attribute + | Command has the -bar attribute b Command is local to current buffer (see below for details on attributes) The list can be filtered on command name with @@ -1342,14 +1343,15 @@ It is possible that the special characters in the range like `.`, `$` or `%` which by default correspond to the current line, last line and the whole buffer, relate to arguments, (loaded) buffers, windows or tab pages. -Possible values are: - -addr=lines Range of lines (this is the default) - -addr=arguments Range for arguments - -addr=buffers Range for buffers (also not loaded buffers) - -addr=loaded_buffers Range for loaded buffers - -addr=windows Range for windows - -addr=tabs Range for tab pages - -addr=other other kind of range +Possible values are (second column is the short name used in listing): + -addr=lines Range of lines (this is the default) + -addr=arguments arg Range for arguments + -addr=buffers buf Range for buffers (also not loaded buffers) + -addr=loaded_buffers load Range for loaded buffers + -addr=windows win Range for windows + -addr=tabs tab Range for tab pages + -addr=quickfix qf Range for quickfix entries + -addr=other ? other kind of range Special cases ~ diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 188cfc91b6..9da11a553d 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -43,6 +43,7 @@ A location list is a window-local quickfix list. You get one after commands like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a location list instead of a quickfix list as the corresponding `:vimgrep`, `:grep`, `:helpgrep`, `:make` do. + *location-list-file-window* A location list is associated with a window and each window can have a separate location list. A location list can be associated with only one window. The location list is independent of the quickfix list. @@ -718,6 +719,9 @@ using these functions are below: " get the location list window id of the third window :echo getloclist(3, {'winid' : 0}).winid + + " get the file window id of a location list window (winnr: 4) + :echo getloclist(4, {'filewinid' : 0}).filewinid < *setqflist-examples* The |setqflist()| and |setloclist()| functions can be used to set the various @@ -732,6 +736,9 @@ using these functions are below: " set the title of the current quickfix list :call setqflist([], 'a', {'title' : 'Mytitle'}) + " change the current entry in the list specified by an identifier + :call setqflist([], 'a', {'id' : qfid, 'idx' : 10}) + " set the context of a quickfix list specified by an identifier :call setqflist([], 'a', {'id' : qfid, 'context' : {'val' : 100}}) diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index ae60c1c5e8..1fcb6611b4 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -450,6 +450,9 @@ Eval: *js_decode()* *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead. +Events: + *SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead. + Highlight groups: *hl-StatusLineTerm* *hl-StatusLineTermNC* are unnecessary because Nvim supports 'winhighlight' window-local highlights. |