-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.outdated
More file actions
803 lines (644 loc) · 25.2 KB
/
vimrc.outdated
File metadata and controls
803 lines (644 loc) · 25.2 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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
" VIM configuration
" =================
syntax on
filetype on
filetype plugin on
"
" ## Plugins
"
" Vim is really great editor. But to extend it to fit my into personal needs I
" use plugin manager. I used to use [NeoBundle](https://github.com/Shougo/neobundle.vim),
" but migrated to [vim-plug](https://github.com/junegunn/vim-plug) recently.
" And I really enjoy it.
"
" [Installation](https://github.com/junegunn/vim-plug#installation) is easy.
" To enable plugin-manager it requires to add `call plug#begin('~/.vim/plugged')` to your `.vimrc` file.
"
call plug#begin('~/.vim/plugged')
"
"
" ### Filetypes
"
" - [vim-nagios](https://github.com/tejr/vim-nagios) plugin provides syntax
" highlight for [Nagios](https://www.nagios.org/) monitoring configuration
" files. `Plug 'tejr/vim-nagios', { 'for': 'nagios' }` line is used to provide
" this plugin to be enabled only for `nagios` files. Could be enabled by
" setting filetype explicitly with `:set filetype=nagios`.
" Plug 'tejr/vim-nagios', { 'for': 'nagios' }
Plug 'alvan/vim-closetag', { 'for': 'html' }
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
let g:closetag_shortcut = '>'
let g:closetag_filetypes = 'html,xhtml,phtml'
Plug 'psliwka/vim-smoothie'
Plug 'martinda/Jenkinsfile-vim-syntax'
Plug 'Glench/Vim-Jinja2-Syntax'
"
"- [rust-lang/rust.vim](https://github.com/rust-lang/rust.vim) plugin brings `rust`
" support to vim. Official one.
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'racer-rust/vim-racer', { 'for': 'rust' }
" set hidden
let g:racer_cmd = "/Users/valiev/.cargo/bin/racer"
let g:racer_experimental_completer = 1
" - [vim-bamboo-log](https://github.com/Valiev/vim-bamboo-log) plugin provides
" syntax highlight for Bamboo CI build logs.
Plug 'Valiev/vim-bamboo-log'
Plug 'hashivim/vim-terraform'
" Plug 'vim-syntastic/syntastic'
" Plug 'juliosueiras/vim-terraform-completion'
" - [bkad/vim-terraform](https://github.com/bkad/vim-terraform) plugin brings
" `terraform` support for vim
Plug 'bkad/vim-terraform'
"
"
" ### Text features
"
" - [winrcent/ferret](https://github.com/wincent/ferret) plugin provides
" extremlly useful bindings for quick search in project with `:Ack`
" command: `<Leader>a` starts search, `<Leader>s` searches for the word under
" cursor
" Plug 'wincent/ferret'
" - [haya14busa/incsearch.vim](https://github.com/haya14busa/incsearch.vim)
" plugin incrementally highlights **all** pattern matches unlike
" default `incsearch`
Plug 'haya14busa/incsearch.vim'
" - [haya14busa/incsearch-fuzzy.vim](https://github.com/haya14busa/incsearch-fuzzy.vim)
" plugin provides fuzzy search support.
Plug 'haya14busa/incsearch-fuzzy.vim'
" - [junegunn/vim-easy-align](https://github.com/junegunn/vim-easy-align) plugin
" provides extremlly easy text alignment. One of my favorite plugins.
Plug 'junegunn/vim-easy-align', { 'on': ['<Plug>(EasyAlign)', 'EasyAlign'] }
" - [bkad/CamelCaseMotion](https://github.com/bkad/CamelCaseMotion) provides
" operations on words with `CamelCases` or `this_kind_of_words`
Plug 'bkad/CamelCaseMotion'
" - [tpope/vim-speeddating](https://github.com/tpope/vim-speeddating) plugin
" bring `<C-A>`/`<C-X>` increment/decrement combinations work for various
" types of dates
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-abolish'
" - [ntpeters/vim-better-whitespace](https://github.com/ntpeters/vim-better-whitespace)
" plugin highlights all whitespaces and moreover provides whitespace stripping.
Plug 'ntpeters/vim-better-whitespace'
" - [cohama/lexima-vim](https://github.com/cohama/lexima.vim) plugin
" provides auto-closing brackets and some other neat features
Plug 'cohama/lexima.vim'
" - [terryma/vim-expand-region](https://github.com/erryma/vim-expand-region) plugin allows
" to visually select increasingly larger regions of text using the same key
" combination
Plug 'terryma/vim-expand-region'
" - TODO: add documentation here
" Plug 'kassio/neoterm'
"
"
" ### Coding features
"
" Plug 'c0r73x/neotags.nvim'
" let g:neotags_recursive = 1
" let g:neotags_find_tool = 'rg --files'
" let g:neotags_ctags_bin = 'ctags'
" - [majutsushi/tagbar](https://github.com/majutsushi/tagbar) plugin bring
" tagbar for vim.
Plug 'majutsushi/tagbar'
" - vimux plugin. FIXME
Plug 'benmills/vimux'
Plug 'jtdowney/vimux-cargo'
Plug 'mhinz/vim-startify'
" - [jaxbot/semantic-highlight](https://github.com/jaxbot/semantic-highlight.vim) plugin brings
" every variable is a different color;
Plug 'jaxbot/semantic-highlight.vim'
" - [junegunn/vim-after-object](https://github.com/junegunn/vim-after-object)
" plugin brings `ca=`/`da=` and other vim-motions.
Plug 'junegunn/vim-after-object'
silent! if has_key(g:plugs, 'vim-after-object')
autocmd VimEnter * silent! call after_object#enable('=', ':', ';', '-', '#', ' ', '*', '.', '|', '/')
endif
" - [scrooloose/syntastic](https://github.com/scrooloose/syntastic) plugin
" provides syntax support for vast programming languages and/or filetypes.
" Plug 'scrooloose/syntastic', { 'for' : ['python', 'javascript', 'ruby'] }
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_check_on_open = 1
" let g:syntastic_python_checker_args='--ignore=E221,E251'
" let g:syntastic_python_checkers=['flake8']
" let g:syntastic_python_flake8_args='--ignore=E221,W504,C812'
highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn
" - [tmux-plugins/vim-tmux](https://github.com/tmux-plugins/vim-tmux) plugin
" provides tmux configuration files syntax highlighting
Plug 'tmux-plugins/vim-tmux'
Plug 'christoomey/vim-tmux-navigator'
Plug 'tpope/vim-dispatch'
" - [benmills/vimux](https://github.com/benmills/vimux) plugin provides
" integration between `vim` and `tmux`
Plug 'benmills/vimux'
" - [tpope/vim-surround](https://github.com/tpope/vim-surround) plugin manages
" parentheses, brackets, quotes, XML tags, and more.
Plug 'tpope/vim-surround'
" - [tpope/vim-commentary](https://github.com/tpope/vim-commentary) plugin
" provides universal binding to manage comments for various filetypes
Plug 'tpope/vim-commentary'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
" - [Shougo/deoplete.nvim](https://github.com/Shougo/deoplete.nvim) plugin
" provides great auto-completion for most of the scripting languages.
" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" let g:deoplete#enable_at_startup = 1
" call deoplete#custom#source('_', 'matchers', ['matcher_full_fuzzy'])
" let g:deoplete#sources = {'rust': ['ale', 'racer']}
" - [osyo-manga/vim-monster](https://github.com/osyo-manga/vim-monster) plugin
" provides auto-completion ruby scripts.
Plug 'osyo-manga/vim-monster', { 'for': ['ruby'] }
Plug 'jreybert/vimagit'
" Plug 'tpope/vim-fugitive'
" - [rizzatti/dash.vim](https://github.com/rizzatti/dash.vim) plugin
" provides documentation using Dash application.
" Plug 'rizzatti/dash.vim'
" - [tpope/vim-endwise](https://github.com/tpope/vim-endwise) plugin helps to end
" certain structures automatically
Plug 'tpope/vim-endwise'
" - [tpope/vim-repeat](https://github.com/tpope/vim-repeat) plugin provides
" repeat for custom plugin actions
Plug 'tpope/vim-repeat'
Plug 'nvim-tree/nvim-web-devicons'
" - [tpope/vim-unimpaired](https://github.com/url_here) plugin provides neat
" paired mappings, like:
" * `[<Space>`/`]<Space>` to paste blank lines
" * `cos` to toggle spell checking
" * `col` to toggle `list` command
" * `cos` to toggle cursor highlight
" * `cow` to toggle word wrapping
" * `con` to toggle line numbering
Plug 'tpope/vim-unimpaired'
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
au BufEnter github.com_*.txt set filetype=markdown
" set guifont=Monaco:h20
set guifont=FiraCode_Nerd_Font_Mono:h23
" - [sheerun/vim-polyglot](https://github.com/sheerun/vim-polyglot) a collection
" on language packs
" Plug 'sheerun/vim-polyglot', { 'for': ['ruby', 'haskell'] }
" - [luochen1990/select-and-search](https://github.com/luochen1990/select-and-search)
" plugin's feature is to select text in v mode, then press n to search next one
" (N for prev one)
Plug 'luochen1990/select-and-search'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Plug 'ycm-core/YouCompleteMe'
Plug 'sunaku/vim-dasht'
" search related docsets
" nnoremap <silent> <Leader>k :call Dasht([expand('<cword>'), expand('<cWORD>')])<Return>
" - [kien/ctrlp.vim](https://github.com/kien/ctrlp.vim) is fuzzy finder for
" search ALL the docsets
" nnoremap <silent> <Leader>K :call Dasht([expand('<cword>'), expand('<cWORD>')], '!')<Return>
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
" Default fzf layout
" - down / up / left / right
let g:fzf_layout = { 'down': '~40%' }
" In Neovim, you can set up fzf window using a Vim command
let g:fzf_layout = { 'window': 'enew' }
let g:fzf_layout = { 'window': '-tabnew' }
let g:fzf_layout = { 'window': '10new' }
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
let g:fzf_history_dir = '~/.local/share/fzf-history'
" [Buffers] Jump to the existing window if possible
let g:fzf_buffers_jump = 1
" [[B]Commits] Customize the options used by 'git log':
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
" [Tags] Command to generate tags file
" let g:fzf_tags_command = 'ctags -R'
" [Commands] --expect expression for directly executing the command
let g:fzf_commands_expect = 'alt-enter,ctrl-x'
" files, buffers and MRUs
Plug 'kien/ctrlp.vim'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/vendor/*
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'dir2': '\v[\/]vendor$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" set hidden
" - [neco-ghc](https://github.com/eagletmt/neco-ghc) is nice autocompletion for
" `haskell`
" Plug 'neco-ghc', { 'for' : 'haskell' }
" setlocal omnifunc=necoghc#omnifunc
" - [zchee/deoplete-jedi](https://github.com/zchee/deoplete-jedi) is
" autocompletion for `python`
" Plug 'zchee/deoplete-jedi', { 'for' : 'python' }
Plug 'dense-analysis/ale'
Plug 'racer-rust/vim-racer', { 'for': 'rust' }
" Plug 'racer-rust/vim-racer', { 'for': 'rust' }
"
let g:ale_fixers = {
\ 'rust': ['rustfmt'],
\}
let g:ale_linters = {
\'rust': ['rls'],
\}
let g:ale_rust_rls_toolchain = 'nightly-2020-03-15'
let g:ale_fix_on_save = 1
let g:airline#extensions#ale#enabled = 1
let g:ale_completion_enabled = 1
let g:airline#extensions#ale#enabled = 1
"
"
" ### Appearel
" - [bling/vim-airline](https://github.com/bling/vim-airline) is a status bar, tabline
Plug 'bling/vim-airline' " status bar
set noshowmode
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#whitespace#enabled = 0
" show current function
let g:airline#extensions#tagbar#flags = 'f'
set hidden
" - [vim-airline/vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
" is the set of themes for `vim-airline`
Plug 'vim-airline/vim-airline-themes'
" let g:airline_theme='gruvbox'
let g:airline_theme='seagull'
" - [scrooloose/nerdtree](https://github.com/scrooloose/nerdtree) is a file
" explorer for vim
Plug 'scrooloose/nerdtree'
" - [jistr/vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs) is an
" externsion for nerdtree to support tabs
Plug 'jistr/vim-nerdtree-tabs'
" - [kshenoy/vim-signature](https://github.com/kshenoy/vim-signature) highlights
" marks
Plug 'kshenoy/vim-signature'
" - [mhinz/vim-signify ](https://github.com/url_here) highlights changes
Plug 'mhinz/vim-signify'
"
"
"### Colors
"
" - [vim-scripts/ScrollColors](https://github.com/vim-scripts/ScrollColors) provides
" `:COLORSCROLL` command to walk thought colorschemes
Plug 'vim-scripts/ScrollColors'
Plug 'morhetz/gruvbox'
Plug 'ayu-theme/ayu-vim'
" - [luochen1990/rainbow](https://github.com/luochen1990/rainbow) highlights
" brackets regaring nested levels
Plug 'luochen1990/rainbow'
" \ 'ctermfgs': ['cyan', 'blue', 'lightblue', 'lightcyan', 'green', 'lightyellow', 'yellow', 'red']
let g:rainbow_conf = {
\ 'ctermfgs': ['red', 'green', 'blue']
\ }
" - [zefei/vim-colortuner](https://github.com/zefei/vim-colortuner) allows you
" tuning your color scheme using sliders
Plug 'zefei/vim-colortuner'
Plug 'sonph/onehalf'
" - [flazz/vim-colorschemes](https://github.com/flazz/vim-colorschemes) yet
" another colorschemes pack
Plug 'flazz/vim-colorschemes'
" - [gosukiwi/vim-atom-dark](https://github.com/gosukiwi/vim-atom-dark) bring
" dark atom colorscheme
Plug 'gosukiwi/vim-atom-dark'
" - [godlygeek/csapprox](https://github.com/url_here) makes GVim-only
" colorschemes Just Work in terminal Vim
Plug 'godlygeek/csapprox'
let g:CSApprox_hook_post = [
\ 'highlight Normal ctermbg=NONE',
\ 'highlight LineNr ctermbg=NONE',
\ 'highlight SignifyLineAdd cterm=bold ctermbg=NONE ctermfg=green',
\ 'highlight SignifyLineDelete cterm=bold ctermbg=NONE ctermfg=red',
\ 'highlight SignifyLineChange cterm=bold ctermbg=NONE ctermfg=yellow',
\ 'highlight SignifySignAdd cterm=bold ctermbg=NONE ctermfg=green',
\ 'highlight SignifySignDelete cterm=bold ctermbg=NONE ctermfg=red',
\ 'highlight SignifySignChange cterm=bold ctermbg=NONE ctermfg=yellow',
\ 'highlight SignColumn ctermbg=NONE',
\ 'highlight CursorLine ctermbg=NONE cterm=underline',
\ 'highlight Folded ctermbg=NONE cterm=bold',
\ 'highlight FoldColumn ctermbg=NONE cterm=bold',
\ 'highlight NonText ctermbg=NONE',
\ 'highlight clear LineNr'
\]
" - [ervandew/supertab](https://github.com/ervandew/supertab) allows you to use
" `<Tab>` for all your insert completion needs
" Plug 'ervandew/supertab'
" - [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons) adds
" filetype glyphs (icons) to other plugins
Plug 'ryanoasis/vim-devicons'
Plug 'sunaku/vim-dasht'
Plug 'arakashic/chromatica.nvim'
filetype plugin indent on
call plug#end()
"
" ## Configuration
"
"
" - `nowrap` disables word wrapping. Easily toggled with `cow` mapping
set nowrap
" - `smartindent` enables smart indentation after `{` and others
set smartindent
" - `showbreak=⁻` starts wrapped lines with this symbol
set showbreak=⁻
" - `breakindent` shows wrapped line will continue visually indented
set breakindent
" - `linebreak` wraps long lines at a character in `'breakat'`
" rather than at the last character that fits on the screen.
set linebreak
" - `textwidth=80` sets maximum width of text that is being inserted to 80
set textwidth=80
" - `backspace=indent,eol,start` enables `backspace`
set backspace=indent,eol,start
" - `clipboard+=unnamed` yanks go on clipboard instead.
set clipboard+=unnamed "
" - `fo+=o` automatically inserts the current comment leader after hitting 'o' or 'O' in Normal mode.
set fo+=o
" - `fo-=r` disables automatically insertion of a comment leader after an enter
set fo-=r
" - `noignorecase` respects case in search
set noignorecase
" - `incsearch` searchs during typing
set incsearch
" - `hlsearch` highlights found strings
set hlsearch
" - `history=1000` keeps 1000 commands in history
set history=1000
" - `undolevels=500` handles 500 commands to undo
set undolevels=500
" - `completeopt=longest,menuone` shows IDE-like autocomplete
" set completeopt=longest,menuone
set completeopt=menuone,noinsert
set wildmode=longest:list,full
set wildmenu
" - `set nofoldenable` makes all folds are open
set nofoldenable
" `set background=dark` to use colors that look good on a dark background
" set term=screen-256color
" set background=light
set background=dark
" `set noerrorbells` for no terminal beeps
set noerrorbells
" `set vb` to use visual bell instead of beeping.
set visualbell
" `set showmatch` highlights paired parentheses
set showmatch
" `set matchtime=5` " Bracket blinking.
set matchtime=5 " Bracket blinking.
" set expandtab " Spaces instead of tabs
set expandtab " Spaces instead of tabs
" set scrolloff=2
set scrolloff=2
" set nonumber " Turn off line numeration. Really piss me off.
set nonumber
" set linespace=0
set linespace=0
" `set ruler`shows cursor position info in the bottom if vim
set ruler
" set shortmess=atI " Shortens messages
set shortmess=atI " Shortens messages
function s:SetCursorLine()
hi cursorline cterm=none ctermbg=darkblue ctermfg=white
endfunction
autocmd VimEnter * call s:SetCursorLine()
" FIXME: Embrace words with auto-pairing
" call lexima#add_rule({'at': '\%#\<\h', 'char': '"', 'input': '<Esc>ea"<Esc>bi"'})
" call lexima#add_rule({'at': '\%#\<\h', 'char': '(', 'input': '<Esc>ea)<Esc>bi('})
" call lexima#add_rule({'at': '\%#\<\h', 'char': '[', 'input': '<Esc>ea]<Esc>bi['})
if has('autocmd') " resume last position in file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
function! WordCount()
let s:old_status = v:statusmsg
let position = getpos(".")
exe ":silent normal g\<c-g>"
let stat = v:statusmsg
let s:word_count = 0
if stat != '--No lines in buffer--'
let s:word_count = str2nr(split(v:statusmsg)[11])
let v:statusmsg = s:old_status
end
call setpos('.', position)
return s:word_count
endfunction
if has('termguicolors')
set termguicolors
endif
"@color flag
" set termguicolors
" colorscheme mod8
"
" colorscheme monokain
" colorscheme birds-of-paradise
" colorscheme monokai-phoenix
" colorscheme materialtheme
" colorscheme luna
" colorscheme madeofcode
" colorscheme gruvbox
" colorscheme greygull
" colorscheme onehalfdark
" colorscheme onehalflight
" colorscheme nightshade_print
" colorscheme nightVision
" colorscheme reliable
" colorscheme orange
" if $ITERM_PROFILE == 'Light'
let ayucolor="light" " for light version of theme
" endif
if $ITERM_PROFILE == 'Default'
let ayucolor="mirage" " for mirage version of theme
endif
" let ayucolor="dark" " for dark version of theme
" colorscheme ayu
" colorscheme autumnleaf
" colorscheme yeller
colorscheme vim-material
" colorscheme solarized8_light
" colorscheme soda
if has("gui_running")
highlight SpellBad term=underline gui=undercurl guisp=Orange
endif
" colorscheme Monokai
" colorscheme solarized8_light_high
" set t_ut=
set undodir=~/.vim/undodir
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=L "remove left-hand scroll bar
set guioptions-=r "remove right-hand scroll bar
set encoding=utf8
set tabstop=2
set softtabstop=2
set shiftwidth=2
set complete-=k
set complete+=k
set dictionary-=/usr/share/dict/words
set dictionary+=/usr/share/dict/words
set nolazyredraw " don't redraw while executing macros"
set magic " Set magic on, for regex"
set mat=2 " how many tenths of a second to blink"
set tags=~/dev/tags
autocmd FileType * autocmd BufWritePre <buffer> StripWhitespace " strip whitespaces
autocmd FileType * setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4
autocmd FileType python let b:dispatch = 'python3 %'
autocmd FileType rust setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd FileType yaml setlocal cuc
autocmd FileType markdown setlocal spell
autocmd FileType ruby compiler ruby
" autocmd FileType ruby,eruby set filetype=ruby.eruby.chef
autocmd BufRead,BufNewFile {Gemfile,Rakefile,Capfile,*.rake,config.ru} set ft=ruby
autocmd BufRead,BufNewFile {*.md,*.mkd,*.markdown} set ft=markdown
autocmd BufRead,BufNewFile {*.hcl} set ft=terraform
autocmd BufRead,BufNewFile {COMMIT_EDITMSG} set ft=gitcommit
autocmd BufNewFile,BufRead COMMIT_EDITMSG setlocal spell
autocmd BufNewFile,BufRead *.json set filetype=json
autocmd BufNewFile,BufRead *.json set foldmethod=syntax
au FocusLost * :wa
" let g:neoterm_repl_ruby = "pry"
" nnoremap <Leader>ff :TREPLSendFile<CR>
"
" ## Mappings
let g:incsearch#auto_nohlsearch = 1
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
map z/ <Plug>(incsearch-fuzzy-/)
let mapleader = "\<Space>"
" nnoremap <Leader><Leader> :Goyo<CR>
" nnoremap <Leader><Leader> :CtrlPCurWD<CR>
" nnoremap <Leader>p :CtrlP<CR>
" save
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
" nnoremap <Leader><Leader> :Files %:p:h<CR>
" command! -bang -nargs=* GGrep
" \ call fzf#vim#grep(
" \ 'git grep --line-number -- '.shellescape(<q-args>), 0,
" \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
nnoremap <Leader><Leader> <cmd>Telescope find_files<cr>
nnoremap <leader>g <cmd>Telescope live_grep<cr>
" nnoremap <Leader><Leader> :Files<CR>
" nnoremap <Leader>p :GFiles<CR>
" nnoremap <Leader>r :Rg<CR>
" nnoremap <Leader>g :GGrep<CR>
" nnoremap <Leader>g :call fzf#vim#ag(expand('<cword>'))<kEnter>
nnoremap <Leader>ww :w<CR>
nnoremap <Leader>q :q<CR>
nnoremap <Leader>wq :wq<CR>
nnoremap <Leader>h :set cursorline!<CR>
" nnoremap <silent> <Leader>a :Rg <C-R><C-W><CR>
"
" search related docsets
" nnoremap <Leader>k :Dasht<Space>
vmap <Leader>y "+y
vmap <Leader>d "+d
" nmap <Leader>p "+p
" nmap <Leader>P "+P
" vmap <Leader>p "+p
" vmap <Leader>P "+P
noremap <Leader>' ciW''<Esc>P
noremap <Leader>" ciW""<Esc>P
noremap <Leader>` ciW``<Esc>P
map <Leader><Tab> :NERDTreeToggle<CR>
map <Leader>. :wa<CR> :VimuxRunLastCommand<CR>
vmap <Enter> <Plug>(EasyAlign)
xmap <Enter> <Plug>(EasyAlign)
map q: :q
nmap <leader>l :set list!<CR>
set listchars=tab:▸\ ,eol:¬
nmap <Leader>t :TagbarToggle<CR>
" nmap <Leader>b :CtrlPBuffer<CR>
" nmap <Leader>r :CtrlPMRU<CR>
nmap <Leader>bn :bnext<CR>
nmap <Leader>bp :bprevious<CR>
noremap H :bprev<CR>
noremap L :bnext<CR>
nmap <Leader>d :bd<CR>
nmap <Leader>k <Plug>DashSearch
nmap <Leader>gg :G<CR>
nnoremap # :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
nnoremap * #
nnoremap U <C-r>
inoremap jk <Esc>
inoremap JK <Esc>
inoremap Jk <Esc>
inoremap jK <Esc>
vnoremap < <gv
vnoremap > >gv"
" Movement in insert mode
inoremap <C-h> <C-o>h
inoremap <C-l> <C-o>a
inoremap <C-j> <C-o>j
inoremap <C-k> <C-o>k
nnoremap Y y$
" <TAB>: completion.
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <Shift+TAB>: completion.
" inoremap <silent><expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
" Disable 'Enterig Ex mode'
nnoremap Q <Nop>
" Hard mode
map <UP> <NOP>
map <DOWN> <NOP>
map <LEFT> <NOP>
map <RIGHT> <NOP>
" Switching windows and close window
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
map <C-q> <C-W>q " check this mapping
let NERDTreeHijackNetrw=1
let g:netrw_liststyle=3
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
let g:rainbow_active = 1
let g:select_and_search_active = 1
nmap <leader>gj <Plug>(signify-next-hunk)
nmap <leader>gk <Plug>(signify-prev-hunk)
omap ic <plug>(signify-motion-inner-pending)
xmap ic <plug>(signify-motion-inner-visual)
omap ac <plug>(signify-motion-outer-pending)
xmap ac <plug>(signify-motion-outer-visual)
nmap <Leader>gs :Gstatus<CR>
nmap <Leader>gc :Gcommit<CR>