-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
1728 lines (1268 loc) · 37.3 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
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
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
" --- INTRO ---
" ------ --- ------
" + + +
" ------ --- ------
"
" Chinggis Tenger
" Vimmer, Archer, and Fisher
" The Son of Web
" Filius VVeborum
"
" ------ --- ------
" + + +
" ------ --- ------
" Vim 8.0
" Vim, Vi (Visual) Improved
" Tengerid Editor
" Perfecting my favorite editor and its configuration
" Vimcraft
" ---
" “No one constitutes as great a favor to me in the Environment of Linux as Vim ...
"when the editors of text are mentioned, Vim is the guiding star.”
"The Four Editors and Their Configuration,
"Ibn Idrīs al-Shāfiʿī.
"(aka sha256)
" ---
" Basic usage
" Deprive option
" :set nonumber
" Show option value
" :set number?
" Empty option of value (for non binary, un-toggled, valued options)
" :set indentexpr&
" Invert option's value
" : set invnumber
" Show all options
" :set
" Show all variables
" :let
" Show all Normal mode user-set key bindings
" :nmap
" Show all marks
" Marks are file bookmarks to save cursor position in buffers
" :marks
" Substitute by adding
" :%s/background/&-color
" Run command on all matching lines
" :%g/background/d
" Define commands
" User defined commands start with capital
" command MyCommand echo "Hello, World!"
" Modeline
" Append to the end to pass options
" #vim: ft=Markdown
" .vimrc is loaded before plugins
" Put code into
" ~/.vim/after/plugin/*.vim
" To run after plugins get loaded
" 1. Vimrc, 2. Plugins, 3. After directory
" Shortcuts
" - scrolloff
" H - home line
" M - middle line
" L - last line
" ] ^i - jump to the next word under cursor
" [ ^i - jump back (searching from BOF)
" " Normal mode paste
" ^r Insert mode paste
" Registers
" * - Primary selection
" + - Clipboard
" % - current file's name (pseudo-register)
" # - alternate file's name
" ^] jump in Help pages
" ^o temporarily switch to Normal Mode and then back after one command
" ^o/^i navigate through jumplist
" g;/g, navigate trough changelist
" Spelling
" Add word to dictionary
" zg - good word
" zG - good word (temporary)
" Remove word from dictionary
" zw - wrong word
" ZW - wrong word (temporary)
" gqip - reformat paragraph, make into one line
" vipJ - same in and through Visual Mode
" n - go to last search
" gn - go to last search and visually select it
" ]], [[ go to next/previous heading
" zj, zk go to next/previous fold (beginning of the fold)
" 1z= correct spelling (choosing first suggestion)
" I prepend to line
" A append to line
" | move to n-th column (character-wise)
" &option - option as set by `set` keyword
" &l:option - local option; option with a local scope, affecting only the buffer or split its set in
" @register, eg @" the unnamed register, primary selection; echo @"; let @a='hello' CTRL+R and "ap to paste from register a, or echo @a
" = expression register, ^r and expression including variables of any kind
" Insert mode
" C-h delete a character backward
" C-w delete a word backward
" C-u delete a line backward
" C-[ switch to normal mode
" See what plugin is remapping the key
" verbose map KEY
" verbose is a separate command to put before other commands for verbosity, getting more information
" iw - anywhere
" aw - whitespace
" <C-g> file (name), mod [+], lines (count), scroll (%) (same as 0<C-g>)
" 1<C-g> full path and the rest
" 2<C-g> buffer, full path, and so
" Use s instead of xi
" TIPS END
" --- ORTNI ---
" --- PLUGINS ---
" Vim-Plug minimalistic plugin manager
call plug#begin('~/.vim/plugged')
Plug 'zirrostig/vim-schlepp'
" Solarized colorscheme
Plug 'altercation/vim-colors-solarized'
" Language pack, 70+ packages
" Slows down a lot
" Fish iskeyword (-,_,.) and indentation frustrates
" Plug 'sheerun/vim-polyglot'
" gcc for commenting lines
Plug 'tpope/vim-commentary'
" yss, cs"', ysiw, ds" for surrounding text
Plug 'tpope/vim-surround'
" Provides file manipulation commands such as :Remove, :Rename, :Move, and :SudoWrite
Plug 'tpope/vim-eunuch'
" Nerdtree
Plug 'scrooloose/nerdtree'
" Vim wiki
" \ww to go to index.wiki
" Plug 'vimwiki/vimwiki'
" Verbose search
" Plug 'henrik/vim-indexed-search'
" Improved incremental searching
Plug 'haya14busa/incsearch.vim'
" Incremental fuzzy search extension
Plug 'haya14busa/incsearch-fuzzy.vim'
" Dependency of the below plugin
Plug 'kana/vim-operator-user'
" Flash yank area
" Visually flash the area yanked to the register/clipboard
Plug 'haya14busa/vim-operator-flashy'
" Star motions
Plug 'haya14busa/vim-asterisk'
" Powerline / Airline
" Mode | Git | File | Type | Charset | % | line/lines | column | trailing / mixed indentation
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Spacemacs key bindings for Vim
" https://github.com/meitham/vim-spacemacs
" Plug 'meitham/vim-spacemacs'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
" Alternative colorscheme
" Plug 'zeis/vim-kolor'
" Highlight i3 config file better
Plug 'PotatoesMaster/i3-vim-syntax'
" Highlight tmux config files better
Plug 'tmux-plugins/vim-tmux'
" Undo history tree
" :UndotreeToggle
Plug 'mbbill/undotree'
" Align tables well
" Plug 'godlygeek/tabular'
" Three plugins in one
" Abbreviations, Substitution, and Case conversion (called Coercion)
" crs snake case, crc camel case, crm mixed case, cru snake upper case
" supports Repeat.vim
" OneTwoThree
Plug 'tpope/vim-abolish'
" Markdown support
" ]] next header, [[ previous, ][ next sibling, [] previous sibling, ]c current, ]u parent, :Tocv Contents
Plug 'plasticboy/vim-markdown'
" Fancy start screen
Plug 'mhinz/vim-startify'
" Fancy file icons
" Works with Nerd Tree
" For Gvim
Plug 'ryanoasis/vim-devicons'
" Dependency
Plug 'tpope/vim-unimpaired'
" Dired for Vim
" :Dirvish
Plug 'justinmk/vim-dirvish'
" Fugitive
" Git wrapper
Plug 'tpope/vim-fugitive'
" Inspired by Quantum theme
Plug 'KeitaNakamura/neodark.vim'
" Show buffer names in status line
Plug 'bling/vim-bufferline'
" Org mode support
Plug 'jceb/vim-orgmode'
" Highlight Nginx config files
Plug 'evanmiller/nginx-vim-syntax'
" Highlight log syntax
Plug 'dzeban/vim-log-syntax'
" Highlight Logrotate log files
Plug 'moon-musick/vim-logrotate'
" Highlight TomL config markup file type syntax
Plug 'cespare/vim-toml'
" Note taking and note management in Vim
Plug 'xolox/vim-misc'
" Plug 'xolox/vim-notes'
" Extended session management
" :OpenSession
Plug 'xolox/vim-session'
" Enhanced bookmarking
" Plug 'vim-scripts/TurboMark'
" Enhanced buffer listing
" :BufExplorer (with single f)
Plug 'jlanzarotta/bufexplorer'
" Scratch buffer
" :Scratch
Plug 'kana/vim-scratch'
" Tab completion
" Plug 'ervandew/supertab'
" Rich text highlight in Vim
Plug 'bpstahlman/txtfmt'
" Coffee script support
Plug 'kchmck/vim-coffee-script'
" Highlight Vimperator config file syntax
Plug 'vimperator/vimperator.vim'
autocmd FileType vimperator setlocal commentstring=\"\ %s
" Highlight trailing whitespace
Plug 'ntpeters/vim-better-whitespace'
" Show git status on Nerd Tree
Plug 'Xuyuanp/nerdtree-git-plugin'
" HTML tags and Latex support for %
" Plug 'tmhedberg/matchit'
"Better URLs
" Universal text linking
Plug 'vim-scripts/utl.vim'
" Narrow region plugin for Vim
" <leader>nr or :NR
" :WidenRegion to save back
Plug 'chrisbra/NrrwRgn'
" Color HEX codes or color names
" :ColorToggle
Plug 'chrisbra/Colorizer'
" Plug 'lilydjwg/colorizer'
" PKGBUILD syntax
Plug 'Firef0x/PKGBUILD.vim'
" Fish support (as separate file type)
" Already provided by Polyglot language pack
" Plug 'dag/vim-fish'
" Auto mkdir when saving
Plug 'pbrisbin/vim-mkdir'
" Dep
" Better increment, of dates etc
" 10<C-a> increments, 5<C-x> decrements
Plug 'tpope/vim-speeddating'
" Better repeating (.)
Plug 'tpope/vim-repeat'
" Better ~/.muttrc
Plug 'vim-scripts/muttrc.vim'
Plug 'junegunn/rainbow_parentheses.vim'
" colo gruvbox (bg=dark)
Plug 'morhetz/gruvbox'
Plug 'kshenoy/vim-signature'
Plug 'airblade/vim-gitgutter'
Plug 'junegunn/fzf.vim'
Plug 'pelodelfuego/vim-swoop'
" Plug 'w0rp/ale'
" Plug 'junegunn/vim-emoji'
" Smarter F and T with highlight
" Forget about ; to repeat
Plug 'rhysd/clever-f.vim'
" <leader>c<space> toggle comment
" <leader>cs sexy comment
" <leader>cu uncomment
" Plug 'scrooloose/nerdcommenter'
" Snippets
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'honza/vim-snippets'
" Interactive scratchpad
" PHP support requires psysh
" Doesn't work on my Vim 8.0 (+job, +channel) but works on Nvim
" Plug 'metakirby5/codi.vim'
" Auto-completion
" Plug 'Valloric/YouCompleteMe'
" Spacemacs colorscheme for Vim
Plug 'colepeters/spacemacs-theme.vim'
" Gist
" git config --global github.user <user>
" :Gist -a
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim'
" Plug 'keith/gist.vim'
" Emmet
" HTML & CSS expansion
" Visual selection, ^y , and abbreviation
" Eg: ul>li*>span>a
Plug 'mattn/emmet-vim'
" Few more commands working with jump points
Plug 'kana/vim-exjumplist'
" Better view for :jumps
Plug 'thinca/vim-poslist'
" Highlight Task warrior config files syntax
" Change ftdetect/task.vim to "taskrc" if in .config/
Plug 'framallo/taskwarrior.vim'
" SearchUnicode - search for character
" UnicodeName - identify character under cursor
" UnicodeTabl - print table in new file
" ^x ^z - complete unicode character
" ^x ^g - complete digraph character
Plug 'chrisbra/unicode.vim'
" ctags
" Supported languages
" http://ctags.sourceforge.net/languages.html
" :TaggbarToggle
Plug 'majutsushi/tagbar'
" Command T
" <leader> t, b, j (jump to recently used files opening them in new buffers); ^c cancel, Tab to switch between prompt and list
" Plug 'wincent/command-t'
" ^p or :CtrlP
" Plug 'ctrlpvim/ctrlp.vim'
" Syntax checker and indicator
" Plug 'vim-syntastic/syntastic'
" Qt QML syntax highlight
Plug 'calincru/qml.vim'
" Highlights Wiki markup syntax
" Styles wiki links removing surrounding brackets
Plug 'chikamichi/mediawiki.vim'
" JUNEGUNN!!!!!!! This guy rocks!
" Hero of Vim
" ga to align
Plug 'junegunn/vim-easy-align'
" Plug 'joshdick/onedark.vim'
" Plug 'chriskempson/base16-vim'
Plug 'pangloss/vim-javascript'
Plug 'terryma/vim-expand-region'
" Wikipedia editor
Plug 'aquach/vim-mediawiki-editor'
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
" Dep. of the below
Plug 'Shougo/unite.vim'
" File explorer
Plug 'Shougo/vimfiler.vim'
" Use as default (instead of netrw)
let g:vimfiler_as_default_explorer = 1
" last plugin
" --- SNIGULP ---
call plug#end()
" Load or not plugins on start
" set noloadplugins
set loadplugins
" Space and Backspace as Leaders
noremap <space> <Nop>
noremap <backspace> <Nop>
" Hardcore Vim
" Switch to Command Mode to Command
" Encouragement to use J to Join Lines; and Ctrl-O to TempOrarily switch to Command Mode, just for one key stroke
inoremap <backspace> <nop>
" Space as global leader
" Analogous to Major mode
let mapleader="\<Space>"
" Backspace as local leader
" Analogous to Minor mode
let maplocalleader="\<Backspace>"
" Integrate Limelight with Goyo
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
" Don't try to be compatible with Vi enabling new features
set nocompatible
" --- SOLARIZED ---
" Highlight syntax
syntax on
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
" --- DEZIRALOS ---
" --- KOLOR ---
" let g:kolor_italic=1 " Enable italic. Default: 1
" let g:kolor_bold=1 " Enable bold. Default: 1
" let g:kolor_underlined=0 " Enable underline. Default: 0
" let g:kolor_alternative_matchparen=0 " Gray 'MatchParen' color. Default: 0
" colorscheme kolor
" --- ROLOK ---
" Spacemacs colorscheme
" if (has("termguicolors"))
" set termguicolors
" endif
" set background=dark
" colorscheme spacemacs-theme
" ---
" Adjust terminal colors
if !has('gui_running')
" Tell Vim terminal supports 256 colors
set t_Co=256
" set term=xterm-256color
endif
" ---
" --- OPTIONS ---
" Causes "Press ENTER or type command to continue" on startup
" set syntax on
" Correct way
" set syntax=vim
" set syntax != syntax on
" Show line numbers
set number
" set rnu
set relativenumber
" Double lines at bottom bar
" Shows file name, modification status, current line number, character on cursor position, scroll percentage
set laststatus=2
" Disable ALL indentation
set noautoindent
set nosmartindent
set nocindent
" Indentation based on file type (.md, .css)
" Used by plugins and rules kept in indent/ directory as a .vim file (eg. ~.vim/plugged/vim-markdown/indent/markdown.vim)
filetype indent off
" set indentexpr? to see, eg indentexpr=GetMarkdownIndent(), indentexpr& to remove
" set indentexpr=someFunction()
" Disable automatic commenting on new line insertion
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Show file name and its modification state in window title
set title
" Tab autocompletion shows menu in Ex mode above the command
set wildmenu
set wildmode=longest:full,full
set wildignore+=*.swp,.git,*.bmp,*.gif,*.ico,*.jpg,*.png,*.pdf,*.psd
" set clipboard=unnamedplus
" Copy to Primary selection
set clipboard=unnamed
" Show keys in Normal mode at the bottom
set showcmd
" Enable mouse
" Works with Nerd Tree to open a file or directory, resize panes
set mouse=a
" set selectmode+=mouse
" Copy to Primary selection in Visual mode
" vnoremap y "*y
" vnoremap Y "*Y
" Put visually selected text in Primary selection register (*)
" set clipboard+=autoselect
" Enable word autocompletion
" C-n to activate
" z= correct, zg add as a good word, zw wrong word
" ]s, [s search for misspelled words forward / backwards
set spell
" en_ca, en_gb, en_au
set spelllang=en_us
" RMB
" For Gvim
set mousemodel=popup
" Show glyphs
scriptencoding utf-8
set encoding=utf8
set termencoding=utf-8
set fileencoding=utf-8
" Keep lines off when scrolling
" Default is 0
set scrolloff=5
set sidescrolloff=5
" Scroll half the window height
" Instead of just one line down/up when reach the end (scroll limit)
" So the cursor stays above
" Not applicable to scrolling shortcuts (^e, ^d, ^f)
set scrolljump=-50
" Nerdfont for Gvim
" set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11
" Disable blinking cursor
" A good article on universal hatred towards eye-annoying blinking cursor
" http://www.jurta.org/en/prog/noblink
set guicursor=a:blinkon0
" Error feedback
set errorbells
set visualbell
" No intro on start
" set shortmess+=I
set shortmess=a
" Set bottom bar's height
" set cmdheight=2
" Highlight current line
" cul
set cursorline
" Highlight current column, file-wise
set cursorcolumn
" zf to fold
set foldenable
" Manually select text in Visual mode or else to fold
set foldmethod=manual
" Show children headings on opening file
set foldlevel=1
" Column showing fold state (open or close) and level
set foldcolumn=1
" Briefly jump to the matching bracket
set showmatch
" Read modeline when found inside files opened
set modeline
" Show line and column position in status line
set ruler
" Can be - or +, is set according to textwidth
" cc
" set colorcolumn=80
" set colorcolumn=+10
" Wrap text when crossing line width
set wrap
" TTY improvements
set ttyfast
" Always substitute globally in file
" Can be toggled with g (eg /g to reverse to local substitution)
" :s, :substitute command
" :s/apple/pear/g
set gdefault
" Search inside wraps too
set wrapscan
" Autocompletion
" set complete=.,w,b,t
" Default: menu,preview
" set completeopt+=preview
" C-x C-k to complete keyword
" C-x C-l to complete line
" C-x C-s spelling suggestion
" C-x C-v Vim commands
set dictionary=/usr/share/dict/words
" C-x C-t
" http://www.gutenberg.org/ebooks/3202
" https://raw.githubusercontent.com/zeke/moby/master/words.txt
set thesaurus=$HOME/.vim/mthesaur.txt
" Enables the reading of .vimrc, .exrc and .gvimrc indent the current
" directory. If you switch this option on you should also consider
" setting the 'secure' option. Using a local .exrc, .vimrc or .gvimrc
" is a potential security leak, use with care!
" set exrc
" set secure
" Shows Normal/Insert mode state
set showmode
" set shiftwidth=4
" Round down indentation to shiftwidth
set shiftround
" Define tab width
" One tab is four spaces long
" Markdown treats four spaces indented lines as code
" One good reason to size accordingly. Tab to declare code line (within block).
set softtabstop=4
set tabstop=4
" Pretty line breaks
set showbreak=↪
" Grep program for :grep command
" Ripgrep
set grepprg=rg
" No redraw on macro execution
set lazyredraw
" No delays on escaping
set noesckeys
" xterm / tmux compatible mouse
set ttymouse=xterm2
" Delete comment character when joining commented lines
set formatoptions+=j
" Change directory to the opened file's or switched buffer's
" Vimfiler doesn't work with it
" set autochdir
" Larger command history
" Default value is 50
set history=1000
" Key to invoke command-line window in Ex Mode (:)
" set cedit=^F
" Command line window height
" set cmdwinheight=7
" set cmdwinheight=20
" Command mode height in statusline
" set cmdheight=1
set cmdheight=2
" Show whitespace as characters (tab, space)
" Useful to see end of line or trail spaces
set list
" Dagger †, Double dagger ‡, Ellipsis …, Cross ✘, White Pointer ▷, White Arrow ⇨
" ‧, •, ·
set listchars=tab:▸\ ,eol:•,trail:·
" Put new window to the right instead of left of the current one on vertical split
set splitright
" Same but below instead of above for horizontal splits
" set splitbelow
" Move cursor to start of line (FNB) rather than keeping the cursor in the current position
" FNB - First Non Blank
" Is set as default
" set startofline
set nostartofline
" Match other marks too on % key press
set matchpairs+=<:>,“:”
" autoread when file is changed from outside
set autoread
" Transparency
" highlight clear
" Backspace
set backspace=eol,start,indent
" Searching without escaping
set magic
" Cross lines when going left/right
" set whichwrap+=<,>,h,l
" How long to blink when matching brackets
" Tenth of second
" mat
set matchtime=2
" lbr
set linebreak
" Linebreak on 120 characters
" tw
set textwidth=200
" compiler fish
" Report messages like "1 line less" even if just one line is changed
" Default is 2
set report=0
" Don't equalize splits
" set equalalways
set noequalalways
" Open Vim command under cursor instead of Linux command
set keywordprg=:help
" Hide pointer when typing
set mousehide
" Pop up menu height on keyword completion
" Default is 0, as much space is available
set pumheight=4
" Default is 20 or half the screen if equalalways (ea) is set
set helpheight=30
" True colors (24 bit)
" Vim colors
" URxvt does not support the colors unlike xterm
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
" set termguicolors
" Default a:blinkon0
" gcr
set guicursor=a:blinkoff150
" Disable backup
" They are being more harming than helpful
" No backup files
set nobackup
" No backup files while editing
set nowritebackup
" No swap files (.swp)
set noswapfile
" Alternative solution
" If first dir doesn't exist, jump to the second
" set backupdir=~/vimtmp,.
" set directory=~/vimtmp,.
" Sign column background color (for marks)
highlight clear SignColumn
" sign unplace * to remove the column
" Whitespace
" Trailing spaces bacground color
highlight ExtraWhitespace ctermbg=black ctermfg=red guibg=black guifg=red
" ^x ^o to invoke
set omnifunc=csscomplete#CompleteCSS
" Vi compatibility for changing words
" Add $ to the end of the word to be changed instead of removing
set cpoptions+=$
" Copy indentation of the current line
" set smartindent
set copyindent
" last option
" --- SNOITPO ---
" Search options
set incsearch
set hlsearch
set ignorecase
set smartcase
" ---
" Improved incremental search
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
" :h g:incsearch#auto_nohlsearch
" set hlsearch
let g:incsearch#auto_nohlsearch = 1
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#)
" Fuzzy search
" map z/ <Plug>(incsearch-fuzzy-/)
" map z? <Plug>(incsearch-fuzzy-?)
" map zg/ <Plug>(incsearch-fuzzy-stay)
" Fuzzyspell search
" map z/ <Plug>(incsearch-fuzzyspell-/)
" map z? <Plug>(incsearch-fuzzyspell-?)
" map zg/ <Plug>(incsearch-fuzzyspell-stay)
" Fuzzy search and fuzzyspell together
function! s:config_fuzzyall(...) abort
return extend(copy({
\ 'converters': [
\ incsearch#config#fuzzy#converter(),
\ incsearch#config#fuzzyspell#converter()
\ ],
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> z/ incsearch#go(<SID>config_fuzzyall())
noremap <silent><expr> z? incsearch#go(<SID>config_fuzzyall({'command': '?'}))
noremap <silent><expr> zg? incsearch#go(<SID>config_fuzzyall({'is_stay': 1}))
" ----
" Flash yank area
" vim-operator-flashy plugin
map y <Plug>(operator-flashy)
nmap Y <Plug>(operator-flashy)$
" ---
" Star motions
" vim-asterisk
" map * <Plug>(asterisk-*)
" map # <Plug>(asterisk-#)
" map g* <Plug>(asterisk-g*)
" map g# <Plug>(asterisk-g#)
" map z* <Plug>(asterisk-z*)
" map gz* <Plug>(asterisk-gz*)
" map z# <Plug>(asterisk-z#)
" map gz# <Plug>(asterisk-gz#)
" Set z (stay) behaviour as default
map * <Plug>(asterisk-z*)
map # <Plug>(asterisk-z#)
map g* <Plug>(asterisk-gz*)
map g# <Plug>(asterisk-gz#)
let g:asterisk#keeppos = 1
" Emmet
" let g:user_emmet_leader_key='<CR>'
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
" --- PLUGIN OPTIONS ---
" Powerline / Airline
" As required by Powerline
let g:powerline_pycmd = 'py3'