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.

218 lines
5.9 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. call plug#begin(expand('~/.config/nvim/plugged'))
  2. " NERDTree
  3. Plug 'scrooloose/nerdtree'
  4. Plug 'jistr/vim-nerdtree-tabs'
  5. Plug 'scrooloose/nerdcommenter'
  6. " vim-airline
  7. Plug 'vim-airline/vim-airline'
  8. Plug 'vim-airline/vim-airline-themes'
  9. " syntastic
  10. Plug 'scrooloose/syntastic'
  11. Plug 'airblade/vim-gitgutter'
  12. Plug 'Raimondi/delimitMate'
  13. Plug 'majutsushi/tagbar'
  14. " rainbow parentheses
  15. Plug 'kien/rainbow_parentheses.vim'
  16. " go
  17. Plug 'fatih/vim-go' " Amazing combination of features.
  18. Plug 'godoctor/godoctor.vim' " Some refactoring tools
  19. " rust
  20. "" will need to install https://github.com/racer-rust/racer
  21. Plug 'racer-rust/vim-racer'
  22. Plug 'rust-lang/rust.vim'
  23. set hidden
  24. let g:racer_cmd = "/home/user/.cargo/bin/racer"
  25. let g:racer_experimental_completer = 1
  26. " javascript
  27. Plug 'jelera/vim-javascript-syntax'
  28. " python
  29. Plug 'davidhalter/jedi-vim'
  30. Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
  31. " deoplete
  32. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  33. Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  34. " neosnippet with deoplete
  35. Plug 'Shougo/neosnippet.vim'
  36. Plug 'Shougo/neosnippet-snippets'
  37. let g:deoplete#enable_at_startup = 1
  38. " Plugin deoplete neosnippet key-mappings.
  39. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  40. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  41. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  42. xmap <C-k> <Plug>(neosnippet_expand_target)
  43. " colors
  44. Plug 'tomasr/molokai'
  45. Plug 'srcery-colors/srcery-vim'
  46. Plug 'rakr/vim-one'
  47. Plug 'morhetz/gruvbox'
  48. let g:srcery_italic = 1
  49. call plug#end()
  50. " visual
  51. syntax on
  52. set ruler
  53. set number
  54. set title
  55. set titlestring=nvim-%F
  56. set t_Co=256
  57. set cursorline
  58. set background=dark " for the dark version
  59. "Credit joshdick
  60. "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
  61. "If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
  62. "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
  63. if (empty($TMUX))
  64. if (has("nvim"))
  65. "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  66. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  67. endif
  68. "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  69. "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  70. " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  71. if (has("termguicolors"))
  72. set termguicolors
  73. endif
  74. endif
  75. if $COLORTERM == 'gnome-terminal'
  76. set term=gnome-256color
  77. else
  78. if $TERM == 'xterm'
  79. set term=xterm-256color
  80. endif
  81. endif
  82. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  83. " go
  84. let g:go_auto_sameids = 1
  85. "" go config
  86. function! s:build_go_files()
  87. let l:file = expand('%')
  88. if l:file =~# '^\f\+\.go$'
  89. call go#cmd#Build(0)
  90. endif
  91. endfunction
  92. let g:go_list_type = "quickfix"
  93. let g:go_fmt_command = "goimports"
  94. let g:go_fmt_fail_silently = 1
  95. let g:go_highlight_types = 1
  96. let g:go_highlight_fields = 1
  97. let g:go_highlight_functions = 1
  98. let g:go_highlight_methods = 1
  99. let g:go_highlight_operators = 1
  100. let g:go_highlight_build_constraints = 1
  101. let g:go_highlight_structs = 1
  102. let g:go_highlight_generate_tags = 1
  103. let g:go_highlight_space_tab_error = 0
  104. let g:go_highlight_array_whitespace_error = 0
  105. let g:go_highlight_trailing_whitespace_error = 0
  106. let g:go_highlight_extra_types = 1
  107. " NERDTree
  108. let NERDTreeShowHidden=1
  109. autocmd vimenter * NERDTree
  110. map <C-n> :NERDTreeToggle<CR>
  111. " NERDCommenter
  112. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  113. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  114. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  115. " vim-airline
  116. "" let g:airline_theme = 'powerlineish'
  117. let g:airline_theme='one'
  118. let g:airline#extensions#syntastic#enabled = 1
  119. let g:airline#extensions#branch#enabled = 1
  120. let g:airline#extensions#tabline#enabled = 1
  121. let g:airline#extensions#tabline#buffer_nr_show = 1
  122. let g:airline#extensions#tagbar#enabled = 1
  123. let g:airline_skip_empty_sections = 1
  124. " syntastic
  125. let g:syntastic_always_populate_loc_list=1
  126. let g:syntastic_error_symbol='✗'
  127. let g:syntastic_warning_symbol='⚠'
  128. let g:syntastic_style_error_symbol = '✗'
  129. let g:syntastic_style_warning_symbol = '⚠'
  130. let g:syntastic_auto_loc_list=1
  131. let g:syntastic_aggregate_errors = 1
  132. let g:syntastic_go_checkers = ['golint', 'govet']
  133. let g:syntastic_python_checkers = []
  134. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  135. " rainbowparentheses
  136. let g:rbpt_colorpairs = [
  137. \ ['brown', 'RoyalBlue3'],
  138. \ ['Darkblue', 'SeaGreen3'],
  139. \ ['darkgray', 'DarkOrchid3'],
  140. \ ['darkgreen', 'firebrick3'],
  141. \ ['darkcyan', 'RoyalBlue3'],
  142. \ ['darkred', 'SeaGreen3'],
  143. \ ['darkmagenta', 'DarkOrchid3'],
  144. \ ['brown', 'firebrick3'],
  145. \ ['gray', 'RoyalBlue3'],
  146. \ ['black', 'SeaGreen3'],
  147. \ ['darkmagenta', 'DarkOrchid3'],
  148. \ ['Darkblue', 'firebrick3'],
  149. \ ['darkgreen', 'RoyalBlue3'],
  150. \ ['darkcyan', 'SeaGreen3'],
  151. \ ['darkred', 'DarkOrchid3'],
  152. \ ['red', 'firebrick3'],
  153. \ ]
  154. let g:rbt_max = 16
  155. let g:rbpt_loadcmd_toggle = 0
  156. au VimEnter * RainbowParenthesesToggle
  157. au Syntax * RainbowParenthesesLoadRound
  158. au Syntax * RainbowParenthesesLoadSquare
  159. au Syntax * RainbowParenthesesLoadBraces
  160. " abbreviations
  161. cnoreabbrev W! w!
  162. cnoreabbrev Q! q!
  163. cnoreabbrev Qall! qall!
  164. cnoreabbrev Wq wq
  165. cnoreabbrev Wa wa
  166. cnoreabbrev wQ wq
  167. cnoreabbrev WQ wq
  168. cnoreabbrev W w
  169. cnoreabbrev Q q
  170. cnoreabbrev Qall qall
  171. "" Switching windows
  172. noremap <C-j> <C-w>j
  173. noremap <C-k> <C-w>k
  174. noremap <C-l> <C-w>l
  175. noremap <C-h> <C-w>h
  176. "" esc mapping
  177. inoremap jk <ESC>
  178. tnoremap jk <C-\><C-n>
  179. " scroll
  180. set scrolloff=5 " keep at least 5 lines above/below
  181. set sidescrolloff=5 " keep at least 5 lines left/right
  182. colorscheme molokai