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.

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