-
Notifications
You must be signed in to change notification settings - Fork 0
savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".
tyru/savemap.vim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
|savemap| is the library to provide a way
to restore current mapping(s)/abbreviation(s) "perfectly".
...But remember, you can always use |:map-<buffer>| 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.
About
savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published