aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt119
-rw-r--r--runtime/doc/change.txt11
-rw-r--r--runtime/doc/eval.txt8
-rw-r--r--runtime/doc/index.txt6
-rw-r--r--runtime/doc/intro.txt2
-rw-r--r--runtime/doc/lsp.txt89
-rw-r--r--runtime/doc/lua.txt15
-rw-r--r--runtime/doc/map.txt2
-rw-r--r--runtime/doc/message.txt4
-rw-r--r--runtime/doc/motion.txt52
-rw-r--r--runtime/doc/starting.txt2
-rw-r--r--runtime/doc/visual.txt8
-rw-r--r--runtime/lua/vim/shared.lua21
13 files changed, 182 insertions, 157 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index f97795b0ee..0d040c154b 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -19,6 +19,7 @@ API Usage *api-rpc* *RPC* *rpc*
*msgpack-rpc*
RPC is the typical way to control Nvim programmatically. Nvim implements the
MessagePack-RPC protocol:
+ https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md
https://github.com/msgpack/msgpack/blob/0b8f5ac/spec.md
Many clients use the API: user interfaces (GUIs), remote plugins, scripts like
@@ -935,8 +936,8 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
'list' options. 'signcolumn' is changed to
`auto` and 'colorcolumn' is cleared. The
end-of-buffer region is hidden by setting
- `eob` flag of 'fillchars' to a space char, and
- clearing the |EndOfBuffer| region in
+ `eob` flag of 'fillchars' to a space char,
+ and clearing the |EndOfBuffer| region in
'winhighlight'.
Return: ~
@@ -1022,7 +1023,7 @@ nvim_put({lines}, {type}, {after}, {follow}) *nvim_put()*
{type} Edit behavior: any |getregtype()| result, or:
• "b" |blockwise-visual| mode (may include
width, e.g. "b3")
- • "c" |characterwise| mode
+ • "c" |charwise| mode
• "l" |linewise| mode
• "" guess by contents, see |setreg()|
{after} Insert after cursor (like |p|), or before (like
@@ -1797,81 +1798,93 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id})
Returns position for a given extmark id
Parameters: ~
- {buffer} The buffer handle
- {namespace} a identifier returned previously with
- nvim_create_namespace
- {id} the extmark id
+ {buffer} Buffer handle, or 0 for current buffer
+ {ns_id} Namespace id from |nvim_create_namespace()|
+ {id} Extmark id
Return: ~
(row, col) tuple or empty list () if extmark id was absent
*nvim_buf_get_extmarks()*
nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
- List extmarks in a range (inclusive)
-
- range ends can be specified as (row, col) tuples, as well as
- extmark ids in the same namespace. In addition, 0 and -1 works
- as shorthands for (0,0) and (-1,-1) respectively, so that all
- marks in the buffer can be queried as:
+ Gets extmarks in "traversal order" from a |charwise| region
+ defined by buffer positions (inclusive, 0-indexed
+ |api-indexing|).
+
+ Region can be given as (row,col) tuples, or valid extmark ids
+ (whose positions define the bounds). 0 and -1 are understood
+ as (0,0) and (-1,-1) respectively, thus the following are
+ equivalent:
+>
+ nvim_buf_get_extmarks(0, my_ns, 0, -1, {})
+ nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {})
+<
- all_marks = nvim_buf_get_extmarks(0, my_ns, 0, -1, {})
+ If `end` is less than `start` , traversal works backwards.
+ (Useful with `limit` , to get the first marks prior to a given
+ position.)
- If end is a lower position than start, then the range will be
- traversed backwards. This is mostly useful with limited
- amount, to be able to get the first marks prior to a given
- position.
+ Example:
+>
+ local a = vim.api
+ local pos = a.nvim_win_get_cursor(0)
+ local ns = a.nvim_create_namespace('my-plugin')
+ -- Create new extmark at line 1, column 1.
+ local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, 0, {})
+ -- Create new extmark at line 3, column 1.
+ local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, 0, {})
+ -- Get extmarks only from line 3.
+ local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {})
+ -- Get all marks in this buffer + namespace.
+ local all = a.nvim_buf_get_extmarks(0, ns, 0, -1, {})
+ print(vim.inspect(ms))
+<
Parameters: ~
- {buffer} The buffer handle
- {ns_id} An id returned previously from
- nvim_create_namespace
- {start} One of: extmark id, (row, col) or 0, -1 for
- buffer ends
- {end} One of: extmark id, (row, col) or 0, -1 for
- buffer ends
- {opts} additional options. Supports the keys:
- • amount: Maximum number of marks to return
+ {buffer} Buffer handle, or 0 for current buffer
+ {ns_id} Namespace id from |nvim_create_namespace()|
+ {start} Start of range, given as (row, col) or valid
+ extmark id (whose position defines the bound)
+ {end} End of range, given as (row, col) or valid
+ extmark id (whose position defines the bound)
+ {opts} Optional parameters. Keys:
+ • limit: Maximum number of marks to return
Return: ~
- [[extmark_id, row, col], ...]
+ List of [extmark_id, row, col] tuples in "traversal
+ order".
*nvim_buf_set_extmark()*
nvim_buf_set_extmark({buffer}, {ns_id}, {id}, {line}, {col}, {opts})
- Create or update an extmark at a position
-
- If an invalid namespace is given, an error will be raised.
-
- To create a new extmark, pass in id=0. The new extmark id will
- be returned. To move an existing mark, pass in its id.
+ Creates or updates an extmark.
- It is also allowed to create a new mark by passing in a
- previously unused id, but the caller must then keep track of
- existing and unused ids itself. This is mainly useful over
- RPC, to avoid needing to wait for the return value.
+ To create a new extmark, pass id=0. The extmark id will be
+ returned. It is also allowed to create a new mark by passing
+ in a previously unused id, but the caller must then keep track
+ of existing and unused ids itself. (Useful over RPC, to avoid
+ waiting for the return value.)
Parameters: ~
- {buffer} The buffer handle
- {ns_id} a identifier returned previously with
- nvim_create_namespace
- {id} The extmark's id or 0 to create a new mark.
- {line} The row to set the extmark to.
- {col} The column to set the extmark to.
+ {buffer} Buffer handle, or 0 for current buffer
+ {ns_id} Namespace id from |nvim_create_namespace()|
+ {id} Extmark id, or 0 to create new
+ {line} Line number where to place the mark
+ {col} Column where to place the mark
{opts} Optional parameters. Currently not used.
Return: ~
- the id of the extmark.
+ Id of the created/updated extmark
nvim_buf_del_extmark({buffer}, {ns_id}, {id}) *nvim_buf_del_extmark()*
- Remove an extmark
+ Removes an extmark.
Parameters: ~
- {buffer} The buffer handle
- {ns_id} a identifier returned previously with
- nvim_create_namespace
- {id} The extmarks's id
+ {buffer} Buffer handle, or 0 for current buffer
+ {ns_id} Namespace id from |nvim_create_namespace()|
+ {id} Extmark id
Return: ~
- true on success, false if the extmark was not found.
+ true if the extmark was found, else false
*nvim_buf_add_highlight()*
nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line},
@@ -1916,8 +1929,8 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line},
*nvim_buf_clear_namespace()*
nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end})
- Clears namespaced objects, highlights and virtual text, from a
- line range
+ Clears namespaced objects (highlights, extmarks, virtual text)
+ from a region.
Lines are 0-indexed. |api-indexing| To clear the namespace in
the entire buffer, specify line_start=0 and line_end=-1.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index bd3f22a371..dcebbc524c 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -90,7 +90,7 @@ start and end of the motion are not in the same line, and there are only
blanks before the start and there are no non-blanks after the end of the
motion, the delete becomes linewise. This means that the delete also removes
the line of blanks that you might expect to remain. Use the |o_v| operator to
-force the motion to be characterwise.
+force the motion to be charwise.
Trying to delete an empty region of text (e.g., "d0" in the first column)
is an error when 'cpoptions' includes the 'E' flag.
@@ -1074,7 +1074,7 @@ also use these commands to move text from one file to another, because Vim
preserves all registers when changing buffers (the CTRL-^ command is a quick
way to toggle between two files).
- *linewise-register* *characterwise-register*
+ *linewise-register* *charwise-register*
You can repeat the put commands with "." (except for :put) and undo them. If
the command that was used to get the text into the register was |linewise|,
Vim inserts the text below ("p") or above ("P") the line where the cursor is.
@@ -1116,10 +1116,9 @@ this happen. However, if the width of the block is not a multiple of a <Tab>
width and the text after the inserted block contains <Tab>s, that text may be
misaligned.
-Note that after a characterwise yank command, Vim leaves the cursor on the
-first yanked character that is closest to the start of the buffer. This means
-that "yl" doesn't move the cursor, but "yh" moves the cursor one character
-left.
+Note that after a charwise yank command, Vim leaves the cursor on the first
+yanked character that is closest to the start of the buffer. This means that
+"yl" doesn't move the cursor, but "yh" moves the cursor one character left.
Rationale: In Vi the "y" command followed by a backwards motion would
sometimes not move the cursor to the first yanked character,
because redisplaying was skipped. In Vim it always moves to
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 84a893a205..f39c40492b 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4727,7 +4727,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
getregtype([{regname}]) *getregtype()*
The result is a String, which is type of register {regname}.
The value will be one of:
- "v" for |characterwise| text
+ "v" for |charwise| text
"V" for |linewise| text
"<CTRL-V>{width}" for |blockwise-visual| text
"" for an empty or unknown register
@@ -6131,7 +6131,7 @@ mode([expr]) Return a string that indicates the current mode.
n Normal
no Operator-pending
- nov Operator-pending (forced characterwise |o_v|)
+ nov Operator-pending (forced charwise |o_v|)
noV Operator-pending (forced linewise |o_V|)
noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|)
niI Normal using |i_CTRL-O| in |Insert-mode|
@@ -7441,7 +7441,7 @@ setreg({regname}, {value} [, {options}])
If {options} contains "a" or {regname} is upper case,
then the value is appended.
{options} can also contain a register type specification:
- "c" or "v" |characterwise| mode
+ "c" or "v" |charwise| mode
"l" or "V" |linewise| mode
"b" or "<CTRL-V>" |blockwise-visual| mode
If a number immediately follows "b" or "<CTRL-V>" then this is
@@ -9708,7 +9708,7 @@ This does NOT work: >
register, "@/" for the search pattern.
If the result of {expr1} ends in a <CR> or <NL>, the
register will be linewise, otherwise it will be set to
- characterwise.
+ charwise.
This can be used to clear the last search pattern: >
:let @/ = ""
< This is different from searching for an empty string,
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 211b7be2cc..ed9853a8da 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -404,7 +404,7 @@ tag char note action in Normal mode ~
|t| t{char} 1 cursor till before Nth occurrence of {char}
to the right
|u| u 2 undo changes
-|v| v start characterwise Visual mode
+|v| v start charwise Visual mode
|w| w 1 cursor N words forward
|x| ["x]x 2 delete N characters under and after the
cursor [into register x]
@@ -866,7 +866,7 @@ These can be used after an operator, but before a {motion} has been entered.
tag char action in Operator-pending mode ~
-----------------------------------------------------------------------
-|o_v| v force operator to work characterwise
+|o_v| v force operator to work charwise
|o_V| V force operator to work linewise
|o_CTRL-V| CTRL-V force operator to work blockwise
@@ -978,7 +978,7 @@ tag command note action in Visual mode ~
|v_r| r 2 replace highlighted area with a character
|v_s| s 2 delete highlighted area and start insert
|v_u| u 2 make highlighted area lowercase
-|v_v| v make Visual mode characterwise or stop
+|v_v| v make Visual mode charwise or stop
Visual mode
|v_x| x 2 delete the highlighted area
|v_y| y yank the highlighted area
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 3292489eda..c59ed43a47 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -271,7 +271,7 @@ and <> are part of what you type, the context should make this clear.
operator is pending.
- Ex commands can be used to move the cursor. This can be
used to call a function that does some complicated motion.
- The motion is always characterwise exclusive, no matter
+ The motion is always charwise exclusive, no matter
what ":" command is used. This means it's impossible to
include the last character of a line without the line break
(unless 'virtualedit' is set).
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 3de2a9e4e6..c4c164ab6c 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1,18 +1,18 @@
-*lsp.txt* The Language Server Protocol
+*lsp.txt* Nvim LSP API
- NVIM REFERENCE MANUAL
+ NVIM REFERENCE MANUAL
-Neovim Language Server Protocol (LSP) API
+Nvim Language Server Protocol (LSP) API *lsp*
-Neovim exposes a powerful API that conforms to Microsoft's published Language
-Server Protocol specification. The documentation can be found here:
+Nvim is a client to the Language Server Protocol:
https://microsoft.github.io/language-server-protocol/
+ Type |gO| to see the table of contents.
================================================================================
- *lsp-api*
+LSP API *lsp-api*
Neovim exposes a API for the language server protocol. To get the real benefits
of this API, a language server must be installed.
@@ -261,13 +261,16 @@ vim.lsp.rpc_response_error({code}, [{message}], [{data}])
the server.
================================================================================
- *vim.lsp.default_callbacks*
+LSP CALLBACKS *lsp-callbacks*
-The |vim.lsp.default_callbacks| table contains the default |lsp-callbacks|
-that are used when creating a new client. The keys are the LSP method names.
+DEFAULT CALLBACKS ~
+ *vim.lsp.default_callbacks*
+The `vim.lsp.default_callbacks` table defines default callbacks used when
+creating a new client. Keys are LSP method names: >
-The following requests and notifications have built-in callbacks defined to
-handle the response in an idiomatic way.
+ :lua print(vim.inspect(vim.tbl_keys(vim.lsp.default_callbacks)))
+
+These LSP requests/notifications are defined by default:
textDocument/publishDiagnostics
window/logMessage
@@ -290,38 +293,40 @@ Use cases:
Any callbacks passed directly to `request` methods on a server client will
have the highest precedence, followed by the `default_callbacks`.
-More information about callbacks can be found in |lsp-callbacks|.
+You can override the default handlers,
+- globally: by modifying the `vim.lsp.default_callbacks` table
+- per-client: by passing the {callbacks} table parameter to
+ |vim.lsp.start_client|
-================================================================================
- *lsp-callbacks*
+Each handler has this signature: >
+
+ function(err, method, params, client_id)
Callbacks are functions which are called in a variety of situations by the
client. Their signature is `function(err, method, params, client_id)` They can
be set by the {callbacks} parameter for |vim.lsp.start_client| or via the
|vim.lsp.default_callbacks|.
-This will be called for:
-- notifications from the server, where `err` will always be `nil`
-- requests initiated by the server. The parameter `err` will be `nil` here as
- well.
- For these, you can respond by returning two values: `result, err` The
- err must be in the format of an RPC error, which is
- `{ code, message, data? }`
- You can use |vim.lsp.rpc_response_error()| to help with creating this object.
-- as a callback for requests initiated by the client if the request doesn't
- explicitly specify a callback (such as in |vim.lsp.buf_request|).
+Handlers are called for:
+- Notifications from the server (`err` is always `nil`).
+- Requests initiated by the server (`err` is always `nil`).
+ The handler can respond by returning two values: `result, err`
+ where `err` must be shaped like an RPC error:
+ `{ code, message, data? }`
+ You can use |vim.lsp.rpc_response_error()| to create this object.
+- Handling requests initiated by the client if the request doesn't explicitly
+ specify a callback (such as in |vim.lsp.buf_request|).
================================================================================
- *vim.lsp.protocol*
-vim.lsp.protocol
+VIM.LSP.PROTOCOL *vim.lsp.protocol*
- Contains constants as described in the Language Server Protocol
- specification and helper functions for creating protocol related objects.
+The `vim.lsp.protocol` module provides constants defined in the LSP
+specification, and helper functions for creating protocol-related objects.
https://github.com/microsoft/language-server-protocol/raw/gh-pages/_specifications/specification-3-14.md
- Useful examples are `vim.lsp.protocol.ErrorCodes`. These objects allow
- reverse lookup by either the number or string name.
+Useful examples are `vim.lsp.protocol.ErrorCodes`. These objects allow reverse
+lookup by either the number or string name.
e.g. vim.lsp.protocol.TextDocumentSyncKind.Full == 1
vim.lsp.protocol.TextDocumentSyncKind[1] == "Full"
@@ -428,7 +433,7 @@ To configure omnifunc, add the following in your init.vim:
>
" Configure for python
autocmd Filetype python setl omnifunc=v:lua.vim.lsp.omnifunc
-
+
" Or with on_attach
start_client {
...
@@ -436,12 +441,12 @@ To configure omnifunc, add the following in your init.vim:
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
end;
}
-
+
" This is optional, but you may find it useful
autocmd CompleteDone * pclose
<
================================================================================
- *lsp-vim-functions*
+LSP FUNCTIONS *lsp-vim-functions*
To use the functions from vim, it is recommended to use |v:lua| to interface
with the Lua functions. No direct vim functions are provided, but the
@@ -461,7 +466,7 @@ request from lua as follows:
nnoremap <silent> ;td <cmd>lua vim.lsp.buf.type_definition()<CR>
<
================================================================================
- *lsp-advanced-js-example*
+LSP EXAMPLE *lsp-advanced-js-example*
For more advanced configurations where just filtering by filetype isn't
sufficient, you can use the `vim.lsp.start_client()` and
@@ -483,7 +488,7 @@ The example will:
local stat = vim.loop.fs_stat(filename)
return stat and stat.type == 'directory' or false
end
-
+
local path_sep = vim.loop.os_uname().sysname == "Windows" and "\\" or "/"
-- Asumes filepath is a file.
local function dirname(filepath)
@@ -494,11 +499,11 @@ The example will:
end)
return result, is_changed
end
-
+
local function path_join(...)
return table.concat(vim.tbl_flatten {...}, path_sep)
end
-
+
-- Ascend the buffer's path until we find the rootdir.
-- is_root_path is a function which returns bool
local function buffer_find_root_dir(bufnr, is_root_path)
@@ -520,7 +525,7 @@ The example will:
end
end
end
-
+
-- A table to store our root_dir to client_id lookup. We want one LSP per
-- root directory, and this is how we assert that.
local javascript_lsps = {}
@@ -531,14 +536,14 @@ The example will:
["typescript"] = true;
["typescript.jsx"] = true;
}
-
+
-- Create a template configuration for a server to start, minus the root_dir
-- which we will specify later.
local javascript_lsp_config = {
name = "javascript";
cmd = { path_join(os.getenv("JAVASCRIPT_LANGUAGE_SERVER_DIRECTORY"), "lib", "language-server-stdio.js") };
}
-
+
-- This needs to be global so that we can call it from the autocmd.
function check_start_javascript_lsp()
local bufnr = vim.api.nvim_get_current_buf()
@@ -555,7 +560,7 @@ The example will:
end)
-- We couldn't find a root directory, so ignore this file.
if not root_dir then return end
-
+
-- Check if we have a client alredy or start and store it.
local client_id = javascript_lsps[root_dir]
if not client_id then
@@ -569,7 +574,7 @@ The example will:
-- are already attached.
vim.lsp.buf_attach_client(bufnr, client_id)
end
-
+
vim.api.nvim_command [[autocmd BufReadPost * lua check_start_javascript_lsp()]]
<
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index edcf246295..c0da06ffe3 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -876,16 +876,23 @@ tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
Parameters: ~
{o} table The table to add the reverse to.
-list_extend({dst}, {src}) *vim.list_extend()*
+list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()*
Extends a list-like table with the values of another list-like
table.
+ NOTE: This mutates dst!
+
Parameters: ~
- {dst} The list which will be modified and appended to.
- {src} The list from which values will be inserted.
+ {dst} list which will be modified and appended to.
+ {src} list from which values will be inserted.
+ {start} Start index on src. defaults to 1
+ {finish} Final index on src. defaults to #src
+
+ Return: ~
+ dst
See also: ~
- |extend()|
+ |vim.tbl_extend()|
tbl_flatten({t}) *vim.tbl_flatten()*
Creates a copy of a list-like table such that any nested
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index abe86749c4..58c0d832e6 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -786,7 +786,7 @@ g@{motion} Call the function set by the 'operatorfunc' option.
character of the text.
The function is called with one String argument:
"line" {motion} was |linewise|
- "char" {motion} was |characterwise|
+ "char" {motion} was |charwise|
"block" {motion} was |blockwise-visual|
Although "block" would rarely appear, since it can
only result from Visual mode where "g@" is not useful.
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 965b062728..bcfd985e71 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -679,8 +679,8 @@ no argument has been specified.
Invalid argument: {arg}
Duplicate argument: {arg}
-An Ex command or function has been executed, but an invalid argument has been
-specified.
+Ex command or function has been executed, but an invalid argument was
+specified. Or a non-executable command was given to |system()|.
*E488* >
Trailing characters
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index e93c833c76..07ff4cf030 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -60,11 +60,11 @@ After applying the operator the cursor is mostly left at the start of the text
that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe"
moves the cursor leftwards to the "e" where the yank started.
- *linewise* *characterwise*
+ *linewise* *charwise* *characterwise*
The operator either affects whole lines, or the characters between the start
and end position. Generally, motions that move between lines affect lines
(are linewise), and motions that move within a line affect characters (are
-characterwise). However, there are some exceptions.
+charwise). However, there are some exceptions.
*exclusive* *inclusive*
Character motion is either inclusive or exclusive. When inclusive, the
@@ -106,10 +106,10 @@ This cannot be repeated: >
d:if 1<CR>
call search("f")<CR>
endif<CR>
-Note that when using ":" any motion becomes characterwise exclusive.
+Note that when using ":" any motion becomes charwise exclusive.
*forced-motion*
-FORCING A MOTION TO BE LINEWISE, CHARACTERWISE OR BLOCKWISE
+FORCING A MOTION TO BE LINEWISE, CHARWISE OR BLOCKWISE
When a motion is not of the type you would like to use, you can force another
type by using "v", "V" or CTRL-V just after the operator.
@@ -121,22 +121,22 @@ deletes from the cursor position until the character below the cursor >
d<C-V>j
deletes the character under the cursor and the character below the cursor. >
-Be careful with forcing a linewise movement to be used characterwise or
-blockwise, the column may not always be defined.
+Be careful with forcing a linewise movement to be used charwise or blockwise,
+the column may not always be defined.
*o_v*
v When used after an operator, before the motion command: Force
- the operator to work characterwise, also when the motion is
+ the operator to work charwise, also when the motion is
linewise. If the motion was linewise, it will become
|exclusive|.
- If the motion already was characterwise, toggle
+ If the motion already was charwise, toggle
inclusive/exclusive. This can be used to make an exclusive
motion inclusive and an inclusive motion exclusive.
*o_V*
V When used after an operator, before the motion command: Force
the operator to work linewise, also when the motion is
- characterwise.
+ charwise.
*o_CTRL-V*
CTRL-V When used after an operator, before the motion command: Force
@@ -508,36 +508,36 @@ aw "a word", select [count] words (see |word|).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aw" switches to
- Visual characterwise mode.
+ Visual charwise mode.
*v_iw* *iw*
iw "inner word", select [count] words (see |word|).
White space between words is counted too.
When used in Visual linewise mode "iw" switches to
- Visual characterwise mode.
+ Visual charwise mode.
*v_aW* *aW*
aW "a WORD", select [count] WORDs (see |WORD|).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aW" switches to
- Visual characterwise mode.
+ Visual charwise mode.
*v_iW* *iW*
iW "inner WORD", select [count] WORDs (see |WORD|).
White space between words is counted too.
When used in Visual linewise mode "iW" switches to
- Visual characterwise mode.
+ Visual charwise mode.
*v_as* *as*
as "a sentence", select [count] sentences (see
|sentence|).
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
*v_is* *is*
is "inner sentence", select [count] sentences (see
|sentence|).
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
*v_ap* *ap*
ap "a paragraph", select [count] paragraphs (see
@@ -558,14 +558,14 @@ a[ "a [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
including the '[' and ']'.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
i] *v_i]* *v_i[* *i]* *i[*
i[ "inner [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
excluding the '[' and ']'.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
a) *v_a)* *a)* *a(*
a( *vab* *v_ab* *v_a(* *ab*
@@ -573,54 +573,54 @@ ab "a block", select [count] blocks, from "[count] [(" to
the matching ')', including the '(' and ')' (see
|[(|). Does not include white space outside of the
parenthesis.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
i) *v_i)* *i)* *i(*
i( *vib* *v_ib* *v_i(* *ib*
ib "inner block", select [count] blocks, from "[count] [("
to the matching ')', excluding the '(' and ')' (see
|[(|).
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
a> *v_a>* *v_a<* *a>* *a<*
a< "a <> block", select [count] <> blocks, from the
[count]'th unmatched '<' backwards to the matching
'>', including the '<' and '>'.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
i> *v_i>* *v_i<* *i>* *i<*
i< "inner <> block", select [count] <> blocks, from
the [count]'th unmatched '<' backwards to the matching
'>', excluding the '<' and '>'.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
*v_at* *at*
at "a tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", including the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
*v_it* *it*
it "inner tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", excluding the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
a} *v_a}* *a}* *a{*
a{ *v_aB* *v_a{* *aB*
aB "a Block", select [count] Blocks, from "[count] [{" to
the matching '}', including the '{' and '}' (see
|[{|).
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
i} *v_i}* *i}* *i{*
i{ *v_iB* *v_i{* *iB*
iB "inner Block", select [count] Blocks, from "[count] [{"
to the matching '}', excluding the '{' and '}' (see
|[{|).
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
a" *v_aquote* *aquote*
a' *v_a'* *a'*
@@ -634,7 +634,7 @@ a` *v_a`* *a`*
start of the line.
Any trailing white space is included, unless there is
none, then leading white space is included.
- When used in Visual mode it is made characterwise.
+ When used in Visual mode it is made charwise.
Repeating this object in Visual mode another string is
included. A count is currently not used.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 7dbbb2d424..e3f0d593a7 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1270,7 +1270,7 @@ exactly four MessagePack objects:
Key Type Def Description ~
rt UInteger 0 Register type:
No Description ~
- 0 |characterwise-register|
+ 0 |charwise-register|
1 |linewise-register|
2 |blockwise-register|
rw UInteger 0 Register width. Only valid
diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt
index ccbbc092ec..0052382044 100644
--- a/runtime/doc/visual.txt
+++ b/runtime/doc/visual.txt
@@ -48,7 +48,7 @@ position.
==============================================================================
2. Starting and stopping Visual mode *visual-start*
- *v* *characterwise-visual*
+ *v* *charwise-visual*
[count]v Start Visual mode per character.
With [count] select the same number of characters or
lines as used for the last Visual operation, but at
@@ -74,7 +74,7 @@ position.
If you use <Esc>, click the left mouse button or use any command that
does a jump to another buffer while in Visual mode, the highlighting stops
-and no text is affected. Also when you hit "v" in characterwise Visual mode,
+and no text is affected. Also when you hit "v" in charwise Visual mode,
"CTRL-V" in blockwise Visual mode or "V" in linewise Visual mode. If you hit
CTRL-Z the highlighting stops and the editor is suspended or a new shell is
started |CTRL-Z|.
@@ -477,7 +477,7 @@ Commands in Select mode:
Otherwise, typed characters are handled as in Visual mode.
When using an operator in Select mode, and the selection is linewise, the
-selected lines are operated upon, but like in characterwise selection. For
+selected lines are operated upon, but like in charwise selection. For
example, when a whole line is deleted, it can later be pasted in the middle of
a line.
@@ -510,7 +510,7 @@ gV Avoid the automatic reselection of the Visual area
selection.
*gh*
-gh Start Select mode, characterwise. This is like "v",
+gh Start Select mode, charwise. This is like "v",
but starts Select mode instead of Visual mode.
Mnemonic: "get highlighted".
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 1912d3708d..631dd04c35 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -226,16 +226,17 @@ function vim.tbl_add_reverse_lookup(o)
return o
end
--- Extends a list-like table with the values of another list-like table.
---
--- NOTE: This *mutates* dst!
--- @see |extend()|
---
--- @param dst list which will be modified and appended to.
--- @param src list from which values will be inserted.
--- @param start Start index on src. defaults to 1
--- @param finish Final index on src. defaults to #src
--- @returns dst
+--- Extends a list-like table with the values of another list-like table.
+---
+--- NOTE: This mutates dst!
+---
+--@see |vim.tbl_extend()|
+---
+--@param dst list which will be modified and appended to.
+--@param src list from which values will be inserted.
+--@param start Start index on src. defaults to 1
+--@param finish Final index on src. defaults to #src
+--@returns dst
function vim.list_extend(dst, src, start, finish)
vim.validate {
dst = {dst, 't'};