-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
311 lines (206 loc) · 6.11 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
" vim configuration file
" destination folder /@user@/home/
""""""""""""""""""""""""""""""""""""
" Type: "
" :sorce ~/.vimrc "
" to reload config file "
""""""""""""""""""""""""""""""""""""
" :vert help <line in config file> "
" to see help page "
""""""""""""""""""""""""""""""""""""
" Sources {{{
" How To Vimrc
" https://dougblack.io/words/a-good-vimrc.html
" Vim 02 -- Конфигурация и плагины
" https://www.youtube.com/watch?v=VPENostK_3w
" Vim 03 -- Vim 03 - Плагины. Самое необходимое
" https://www.youtube.com/watch?v=pIcLJc85RDc
" The Ultimate Vimrc
" https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" Word wrap without line breaks
" http://vim.wikia.com/wiki/Word_wrap_without_line_breaks
" }}}
" UI Layout {{{
" Generic {{{
" Show current vim command in bottom bar
set showcmd
" Highlight current line
set cursorline
" Graphical menu of all the matches you can cycle through (try to type :source ~/.vim)
set wildmenu
" Redraw only when we need to.
set lazyredraw
" Highlight matching [{()}]
set showmatch
" Enable syntax highlighting
syntax enable
" Tells Vim to only wrap at a character in the breakat option (by default, this includes " ^I!@*-+;:,./?")
set linebreak
set ls=2 " Always show statusbar
" }}}
" GUI {{{
if has("gui_running")
" Maximize GUI window
set lines=999 columns=999
" прячем панельки
" "set guioptions-=m " меню
" set guioptions-=T " тулбар
" "set guioptions-=r " скроллбары
endif
" }}}
" Mac {{{
set guifont=Consolas:h13
" }}}
" }}}
" Searching {{{
" Sets how many lines of history VIM has to remember
set history=500
" Ignore case while searching
set ignorecase
" Highlight search results
set hlsearch
" Highlight choosen search result
set incsearch
" For regular expressions turn magic on
set magic
" }}}
" Tmux {{{
" Allows cursor change in tmux mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" }}}
" Backups {{{
" Moves .swp files into /tmp directory, so they doesn't annoy.
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
" }}}
" Plugins {{{
""""""""""""""""""""""""""""""""""""""""""""
" Plugin manager -- Vim-Plug "
" https://github.com/junegunn/vim-plug "
" "
" Type :PlugInstall to install all plugins "
""""""""""""""""""""""""""""""""""""""""""""
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Installed Plugins {{{
" Project Navigation {{{
" Nerd tree
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Class/module browser
Plug 'majutsushi/tagbar'
" }}}
" Snippets support {{{
Plug 'garbas/vim-snipmate' " Snippets manager
Plug 'MarcWeber/vim-addon-mw-utils' " dependencies #1
Plug 'tomtom/tlib_vim' " dependencies #2
Plug 'honza/vim-snippets' " snippets repo
" }}}
" Langage support {{{
" You Complete Me
Plug 'Valloric/YouCompleteMe', { 'for': ['cpp', 'h', 'java'] }
" Auto pairs
Plug 'jiangmiao/auto-pairs'
" Vimtex for latex files
Plug 'lervag/vimtex', { 'for': 'tex' }
" Gundo
Plug 'simnalamburt/vim-mundo'
" Undo Tree
Plug 'mbbill/undotree'
" Syntastic - for errors highlight
"Plug 'vim-syntastic/syntastic'
" Vim-Airline (Lean & mean status/tabline for vim that's light as air)
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Simple tmux statusline generator with support for powerline symbols and vim/airline/lightline statusline integration
"Plug 'edkolev/tmuxline.vim'
" Vim syntax highlighting for i3 config
Plug 'mboughaba/i3config.vim', { 'for': '.i3.config'}
" }}}
" Color schemes {{{
" Gruvbox
" https://github.com/morhetz/gruvbox
"Plug 'morhetz/gruvbox'
" Badwolf
" https://github.com/sjl/badwolf/
"Plug 'sjl/badwolf'
" Dracula
" https://github.com/dracula/vim
Plug 'dracula/vim'
" }}}
" }}}
" Testing Plugins {{{
" Ctrlp -- for file search
"Plug 'kien/ctrlp.vim'
" Multiple Plug commands can be written in a single line using | separators
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" Using a non-master branch
" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
" Plug 'fatih/vim-go', { 'tag': '*' }
" Plugin options
" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
" Plugin outside ~/.vim/plugged with post-update hook
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Unmanaged plugin (manually installed and updated)
" Plug '~/my-prototype-plugin'
" }}}
" Initialize plugin system
call plug#end()
" Syntastic {{{
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" }}}
" Airline {{{
set laststatus=2
" Old theme
let g:airline_theme = 'zenburn'
"let g:airline_theme = 'dracula'
let g:airline_left_sep = ''
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_right_sep = ''
" }}}
" }}}
" Colors {{{
try
colorscheme dracula
catch
endtry
set background=dark
" }}}
" Key mappings {{{
" Nerd tree opening
map <C-e> :NERDTreeToggle<CR>
map <C-u> :UndotreeToggle<CR>
"map <C-w> :w!<cr>
" }}}
" Organization {{{
" Tell vim to fold sections by markers, rather than indentation.
set foldmethod=marker
" Closes every fold by default
set foldlevel=0
" Tell vim only use these settings for this file.
" Modelines are special comments somewhere in a file that can can declare certain Vim settings to be used only for that file.
" So we'll tell Vim to check just the final line of the file for a modeline.
set modelines=1
" }}}
" Extra {{{
" Set to auto read when a file is changed from the outside
set autoread
set enc=utf-8 " utf-8 as default file encoding
" }}}