Guest User

Untitled

a guest
Jan 3rd, 2022
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.29 KB | None | 0 0
  1. "" Copy/Paste/Cut
  2. if has('unnamedplus')
  3.   set clipboard=unnamed,unnamedplus
  4. endif
  5. set foldmethod=indent
  6.  
  7. nmap o o<Esc>
  8. nmap O O<Esc>
  9.  
  10. nmap ;;' :set opfunc=WrapWithQuotes<CR>g@
  11. vmap ;;' <Esc>`<i'<Esc>`>a'<Esc>
  12. imap ;;' ''<Left>
  13.  
  14. nmap ;;" :set opfunc=WrapWithDoubleQuotes<CR>g@
  15. vmap ;;" <Esc>`<i"<Esc>`>a"<Esc>
  16. imap ;;" ""<Left>
  17.  
  18. nmap ;;( :set opfunc=WrapWithParentheses<CR>g@
  19. vmap ;;( <Esc>`<i(<Esc>`>a)<Esc>
  20. imap ;;( ()<Left>
  21.  
  22. nmap ;;{ :set opfunc=WrapWithCurlyBrackets<CR>g@
  23. vmap ;;{ <Esc>`<i{<Esc>`>a}<Esc>
  24. imap ;;{ {}<Left>
  25.  
  26. nmap ;;[ :set opfunc=WrapWithSquareBrackets<CR>g@
  27. vmap ;;[ <Esc>`<i[<Esc>`>a]<Esc>
  28. imap ;;[ []<Left>
  29.  
  30. nmap ;;< :set opfunc=WrapWithTriangleBrackets<CR>g@
  31. vmap ;;< <Esc>`<i<<Esc>`>a><Esc>
  32. imap ;;< <><left>
  33.  
  34. nmap ,, :set opfunc=WrapWithParentheses<CR>g@
  35.  
  36. function! WrapWithQuotes(type)
  37.    normal! `[v`]`<i'`>la'
  38. endfunction
  39.  
  40. function! WrapWithDoubleQuotes(type)
  41.    normal! `[v`]`<i"`>la"
  42. endfunction
  43.  
  44. function! WrapWithParentheses(type)
  45.    normal! `[v`]`<i(`>la)
  46. endfunction
  47.  
  48. function! WrapWithSquareBrackets(type)
  49.    normal! `[v`]`<i[`>la]
  50. endfunction
  51.  
  52. function! WrapWithCurlyBrackets(type)
  53.    normal! `[v`]`<i{`>la}
  54. endfunction
  55.  
  56. function! WrapWithTriangleBrackets(type)
  57.    normal! `[v`]`<i<`>la>
  58. endfunction
Advertisement
Add Comment
Please, Sign In to add comment