Mercurial > vim
comparison runtime/doc/builtin.txt @ 28602:398c5b3211f9 v8.2.4825
patch 8.2.4825: can only get a list of mappings
Commit: https://github.com/vim/vim/commit/09661203ecefbee6a6f09438afcff1843e9dbfb4
Author: Ernie Rael <errael@raelity.com>
Date: Mon Apr 25 14:40:44 2022 +0100
patch 8.2.4825: can only get a list of mappings
Problem: Can only get a list of mappings.
Solution: Add the optional {abbr} argument. (Ernie Rael, closes https://github.com/vim/vim/issues/10277)
Rename to maplist(). Rename test file.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 25 Apr 2022 15:45:03 +0200 |
parents | d3c966c0cdf7 |
children | 4d76b3e07c07 |
comparison
equal
deleted
inserted
replaced
28601:a4d54a260c59 | 28602:398c5b3211f9 |
---|---|
233 List list of jump list items | 233 List list of jump list items |
234 getline({lnum}) String line {lnum} of current buffer | 234 getline({lnum}) String line {lnum} of current buffer |
235 getline({lnum}, {end}) List lines {lnum} to {end} of current buffer | 235 getline({lnum}, {end}) List lines {lnum} to {end} of current buffer |
236 getloclist({nr}) List list of location list items | 236 getloclist({nr}) List list of location list items |
237 getloclist({nr}, {what}) Dict get specific location list properties | 237 getloclist({nr}, {what}) Dict get specific location list properties |
238 getmappings() List list of all mappings, a dict for each | |
239 getmarklist([{buf}]) List list of global/local marks | 238 getmarklist([{buf}]) List list of global/local marks |
240 getmatches([{win}]) List list of current matches | 239 getmatches([{win}]) List list of current matches |
241 getmousepos() Dict last known mouse position | 240 getmousepos() Dict last known mouse position |
242 getpid() Number process ID of Vim | 241 getpid() Number process ID of Vim |
243 getpos({expr}) List position of cursor, mark, etc. | 242 getpos({expr}) List position of cursor, mark, etc. |
336 maparg({name} [, {mode} [, {abbr} [, {dict}]]]) | 335 maparg({name} [, {mode} [, {abbr} [, {dict}]]]) |
337 String or Dict | 336 String or Dict |
338 rhs of mapping {name} in mode {mode} | 337 rhs of mapping {name} in mode {mode} |
339 mapcheck({name} [, {mode} [, {abbr}]]) | 338 mapcheck({name} [, {mode} [, {abbr}]]) |
340 String check for mappings matching {name} | 339 String check for mappings matching {name} |
340 maplist([{abbr}]) List list of all mappings, a dict for each | |
341 mapnew({expr1}, {expr2}) List/Dict/Blob/String | 341 mapnew({expr1}, {expr2}) List/Dict/Blob/String |
342 like |map()| but creates a new List or | 342 like |map()| but creates a new List or |
343 Dictionary | 343 Dictionary |
344 mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result | 344 mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result |
345 match({expr}, {pat} [, {start} [, {count}]]) | 345 match({expr}, {pat} [, {start} [, {count}]]) |
3569 Examples (See also |getqflist-examples|): > | 3569 Examples (See also |getqflist-examples|): > |
3570 :echo getloclist(3, {'all': 0}) | 3570 :echo getloclist(3, {'all': 0}) |
3571 :echo getloclist(5, {'filewinid': 0}) | 3571 :echo getloclist(5, {'filewinid': 0}) |
3572 | 3572 |
3573 | 3573 |
3574 getmappings() *getmappings()* | |
3575 Returns a |List| of all mappings. Each List item is a |Dict|, | |
3576 the same as what is returned by |maparg()|, see | |
3577 |mapping-dict|. | |
3578 | |
3579 Example to show all mappings with 'MultiMatch' in rhs: > | |
3580 vim9script | |
3581 echo getmappings()->filter( | |
3582 (_, m) => match(m.rhs, 'MultiMatch') >= 0) | |
3583 | |
3584 | |
3585 getmarklist([{buf}]) *getmarklist()* | 3574 getmarklist([{buf}]) *getmarklist()* |
3586 Without the {buf} argument returns a |List| with information | 3575 Without the {buf} argument returns a |List| with information |
3587 about all the global marks. |mark| | 3576 about all the global marks. |mark| |
3588 | 3577 |
3589 If the optional {buf} argument is specified, returns the | 3578 If the optional {buf} argument is specified, returns the |
5245 | 5234 |
5246 maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* | 5235 maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* |
5247 When {dict} is omitted or zero: Return the rhs of mapping | 5236 When {dict} is omitted or zero: Return the rhs of mapping |
5248 {name} in mode {mode}. The returned String has special | 5237 {name} in mode {mode}. The returned String has special |
5249 characters translated like in the output of the ":map" command | 5238 characters translated like in the output of the ":map" command |
5250 listing. | 5239 listing. When {dict} is TRUE a dictionary is returned, see |
5240 below. To get a list of all mappings see |maplist()|. | |
5251 | 5241 |
5252 When there is no mapping for {name}, an empty String is | 5242 When there is no mapping for {name}, an empty String is |
5253 returned. When the mapping for {name} is empty, then "<Nop>" | 5243 returned. When the mapping for {name} is empty, then "<Nop>" |
5254 is returned. | 5244 is returned. |
5255 | 5245 |
5344 < This avoids adding the "_vv" mapping when there already is a | 5334 < This avoids adding the "_vv" mapping when there already is a |
5345 mapping for "_v" or for "_vvv". | 5335 mapping for "_v" or for "_vvv". |
5346 | 5336 |
5347 Can also be used as a |method|: > | 5337 Can also be used as a |method|: > |
5348 GetKey()->mapcheck('n') | 5338 GetKey()->mapcheck('n') |
5339 | |
5340 | |
5341 maplist([{abbr}]) *maplist()* | |
5342 Returns a |List| of all mappings. Each List item is a |Dict|, | |
5343 the same as what is returned by |maparg()|, see | |
5344 |mapping-dict|. When {abbr} is there and it is |TRUE| use | |
5345 abbreviations instead of mappings. | |
5346 | |
5347 Example to show all mappings with 'MultiMatch' in rhs: > | |
5348 vim9script | |
5349 echo maplist()->filter( | |
5350 (_, m) => match(m.rhs, 'MultiMatch') >= 0) | |
5349 | 5351 |
5350 | 5352 |
5351 mapnew({expr1}, {expr2}) *mapnew()* | 5353 mapnew({expr1}, {expr2}) *mapnew()* |
5352 Like |map()| but instead of replacing items in {expr1} a new | 5354 Like |map()| but instead of replacing items in {expr1} a new |
5353 List or Dictionary is created and returned. {expr1} remains | 5355 List or Dictionary is created and returned. {expr1} remains |