Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tyru/savemap.vim

savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".
https://github.com/tyru/savemap.vim

keymapping keymappings library mapping mappings vim

Last synced: about 1 month ago
JSON representation

savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".

Awesome Lists containing this project

README

        

|savemap| is the library to provide a way
to restore current mapping(s)/abbreviation(s) "perfectly".

...But remember, you can always use |:map-| for "simple" case.

>
nmap foo blahblahblah

let foo_nmap = savemap#save_map('n', 'foo')
if empty(foo_nmap)
echoerr 'your vim version is lower than 7.3.032!'
endif

nmap foo bar
" Execute 'bar'.
normal foo

call foo_nmap.restore()
" Execute 'blahblahblah'.
normal foo

Omit 2nd arg of |savemap#save_map()| to save all mappings of the mode.
>
let normal_mappings = savemap#save_map('n')
if empty(normal_mappings)
echoerr 'your vim version is lower than 7.3.032!'
endif

" Clear!
nmapclear

" Map own mappings.
nnoremap a b
nnoremap c d
...

try
... " Do it
finally
call normal_mappings.restore()
endtry

See doc/savemap.txt or :help savemap for more details.