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.

161 lines
4.3 KiB

6 years ago
  1. "" github.com/arnaucube/configs
  2. call plug#begin(expand('~/.config/nvim/plugged'))
  3. Plug 'scrooloose/nerdtree'
  4. Plug 'jistr/vim-nerdtree-tabs'
  5. Plug 'vim-airline/vim-airline'
  6. Plug 'vim-airline/vim-airline-themes'
  7. Plug 'airblade/vim-gitgutter'
  8. Plug 'Raimondi/delimitMate'
  9. Plug 'scrooloose/syntastic'
  10. Plug 'scrooloose/nerdcommenter'
  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. " 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. set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
  64. " go
  65. let g:go_auto_sameids = 1
  66. " vim-airline
  67. "" let g:airline_theme = 'powerlineish'
  68. let g:airline_theme='one'
  69. let g:airline#extensions#syntastic#enabled = 1
  70. let g:airline#extensions#branch#enabled = 1
  71. let g:airline#extensions#tabline#enabled = 1
  72. let g:airline#extensions#tagbar#enabled = 1
  73. let g:airline_skip_empty_sections = 1
  74. " abbreviations
  75. cnoreabbrev W! w!
  76. cnoreabbrev Q! q!
  77. cnoreabbrev Qall! qall!
  78. cnoreabbrev Wq wq
  79. cnoreabbrev Wa wa
  80. cnoreabbrev wQ wq
  81. cnoreabbrev WQ wq
  82. cnoreabbrev W w
  83. cnoreabbrev Q q
  84. cnoreabbrev Qall qall
  85. let g:deoplete#enable_at_startup = 1
  86. let g:srcery_italic = 1
  87. " NERDTree
  88. let NERDTreeShowHidden=1
  89. autocmd vimenter * NERDTree
  90. map <C-n> :NERDTreeToggle<CR>
  91. " NERDCommenter
  92. let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
  93. let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
  94. let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
  95. "" Switching windows
  96. noremap <C-j> <C-w>j
  97. noremap <C-k> <C-w>k
  98. noremap <C-l> <C-w>l
  99. noremap <C-h> <C-w>h
  100. " syntastic
  101. let g:syntastic_always_populate_loc_list=1
  102. let g:syntastic_error_symbol='✗'
  103. let g:syntastic_warning_symbol='⚠'
  104. let g:syntastic_style_error_symbol = '✗'
  105. let g:syntastic_style_warning_symbol = '⚠'
  106. let g:syntastic_auto_loc_list=1
  107. let g:syntastic_aggregate_errors = 1
  108. "" go config
  109. function! s:build_go_files()
  110. let l:file = expand('%')
  111. if l:file =~# '^\f\+\.go$'
  112. call go#cmd#Build(0)
  113. endif
  114. endfunction
  115. let g:go_list_type = "quickfix"
  116. let g:go_fmt_command = "goimports"
  117. let g:go_fmt_fail_silently = 1
  118. let g:syntastic_go_checkers = ['golint', 'govet']
  119. let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
  120. let g:go_highlight_types = 1
  121. let g:go_highlight_fields = 1
  122. let g:go_highlight_functions = 1
  123. let g:go_highlight_methods = 1
  124. let g:go_highlight_operators = 1
  125. let g:go_highlight_build_constraints = 1
  126. let g:go_highlight_structs = 1
  127. let g:go_highlight_generate_tags = 1
  128. let g:go_highlight_space_tab_error = 0
  129. let g:go_highlight_array_whitespace_error = 0
  130. let g:go_highlight_trailing_whitespace_error = 0
  131. let g:go_highlight_extra_types = 1