-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
148 lines (127 loc) · 5.1 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
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim' " Plugin manager
Plugin 'tpope/vim-fugitive' " Git plugin
Plugin 'scrooloose/nerdtree' " File manager
"Plugin 'mileszs/ack.vim' " Searching files (together with ag)
Plugin 'junegunn/fzf' " Fuzzy search
Plugin 'junegunn/fzf.vim' " Fuzzy search
Plugin 'w0rp/ale' " Asynchronous lint engine
Plugin 'itchyny/lightline.vim' " Statusline for vim
Plugin 'airblade/vim-gitgutter' " Show git diff
Plugin 'edkolev/tmuxline.vim' " Tmux statusline generator
Plugin 'vimwiki/vimwiki' " Maintain notes
Plugin 'tpope/vim-obsession' " Store vim sessions
"Plugin 'tpope/vim-surround' " Change delete surrondings in pairs
"Plugin 'lervag/vimtex' " Latex
Plugin 'Valloric/YouCompleteMe' " Fuzzy-search code completion
"Plugin 'SirVer/ultisnips' " Snippet engine
"Plugin 'honza/vim-snippets' " Snippets
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
" filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just
" :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
syntax enable " enable syntax processing
" TABS AND SPACES
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set shiftwidth=4
set expandtab " tabs are spaces
" UI
set number " show line number
set showcmd " show command in bottom bar
" NERDTree
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" fzf
map ; :Buffers<CR>
nmap <Leader>t :Files<CR>
nmap <Leader>r :Tags<CR>
" ALE
" Lightline
set laststatus=2
set noshowmode
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [['mode', 'paste'], ['filename', 'modified']],
\ 'right': [['lineinfo'], ['percent'], ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok']]
\ },
\ 'component_expand': {
\ 'linter_warnings': 'LightlineLinterWarnings',
\ 'linter_errors': 'LightlineLinterErrors',
\ 'linter_ok': 'LightlineLinterOK'
\ },
\ 'component_type': {
\ 'readonly': 'error',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error'
\ },
\ }
function! LightlineLinterWarnings() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d W', all_non_errors)
endfunction
function! LightlineLinterErrors() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d E', all_errors)
endfunction
function! LightlineLinterOK() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? 'No errors' : ''
endfunction
autocmd User ALELint call s:MaybeUpdateLightline()
" Update and show lightline but only if it's visible (e.g., not in Goyo)
function! s:MaybeUpdateLightline()
if exists('#lightline')
call lightline#update()
end
endfunction
" tmuxline
let g:tmuxline_powerline_separators = 0
" latex
" let g:vimtex_view_general_viewer = 'mupdf' " Set default viewer
" let g:vimtex_latexmk_options='-pdf -pdflatex="xelatex -synctex=1 \%S \%O" -verbose -file-line-error -interaction=nonstopmode'
" Latex code completion
"let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
" YouCompleteMe
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
endif
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
" Snippet trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
"let g:UltiSnipsExpandTrigger="<c-j>"
"let g:UltiSnipsJumpForwardTrigger="<c-j>"
"let g:UltiSnipsJumpBackwardTrigger="<c-k>"
" vimwiki options
let g:vimwiki_list = [{'syntax': 'markdown', 'ext': '.md'}]
" Load all plugins now.
" Plugins need to be added to runtimepath before helptags can be generated.
packloadall
" Load all of the helptags now, after plugins have been loaded.
" All messages and errors will be ignored.
silent! helptags