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.

171 lines
4.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. call plug#begin(expand('~/.config/nvim/plugged'))
  2. Plug 'scrooloose/nerdtree'
  3. Plug 'jistr/vim-nerdtree-tabs'
  4. Plug 'vim-airline/vim-airline'
  5. Plug 'vim-airline/vim-airline-themes'
  6. Plug 'airblade/vim-gitgutter'
  7. Plug 'Raimondi/delimitMate'
  8. Plug 'scrooloose/syntastic'
  9. Plug 'scrooloose/nerdcommenter'
  10. " go
  11. Plug 'fatih/vim-go' " Amazing combination of features.
  12. Plug 'godoctor/godoctor.vim' " Some refactoring tools
  13. " rust
  14. "" will need to install https://github.com/racer-rust/racer
  15. Plug 'racer-rust/vim-racer'
  16. Plug 'rust-lang/rust.vim'
  17. set hidden
  18. let g:racer_cmd = "/home/user/.cargo/bin/racer"
  19. let g:racer_experimental_completer = 1
  20. " javascript
  21. Plug 'jelera/vim-javascript-syntax'
  22. " python
  23. Plug 'davidhalter/jedi-vim'
  24. Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
  25. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  26. Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
  27. " colors
  28. Plug 'tomasr/molokai'
  29. Plug 'srcery-colors/srcery-vim'
  30. Plug 'rakr/vim-one'
  31. Plug 'morhetz/gruvbox'
  32. call plug#end()
  33. " setup
  34. " visual
  35. syntax on
  36. set ruler
  37. set number
  38. set title
  39. set titlestring=nvim-%F
  40. set t_Co=256
  41. set cursorline
  42. " colorscheme one
  43. " set background=dark
  44. "Credit joshdick
  45. "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
  46. "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
  47. "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
  48. if (empty($TMUX))
  49. if (has("nvim"))
  50. "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  51. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  52. endif
  53. "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  54. "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  55. " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  56. if (has("termguicolors"))
  57. set termguicolors
  58. endif
  59. endif
  60. set background=dark " for the dark version
  61. " set background=light " for the light version
  62. " colorscheme one
  63. colorscheme molokai
  64. if $COLORTERM == 'gnome-terminal'
  65. set term=gnome-256color
  66. else
  67. if $TERM == 'xterm'
  68. set term=xterm-256color
  69. endif
  70. endif
  71. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  72. " go
  73. let g:go_auto_sameids = 1
  74. " vim-airline
  75. "" let g:airline_theme = 'powerlineish'
  76. let g:airline_theme='one'
  77. let g:airline#extensions#syntastic#enabled = 1
  78. let g:airline#extensions#branch#enabled = 1
  79. let g:airline#extensions#tabline#enabled = 1
  80. let g:airline#extensions#tagbar#enabled = 1
  81. let g:airline_skip_empty_sections = 1
  82. " abbreviations
  83. cnoreabbrev W! w!
  84. cnoreabbrev Q! q!
  85. cnoreabbrev Qall! qall!
  86. cnoreabbrev Wq wq
  87. cnoreabbrev Wa wa
  88. cnoreabbrev wQ wq
  89. cnoreabbrev WQ wq
  90. cnoreabbrev W w
  91. cnoreabbrev Q q
  92. cnoreabbrev Qall qall
  93. let g:deoplete#enable_at_startup = 1
  94. let g:srcery_italic = 1
  95. " NERDTree
  96. let NERDTreeShowHidden=1
  97. autocmd vimenter * NERDTree
  98. map <C-n> :NERDTreeToggle<CR>
  99. " NERDCommenter
  100. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  101. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  102. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  103. "" Switching windows
  104. noremap <C-j> <C-w>j
  105. noremap <C-k> <C-w>k
  106. noremap <C-l> <C-w>l
  107. noremap <C-h> <C-w>h
  108. " syntastic
  109. let g:syntastic_always_populate_loc_list=1
  110. let g:syntastic_error_symbol='✗'
  111. let g:syntastic_warning_symbol='⚠'
  112. let g:syntastic_style_error_symbol = '✗'
  113. let g:syntastic_style_warning_symbol = '⚠'
  114. let g:syntastic_auto_loc_list=1
  115. let g:syntastic_aggregate_errors = 1
  116. "" go config
  117. function! s:build_go_files()
  118. let l:file = expand('%')
  119. if l:file =~# '^\f\+\.go$'
  120. call go#cmd#Build(0)
  121. endif
  122. endfunction
  123. let g:go_list_type = "quickfix"
  124. let g:go_fmt_command = "goimports"
  125. let g:go_fmt_fail_silently = 1
  126. let g:syntastic_go_checkers = ['golint', 'govet']
  127. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  128. let g:go_highlight_types = 1
  129. let g:go_highlight_fields = 1
  130. let g:go_highlight_functions = 1
  131. let g:go_highlight_methods = 1
  132. let g:go_highlight_operators = 1
  133. let g:go_highlight_build_constraints = 1
  134. let g:go_highlight_structs = 1
  135. let g:go_highlight_generate_tags = 1
  136. let g:go_highlight_space_tab_error = 0
  137. let g:go_highlight_array_whitespace_error = 0
  138. let g:go_highlight_trailing_whitespace_error = 0
  139. let g:go_highlight_extra_types = 1
  140. "" esc mapping
  141. inoremap jk <ESC>