init.vim 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. """""""""" HOUSEKEEPING """"""""""
  2. syntax on
  3. set nowrap
  4. set encoding=utf8
  5. set mouse=a
  6. set splitbelow
  7. set splitright
  8. " escape can blow me
  9. nnoremap <C-c> <Esc>
  10. " Set Proper Tabs
  11. set tabstop=4
  12. set shiftwidth=4
  13. set smarttab
  14. set expandtab
  15. " Always display the status line
  16. set laststatus=2
  17. " Gets rid of highlights after search
  18. nnoremap <silent> <F7> :nohlsearch<CR><F7>
  19. " Line numbers
  20. set number
  21. " Toggle line numbers
  22. nnoremap <F6> :set nonumber!<CR>
  23. nnoremap <F9> :vsplit<CR>
  24. nnoremap <F10> :split<CR>
  25. nnoremap <F12> :only<CR>
  26. nnoremap <F2> :BuffergatorToggle<CR>
  27. nnoremap <F3> :SyntasticCheck<CR>
  28. " Be iMproved
  29. if &compatible
  30. set nocompatible
  31. endif
  32. " Remap window switch
  33. nnoremap <C-h> <C-w>h
  34. nnoremap <C-j> <C-w>j
  35. nnoremap <C-k> <C-w>k
  36. nnoremap <C-l> <C-w>l
  37. " Remap terminal switch
  38. tnoremap <C-[> <C-\><C-n>
  39. tnoremap <C-c><Esc> <Esc>
  40. tnoremap <C-h> <C-\><C-n><C-w>h
  41. tnoremap <C-j> <C-\><C-n><C-w>j
  42. tnoremap <C-k> <C-\><C-n><C-w>k
  43. tnoremap <C-l> <C-\><C-n><C-w>l
  44. " <TAB>: completion.
  45. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  46. " Enable Elite mode, No ARRRROWWS!!!!
  47. let g:elite_mode=1
  48. " Disable arrow movement, resize splits instead.
  49. if get(g:, 'elite_mode')
  50. nnoremap <Up> :resize -2<CR>
  51. nnoremap <Down> :resize +2<CR>
  52. nnoremap <Left> :vertical resize -2<CR>
  53. nnoremap <Right> :vertical resize +2<CR>
  54. endif
  55. """""""""" END HOUSEKEEPING """"""""""
  56. """""""""" PLUGINS """"""""""
  57. " Required:
  58. set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
  59. " Required:
  60. if dein#load_state('~/chris/.cache/dein')
  61. call dein#begin('~/.cache/dein')
  62. " Let dein manage dein
  63. " Required:
  64. call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
  65. " Start Screen
  66. call dein#add('mhinz/vim-startify')
  67. " Search Index shows how many instances of searched term
  68. call dein#add('google/vim-searchindex')
  69. " line indents
  70. "call dein#add('Yggdroot/indentLine')
  71. " Gutentags
  72. call dein#add('ludovicchabant/vim-gutentags')
  73. " Tagbar
  74. call dein#add('majutsushi/tagbar')
  75. " Add or remove your plugins here: TODO
  76. call dein#add('Shougo/neosnippet.vim')
  77. call dein#add('Shougo/neosnippet-snippets')
  78. " Themes
  79. call dein#add('liuchengxu/space-vim-dark')
  80. call dein#add('nightsense/stellarized')
  81. call dein#add('vim-airline/vim-airline')
  82. call dein#add('vim-airline/vim-airline-themes')
  83. call dein#add('chriskempson/base16-vim')
  84. " Auto Pairs
  85. call dein#add('jiangmiao/auto-pairs')
  86. " Buffergator use \b
  87. call dein#add('jeetsukumaran/vim-buffergator')
  88. " Ctrlp
  89. call dein#add('ctrlpvim/ctrlp.vim')
  90. " Searchtasks searches for TODO, FIXME, XXX and such run :SearchTasks .
  91. call dein#add('gilsondev/searchtasks.vim')
  92. " Syntax
  93. call dein#add('w0rp/ale')
  94. " Multiple Cursors
  95. call dein#add('terryma/vim-multiple-cursors')
  96. " NERDTree
  97. call dein#add('scrooloose/nerdtree')
  98. " BufOnly use :BufOnly to unload all or pass it a single buffer
  99. call dein#add('vim-scripts/BufOnly.vim')
  100. " For autocomplete
  101. call dein#add('zchee/deoplete-jedi')
  102. call dein#add('Shougo/deoplete.nvim')
  103. " For vim 8+
  104. if !has('nvim')
  105. call dein#add('roxma/nvim-yarp')
  106. call dein#add('roxma/vim-hug-neovim-rpc')
  107. endif
  108. " You can specify revision/branch/tag.
  109. call dein#add('Shougo/deol.nvim', { 'rev': '01203d4c9' })
  110. " Required:
  111. call dein#end()
  112. call dein#save_state()
  113. endif
  114. " Required:
  115. filetype plugin indent on
  116. syntax enable
  117. " If you want to install not installed plugins on startup.
  118. if dein#check_install()
  119. call dein#install()
  120. endif
  121. """""""""" END PLUGINS """"""""""
  122. """""""""" SPACEVIM THEME """"""""""
  123. " Set theme
  124. if strftime('%H') >= 7 && strftime('%H') < 10
  125. set background=light
  126. colorscheme stellarized
  127. else
  128. let g:airline_theme='violet'
  129. set background=dark
  130. colorscheme space-vim-dark
  131. " Range: 233 (darkest) ~ 238 (lightest)
  132. " Default: 235
  133. let g:space_vim_dark_background = 233
  134. color space-vim-dark
  135. hi Comment guifg=#5C6370 ctermfg=59
  136. let base16colorspace=256 " Access colors present in 256 colorspace
  137. let g:airline#extensions#tabline#enabled = 1
  138. let g:airline_powerline_fonts = 1
  139. let g:hybrid_custom_term_colors = 1
  140. endif
  141. " Enable highlighting of the current line
  142. set cursorline
  143. """""""""" END THEME """"""""""
  144. """""""""" BEGIN CONFIGS """"""""""
  145. " Deoplete
  146. let g:deoplete#enable_at_startup = 1
  147. " Startify
  148. let g:startify_custom_header = [
  149. \ ' _ __ _ ',
  150. \ ' / | / /__ ____ _ __(_)___ ___ ',
  151. \ ' / |/ / _ \/ __ \ | / / / __ `__ \',
  152. \ ' / /| / __/ /_/ / |/ / / / / / / /',
  153. \ ' /_/ |_/\___/\____/|___/_/_/ /_/ /_/ ']
  154. let g:syntastic_cpp_config_file='.syntastic_cpp_config'
  155. " Tagbar
  156. nmap <F8> :TagbarToggle<CR>
  157. " NERDTree
  158. nmap <F5> :NERDTreeToggle<CR>
  159. " SearchTasks
  160. nmap <F4> :SearchTasks *<CR>
  161. """""""""" END CONFIGS """"""""""
  162. " Ctrlp
  163. let g:ctrlp_map = '<c-p>'
  164. let g:ctrlp_cmd = 'CtrlP'
  165. " MULTI CURSOR
  166. let g:multi_cursor_use_default_mapping=0
  167. " Default mapping
  168. let g:multi_cursor_start_word_key = '<C-n>'
  169. let g:multi_cursor_select_all_word_key = '<A-n>'
  170. let g:multi_cursor_start_key = 'g<C-n>'
  171. let g:multi_cursor_select_all_key = 'g<A-n>'
  172. let g:multi_cursor_next_key = '<C-n>'
  173. let g:multi_cursor_prev_key = '<C-p>'
  174. let g:multi_cursor_skip_key = '<C-x>'
  175. let g:multi_cursor_quit_key = '<Esc>'
  176. " ALE
  177. let g:ale_linters = {
  178. \ 'cpp' : ['gcc'],
  179. \ 'c' : ['gcc']
  180. \}
  181. let g:ale_cpp_gcc_options='-Wall -Wextra'
  182. let g:ale_c_gcc_options='-Wall -Wextra'
  183. " Python
  184. if !empty(glob("/bin/python3.6"))
  185. " For RHEL
  186. let g:python3_host_prog = '/bin/python3.6'
  187. else
  188. " For Debian based
  189. let g:python3_host_prog = '/usr/bin/python3.6'
  190. endif
  191. """"""""""" FUNCTION KEYS """"""""""""""
  192. "TODO figure out cscope
  193. "TODO create function key section
  194. "TODO figure out virtualenv for neovim