mappings.vim 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. if !exists('g:vscode')
  2. " Better nav for omnicomplete
  3. inoremap <expr> <c-j> ("\<C-n>")
  4. inoremap <expr> <c-k> ("\<C-p>")
  5. " I hate escape more than anything else
  6. inoremap jk <Esc>
  7. inoremap kj <Esc>
  8. " Easy CAPS
  9. " inoremap <c-u> <ESC>viwUi
  10. " nnoremap <c-u> viwU<Esc>
  11. " TAB in general mode will move to text buffer
  12. nnoremap <TAB> :bnext<CR>
  13. " SHIFT-TAB will go back
  14. nnoremap <S-TAB> :bprevious<CR>
  15. " Alternate way to save
  16. nnoremap <C-s> :w<CR>
  17. " Alternate way to quit
  18. nnoremap <C-Q> :wq!<CR>
  19. " Use control-c instead of escape
  20. nnoremap <C-c> <Esc>
  21. " <TAB>: completion.
  22. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  23. " Better window navigation
  24. nnoremap <C-h> <C-w>h
  25. nnoremap <C-j> <C-w>j
  26. nnoremap <C-k> <C-w>k
  27. nnoremap <C-l> <C-w>l
  28. " Use alt + hjkl to resize windows
  29. nnoremap <M-j> :resize -2<CR>
  30. nnoremap <M-k> :resize +2<CR>
  31. nnoremap <M-h> :vertical resize -2<CR>
  32. nnoremap <M-l> :vertical resize +2<CR>
  33. endif
  34. " Better tabbing
  35. vnoremap < <gv
  36. vnoremap > >gv