rc

Removed JavaComplete2.vim from .vimrc. It only works properly on the Java STL, blocks my own class completions (Which YCM does very well) and inserts annoying opening brackets. Fuck Java, really.

Author
Vngngdn
Date
Nov. 24, 2016, 4:37 p.m.
Hash
4f88ae85b8918bc1b4ba31c4b1c264dcdd5f3149
Parent
457c85b53ffb7a4ce21a68cc822f3b0f9605143c
Modified file
.vimrc

.vimrc

0 additions and 26 deletions.

View changes Hide changes
1
1
" Some details on the contents:
2
2
" This file is my personal Vim configuration file. It contains my plugins, is
3
3
" divided to subject, and fattened with lovely comments.
4
4
" Please be advised that some (obvious) settings are left out, because I
5
5
" actually only use NeoVim. Again, this is my PERSONAL file, not a 'general
6
6
" public Vi(m) compatible' file.
7
7
8
8
" VUNDLE {{{
9
9
" Vundle is used to manage plugins for Vim. It needs additional setup, so it
10
10
" gets priority in my .vimrc.
11
11
12
12
filetype off                  " required
13
13
14
14
" set the runtime path to include Vundle and initialize
15
15
set rtp+=~/.config/nvim/bundle/Vundle.vim
16
16
call vundle#begin()
17
17
18
18
" let Vundle manage Vundle, required
19
19
Plugin 'VundleVim/Vundle.vim'
20
20
21
21
" YCM is a plugin that allows Vim semantic type checking and more programming mumbo jumbo. It is godlike and it must always be there for me.
22
22
Plugin 'Valloric/YouCompleteMe'
23
23
24
24
" Java is a holy language, and because of its holiness, it requires an onslaught
25
-
" of bloat software on your PC to even get a bit of semantic autocompletion.
26
-
" I've found a project which (at least) works without having to install Eclipse,
27
-
" Eclim, and whatever else you need. This is that tool.
28
-
Plugin 'artur-shaik/vim-javacomplete2'
29
-
30
-
" Neomake replaces Syntastic from now on. It's an asynchronous linter, so yeah,
31
25
" pretty cool and must-have.
32
26
Plugin 'neomake/neomake'
33
27
34
28
" Airline provides a neat and feature rich status bar. Really nice to have.
35
29
Plugin 'bling/vim-airline'
36
30
37
31
" Bufferline will show buffers in the status bar. There's enough room anyway, so I fancied having it.
38
32
Plugin 'bling/vim-bufferline'
39
33
40
34
" A fuzzy searcher. Just CTRL+P and BAM all your files are visible.
41
35
Plugin 'kien/ctrlp.vim'
42
36
43
37
" This is a plugin for Git interaction. It places added and removed line icons
44
38
" in the 'gutter' (the bar next to the line numbering). It's better than
45
39
" Fugitive, because not only does it provide something you don't have with it
46
40
" (visible change lines), Fugitive offers functionality I rarely use (Git
47
41
" commands from Vim, which I ALWAYS do in the standard TUI), and it has
48
42
" provisions for NeoVim's asynchronous abilities.
49
43
Plugin 'airblade/vim-gitgutter'
50
44
51
45
" This provides snippets for redundant code. Praise the hackers man.
52
46
Plugin 'SirVer/ultisnips'
53
47
54
48
" In addition to UltiSnips, this plugin contains a prefetched repository of snippets. Must have, because I'm not planning on writing all of those by myself.
55
49
Plugin 'honza/vim-snippets'
56
50
57
51
" Rust syntax files, including Syntastic integration:
58
52
" To be removed when these are added to (Neo)Vim 'upstream'.
59
53
Plugin 'rust-lang/rust.vim'
60
54
61
55
" All of your Plugins must be added before the following line
62
56
call vundle#end()            " required
63
57
filetype plugin indent on    " required
64
58
" }}}
65
59
66
60
" YOUCOMPLETEME {{{
67
61
" YouCompleteMe is a godlike completer for Vim. As such, it is worthy of its own section.
68
62
" However, I'll be trying out Deoplete in the future, which might render it
69
63
" obsolete. Until further notice, I'm keeping this beauty.
70
64
"
71
65
" This setting will force YCM to close the preview buffer after selecting the completion.
72
66
let g:ycm_autoclose_preview_window_after_completion=1
73
67
74
68
" Sets the symbol used to indicate a syntax error:
75
69
let g:ycm_error_symbol = '>>'
76
70
77
71
" Sets the symbol used to indicate a warning:
78
72
let g:ycm_warning_symbol = 'i'
79
73
80
74
" Fills the identifier completion database with the language's keywords (e.g., when starting a new Java file, "class" will already be in the completion engine.
81
75
let g:ycm_seed_identifiers_with_syntax = 1
82
76
83
77
" This setting tells YCM what keys to use to accept completion. I removed <Down> as default, because I'm a silly coder and still use my arrow keys to navigate my source files. Hey, years of negligence for Vim leaves its marks. To think I ever thought Notepad++ was the best editor ever, the fuck...
84
78
let g:ycm_key_list_select_completion=['<TAB>']
85
79
86
80
" Same reason; I'm a dumb fuck and arrows are still hardwired in my brain.
87
81
let g:ycm_key_list_previous_completion=['<S-TAB>']
88
82
89
83
" Configures the pointer to the ycm_extra_conf.py file.
90
84
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
91
85
let g:ycm_confirm_extra_conf = 0 " Disables security confirmation before loading the conf.py file.
92
86
93
87
" Configuration necessary for sematic Rust completion
94
88
let g:ycm_rust_src_path = '/usr/src/rust/src'
95
89
" }}}
96
90
"
97
91
" JAVACOMPLETE {{{
98
-
" Refraining from having to use Eclim and all the junk that attaches itself to
99
-
" it, means I have to use something else. Vim-javacomplete2 is that thing, but
100
-
" it has some additional settings that need to be set, in order to use it
101
-
" properly.
102
-
"
103
-
" Required; tell Vim that there's a completer for Java files:
104
-
autocmd FileType java setlocal omnifunc=javacomplete#Complete
105
-
" Stops adding closing braces, which conflicts with my way of thinking, which
106
-
" is: If I didn't hit the key for it, why the fuck is it on my screen.
107
-
let g:JavaComplete_ClosingBrace = 0
108
-
" JavaComplete uses a cache, which I can totally understand, because Java. I've
109
-
" set it to something more reasonable:
110
-
let g:JavaComplete_BaseDir = '~/.vim/.javacomplete-cache'
111
-
"
112
-
" TODO: javacomplete2 has a list of "default keymappings" on its GitHub page.
113
-
" It's possible that I'll have to delete these later. If so, refer to 
114
-
" https://github.com/artur-shaik/vim-javacomplete2#required
115
-
" }}}
116
-
"
117
-
" NEOMAKE {{{
118
92
" This setting lets Neomake run on every file write:
119
93
autocmd! BufWritePost * Neomake
120
94
" }}}
121
95
"
122
96
" GITGUTTER {{{
123
97
" Disables all keymappings of GitGutter. I don't use them anyway.
124
98
let g:gitgutter_map_keys = 0
125
99
" Sets the 'refresh time' of when to update. Standard is 4 seconds.
126
100
set updatetime=250
127
101
" Asynchronous updating is default, so no setting is needed. Check the FAQ if
128
102
" necessary for more information.
129
103
" }}}
130
104
"
131
105
" AIRLINE {{{
132
106
" Airline is a great status bar plugin. Although it can behave quirky if Powerline is not on the scene. These scripts are dedicated to handle that behavior.
133
107
134
108
" These lines will load the powerline font for use in Airline.
135
109
if !exists('g:airline_symbols')
136
110
		let g:airline_symbols={}
137
111
	endif
138
112
let g:airline_symbols.space="\ua0"
139
113
let g:airline_powerline_fonts=1
140
114
141
115
" If there is only one tab opened, the tab bar will display the different buffers.
142
116
let g:airline#extensions#tabline#enabled=1
143
117
let g:bufferline_echo = 0 " Disables automatic echoing to the bufferline.
144
118
145
119
" }}}
146
120
147
121
" ULTISNIPS {{{
148
122
" As mentioned earlier, this provides snippets to stop redundant code.
149
123
150
124
" To begin, changing default TAB, because YCM already uses TAB.
151
125
	let g:UltiSnipsExpandTrigger="<c-l>"
152
126
	let g:UltiSnipsJumpForwardTrigger="<c-j>"
153
127
	let g:UltiSnipsJumpBackwardTrigger="<c-k>"
154
128
155
129
" }}} 
156
130
"
157
131
" COLOURS & COLORS {{{
158
132
159
133
colorscheme molokai " I like molokai. I've used badwolf, but I like popping colors.
160
134
161
135
" }}}
162
136
163
137
" SPACES & TABS {{{
164
138
165
139
" The number of visual spaces per TAB hit.
166
140
set tabstop=4
167
141
168
142
" Setting the amount of tabs to 4. The default is 8.
169
143
set shiftwidth=4
170
144
171
145
" This breaks lines after column 80.
172
146
set textwidth=80
173
147
" }}}
174
148
175
149
" UI CONFIGURATION {{{
176
150
177
151
" The next 2 settings enable relative line numbering, but retain the absolute
178
152
" line numbering for the line currently selected by the cursor.
179
153
set number
180
154
set relativenumber
181
155
set cursorline " Highlights the line currently selected by the cursor.
182
156
filetype indent on " Detects filetype on load, and loads the appropriate syntax file.
183
157
set showmatch " Highlights matching parenthesis on hover ("[, {, ...").
184
158
" scrolloff tells Vim how much lines above/below the cursor should always be
185
159
" visible. For example, if set to 5, there will always be 5 lines below and
186
160
" above the cursor, except when reaching the EOF.
187
161
set scrolloff=5
188
162
" Next setting disables outputting the current mode to the last line. I did so,
189
163
" because I use Airline, which already prints the current mode.
190
164
set noshowmode
191
165
" }}}
192
166
193
167
" SEARCHING {{{
194
168
195
169
" Problem with hlsearch is that it does not turn off the highlighting. So searching for vowels may quickly result in everything being highlighted. This is a mapping. It will remove highlighting when entering \<SPACE>
196
170
nnoremap <leader><space> :nohlsearch<CR>
197
171
" }}}
198
172
199
173
" FOLDING {{{
200
174
" In case I forget (I'm Belgian), folding is hiding code parts that belong together, like functions. Très important. Fuck azerty.
201
175
202
176
" This enables folding as is.
203
177
set foldenable
204
178
205
179
" This setting determines how many folds have to be opened. The number indicates the folding level. So 0 = every possible folding is folded. 99 = practically everything is open. I'm using 10, since I already have a problem with more than 3 nested loops.
206
180
set foldlevelstart=10
207
181
208
182
" This setting blocks overuse of nested foldings. I don't know how this will turn out in LISP/Scheme, but I'll be damned if this setting does more harm than good.
209
183
set foldnestmax=10
210
184
211
185
" This setting is commented by default, but included in case I start to grow hate for the current way Vim handles folding (za). It basically maps that command to spacebar. I may map it to z because then I only have to type one letter and RETURN, that's 33% of my time saved! =3
212
186
"nnoremap <space> za
213
187
214
188
" }}}
215
189
216
190
" MOVEMENT {{{
217
191
218
192
" Up and down moving in Vim using j/k defaults to "physical line movement", i.e.
219
193
" if a line is too long, it's wrapped to the next line ("virtual lines"), but
220
194
" the line counter still regards it as 1 line.
221
195
" The next setting makes it so that, if j/k is pressed once, it moves over
222
196
" virtual lines, but when repeated (say "5dd"), it moves over physical lines.
223
197
" Basically, the perfect tradeoff solution when using relative line numbering.
224
198
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
225
199
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
226
200
" Next 4 lines disable arrow keys.
227
201
noremap <Up> <nop>
228
202
noremap <Down> <nop>
229
203
noremap <Left> <nop>
230
204
noremap <Right> <nop>
231
205
" }}}
232
206
233
207
" BACKING UP {{{
234
208
235
209
" What these lines do, is move the backup files to the /tmp folder. This will keep my directories clean and neat.
236
210
set backup
237
211
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
238
212
set backupskip=/tmp/*,/private/tmp/*
239
213
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
240
214
set writebackup
241
215
" }}}
242
216
"
243
217
" NEOVIM {{{
244
218
" While it certainly is an improvement over 'vanilla' Vim, it does some things
245
219
" that keep me from using Vim as it's supposed to be; limited to no mouse usage.
246
220
" So I disable it. I'll enable it again when I've twisted my mind far enough to
247
221
" not touch my mouse again. (Not to mention some terminals don't support mouse
248
222
" control, so it's a bad habit nonetheless if you spend all your time on
249
223
" GNU/Linux distros)
250
224
set mouse=""
251
225
" }}}
252
226
"
253
227
" MACROS {{{
254
228
" Function that allows to quickly switch between relative and absolute numbering using
255
229
" CTRL+N(umber).
256
230
function! NumberToggle()
257
231
	if(&relativenumber == 1)
258
232
		set norelativenumber  " Necessary to disable the previous behavior.
259
233
		set number
260
234
	else
261
235
		set number " Retains absolute number on the current line.
262
236
		set relativenumber
263
237
	endif
264
238
endfunc
265
239
nnoremap <C-n> :call NumberToggle()<cr>
266
240
" }}}
267
241
" OTHER IMPORTANT STUFF {{{
268
242
269
243
270
244
" I found this gem on Reddit. If I'm editing a file that's read only, and I started Vim without sudo, then this little line will do just that for me. All I have to do is use "w!!" when saving.
271
245
" Extensive explanation can also be found at https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work#7078429
272
246
cmap w!! w !sudo tee > /dev/null %
273
247
274
248
275
249
" This setting will allow me to switch to another buffer without need to save the current buffer.
276
250
set hidden
277
251
" }}}
278
252
279
253
" Because Vim can fold vimrc files with the right syntax, These lines will tell Vim how to handle that.
280
254
set modelines=2 "This tells Vim that the last 2 lines of this file should only apply to this file.
281
255
" So as you can see, the last 2 lines get a special vim:-prefix, so Vim knows for sure this is what's important.
282
256
" To wrap a new section, look at the other sections, and copy that syntax.
283
257
" vim:foldmethod=marker
284
258
" vim:foldlevel=0
285
259