> @errael commented on this pull request.
>
> > @@ -3570,6 +3571,17 @@ getloclist({nr} [, {what}])
> > *getloclist()*
> :echo getloclist(5, {'filewinid': 0})
>
>
> +getmaps() *getmaps()*
> + Returns a |List| of all mappings. Each List item is a |Dict|
> + as defined by |maparg()|. For a given mapping, the Dict from
> + getmaps() is identical to the dict from |maparg()|.
>
> > I would think the {mode} argument to mapset() could be a special
> > value and then the "mode" from the dict is uesd.
>
> I would suggest `mapset({dict})` means take abbr and mode from dict,
> that's easy for a user to understand.
> It's unclear to me, whether or not `mapcheck()` would want a similar change.
>
> Either way, is there a reason not to include "abbr: true/false" in the
> mapping-dict? I think it could be done right now, without any negative
> consequences. I'm guessing `mapset()` wouldn't care today.
Yes, that should work nicely. Then maplist() or maparg() can be used to
get an existing mapping, and restore it later. And it would also work
for an abbreviation, without having to specify that separately.
> I'm a casual vim user, so I'm mostly clueless about a lot of vim
> stuff. Considering the above, and playing with the new `maplist()`
> function, I did the following experiment because I was trying to
> figure out where `nox` came from for the `Q` mapping. I'm sure
> whatever drives having `[on]unmap` also implicitly do `sunmap` gives a
> better user experience.
> ```
> map X xyzzy [' ']
> nunmap X ['ov']
> map X xyzzy [' ']
> xunmap X ['nos']
> map X xyzzy [' ']
> sunmap X ['nox']
> map X xyzzy [' ']
> ounmap X ['nv']
> map X xyzzy [' ']
> sunmap X ['nox']
> smap X xyzzy ['s', 'nox']
> ```
There is a lot of history. Starting with the original Vi only having
"map" and "map!". Visual and Select modes were added later, so mappings
for different modes were made possible.
--
Q: What is a patch 22?
A: A patch you need to include to make it possible to include patches.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220425183016.B52D61C410D%40moolenaar.net.