init.vim 5.9 KB

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