general.vim 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. " Be IMproved
  2. if &compatible
  3. set nocompatible
  4. endif
  5. " set leader key
  6. let g:mapleader = "\<Space>"
  7. " set local leader key
  8. let g:maplocalleader = ','
  9. syntax enable " Enables syntax highlighing
  10. set hidden " Required for specific actions that require multiple buffers
  11. set nowrap " display long lines as just one line
  12. set encoding=utf-8 " The encoding displayed
  13. set pumheight=10 " Makes popup menu smaller
  14. set fileencoding=utf-8 " The encoding written to file
  15. set ruler " show the cursor position all the time
  16. set cmdheight=2 " always keep this at 2"
  17. set iskeyword+=- " treat dash separated words as a word text object"
  18. set mouse=a " Enable your mouse
  19. set splitbelow " Horizontal splits will automatically be below
  20. set splitright " Vertical splits will automatically be to the right
  21. set t_Co=256 " Support 256 colors
  22. set autochdir " Your working directory will always be the same as your working directory
  23. set conceallevel=0 " So that I can see `` in markdown files
  24. set tabstop=2 " Insert 2 spaces for a tab
  25. set shiftwidth=2 " Change the number of space characters inserted for indentation
  26. set smarttab " Makes tabbing smarter will realize you have 2 vs 4
  27. set expandtab " Converts tabs to spaces
  28. set smartindent " Makes indenting smart
  29. set autoindent " Good auto indent
  30. set laststatus=0 " Always display the status line
  31. set number " Line numbers
  32. set cursorline " Enable highlighting of the current line
  33. set background=dark " tell vim what the background color looks like
  34. let g:elite_mode=1 " Disable arrows"
  35. filetype plugin indent on " Gives vim abilty to recognize filetypes
  36. " Disable arrow movement, resize splits instead.
  37. if get(g:, 'elite_mode')
  38. nnoremap <Up> :resize -2<CR>
  39. nnoremap <Down> :resize +2<CR>
  40. nnoremap <Left> :vertical resize -2<CR>
  41. nnoremap <Right> :vertical resize +2<CR>
  42. endif
  43. " Alternate way to save
  44. nnoremap <C-s> :w<CR>
  45. " Alternate way to quit
  46. nnoremap <C-Q> :wq!<CR>
  47. " Use control-c instead of escape
  48. nnoremap <C-c> <Esc>
  49. " <TAB>: completion.
  50. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  51. " Open terminal with F1
  52. nnoremap <silent> <F1> :10split term://bash<CR>
  53. nnoremap <silent> <F2> :bdelete! term://*<return>
  54. nnoremap <C-h> <C-w>h
  55. nnoremap <C-j> <C-w>j
  56. nnoremap <C-k> <C-w>k
  57. nnoremap <C-l> <C-w>l
  58. " Remap terminal switch
  59. tnoremap <C-[> <C-\><C-n>
  60. tnoremap <C-c><Esc> <Esc>
  61. tnoremap <C-h> <C-\><C-n><C-w>h
  62. tnoremap <C-j> <C-\><C-n><C-w>j
  63. tnoremap <C-k> <C-\><C-n><C-w>k
  64. tnoremap <C-l> <C-\><C-n><C-w>l
  65. nnoremap <M-h> <C-w>h
  66. nnoremap <M-j> <C-w>j
  67. nnoremap <M-k> <C-w>k
  68. nnoremap <M-l> <C-w>l
  69. " I think this does something on mac but I might be full of shit
  70. nnoremap <D-h> <C-w>h
  71. nnoremap <D-j> <C-w>j
  72. nnoremap <D-k> <C-w>k
  73. nnoremap <D-l> <C-w>l
  74. " I hate escape more than anything else
  75. inoremap jk <Esc>
  76. inoremap kj <Esc>
  77. " This is how much I hate it
  78. inoremap <esc> <nop>
  79. " Easy CAPS
  80. inoremap <c-u> <ESC>viwUi
  81. nnoremap <c-u> viwU<Esc>
  82. " TAB in general mode will move to text buffer
  83. nnoremap <C-TAB> :VimwikiNextLink<CR>
  84. " SHIFT-TAB will go back
  85. nnoremap <C-S-TAB> :VimwikiPrevLink<CR>
  86. "nmap <Leader>wn <Plug>VimwikiNextLink
  87. "nmap <Leader>wp <Plug>VimwikiPrevLink
  88. " TAB in general mode will move to text buffer
  89. nnoremap <TAB> :bnext<CR>
  90. " SHIFT-TAB will go back
  91. nnoremap <S-TAB> :bprevious<CR>
  92. " Copy paste between vim and everything else
  93. set clipboard=unnamedplus
  94. " hold when tabbing
  95. vnoremap < <gv
  96. vnoremap > >gv
  97. set conceallevel=0
  98. cmap w!! w !sudo tee %