- Improved save snippets.
This commit is contained in:
parent
6224509a90
commit
24b2ed20c6
@ -175,7 +175,6 @@ abbr python3 <<EOF | EOF
|
|||||||
${0}
|
${0}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
snippet lua
|
snippet lua
|
||||||
options head
|
options head
|
||||||
abbr lua <<EOF | EOF
|
abbr lua <<EOF | EOF
|
||||||
@ -187,21 +186,31 @@ snippet save_pos
|
|||||||
options head
|
options head
|
||||||
abbr use pos save
|
abbr use pos save
|
||||||
let pos_save = getpos('.')
|
let pos_save = getpos('.')
|
||||||
${0}
|
try
|
||||||
call setpos('.', pos_save)
|
${0}
|
||||||
|
finally
|
||||||
|
call setpos('.', pos_save)
|
||||||
|
endtry
|
||||||
|
|
||||||
snippet save_register
|
snippet save_register
|
||||||
options head
|
options head
|
||||||
abbr use register save
|
abbr use register save
|
||||||
let save_reg_$1 = getreg('${1}')
|
let save_reg_$1 = getreg('${1}')
|
||||||
let save_regtype_$1 = getregtype('$1')
|
let save_regtype_$1 = getregtype('$1')
|
||||||
${0}
|
try
|
||||||
call setreg('$1', save_reg_$1, save_regtype_$1)
|
${0}
|
||||||
|
finally
|
||||||
|
call setreg('$1', save_reg_$1, save_regtype_$1)
|
||||||
|
endtry
|
||||||
|
|
||||||
snippet save_option
|
snippet save_option
|
||||||
options head
|
options head
|
||||||
abbr use option save
|
abbr use option save
|
||||||
let $1_save = &${1}
|
let $1_save = &${1}
|
||||||
let &$1 = ${2}
|
let &$1 = ${2}
|
||||||
${0}
|
try
|
||||||
let &$1 = $1_save
|
${0}
|
||||||
|
finally
|
||||||
|
let &$1 = $1_save
|
||||||
|
endtry
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user