Merge pull request #18200 from atusy/doc-vim-keymap-set

docs: vim.keymap.set can specify buffer as an option
This commit is contained in:
zeertzjq 2022-04-21 17:31:40 +08:00 committed by GitHub
commit 5c4ec25478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -2055,6 +2055,9 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
"silent". In addition to the options listed in
|nvim_set_keymap()|, this table also accepts the
following keys:
• 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

View File

@ -40,6 +40,8 @@ local keymap = {}
--
---@param 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 following keys:
--- - 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