general.vim 4.0 KB

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