Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " A simple wrapper for using vim-sandwich interactively
- nnoremap <expr> <leader>c ":normal saiw" . input("Type: ") . "<cr>"
- " Or using a custom function
- function! Wrap(character)
- let save_pos = getpos(".")
- exec "normal saiw" . a:character
- call setpos(".", save_pos)
- endfunction
- inoremap <c-s>" <c-\><c-O>:call Wrap('"')<cr>
- inoremap <c-s>( <c-\><c-O>:call Wrap('(')<cr>
- etc.
- nnoremap <expr> <leader>c ":call Wrap('" . input("Type: ") . "')<cr>"
Add Comment
Please, Sign In to add comment