-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
571 lines (439 loc) · 14.5 KB
/
vimrc
File metadata and controls
571 lines (439 loc) · 14.5 KB
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
" Inspired by:
" https://github.com/mathiasbynens/dotfiles
" https://github.com/mpyatishev
" https://github.com/mislav/vimfiles/blob/master/vimrc
" https://github.com/gmarik/vimfiles
" https://github.com/swaroopch/dotvim/blob/master/vimrc
" https://github.com/madundead/stuff/blob/master/dotfiles/vim/vimrc.symlink
"" Vim, not Vi.
" This must be first, because it changes other options as a side effect.
set nocompatible
" Set Dein base path (required)
let s:dein_base = '~/.cache/dein'
" Set Dein source path (required)
let s:dein_src = '~/.cache/dein/repos/github.com/Shougo/dein.vim'
" Set Dein runtime path (required)
execute 'set runtimepath+=' . s:dein_src
" Call Dein initialization (required)
call dein#begin(s:dein_base)
call dein#add(s:dein_src)
" Your plugins go here:
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
" Editing
call dein#add('Raimondi/delimitMate')
call dein#add('SirVer/ultisnips')
call dein#add('editorconfig/editorconfig-vim')
" call dein#add('python-mode/python-mode')
call dein#add('mattn/emmet-vim')
call dein#add('preservim/nerdcommenter')
call dein#add('tpope/vim-surround')
" View
" Autocomplete
call dein#add('neoclide/coc.nvim', { 'merged': 0, 'rev': 'master', 'build': 'yarn install --frozen-lockfile' })
" call dein#add('Shougo/deoplete.nvim', {'rev': '5.2'})
call dein#add('Xuyuanp/nerdtree-git-plugin')
" call dein#add('Yggdroot/indentLine')
call dein#add('vim-airline/vim-airline')
call dein#add('bronson/vim-trailing-whitespace')
call dein#add('chriskempson/base16-vim')
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('ervandew/supertab')
call dein#add('gcavallanti/vim-noscrollbar')
" call dein#add('haya14busa/incsearch.vim')
call dein#add('jistr/vim-nerdtree-tabs')
call dein#add('jlanzarotta/bufexplorer')
call dein#add('low-ghost/nerdtree-fugitive')
call dein#add('mhinz/vim-signify')
" call dein#add('nathanaelkane/vim-indent-guides')
call dein#add('mileszs/ack.vim')
call dein#add('preservim/nerdtree')
" call dein#add('vim-syntastic/syntastic')
" call dein#add('sjl/gundo.vim')
call dein#add('tpope/vim-fugitive')
call dein#add('wesQ3/vim-windowswap')
" Formatting
" call dein#add('csscomb/vim-csscomb')
" call dein#add('maksimr/vim-jsbeautify')
" Syntax
" call dein#add('sheerun/vim-polyglot')
call dein#add('cespare/vim-toml')
" CSS
" call dein#add('groenewege/vim-less')
" call dein#add('hail2u/vim-css3-syntax')
" call dein#add('tpope/vim-haml')
call dein#add('wavded/vim-stylus')
" JavaScript
" call dein#add('SevInf/vim-bemhtml')
call dein#add('heavenshell/vim-jsdoc', {'build': 'make install'})
" call dein#add('jason0x43/vim-js-indent')
" call dein#add('kchmck/vim-coffee-script')
call dein#add('leafgarland/typescript-vim')
call dein#add('HerringtonDarkholme/yats.vim')
" call dein#add('mxw/vim-jsx')
call dein#add('maxmellon/vim-jsx-pretty')
call dein#add('othree/javascript-libraries-syntax.vim')
call dein#add('pangloss/vim-javascript')
call dein#add('posva/vim-vue')
call dein#add('evanleck/vim-svelte')
call dein#add('jparise/vim-graphql')
" call dein#add('ternjs/tern_for_vim')
" HTML
" call dein#add('AndrewRadev/vim-eco')
" call dein#add('Glench/Vim-Jinja2-Syntax')
call dein#add('digitaltoad/vim-pug')
" call dein#add('evidens/vim-twig')
" call dein#add('godlygeek/tabular')
" call dein#add('gregsexton/MatchTag')
" call dein#add('mustache/vim-mustache-handlebars')
" call dein#add('othree/html5.vim')
" call dein#add('preservim/vim-markdown')
" Go
call dein#add('fatih/vim-go')
" Kotlin
call dein#add('udalov/kotlin-vim')
" Nginx
call dein#add('chr4/nginx.vim')
"" Plugins end
" Finish Dein initialization (required)
call dein#end()
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype plugin indent on
" Uncomment if you want to install not-installed plugins on startup.
" if dein#check_install()
" call dein#install()
" endif
"" General Settings begin
" Enable file type detection
syntax on
" Line endings should be Unix-style unless the file is from someone else.
" set fileformat=unix
" au BufNewFile * set fileformat=unix
" Automatically indent when adding a curly bracket, etc.
set autoindent
set smartindent
" Make tabs as wide as four spaces
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
" Allow backspace in insert mode
set backspace=indent,eol,start
" Centralize backups, swapfiles and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
set undofile
set undodir=~/.vim/undo
set undolevels=1000
set undoreload=10000
" Disable swap files; systems don't crash that often these days
set updatecount=0
" Disable the F1 help key
map <F1> <Esc>
imap <F1> <Esc>
" Show special characters
" set listchars=tab:—\ ,trail:·,eol:¬,nbsp:_
if v:version >= 700
set list listchars=tab:\ \ ,trail:·,extends:>,nbsp:_
else
set list listchars=tab:\ \ ,trail:·,extends:>
endif
" Don't break up long lines, but visually wrap them.
set textwidth=0
set nowrap
" Minimal number of screen lines to keep above and below the cursor.
" Start scrolling three lines before the horizontal window border
set scrolloff=0
" This keeps the cursor always in the vertical middle of the screen.
" set scrolloff=999
"
" Use UTF-8 without BOM
set fileencodings-=latin1
set fileencodings+=cp1251
set encoding=utf-8 nobomb
" Status line
" Always show status line
set laststatus=2
" http://stackoverflow.com/a/10416234/1284255
set statusline=
set statusline+=%7*\[%n] "buffernr
set statusline+=%1*\ %<%F\ "File+path
set statusline+=%2*\ %y\ "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''} "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\ "Encoding2
set statusline+=%4*\ %{&ff}\ "FileFormat (dos/unix..)
set statusline+=%8*\ %=\ row:%l/%L\ (%03p%%)\ "Rownumber/total (%)
set statusline+=%9*\ col:%03c\ "Colnr
set statusline+=%0*\ \ %m%r%w\ %P\ \ "Modified? Readonly? Top/bot.
" Show line number, cursor position.
set ruler
" Show the (partial) command as it’s being typed
set showcmd
" Search
" Search as you type.
set incsearch
" Ignore case while searching
set ignorecase
" Case sensitive search if upper case char
set smartcase
" Make /g flag default when doing :s
set gdefault
" Highlight searches
set hlsearch
" do not redraw while running macros
set lazyredraw
" Show autocomplete menus
set wildmenu
" Ignore VCS files
set wildignore+=.git,.svn
" Ignore projects
set wildignore+=*.sublime-project,*.sublime-workspace
" Ignore archive files
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
" Ignore bin files
set wildignore+=*.pyc
" Images
set wildignore+=*.psd,*.svg,*.png,*.jpg,*.gif
" Ignore less cache
set wildignore+=*/LESS_CACHE/*,*/CACHE/*
" Ignore Sass cache
set wildignore+=*sass_cache*
" Ignore env
set wildignore+=*/env/*,*/node_modules/*,*/.nyc_output/*,*/cache/*,*/built/*,*/bower_components/*,*/vendor/*,*/__pycache__/*
set wildignore+=log/**,tmp/**
" Show the current mode
set showmode
" Show matching brackets
" ?
set showmatch
" DoMatchParen highlight matching bracket
" Bracket blinking
set matchtime=2
" Error bells are displayed visually.
" set visualbell
" Disable error bells
set noerrorbells
" Automatically read files which have been changed outside of Vim, if we
" haven't changed it already.
set autoread
" F2 - save
map <F2> :w<CR>
" Shift + F2 - save all
map <S-F2> :wa<CR>
" Spell
" See: http://www.opennet.ru/base/X/vim_orfo.txt.html
" set spell spelllang=en,ru
" Netrw
" let g:netrw_banner=0
"" General Settings end
" set colorcolumn=+1
" set colorcolumn=81
" don't try to highlight long lines
set synmaxcol=210
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
if exists('$WAYLAND_DISPLAY')
set clipboard+=unnamedplus
else
set clipboard=unnamed,unnamedplus
endif
" Optimize for fast terminal connections
set ttyfast
" Change mapleader
let mapleader="\\"
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Enable line numbers
set number
set relativenumber
" Highlight current line
set cursorline
set cursorcolumn
" Time out on key codes but not mappings.
" Basically this makes terminal Vim work sanely.
set notimeout
set ttimeout
set ttimeoutlen=50
" Enable mouse in all modes
set mouse=a
" Don't reset cursor to start of line when moving around.
set nostartofline
" Don’t show the intro message when starting Vim
set shortmess=atI
" Show the filename in the window titlebar
set title
" Сворачивание кода
set foldmethod=syntax
set foldlevel=99
set foldlevelstart=99
" Shift + Tab - next tab
" map <S-Tab> :tabnext<CR>
map <Leader>n <esc>:tabprev<CR>
map <Leader>m <esc>:tabnext<CR>
" Go Insert mode, C-v and then S-F3 prints this code
if &term =~ '^screen'
set <S-F3>=[1;2R
endif
if &term =~ '^xterm-256color'
set <F3>=OR
set <F2>=OQ
endif
if &term =~ '^screen-256color'
set <S-F3>=[1;2R
set <F3>=[13~
set <F2>=[12~
endif
" Shift + F3 - open buffer
map <S-F3> :BufExplorer<CR>
" auto switch to folder where editing file
" autocmd BufEnter * cd %:p:h
"from http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
:set completeopt=menuone,longest,preview
:nmap <Leader>sv :source ~/.vim/vimrc<CR>
:nmap <Leader>v :e ~/.vim/vimrc<CR>
" Don't stop visual mode after indenting
vnoremap < <gv
vnoremap > >gv
"toggles with Xorg key
set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯЖ;ABCDEFGHIJKLMNOPQRSTUVWXYZ:,фисвуапршолдьтщзйкыегмцчняю;abcdefghijklmnopqrstuvwxyz.
"toggles with Ctrl + ^
set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan
" Обновлять состояние vim
set updatetime=2000
" Save on buffer switch
set autowrite
" Plugins " {{{
" Editing
" Plugin 'preservim/nerdcommenter'
" Добавлять и удалять пробелы после символов комментирования
let NERDSpaceDelims=1
let NERDRemoveExtraSpaces=1
"
" Plugin 'SirVer/ultisnips'
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
let g:UltiSnipsEnableSnipMate = 0
"
" Plugin 'python-mode/python-mode'
let g:pymode_lint = 0
let g:pymode_lint_on_write = 0
let g:pymode_lint_unmodified = 0
let g:pymode_lint_on_fly = 0
let g:pymode_lint_message = 0
let g:pymode_rope = 0
let g:pymode_rope_lookup_project = 0
"
" View
" Plugin 'neoclide/coc.nvim'
let g:coc_global_extensions = ['coc-tsserver']
" Plugin 'preservim/nerdtree'
" Open a NERDTree automatically when vim starts up if no files were specified
" autocmd vimenter * NERDTree
" F3 - open dir
" map <S-F3> :Sexplore!<CR>
" map <S-F3> :Texplore<CR>
map <F3> :NERDTreeToggle<CR>
let NERDTreeChDirMode=2
" adds new keymaps for add and delete nodes
runtime! plugin/NERD_tree.vim
let opts = {'key': 'a', 'quickhelpText': 'add new node', 'callback': 'NERDTreeAddNode'}
call NERDTreeAddKeyMap(opts)
let opts = {'key': 'd', 'quickhelpText': 'delete node', 'callback': 'NERDTreeDeleteNode'}
call NERDTreeAddKeyMap(opts)
let NERDTreeWinSize=30
" Ignore files
let NERDTreeIgnore=['.sublime-project$[[file]]', '.sublime-workspace$[[file]]', '.pyc$[[file]]', '__pycache__$[[dir]]']
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('pug', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '−'
"
" Plugin 'vim-airline/vim-airline'
" Hide git branch and show scrollbar
" line number/total lines:column number
let g:airline_section_b='%{noscrollbar#statusline(20, "—", "|")}%l/%L:%v'
" Hide right section
let g:airline_section_z=airline#section#create([''])
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#hunks#enabled = 0
"
" Plugin 'chriskempson/base16-vim'
" set background=light
" set termguicolors
if exists('$BASE16_THEME')
\ && (!exists('g:colors_name') || g:colors_name != 'base16-$BASE16_THEME')
let base16colorspace=256
colorscheme base16-$BASE16_THEME
endif
"
" Plugin 'Xuyuanp/nerdtree-git-plugin'
let g:NERDTreeIndicatorMapCustom = {
\ "Modified" : "•",
\ "Staged" : "+",
\ "Untracked" : "¤",
\ "Renamed" : "➜",
\ "Unmerged" : "═",
\ "Deleted" : "×",
\ "Dirty" : "×",
\ "Clean" : "v",
\ 'Ignored' : '_',
\ "Unknown" : "?"
\ }
"
" Plugin 'mhinz/vim-signify'
let g:signify_vcs_list = [ 'git' ]
"
" Plugin 'Shougo/deoplete.nvim'
let g:deoplete#enable_at_startup = 1
"
" Plugin 'haya14busa/incsearch.vim'
" map / <Plug>(incsearch-forward)
" map ? <Plug>(incsearch-backward)
" map g/ <Plug>(incsearch-stay)
"
" Formatting
" Syntax
" JavaScript
" Plugin 'pangloss/vim-javascript'
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_flow = 1
"
" vim-jsx
" Plugin 'mxw/vim-jsx'
let g:jsx_ext_required = 1
"
" Plugin 'othree/javascript-libraries-syntax.vim'
let g:used_javascript_libs = 'jquery,underscore,ramda,vue,react'
"
" Plugin 'ternjs/tern_for_vim'
let g:tern_show_argument_hints='no'
let g:tern_show_signature_in_pum=0
"
" Plugin 'heavenshell/vim-jsdoc'
nmap <silent> <C-l> <Plug>(jsdoc)
"
" " }}}