plugins: Gutentags only for some filetypes
[vimconf.git] / plugins.vim
1 function! Cond(cond, ...)
2 let opts = get(a:000, 0, {})
3 return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
4 endfunction
5
6 Plug 'mhinz/vim-startify'
7 Plug 'dstein64/vim-startuptime'
8
9 Plug 'vim-airline/vim-airline'
10 Plug 'gruvbox-community/gruvbox'
11
12 Plug 'benknoble/vim-auto-origami'
13
14 Plug 'scrooloose/nerdcommenter'
15 Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
16
17 Plug 'roryokane/detectindent'
18
19 " This plugin cannot be conditionally loaded, see github issue #18
20 Plug 'derekwyatt/vim-fswitch' ", {'for': ['c', 'cpp', 'objc']}
21
22 Plug 'godlygeek/tabular'
23 Plug 'junegunn/vim-easy-align'
24
25 Plug 'thinca/vim-fontzoom'
26
27 Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'}
28
29 " Make . more useful after a plugin map
30 Plug 'tpope/vim-repeat'
31
32 Plug 'flwyd/vim-conjoin'
33
34
35 function PluginsConfig()
36
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
41
42 let g:airline_powerline_fonts=1
43 let g:airline#extensions#tabline#enabled=1
44 let g:airline#extensions#branch#enabled=1
45
46 let g:gruvbox_contrast_light='hard'
47 let g:gruvbox_contrast_dark='hard'
48 set bg=dark
49
50 if &term =~ 'linux'
51 let g:gruvbox_termcolors=16
52 else
53 " Setting termguicolors has two implications:
54 " - Breaks colors for some versions of mosh, but not if tmux is used on top of
55 " mosh. See https://github.com/mobile-shell/mosh/issues/928
56 set termguicolors
57 let g:gruvbox_italic = 1
58 endif
59 colorscheme gruvbox
60
61 " let NERDTreeWinPos="right"
62 let NERDTreeHijackNetrw=0
63 let NERDTreeWinSize=22
64 let NERDTreeQuitOnOpen=1
65 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
66
67 let g:startify_files_number = 5
68 let g:startify_session_persistence = 1
69 let g:startify_lists = [
70 \ { 'type': 'dir', 'header': [' Recent files'] },
71 \ { 'type': 'sessions', 'header': [' Saved sessions'] },
72 \ ]
73
74 if has('nvim')
75 let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
76 let g:startify_custom_header = [
77 \ '',
78 \ ' ╻ ╻ ╻ ┏┳┓',
79 \ ' NEO ┃┏┛ ┃ ┃┃┃',
80 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
81 \ '',
82 \ ]
83 else
84 let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
85 let g:startify_custom_header = [
86 \ '',
87 \ ' ╻ ╻ ╻ ┏┳┓',
88 \ ' ┃┏┛ ┃ ┃┃┃',
89 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
90 \ '',
91 \ ]
92 endif
93 endfunction
94