-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
1301 lines (1030 loc) · 37.7 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
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just /usr/share/vim/vimfiles/archlinux.vim) and
" sourced by the call to :runtime you can find below. If you wish to change any of those settings, you should do it in
" this file (/etc/vimrc), since archlinux.vim will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing archlinux.vim since it alters the value of the 'compatible' option.
" This line should not be removed as it ensures that various options are properly set to work with the Vim-related
" packages.
"runtime! archlinux.vim
" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
"
" Or better yet, read /usr/share/vim/vim72/vimrc_example.vim or the vim manual and configure vim to your own liking!
" >>> Note: to set any value to default, comment the line with \" to disable a setting, add "no" to the beginning.
" Disable compatibility mode
set nocompatible
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Vundle
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax off
filetype plugin indent off
set rtp+=~/.vim/vundle/Vundle.vim
call vundle#begin('~/.vim/vundle')
" Plugins
Plugin 'altercation/vim-colors-solarized'
Plugin 'derekwyatt/vim-fswitch'
Plugin 'gmarik/Vundle.vim'
Plugin 'jiangmiao/auto-pairs.git'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-pandoc/vim-pandoc-syntax'
Plugin 'vim-scripts/DoxygenToolkit.vim'
Plugin 'vim-scripts/taglist.vim'
"Plugin 'Rip-Rip/clang_complete.git'
Plugin 'rhysd/vim-clang-format.git'
Plugin 'lervag/vimtex.git'
Plugin 'Yggdroot/indentLine.git'
Plugin 'kien/ctrlp.vim.git'
Plugin 'jonathanfilip/vim-lucius.git'
Plugin 'sickill/vim-sunburst.git'
Plugin 'justinmk/vim-syntax-extra.git'
Plugin 'mgrabovsky/vim-xverif.git'
Plugin 'SirVer/ultisnips'
"" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
Plugin 'vim-scripts/TaskList.vim.git'
call vundle#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" General behavior of Vim
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting.
syntax on
" Enable filetype specific plugins and indentation
filetype plugin indent on
" Set the standard encoding
set encoding=utf8
" Set the height of the command bar
set cmdheight=1
" Always show the status line
set laststatus=2
" Show tab line if there are at least two pages
set showtabline=1
" Show (partial) command in status line
set showcmd
" Show line numbers.
set number
" Show offset
set relativenumber
" Show the line and column number of the cursor position, seperated by a
" comma.
set ruler
" Makes Vim ask for a confirmation instead of showing an error message.
set confirm
" Set the maximum width of text that is being insterd without breaking it
" to a new line.
" Setting this value to '0' disables this option.
set textwidth=80
" Set whether a line that doesn't fit into a window is wrapped around at
" the end of the window.
set wrap
" Make Vim wrap long lines at specified characters instead of wrapping at
" the last character in the line.
set linebreak
" Show the cursor line by default
set cursorline
" redraw only when we need to
set lazyredraw
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Make 'word' stop at underscores. Does not affect 'Word'.
"set iskeyword-=_
" Set auto reload for files changed externally
set autoread
" Enable mouse itegration
set mouse=a
" Set default directory for swapfiles
set directory=~/.vim/swapfiles//
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Window Properties
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Define the default width of the current window
"set columns=100
"set winwidth=50
" Define the default height of the current window
"set winheight=100
"set lines=60
" Show a vertical lign at column 80
set colorcolumn=81
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Wildmenu
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set Wildmenu
set wildmenu
" Make the wild menu auto complete to the longest substring of all matches
set wildmode=list:longest
" A list of file patterns. A file that matches with one of these patterns is
" ignored when expanding wildcards, completing file or directory names, etc.
set wildignore+=*.o,*.d,*.obj,*.bak,*.exe,*.aux,*.toc,*.backup
set wildignore+=.*.swo,.*.swp,.clang_complete,.project.vim,.ycm_extra_conf.py,project.debug,tags,rubber.cache,*.o,*.pyc
" Display certain whitespace characters
set listchars=tab:»-,extends:@,trail:·
set list
" Make completion case-insensitive
set wildignorecase
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Persistent undo
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set undodir=$HOME/.vim/undo/ " where to store undofiles
set undofile " enable undofile
set undolevels=500 " max undos stored
set undoreload=10000 " buffer stored undos
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Scrolling properties
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set leading/trailing lines for the cursor when moving vertically.
set scrolloff=7
" Set leading/trailing columns for the cursor when moving horizontally.
set sidescrolloff=15
" Set the amount of columns to scroll horizontally, when the end of the window
" is reached.
set sidescroll=1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Indentation rules
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Number of spaces a <TAB> counts for
set tabstop=4
" Number of spaces that a Tab counts for while performing editing
" operations.
set softtabstop=4
" Number of spaces to use for each step of (auto)indent.
set shiftwidth=4
" When on, a <Tab> in front of a line inserts blanks according to
" 'shiftwidth'. 'tabstop' is used in other places. A <BS> will delete a
" 'shiftwidth' wide bunch of space at the start of the line.
" What gets inserted (a <Tab> or spaces) depends on the 'expandtab' option.
set smarttab
" Use the appropriate number of spaces to insert a <Tab>. Spaces are used
" in indents with the '>' and '<' commands and when 'autoindent' is on. To
" insert a real tab when 'expandtab' is on, use CTRL-V <Tab>.
set expandtab
" Copy indent from current line when starting a new line (typing <CR> in Insert
" Mode or when using the "o" or "O" command).
set autoindent
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Search properties
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Allow 'search next' to jump back to the beginning of the file if the end
" was reached (equivalent for 'search previous').
set wrapscan
" Set whether to highlight matches for previous search patterns.
set hlsearch
" While typing a search command, show immediately where the so far typed
" pattern matches.
set incsearch
" Ignore the case when searching
set ignorecase
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" User-defined folding
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Define where to create folds
set foldmethod=marker
" Set the number of screen line above which a fold can be displayed closed.
set foldminlines=3
" Define the maximum nesting of folds (for the 'indent' and 'syntax' methods).
set foldnestmax=2
set nofoldenable " disable folding
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Spelling
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use ]s to jump to next misspelled word
" use [s to jump to previous misspelled word
" use z= to show alternatives
" use zg to add a word to the dictionary
" use zw to mark words a incorrect
" Enable spellchecking by default (disable it by using :set nospell)
set nospell
" Set languages for spell checking
set spelllang=en_us
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" SuperTab
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SuperTab option for context aware completion
"let g:SuperTabDefaultCompletionType = "<C-x><C-u>"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Vim auto completion and appearance
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Don't set completeopt, as YCM overrides it anyway
" Limit popup menu height
set pumheight=20
" Close invisible preview windows
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
" Define a cholor scheme
"
" Here is a list of available color schemes
" blue
" darkblue
" default
" delek
" desert
" elflord
" evening
" koehler
" morning
" murphy
" pablo
" peachpuff
" ron
" shine
" slate
" torte
" zellner
" set the color defintion to 256 different colors
set t_Co=256
colorscheme lucius
LuciusBlack
" set the color of the popup menu
highlight Pmenu guibg=brown gui=bold
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Conceal feature configuration
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set conceallevel
"set conceallevel=0
" Set concealcursor strategy
"
" n - Normal mode
" v - Visual mode
" i - Insert mode
" c - Command line editing
"set concealcursor="nc"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Set splitting options
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set splitright
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" User-defined statusline
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" seperator used in the status line
let g:statusline_sep_left='╲'
let g:statusline_sep_right='╱'
function! StatuslineMode()
let l:mode = mode()
if l:mode ==# "n"
let l:modestr="N "
elseif l:mode ==# "i"
let l:modestr="I "
elseif l:mode ==# "v"
let l:modestr="V "
elseif l:mode ==# "V"
let l:modestr="VL"
elseif l:mode ==# ""
let l:modestr="VB"
elseif l:mode ==# "R"
let l:modestr="R "
elseif l:mode ==# "s"
let l:modestr="S "
elseif l:mode ==# "S"
let l:modestr="SL"
elseif l:mode ==# ""
let l:modestr="SB"
elseif l:mode ==# "Rv"
let l:modestr="VR"
elseif l:mode ==# "no"
let l:modestr="NO"
else
let l:modestr=l:mode
endif
let b:statusline_mode = " ".l:modestr." "
return b:statusline_mode
endfunction
function! StatuslineFileName()
let b:statusline_filename = ""
if len(expand('%')) > 0
if &ft ==# "help"
let b:statusline_filename = "help: ".expand('%:t:r')." "
else
let b:statusline_filename = expand('%')." "
endif
endif
return b:statusline_filename
endfunction
function! StatuslineAttributes()
let b:statusline_attributes = ""
if &ft ==# "help"
return ""
endif
if &modifiable && &modified
let b:statusline_attributes .= "mod"
elseif !&modifiable
let b:statusline_attributes .= "umod"
endif
if &readonly
if len(b:statusline_attributes) > 0
let b:statusline_attributes .= ","
endif
let b:statusline_attributes .= "read"
endif
if len(b:statusline_attributes) > 0
let b:statusline_attributes .= " "
endif
return b:statusline_attributes
endfunction
function! StatuslineFileInfo()
let b:statusline_fileinfo = ''
if &ft ==# "help"
return ""
endif
" only display fileformat if it differs from the default
if len(&fileformat) > 0 && !(&fileformat ==# (split(&fileformats,','))[0])
let b:statusline_fileinfo .= g:statusline_sep_right." ".&fileformat." "
endif
" only display fileencoding if it differs from the internal representation
if len(&fileencoding) && !(&fileencoding ==# &encoding) > 0
let b:statusline_fileinfo .= g:statusline_sep_right." ".&fileencoding." "
endif
if len(&filetype) > 0
let b:statusline_fileinfo .= g:statusline_sep_right." ".&filetype." "
endif
return b:statusline_fileinfo
endfunction
function! ConditionalSep(fn, left)
let l:str = a:fn()
if len(l:str) > 0
if a:left
return " ".g:statusline_sep_left." "
else
return " ".g:statusline_sep_right." "
endif
endif
return ""
endfunction
highlight User1 term=reverse cterm=bold,reverse gui=bold,reverse guifg=White guibg=Red
highlight User2 term=reverse cterm=bold,reverse gui=bold,reverse guifg=Black guibg=White
" default the statusline to green when entering Vim
hi statusline guibg=Black ctermfg=8 guifg=White ctermbg=15
"
" Set statusline
"
set statusline=%2*%{StatuslineMode()}%*
set statusline+=%{g:statusline_sep_left}\ "
set statusline+=%<
set statusline+=%{StatuslineFileName()}"
set statusline+=%{ConditionalSep(function('StatuslineFileName'),1)}
set statusline+=%1*
set statusline+=%{StatuslineAttributes()}
set statusline+=%w
set statusline+=%*
set statusline+=%{ConditionalSep(function('StatuslineAttributes'),1)}
set statusline+=%=
set statusline+=%{StatuslineFileInfo()}
set statusline+=%{g:statusline_sep_right}
set statusline+=\ %3.l:%2v\ "
set statusline+=%{g:statusline_sep_right}
set statusline+=\ %3p%%\ "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Format options
"
" This is a sequence of letters which describes how automatic formatting is
" to be done.
"
" letter meaning when present in 'formatoptions'
" ------ ---------------------------------------
" t Auto-wrap text using textwidth (does not apply to comments).
" c Auto-wrap comments using textwidth, inserting the current comment
" leader automatically.
" r Automatically insert the current comment leader after hitting
" <ENTER> in Insert Mode.
" o Automatically insert the current comment leader after hitting 'o' or
" 'O' in Normal mode.
" q Allow formatting of comments with "gq".
" w Trailing white space indicates a paragraph continues in the next
" line. A line that ends in a non-white character ends a paragraph.
" l Long lines are not broken in insert mode: When a line was longer
" than 'textwidth' when the insert command started, Vim does not
" automatically format it.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set formatoptions=c,q,r,l
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" User-defined commands
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Alias to vertically resize the current window
"command! -nargs=+ Say :echo <q-args>
command! -nargs=1 V :vertical resize <args>
" Switches between absolute and relative line numbers
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
autocmd InsertEnter * :set relativenumber
autocmd InsertLeave * :set norelativenumber
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Custom keymaps
"
" {cmd} {attr} {lhs} {rhs}
"
" {cmd} : of the form <?>map, <?>noremap or <?>unmap,
" where <?> can be one of the following:
"
" : - normal, visual, select and operator pending mode
" :! - insert and command-line mode
" :n - normal mode
" :i - insert mode
" :v - visual and select mode
" :s - select mode
" :x - visual mode
" :c - command-line mode
" :o - operator pending mode
"
" {attr} : optional, one or more of the following
"
" <buffer> - the mapping will by effective in the
" current buffer only
" <silent> - the mapping will not be echoed in
" the command line
" <expr>
" <script> - the mapping will only remap charachters
" using mappings that were defined local
" <unique> - lets the command fail if the mapping or
" abbreviation already exists
" <special> - useful to suppress side effect when
" mapping with <> notation for special
" charachters such as digraphs, umlauts, or accent
"
" Key modifiers:
" Control - <C-key>
" Shift - <S-key>
" Alt - <A-key> or <M-key>
" Super - <T-key>
" Command - <D-key>
"
" Special keys:
" <BS> Backspace
" <Tab> Tab
" <CR> Enter
" <Enter> Enter
" <Return> Enter
" <Esc> Escape
" <Space> Space
" <Up> Up arrow
" <Down> Down arrow
" <Left> Left arrow
" <Right> Right arrow
" <F1> - <F12> Function keys 1 to 12
" #1, #2..#9,#0 Function keys F1 to F9, F10
" <Insert> Insert
" <Del> Delete
" <Home> Home
" <End> End
" <PageUp> page-up
" <PageDown> page-down
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set leader key
let mapleader=','
" set W and Q to the same commands as w and q
command! -bang W w<bang>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Wq wq<bang>
command! -bang WQ wq<bang>
command! -bang Q q<bang>
command! -bang Qa qa<bang>
command! -bang QA qa<bang>
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move between splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Alternative Escape key
inoremap jk <Esc>
inoremap q <Esc>
nnoremap q <Esc>
vnoremap q <Esc>
cnoremap q <Esc>
onoremap q <Esc>
" <F2> - NERD Tree
nnoremap <silent> <F2> :NERDTree<CR>
" <F5> - compile and show messages
map <silent> <F5> :make<CR>:cl<CR>
" <F6> - Show the compiler messages
nnoremap <silent> <F6> :cl<CR>
" <F7> - toggle the tag list plugin window
map <silent> <F7> :TlistUpdate<CR>:TlistToggle<CR>
" <F12> - insert the current date and time
inoremap <silent> <F12> <C-R>=strftime('%c')<CR>
cnoremap <silent> <F12> <C-R>=strftime('%c')<CR>
" Shortcut for arranging text to 'textwidth'
nnoremap w gwgw
inoremap w <C-o>gwgw<CR>
xnoremap w gw
nnoremap <Leader>g gwip
"<Space> - toggle line number style
nnoremap <silent> <Space> :call NumberToggle()<CR>
" <BS> - Remove all trailing whitespaces
nnoremap <silent> <BS> :DeleteTrailingWs<CR>
" <A-F> - Vim's file name completion
inoremap f <C-X><C-F>
" If pressing Tab in Normal Mode, cycle to the next tab
nnoremap <silent> <C-Tab> :tabnext<CR>
" If pressing Shift+Tab in Normal Mode, cycle to the previous tab
nnoremap <silent> <S-Tab> :tabprevious<CR>
" <C-N> - create a new tab and prompt file open dialog
nnoremap <C-N> :tabnew <C-D>
" <A-N> - create new vertical window and prompt file open dialog
nnoremap n <C-W>v<C-W>l:edit <C-D>
" Open the alternate file
nnoremap <silent> ,ff :FSHere<CR>
nnoremap <silent> ,fh <C-W>v<C-W>h:FSHere<CR>
nnoremap <silent> ,fk <C-W>s<C-W>k:FSHere<CR>
nnoremap <silent> ,fj <C-W>s<C-W>j:FSHere<CR>
nnoremap <silent> ,fl <C-W>v<C-W>l:FSHere<CR>
" ,c - toggle comment (uses NERD_commenter)
nnoremap <silent> <C-C> :call NERDComment(0, "toggle")<CR>
vnoremap <silent> <C-C> :call NERDComment(1, "toggle")<CR>
" <A-J> - Open tag list selection menu
nnoremap j :tselect <C-R>=expand("<cword>")<CR><CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Tag list
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Close_On_Select = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Show_One_File = 1
let Tlist_Sort_Type = "name"
let Tlist_WinWidth = 80
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" VimTeX Plugin
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" latex is sorted by order
let Tlist_tex_settings = 'latex;l:labels;s:sections;t:subsections;u:subsubsections;p:paragraphs'
au BufReadPre *.tex let Tlist_Sort_Type = "order"
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" Set which LaTeX symbols to conceal
"
" a : accents / ligatures
" d : delimeters
" g : Greek
" m : math
" s : superscript / subscript
let g:tex_conceal=""
" enable/disable folding
" default: 1
let g:vimtex_fold_enabled = 0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" ProVerif
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Syntax highlighting for proverif files (SPI calculus)
augroup filetype
au! BufRead,BufNewFile *.pv set filetype=proverif-pv
au! BufRead,BufNewFile *.pv set syntax=proverif-pv
au FileType proverif source /Users/wiamrachid/.vim/vundle/vim-xverif/syntax/proverif-pv.vim
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Make
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Define filetype for Makefiles
augroup filetype
au! BufRead,BufNewFile *Makefile* set filetype=make
augroup END
" Set the default make program
set makeprg=make
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" cindent
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup filetype
au! BufNewFile,BufRead *.c,*.cpp,*.cc,*.h,*.hpp,*.java,Makefile,*.ll set cindent
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" C/C++
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Allows to jump to the alternate file, e.g. the header file for a C file
let g:alternateNoDefaultAlternate = 1
let g:alternateExtensions_h = "c,cpp,cxx,cc,CC,hpp,h"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" LLVM
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting for LLVM files.
augroup filetype
au! BufRead,BufNewFile *.ll set filetype=llvm
augroup END
augroup filetype
au! BufRead,BufNewFile *.td set filetype=tablegen
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" YouCompleteMe
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" number of characters the user needs to type before identifier-based completion
" suggestions are triggered
" NOTE: this option is not used for semantic completion
" Default: 2
let g:ycm_min_num_of_chars_for_completion = 2
" minimum number of characters that a completion candidate coming from the
" identifier completer must have to be shown in the popup menu
" Default: 0
"let g:ycm_min_num_identifier_candidate_chars = 0
" turns off YCM's identifier completer (the as-you-type popup) and the semantic
" triggers
" Default: 1
"let g:ycm_auto_trigger = 1
" controls for which Vim filetypes (see :h filetype) should YCM be turned on
" NOTE: the key '*' matches all filetypes
" Default: {'*' : 1}
"let g:ycm_filetype_whitelist = { '*' : 1 }
" controls for which Vim filetypes (see :h filetype) should YCM be turned off
"let g:ycm_filetype_blacklist = {
"\ 'tagbar' : 1,
"\ 'qf' : 1,
"\ 'notes' : 1,
"\ 'markdown' : 1,
"\ 'unite' : 1,
"\ 'text' : 1,
"\ 'vimwiki' : 1,
"\ 'pandoc' : 1,
"\ 'infolog' : 1,
"\ 'mail' : 1
"\}
" Controls for which Vim filetypes (see :h filetype) should the YCM semantic
" completion engine be turned off
" Default: {}
"let g:ycm_filetype_specific_completion_to_disable = {}
" turns on YCM's diagnostic display features
" Default: 1
"let g:ycm_show_diagnostics_ui = 1
" YCM will use the value of this option as the symbol for errors in the Vim
" gutter.
" Default: >>
let g:ycm_error_symbol = '>>'
" YCM will use the value of this option as the symbol for warnings in the Vim
" gutter.
" Default: >>
let g:ycm_warning_symbol = '<>'
" put icons in Vim's gutter on lines that have a diagnostic set
" NOTE: turning this off will also turn off the YcmErrorLine and YcmWarningLine
" highlighting
" Default: 1
"let g:ycm_enable_diagnostic_signs = 1
" highlight regions of text that are related to the diagnostic that is present
" on a line, if any
" Default: 1
"let g:ycm_enable_diagnostic_highlighting = 1
" echo the text of the diagnostic present on the current line when you move your
" cursor to that line
" Default: 1
let g:ycm_echo_current_diagnostic = 1
" populate the location list automatically every time it gets new diagnostic
" data
" NOTE: off by default to not interfere with other data you might have placed in
" the location list
" Default: 0
"let g:ycm_always_populate_location_list = 0
" :YcmDiags will automatically open the location list after forcing a
" compilation and filling the list with diagnostic data
" Default: 1
"let g:ycm_open_loclist_on_ycm_diags = 1
" change the updatetime Vim option to 2000
" This may conflict with some other plugins you have (but it's unlikely). The
" updatetime option is the number of milliseconds that have to pass before Vim's
" CursorHold (see :h CursorHold) event fires. YCM runs the completion engines'
" "file comprehension" systems in the background on every such event; the
" identifier-based engine collects the identifiers whereas the semantic engine
" compiles the file to build an AST.
" Default: 1
"let g:ycm_allow_changing_updatetime = 1
" show the completion menu even when typing inside comments
" Default: 0
let g:ycm_complete_in_comments = 0
" show the completion menu even when typing inside strings
" NOTE: turned on by default so that you can use the filename completion inside
" strings. very useful for #include
" Default: 1
"let g:ycm_complete_in_strings = 1
" collect identifiers from strings and comments
" Default: 0
"let g:ycm_collect_identifiers_from_comments_and_strings = 0
" collect identifiers from tags files
" Default: 0
"let g:ycm_collect_identifiers_from_tags_files = 0
" seed its identifier database with the keywords of the programming language
" you're writing
" Default: 0
"let g:ycm_seed_identifiers_with_syntax = 0
" a way of sending data from Vim to your FlagsForFile function in your
" .ycm_extra_conf.py file
" Default: []
"let g:ycm_extra_conf_vim_data = []
" force the use of a specific interpreter of your choosing
" NOTE: The YCM client running inside Vim always uses the Python interpreter
" that's embedded inside Vim.
" Default: ''
"let g:ycm_path_to_python_interpreter = ''
" By default, the ycmd completion server writes logs to logfiles. When this
" option is set to 1, the server writes logs to Vim's stdout (so you'll see them
" in the console).
" Default: 0
"let g:ycm_server_use_vim_stdout = 0
" keep the logfiles around after shutting down (they are deleted on shutdown by
" default)
" Default: 0
"let g:ycm_server_keep_logfiles = 0
" The logging level that the ycmd completion server uses.
" debug
" info
" warning
" error
" critical
"
" Default: info
"let g:ycm_server_log_level = 'info'
" OmniSharp server will be automatically started (once per Vim session) when you
" open a C# file.
" Default: 1
" let g:ycm_auto_start_csharp_server = 1
" OmniSharp server will be automatically stopped upon closing Vim.
" Default: 1
"let g:ycm_auto_stop_csharp_server = 1
" Default: 0