rc

Removed Vim-Hardtime from my list of plugins. It's nice and all, but it fucks up every damn macro that uses hjkl. I'll just disable the arrow keys myself, and try myself not to repeat like a fool.

Author
Vngngdn
Date
July 17, 2016, 12:44 p.m.
Hash
262eb21841b394a5a0f219729fe37b6d45c0220a
Parent
a62fb48187cc70cc4a289a247d66db3cf4165e76
Modified file
.vimrc

.vimrc

0 additions and 13 deletions.

View changes Hide changes
1
1
" I'll most certainly add comments to every fucking line I write. It goes
2
2
" without saying that I need to know what every line does.
3
3
4
4
" VUNDLE {{{
5
5
" Vundle is used to manage plugins for Vim. It needs additional setup, so it
6
6
" gets priority in my .vimrc.
7
7
8
8
filetype off                  " required
9
9
10
10
" set the runtime path to include Vundle and initialize
11
11
set rtp+=~/.vim/bundle/Vundle.vim
12
12
call vundle#begin()
13
13
14
14
" let Vundle manage Vundle, required
15
15
Plugin 'VundleVim/Vundle.vim'
16
16
17
17
" 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.
18
18
" XXX: This might be removed in favor of Deoplete. It depends on whether
19
19
" Deoplete is better or not.
20
20
Plugin 'Valloric/YouCompleteMe'
21
21
22
22
" Airline provides a neat and feature rich status bar. Really nice to have.
23
23
Plugin 'bling/vim-airline'
24
24
25
25
" Bufferline will show buffers in the status bar. There's enough room anyway, so I fancied having it.
26
26
Plugin 'bling/vim-bufferline'
27
27
28
28
" Syntastic does automatic syntax checking without the need to compile.
29
29
" XXX: Might be replaced in the future in favor of Neomake, because it's
30
30
" asynchronous, and I only use NeoVim these days, honestly.
31
31
Plugin 'scrooloose/syntastic'
32
32
33
33
" A fuzzy searcher. Just CTRL+P and BAM all your files are visible.
34
34
Plugin 'kien/ctrlp.vim'
35
35
36
36
" This plugin enables Git intergration.
37
37
Plugin 'tpope/vim-fugitive'
38
38
39
39
" This provides snippets for redundant code. Praise the hackers man.
40
40
Plugin 'SirVer/ultisnips'
41
41
42
42
" 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.
43
43
Plugin 'honza/vim-snippets'
44
44
45
45
" Rust syntax files, including Syntastic integration:
46
46
" To be removed when these are added to (Neo)Vim 'upstream'.
47
47
Plugin 'rust-lang/rust.vim'
48
48
49
49
" Helps me in kicking the habit induced by things like Notepad++.
50
-
" This plugin will stay here until I've kicked the habit properly.
51
-
Plugin 'takac/vim-hardtime'
52
-
53
-
" All of your Plugins must be added before the following line
54
50
call vundle#end()            " required
55
51
filetype plugin indent on    " required
56
52
" }}}
57
53
58
54
" YOUCOMPLETEME {{{
59
55
" YouCompleteMe is a godlike completer for Vim. As such, it is worthy of its own section.
60
56
" However, I'll be trying out Deoplete in the future, which might render it
61
57
" obsolete. Until further notice, I'm keeping this beauty.
62
58
"
63
59
" This setting will force YCM to close the preview buffer after selecting the completion.
64
60
let g:ycm_autoclose_preview_window_after_completion=1
65
61
66
62
" Sets the symbol used to indicate a syntax error:
67
63
let g:ycm_error_symbol = '>>'
68
64
69
65
" Sets the symbol used to indicate a warning:
70
66
let g:ycm_warning_symbol = 'i'
71
67
72
68
" 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.
73
69
let g:ycm_seed_identifiers_with_syntax = 1
74
70
75
71
" 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...
76
72
let g:ycm_key_list_select_completion=['<TAB>']
77
73
78
74
" Same reason; I'm a dumb fuck and arrows are still hardwired in my brain.
79
75
let g:ycm_key_list_previous_completion=['<S-TAB>']
80
76
81
77
" Configures the pointer to the ycm_extra_conf.py file.
82
78
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
83
79
let g:ycm_confirm_extra_conf = 0 " Disables security confirmation before loading the conf.py file.
84
80
" }}}
85
81
86
82
" AIRLINE {{{
87
83
" 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.
88
84
89
85
90
86
91
87
" These lines will load the powerline font for use in Airline.
92
88
if !exists('g:airline_symbols')
93
89
		let g:airline_symbols={}
94
90
endif
95
91
let g:airline_symbols.space="\ua0"
96
92
let g:airline_powerline_fonts=1
97
93
98
94
" If there is only one tab opened, the tab bar will display the different buffers.
99
95
let g:airline#extensions#tabline#enabled=1
100
96
101
97
" Makes Airline appear immediately, instead of waiting for a split.
102
98
set laststatus=2
103
99
" }}}
104
100
105
101
" ULTISNIPS {{{
106
102
" As mentioned earlier, this provides snippets to stop redundant code.
107
103
108
104
" To begin, changing default TAB, because YCM already uses TAB.
109
105
	let g:UltiSnipsExpandTrigger="<c-l>"
110
106
	let g:UltiSnipsJumpForwardTrigger="<c-j>"
111
107
	let g:UltiSnipsJumpBackwardTrigger="<c-k>"
112
108
113
109
" }}} 
114
110
"
115
111
116
-
" HARDTIME {{{
117
-
" Some settings are required to make vim-hardtime function properly
118
-
let g:hardtime_default_on = 1 " Start hardtime immediately.
119
-
let g:hardtime_allow_different_key = 1 " Allows 'jhk', but not 'jjj'.
120
-
" Using the arrow keys is (arguably) a bad habit as well, so they're disabled:
121
-
let g:list_of_disabled_keys = ["<UP>", "<DOWN>", "<LEFT>", "<RIGHT>"]
122
-
" }}}
123
-
124
-
" COLOURS & COLORS {{{
125
112
126
113
colorscheme molokai " I like molokai. I've used badwolf, but I like popping colors.
127
114
128
115
" }}}
129
116
130
117
" SPACES & TABS {{{
131
118
132
119
" The number of visual spaces per TAB hit.
133
120
set tabstop=4
134
121
135
122
" Setting the amount of tabs to 4. The default is 8.
136
123
set shiftwidth=4
137
124
138
125
" This breaks lines after column 80.
139
126
set textwidth=80
140
127
" }}}
141
128
142
129
" UI CONFIGURATION {{{
143
130
144
131
set relativenumber  " I used to use standard numbers, but relative numbers make moving around so much easier.
145
132
set cursorline " Highlights the line currently selected by the cursor.
146
133
filetype indent on " Detects filetype on load, and loads the appropriate syntax file.
147
134
" This highlights the matching parenthesis ([, {, (, ...). I think this is default, but in case it's not, tadaa.
148
135
set showmatch " Highlights matching parenthesis on hover ("[, {, ...").
149
136
set scrolloff=5  " It may seem a lot, but I like to have some content always visible.
150
137
" }}}
151
138
152
139
" SEARCHING {{{
153
140
154
141
" 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>
155
142
nnoremap <leader><space> :nohlsearch<CR>
156
143
" }}}
157
144
158
145
" FOLDING {{{
159
146
" In case I forget (I'm Belgian), folding is hiding code parts that belong together, like functions. Très important. Fuck azerty.
160
147
161
148
" This enables folding as is.
162
149
set foldenable
163
150
164
151
" 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.
165
152
set foldlevelstart=10
166
153
167
154
" 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.
168
155
set foldnestmax=10
169
156
170
157
" 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
171
158
"nnoremap <space> za
172
159
173
160
" }}}
174
161
175
162
" MOVEMENT {{{
176
163
177
164
" When you go up, and you have a line going over multiple lines because it's too long, the standard mapping will skip that. These two settings will block that behaviour.
178
165
nnoremap j gj
179
166
nnoremap k gk
180
167
" }}}
181
168
182
169
" BACKING UP {{{
183
170
184
171
" What these lines do, is move the backup files to the /tmp folder. This will keep my directories clean and neat.
185
172
set backup
186
173
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
187
174
set backupskip=/tmp/*,/private/tmp/*
188
175
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
189
176
set writebackup
190
177
" }}}
191
178
"
192
179
" NEOVIM {{{
193
180
" While it certainly is an improvement over 'vanilla' Vim, it does some things
194
181
" that keep me from using Vim as it's supposed to be; limited to no mouse usage.
195
182
" So I disable it. I'll enable it again when I've twisted my mind far enough to
196
183
" not touch my mouse again. (Not to mention some terminals don't support mouse
197
184
" control, so it's a bad habit nonetheless if you spend all your time on
198
185
" GNU/Linux distros)
199
186
set mouse=""
200
187
" }}}
201
188
"
202
189
" MACROS {{{
203
190
" Function taken from
204
191
" http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/
205
192
" that allows to quickly switch between relative and absolute numbering using
206
193
" CTRL+N(umber).
207
194
function! NumberToggle()
208
195
	if(&relativenumber == 1)
209
196
		set norelativenumber  " Necessary to disable the previous behavior.
210
197
		set number
211
198
	else
212
199
		set nonumber  " Idem
213
200
		set relativenumber
214
201
	endif
215
202
endfunc
216
203
nnoremap <C-n> :call NumberToggle()<cr>
217
204
" }}}
218
205
" OTHER IMPORTANT STUFF {{{
219
206
220
207
221
208
" 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.
222
209
" Extensive explanation can also be found at https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work#7078429
223
210
cmap w!! w !sudo tee > /dev/null %
224
211
225
212
226
213
" This setting will allow me to switch to another buffer without need to save the current buffer.
227
214
set hidden
228
215
" }}}
229
216
230
217
" Because Vim can fold vimrc files with the right syntax, These lines will tell Vim how to handle that.
231
218
set modelines=2 "This tells Vim that the last 2 lines of this file should only apply to this file.
232
219
" So as you can see, the last 2 lines get a special vim:-prefix, so Vim knows for sure this is what's important.
233
220
" To wrap a new section, look at the other sections, and copy that syntax.
234
221
" vim:foldmethod=marker
235
222
" vim:foldlevel=0
236
223