- Removed a bunch of date code which is now obsolete with the Git tracker.
- Removed the syntax enabler from the .vimrc, because Neovim does that automatically. - Basically, removed A LOT of stuff that is now obsolete thanks to Neovim.
- Author
- Vngngdn
- Date
- June 27, 2016, 4:29 p.m.
- Hash
- 1fcccd2009948a1c97ef83819cf90968f6a1a455
- Parent
- 4d59f602f76f0ff8316c0941d754b6add124a2c0
- Modified file
- .vimrc
.vimrc ¶
10 additions and 7 deletions.
View changes Hide changes
1 |
1 |
"I'll most certainly add comments to every fucking line I write. It goes without saying that I need to know what every line does. |
2 |
2 |
|
3 |
3 |
" VUNDLE {{{ |
4 |
4 |
"Vundle is used to manage plugins for Vim. It needs additional setup, so it gets priority in my .vimrc. |
5 |
5 |
"Note that this part is a verbatim copy of VundleVim's GitHub page. |
6 |
6 |
|
7 |
7 |
set nocompatible " be iMproved, required |
8 |
- | filetype off " required |
9 |
8 |
|
10 |
9 |
" set the runtime path to include Vundle and initialize |
11 |
10 |
set rtp+=~/.vim/bundle/Vundle.vim |
12 |
11 |
call vundle#begin() |
13 |
12 |
|
14 |
13 |
" let Vundle manage Vundle, required |
15 |
14 |
Plugin 'VundleVim/Vundle.vim' |
16 |
15 |
|
17 |
16 |
" 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 |
17 |
Plugin 'Valloric/YouCompleteMe' |
+ |
18 |
" Deoplete is better or not. |
+ |
19 |
Plugin 'Valloric/YouCompleteMe' |
19 |
20 |
|
20 |
21 |
" Airline provides a neat and feature rich status bar. Really nice to have. |
21 |
22 |
Plugin 'bling/vim-airline' |
22 |
23 |
|
23 |
24 |
" Bufferline will show buffers in the status bar. There's enough room anyway, so I fancied having it. |
24 |
25 |
Plugin 'bling/vim-bufferline' |
25 |
26 |
|
26 |
27 |
" Syntastic does automatic syntax checking without the need to compile. |
27 |
28 |
Plugin 'scrooloose/syntastic' |
+ |
29 |
" asynchronous, and I only use NeoVim these days, honestly. |
+ |
30 |
Plugin 'scrooloose/syntastic' |
28 |
31 |
|
29 |
32 |
" This is a fuzzy searcher. Until further notice, I still have to find out why this is awesome as fuck according to others. |
30 |
- | Plugin 'kien/ctrlp.vim' |
+ |
33 |
Plugin 'kien/ctrlp.vim' |
31 |
34 |
|
32 |
35 |
" This plugin enables Git intergration. |
33 |
36 |
Plugin 'tpope/vim-fugitive' |
34 |
37 |
|
35 |
38 |
" I discovered this beauty (21/11/2015 17:10 GMT+1 Brussels). It provides snippets for redundant code. Praise the hackers man. |
36 |
- | Plugin 'SirVer/ultisnips' |
+ |
39 |
Plugin 'SirVer/ultisnips' |
37 |
40 |
|
38 |
41 |
" 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. |
39 |
42 |
Plugin 'honza/vim-snippets' |
40 |
43 |
|
41 |
44 |
" All of your Plugins must be added before the following line |
42 |
45 |
call vundle#end() " required |
43 |
46 |
filetype plugin indent on " required |
44 |
47 |
" To ignore plugin indent changes, instead use: |
45 |
48 |
"filetype plugin on |
46 |
49 |
" |
47 |
50 |
" Brief help |
48 |
51 |
" :PluginList - lists configured plugins |
49 |
52 |
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate |
50 |
53 |
" :PluginSearch foo - searches for foo; append `!` to refresh local cache |
51 |
54 |
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal |
52 |
55 |
" |
53 |
56 |
" see :h vundle for more details or wiki for FAQ |
54 |
57 |
" Put your non-Plugin stuff after this line |
55 |
58 |
" }}} |
56 |
59 |
|
57 |
60 |
" YOUCOMPLETEME {{{ |
58 |
61 |
" YouCompleteMe is a godlike completer for Vim. As such, it is worthy of its own section. |
59 |
62 |
" |
+ |
63 |
" obsolete. Until further notice, I'm keeping this beauty. |
+ |
64 |
" |
60 |
65 |
" This setting will force YCM to close the preview buffer after selecting the completion. |
61 |
66 |
let g:ycm_autoclose_preview_window_after_completion=1 |
62 |
67 |
|
63 |
68 |
" Sets the symbol used to indicate a syntax error: |
64 |
69 |
let g:ycm_error_symbol = '>>' |
65 |
70 |
|
66 |
71 |
" Sets the symbol used to indicate a warning: |
67 |
72 |
let g:ycm_warning_symbol = 'i' |
68 |
73 |
|
69 |
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. |
70 |
75 |
let g:ycm_seed_identifiers_with_syntax=0 |
71 |
76 |
|
72 |
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... |
73 |
78 |
let g:ycm_key_list_select_completion=['<TAB>'] |
74 |
79 |
|
75 |
80 |
" Same reason; I'm a dumb fuck and arrows are still hardwired in my brain. |
76 |
81 |
" Switching from azerty to qwerty is still fucking with my brain (21/11/2015). |
77 |
- | let g:ycm_key_list_previous_completion=['<S-TAB>'] |
78 |
82 |
|
79 |
83 |
" }}} |
80 |
84 |
|
81 |
85 |
" AIRLINE {{{ |
82 |
86 |
" 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 behaviour. |
83 |
- | |
+ |
87 |
|
84 |
88 |
|
85 |
89 |
|
86 |
90 |
" These lines will load the powerline font for use in Airline. |
87 |
91 |
if !exists('g:airline_symbols') |
88 |
92 |
let g:airline_symbols={} |
89 |
93 |
endif |
90 |
94 |
let g:airline_symbols.space="\ua0" |
91 |
95 |
let g:airline_powerline_fonts=1 |
92 |
96 |
|
93 |
97 |
" If there is only one tab opened, the tab bar will display the different buffers. |
94 |
98 |
let g:airline#extensions#tabline#enabled=1 |
95 |
99 |
|
96 |
100 |
" Makes Airline appear immediately, instead of waiting for a split. |
97 |
101 |
set laststatus=2 |
98 |
102 |
" }}} |
99 |
103 |
|
100 |
104 |
" ULTISNIPS {{{ |
101 |
105 |
" As mentioned earlier, this provides snippets to stop redundant code. |
102 |
106 |
|
103 |
107 |
" To begin, changing default TAB, because YCM already uses TAB. |
104 |
108 |
let g:UltiSnipsExpandTrigger="<c-l>" |
105 |
109 |
let g:UltiSnipsJumpForwardTrigger="<c-j>" |
106 |
110 |
let g:UltiSnipsJumpBackwardTrigger="<c-k>" |
107 |
111 |
|
108 |
112 |
" }}} |
109 |
113 |
" |
110 |
114 |
" COLOURS & COLORS {{{ |
111 |
115 |
|
112 |
116 |
" A colour scheme for my Vim. Recommended by some source I consider trustworthy (http://dougblack.io/words/a-good-vimrc.html). He (She? (It? it's 2015, gotta take "it" into account.)) uses Badwolf, but Molokai apparantly uses bolding (making text fatter, I'm Shakespeare 2.0) which I like. |
113 |
- | colorscheme molokai |
114 |
- | |
+ |
117 |
|
115 |
118 |
" Enables syntax processing. Might as well take my liver as well since I can't live without syntax processing either. Vim really is a life saver huh? :) |
116 |
119 |
syntax enable |
117 |
120 |
" }}} |
118 |
121 |
|
119 |
122 |
" SPACES & TABS {{{ |
120 |
123 |
|
121 |
124 |
" The number of visual spaces per TAB hit. |
122 |
125 |
set tabstop=4 |
123 |
126 |
|
124 |
127 |
" Setting the amount of tabs to 4. The default is 8. |
125 |
128 |
set shiftwidth=4 |
126 |
129 |
|
127 |
130 |
" This breaks lines after column 80. |
128 |
131 |
set textwidth=80 |
129 |
132 |
" }}} |
130 |
133 |
|
131 |
134 |
" UI CONFIGURATION {{{ |
132 |
135 |
|
133 |
136 |
" Seriously. If Vim wasn't so barebones, I'd have spammed the mailing list to make this default. But because Vim is completely customizable, I think it's good I have to manually add this. BTW, this creates line numbers. |
134 |
137 |
set number |
135 |
138 |
|
136 |
139 |
" This highlights the current line. Loved this back in Gedit and Notepad++, and I want it, or I'm gonna bust a tit. |
137 |
140 |
set cursorline |
138 |
141 |
|
139 |
142 |
" Detects filetype, and loads the appropriate language indentation files. I love this. It's so cumbersome to constantly hit TAB because of readability. Also Python needs this. |
140 |
143 |
filetype indent on |
141 |
144 |
|
142 |
145 |
" In addition, this automatically indents shit. |
143 |
146 |
set autoindent |
144 |
147 |
|
145 |
148 |
" Ermagherd. This throws a wildmenu when you can use autocomplete to cycle trough files. GIMME GIMME |
146 |
149 |
set wildmenu |
147 |
150 |
|
148 |
151 |
" So apparantly, Vim has a tendency to redraw the entire screen when it's not really necessary. This tells it to only redraw when unnecessary. If menus don't disappear, I think this is the line to comment out first. |
149 |
152 |
set lazyredraw |
150 |
153 |
|
151 |
154 |
" This highlights the matching parenthesis ([, {, (, ...). I think this is default, but in case it's not, tadaa. |
152 |
155 |
set showmatch |
153 |
156 |
" }}} |
154 |
157 |
|
155 |
158 |
" SEARCHING {{{ |
156 |
159 |
|
157 |
160 |
" What this does, is, when you type a character to search, Vim automatically goes to the first occurrence. When refining the search, it does that again. So searching goes that bit faster. |
158 |
161 |
set incsearch |
159 |
162 |
|
160 |
163 |
" This will highlight all occurrences when searching on the go. |
161 |
164 |
set hlsearch |
162 |
165 |
|
163 |
166 |
" 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> |
164 |
167 |
nnoremap <leader><space> :nohlsearch<CR> |
165 |
168 |
" }}} |
166 |
169 |
|
167 |
170 |
" FOLDING {{{ |
168 |
171 |
" In case I forget (I'm Belgian), folding is hiding code parts that belong together, like functions. Très important. Fuck azerty. |
169 |
172 |
|
170 |
173 |
" This enables folding as is. |
171 |
174 |
set foldenable |
172 |
175 |
|
173 |
176 |
" 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. |
174 |
177 |
set foldlevelstart=10 |
175 |
178 |
|
176 |
179 |
" 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. |
177 |
180 |
set foldnestmax=10 |
178 |
181 |
|
179 |
182 |
" 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 |
180 |
183 |
"nnoremap <space> za |
181 |
184 |
|
182 |
185 |
" Again, because Python is thé best programming language ever made (not perfect, but still the best), folding based on indentation is imperative. This command does exactly that. Who needs {}? Although this causes it to not care about {} folding. Other acceptable values are marker, manual, expr, syntax, diff. |
183 |
186 |
"set foldmethod=indent |
184 |
187 |
" }}} |
185 |
188 |
|
186 |
189 |
" MOVEMENT {{{ |
187 |
190 |
|
188 |
191 |
" 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. |
189 |
192 |
nnoremap j gj |
190 |
193 |
nnoremap k gk |
191 |
194 |
" }}} |
192 |
195 |
|
193 |
196 |
" BACKING UP {{{ |
194 |
197 |
|
195 |
198 |
" What these lines do, is move the backup files to the /tmp folder. This will keep my directories clean and neat. |
196 |
199 |
set backup |
197 |
200 |
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp |
198 |
201 |
set backupskip=/tmp/*,/private/tmp/* |
199 |
202 |
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp |
200 |
203 |
set writebackup |
201 |
204 |
" }}} |
202 |
205 |
" |
203 |
206 |
" MACROS {{{ |
204 |
207 |
" Macros are the FSM's present to the glorious users of Vim. They make my life a breeze, so I declare a couple of them right here. |
205 |
208 |
" |
206 |
209 |
" This macro is for Python classes: It takes the given word at the line, and makes a property-style handler with that word. |
207 |
210 |
" }}} |
208 |
211 |
" OTHER IMPORTANT STUFF {{{ |
209 |
212 |
|
210 |
213 |
" Disables Vi compatibility. All stop using Vi. It's proprietary, shitty, fucked up, and as useless as Windows Notepad. Might as well use Ed. Besides, there's no place for Vi in the Church of Emacs, vi vi vi is the editor of the beast. |
211 |
214 |
set nocompatible |
212 |
215 |
|
213 |
216 |
|
214 |
217 |
" 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. |
215 |
218 |
" Extensive explanation can also be found at https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work#7078429 |
216 |
219 |
cmap w!! w !sudo tee > /dev/null % |
217 |
220 |
|
218 |
221 |
" This is a goodie that I forgot (added 06/11/2015 22:54 Brussels Winter time (Yes, I still haven't set Git up properly, so timestamp): It says Vim to use UTF-8 encoding. |
219 |
222 |
set encoding=utf8 |
220 |
223 |
|
221 |
224 |
" This setting will allow me to switch to another buffer without need to save the current buffer. |
222 |
225 |
set hidden |
223 |
226 |
" }}} |
224 |
227 |
|
225 |
228 |
" Because Vim can fold vimrc files with the right syntax, These lines will tell Vim how to handle that. |
226 |
229 |
set modelines=2 "This tells Vim that the last 2 lines of this file should only apply to this file. |
227 |
230 |
" So as you can see, the last 2 lines get a special vim:-prefix, so Vim knows for sure this is what's important. |
228 |
231 |
" To wrap a new section, look at the other sections, and copy that syntax. |
229 |
232 |
" vim:foldmethod=marker |
230 |
233 |
" vim:foldlevel=0 |
231 |
234 |