import { mapset } from "https://deno.land/x/denops_std@v3.6.0/function/vim/mod.ts";
Restore a mapping from a dictionary returned by |maparg()|.
{mode} and {abbr} should be the same as for the call to
|maparg()|.
{mode} is used to define the mode in which the mapping is set,
not the "mode" entry in {dict}.
Example for saving and restoring a mapping:
let save_map = maparg('K', 'n', 0, 1)
nnoremap K somethingelse
...
call mapset('n', 0, save_map)
Note that if you are going to replace a map in several modes,
e.g. with :map!
, you need to save the mapping for all of
them, since they can differ.