-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
46 lines (33 loc) · 934 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|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.