Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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".
- Host: GitHub
- URL: https://github.com/tyru/savemap.vim
- Owner: tyru
- Created: 2010-11-06T16:40:29.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-11-10T11:49:24.000Z (about 12 years ago)
- Last Synced: 2023-04-15T16:13:21.536Z (over 1 year ago)
- Topics: keymapping, keymappings, library, mapping, mappings, vim
- Language: VimL
- Homepage: http://www.vim.org/scripts/script.php?script_id=3311
- Size: 156 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README
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 blahblahblahlet foo_nmap = savemap#save_map('n', 'foo')
if empty(foo_nmap)
echoerr 'your vim version is lower than 7.3.032!'
endifnmap foo bar
" Execute 'bar'.
normal foocall foo_nmap.restore()
" Execute 'blahblahblah'.
normal fooOmit 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()
endtrySee doc/savemap.txt or :help savemap for more details.