1 function! Cond(cond, ...)
2 let opts = get(a:000, 0, {})
3 return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
6 Plug 'mhinz/vim-startify'
7 Plug 'dstein64/vim-startuptime'
9 Plug 'vim-airline/vim-airline'
10 Plug 'gruvbox-community/gruvbox'
12 Plug 'benknoble/vim-auto-origami'
14 Plug 'scrooloose/nerdcommenter'
15 Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
17 Plug 'roryokane/detectindent'
19 " This plugin cannot be conditionally loaded, see github issue #18
20 Plug 'derekwyatt/vim-fswitch' ", {'for': ['c', 'cpp', 'objc']}
22 Plug 'godlygeek/tabular'
23 Plug 'junegunn/vim-easy-align'
25 Plug 'thinca/vim-fontzoom'
27 Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'}
29 " Make . more useful after a plugin map
30 Plug 'tpope/vim-repeat'
32 Plug 'flwyd/vim-conjoin'
35 function PluginsConfig()
37 " Some preferences for indent detection
38 let g:detectindent_min_indent = 2
39 let g:detectindent_max_indent = 4
40 let g:detectindent_preferred_indent = 4
42 " Minimum indenting for source code
43 au FileType c,cpp,objc,java,cs let g:detectindent_min_indent = 4
44 " Consider using localvimrc config file or editorconfig instead
45 "au BufReadPost *.java :DetectIndent
47 let g:airline_powerline_fonts=1
48 let g:airline#extensions#tabline#enabled=1
49 let g:airline#extensions#branch#enabled=1
51 let g:gruvbox_contrast_light='hard'
52 let g:gruvbox_contrast_dark='hard'
56 let g:gruvbox_termcolors=16
58 " Setting termguicolors has two implications:
59 " - Breaks colors for some versions of mosh, but not if tmux is used on top of
60 " mosh. See https://github.com/mobile-shell/mosh/issues/928
62 let g:gruvbox_italic = 1
66 " let NERDTreeWinPos="right"
67 let NERDTreeHijackNetrw=0
68 let NERDTreeWinSize=22
69 let NERDTreeQuitOnOpen=1
70 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
72 let g:startify_files_number = 5
73 let g:startify_session_persistence = 1
74 let g:startify_lists = [
75 \ { 'type': 'dir', 'header': [' Recent files'] },
76 \ { 'type': 'sessions', 'header': [' Saved sessions'] },
80 let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
81 let g:startify_custom_header = [
85 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
89 let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
90 let g:startify_custom_header = [
94 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
99 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
100 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
101 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
102 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'