-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatusline.vim
50 lines (44 loc) · 1.33 KB
/
statusline.vim
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
" STATUS LINE --------------------------------------------
" light line
function! LightlineFilename()
let root = fnamemodify(get(b:, 'git_dir'), ':h')
let path = expand('%:p')
if path[:len(root)-1] ==# root
return path[len(root)+1:]
endif
return expand('%')
endfunction
" Update and show lightline but only if it's visible (e.g., not in Goyo)
function! g:MaybeUpdateLightline()
if exists('#lightline')
call lightline#update()
end
endfunction
autocmd User ALELint call g:MaybeUpdateLightline()
" colorschemes I like the most are jellybeans, seoul256 and simpleblack
let g:lightline = {
\ 'colorscheme': 'ayu_dark',
\ 'active': {
\ 'left': [['mode', 'paste'], ['filename']],
\ 'right': [['lineinfo'], ['filetype'], ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok', 'gutentags', 'modified']]
\ },
\ 'inactive': {
\ 'left': [['filename']],
\ 'right': [['lineinfo'], ['filetype']]
\ },
\ 'component_expand': {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ 'gutentags': 'gutentags#statusline'
\ },
\ 'component_type': {
\ 'readonly': 'error',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ },
\ 'component_function': {
\ 'filename': 'LightlineFilename',
\ }
\ }