]> git.sthu.org Git - vimconf.git/blob - plugins.vim
plugins: Add message for creating .vimspector.json
[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 " 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
46
47 let g:airline_powerline_fonts=1
48 let g:airline#extensions#tabline#enabled=1
49 let g:airline#extensions#branch#enabled=1
50
51 let g:gruvbox_contrast_light='hard'
52 let g:gruvbox_contrast_dark='hard'
53 set bg=dark
54
55 if &term =~ 'linux'
56 let g:gruvbox_termcolors=16
57 else
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
61 set termguicolors
62 let g:gruvbox_italic = 1
63 endif
64 colorscheme gruvbox
65
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
71
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'] },
77 \ ]
78
79 if has('nvim')
80 let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
81 let g:startify_custom_header = [
82 \ '',
83 \ ' ╻ ╻ ╻ ┏┳┓',
84 \ ' NEO ┃┏┛ ┃ ┃┃┃',
85 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
86 \ '',
87 \ ]
88 else
89 let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
90 let g:startify_custom_header = [
91 \ '',
92 \ ' ╻ ╻ ╻ ┏┳┓',
93 \ ' ┃┏┛ ┃ ┃┃┃',
94 \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
95 \ '',
96 \ ]
97 endif
98
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'
103 endfunction
104