mirror of
https://github.com/neovim/neovim.git
synced 2025-10-12 04:46:10 +00:00
vim-patch:8.2.4820: not simple programmatic way to find a specific mapping
Problem: Not simple programmatic way to find a specific mapping.
Solution: Add getmappings(). (Ernie Rael, closes vim/vim#10273)
659c240cf7
Co-authored-by: Ernie Rael <errael@raelity.com>
This commit is contained in:
12
runtime/doc/builtin.txt
generated
12
runtime/doc/builtin.txt
generated
@@ -2612,6 +2612,16 @@ getloclist({nr} [, {what}]) *getloclist()*
|
||||
echo getloclist(5, {'filewinid': 0})
|
||||
<
|
||||
|
||||
getmappings() *getmappings()*
|
||||
Returns a |List| of all mappings. Each List item is a |Dict|,
|
||||
the same as what is returned by |maparg()|, see
|
||||
|mapping-dict|.
|
||||
|
||||
Example to show all mappings with "MultiMatch" in rhs: >
|
||||
echo getmappings()->filter({_, m ->
|
||||
\ match(get(m, 'rhs', ''), 'MultiMatch') >= 0
|
||||
\ })
|
||||
|
||||
getmarklist([{buf}]) *getmarklist()*
|
||||
Without the {buf} argument returns a |List| with information
|
||||
about all the global marks. |mark|
|
||||
@@ -4161,7 +4171,7 @@ 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:
|
||||
following items: *mapping-dict*
|
||||
"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
|
||||
|
@@ -1012,6 +1012,7 @@ Mappings and Menus: *mapping-functions*
|
||||
digraph_getlist() get all |digraph|s
|
||||
digraph_set() register |digraph|
|
||||
digraph_setlist() register multiple |digraph|s
|
||||
getmappings() get list of all mappings
|
||||
hasmapto() check if a mapping exists
|
||||
mapcheck() check if a matching mapping exists
|
||||
maparg() get rhs of a mapping
|
||||
|
14
runtime/lua/vim/_meta/vimfn.lua
generated
14
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -3175,6 +3175,18 @@ function vim.fn.getline(lnum, end_) end
|
||||
--- @return any
|
||||
function vim.fn.getloclist(nr, what) end
|
||||
|
||||
--- Returns a |List| of all mappings. Each List item is a |Dict|,
|
||||
--- the same as what is returned by |maparg()|, see
|
||||
--- |mapping-dict|.
|
||||
---
|
||||
--- Example to show all mappings with "MultiMatch" in rhs: >
|
||||
--- echo getmappings()->filter({_, m ->
|
||||
--- \ match(get(m, 'rhs', ''), 'MultiMatch') >= 0
|
||||
--- \ })
|
||||
---
|
||||
--- @return any
|
||||
function vim.fn.getmappings() end
|
||||
|
||||
--- Without the {buf} argument returns a |List| with information
|
||||
--- about all the global marks. |mark|
|
||||
---
|
||||
@@ -5022,7 +5034,7 @@ function vim.fn.map(expr1, expr2) end
|
||||
---
|
||||
--- When {dict} is there and it is |TRUE| return a dictionary
|
||||
--- containing all the information of the mapping with the
|
||||
--- following items:
|
||||
--- following items: *mapping-dict*
|
||||
--- "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
|
||||
|
Reference in New Issue
Block a user