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.

201 lines
5.3 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 'luochen1990/rainbow'
  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. " automatically adjust shiftwidth and expand tab based on current file
  38. Plug 'tpope/vim-sleuth'
  39. let g:deoplete#enable_at_startup = 1
  40. " Plugin deoplete neosnippet key-mappings.
  41. " Note: It must be "imap" and "smap". It uses <Plug> mappings.
  42. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  43. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  44. xmap <C-k> <Plug>(neosnippet_expand_target)
  45. " colors
  46. Plug 'tomasr/molokai'
  47. Plug 'srcery-colors/srcery-vim'
  48. Plug 'rakr/vim-one'
  49. Plug 'morhetz/gruvbox'
  50. Plug 'toupeira/vim-desertink'
  51. Plug 'maksimr/Lucius2'
  52. let g:srcery_italic = 1
  53. call plug#end()
  54. " visual
  55. syntax on
  56. set ruler
  57. set number
  58. set title
  59. set titlestring=nvim-%F
  60. set t_Co=256
  61. set cursorline
  62. set background=dark " for the dark version
  63. "Credit joshdick
  64. "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
  65. "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
  66. "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
  67. if (empty($TMUX))
  68. if (has("nvim"))
  69. "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  70. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  71. endif
  72. "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  73. "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  74. " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  75. if (has("termguicolors"))
  76. set termguicolors
  77. endif
  78. endif
  79. if $COLORTERM == 'gnome-terminal'
  80. set term=gnome-256color
  81. else
  82. if $TERM == 'xterm'
  83. set term=xterm-256color
  84. endif
  85. endif
  86. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  87. " go
  88. let g:go_auto_sameids = 1
  89. "" go config
  90. function! s:build_go_files()
  91. let l:file = expand('%')
  92. if l:file =~# '^\f\+\.go$'
  93. call go#cmd#Build(0)
  94. endif
  95. endfunction
  96. let g:go_list_type = "quickfix"
  97. let g:go_fmt_command = "goimports"
  98. let g:go_fmt_fail_silently = 1
  99. let g:go_highlight_types = 1
  100. let g:go_highlight_fields = 1
  101. let g:go_highlight_functions = 1
  102. let g:go_highlight_methods = 1
  103. let g:go_highlight_operators = 1
  104. let g:go_highlight_build_constraints = 1
  105. let g:go_highlight_structs = 1
  106. let g:go_highlight_generate_tags = 1
  107. let g:go_highlight_space_tab_error = 0
  108. let g:go_highlight_array_whitespace_error = 0
  109. let g:go_highlight_trailing_whitespace_error = 0
  110. let g:go_highlight_extra_types = 1
  111. " NERDTree
  112. let NERDTreeShowHidden=1
  113. autocmd vimenter * NERDTree
  114. map <C-n> :NERDTreeToggle<CR>
  115. " NERDCommenter
  116. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  117. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  118. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  119. " vim-airline
  120. "" let g:airline_theme = 'powerlineish'
  121. let g:airline_theme='one'
  122. let g:airline#extensions#syntastic#enabled = 1
  123. let g:airline#extensions#branch#enabled = 1
  124. let g:airline#extensions#tabline#enabled = 1
  125. let g:airline#extensions#tabline#buffer_nr_show = 1
  126. let g:airline#extensions#tagbar#enabled = 1
  127. let g:airline_skip_empty_sections = 1
  128. " syntastic
  129. let g:syntastic_always_populate_loc_list=1
  130. let g:syntastic_error_symbol='✗'
  131. let g:syntastic_warning_symbol='⚠'
  132. let g:syntastic_style_error_symbol = '✗'
  133. let g:syntastic_style_warning_symbol = '⚠'
  134. let g:syntastic_auto_loc_list=1
  135. let g:syntastic_aggregate_errors = 1
  136. let g:syntastic_go_checkers = ['golint', 'govet']
  137. let g:syntastic_python_checkers = []
  138. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  139. " rainbowparentheses
  140. let g:rainbow_active = 1
  141. " abbreviations
  142. cnoreabbrev W! w!
  143. cnoreabbrev Q! q!
  144. cnoreabbrev Qall! qall!
  145. cnoreabbrev Wq wq
  146. cnoreabbrev Wa wa
  147. cnoreabbrev wQ wq
  148. cnoreabbrev WQ wq
  149. cnoreabbrev W w
  150. cnoreabbrev Q q
  151. cnoreabbrev Qall qall
  152. "" Switching windows
  153. noremap <C-j> <C-w>j
  154. noremap <C-k> <C-w>k
  155. noremap <C-l> <C-w>l
  156. noremap <C-h> <C-w>h
  157. "" esc mapping
  158. inoremap jk <ESC>
  159. tnoremap jk <C-\><C-n>
  160. " scroll
  161. set scrolloff=5 " keep at least 5 lines above/below
  162. set sidescrolloff=5 " keep at least 5 lines left/right
  163. colorscheme molokai