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