You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
2.0KB

  1. " Map leader
  2. map <Space> <leader>
  3. map <Space><Space> <leader><leader>
  4. let mapleader = " "
  5. map <leader><leader><leader> :hi Normal ctermbg=NONE<CR>:hi EndOfBuffer ctermbg=NONE<CR>
  6. " Quickfix navigation
  7. noremap <Up> :cprev<CR>
  8. noremap <Down> :cnext<CR>
  9. " Play default macro
  10. noremap <leader>q @q
  11. " Bepo mappings
  12. noremap t h
  13. noremap r l
  14. noremap T H
  15. noremap R L
  16. noremap L D
  17. noremap h r
  18. noremap H R
  19. noremap j t
  20. noremap l d
  21. " Scrolling
  22. noremap <C-D> <C-Y>
  23. noremap <C-S> <C-E>
  24. " Movements (by displayed line)
  25. noremap d gk
  26. noremap s gj
  27. " Swap display line behavior
  28. noremap gd k
  29. noremap gs j
  30. noremap 0 g0
  31. noremap g0 0
  32. noremap $ g$
  33. noremap g$ $
  34. noremap ^ g^
  35. noremap g^ ^
  36. " Page up/down
  37. noremap D <C-u>
  38. noremap S <C-d>
  39. " Next and previous in 'f' search to match standard scheme
  40. noremap , ;
  41. noremap ; ,
  42. " Windows
  43. nmap é <C-w>
  44. noremap <C-W>h <C-W>s<C-W>j
  45. noremap <C-W>v <C-W>v
  46. noremap <C-W>é <C-w><C-w>
  47. noremap <C-W>/ 4<C-W><
  48. noremap <C-W>* 4<C-W>>
  49. noremap <C-W>+ 4<C-W>+
  50. noremap <C-W>- 4<C-W>-
  51. noremap <C-W>t <C-W>h
  52. noremap <C-W>r <C-W>l
  53. noremap <C-W>d <C-W>k
  54. noremap <C-W>s <C-W>j
  55. noremap <C-W>T <C-W>H
  56. noremap <C-W>R <C-W>L
  57. noremap <C-W>D <C-W>K
  58. noremap <C-W>S <C-W>J
  59. noremap <C-W>n :vnew<CR>
  60. noremap <C-W>f :vsplit<CR>gf
  61. " Tabs
  62. nnoremap ggt gt
  63. nnoremap ggl :tabclose<CR>
  64. nnoremap ggn :tabnew<CR>
  65. " buffers as tabs
  66. nnoremap gt :bnext<CR>
  67. nnoremap gT :bprevious<CR>
  68. nnoremap gn :enew<CR>
  69. nnoremap gl :bprevious<CR>:bdelete #<CR>
  70. nnoremap gL :bprevious<CR>:bdelete! #<CR>
  71. " fold navigation
  72. noremap zs zj
  73. noremap zd zk
  74. noremap zt zm
  75. noremap zT zM
  76. " Spell errors navigation
  77. noremap zv [s
  78. noremap zl ]s
  79. " Insert lines
  80. noremap <leader>o o<Esc>
  81. noremap <leader>O O<Esc>
  82. " follow links, C-] is impossible to type
  83. noremap _ <C-]>
  84. " disable Ex mode
  85. noremap Q <nop>
  86. " have Y work like D and C (ie: yank the line right of the cursor)
  87. nnoremap Y y$
  88. " remap ii to Esc in insert mode, easier !
  89. inoremap ii <Esc>
  90. " Write with root privileges
  91. command! WW execute "w suda://%"
  92. command! W execute "w"
  93. " Edit vimrc
  94. nnoremap <leader>$ :e $MYVIMRC<CR>
  95. " Exit terminal
  96. tnoremap ii <C-\><C-n>