summaryrefslogtreecommitdiff
path: root/configs/statusline.vim
blob: 2b4790a77b5550375392c1e958c42fb3a6404f78 (plain)
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
set laststatus=2
if !has('gui_running')
	set t_Co=256
endif

set noshowmode

function! StatusDiagnostic() abort
	let info = get(b:, 'coc_diagnostic_info', {})
	if empty(info) | return '' | endif
	let msgs = []
	if get(info, 'error', 0)
		call add(msgs, 'E' . info['error'])
	endif
	if get(info, 'warning', 0)
		call add(msgs, 'W' . info['warning'])
	endif
	return join(msgs, ' '). ' ' . get(g:, 'coc_status', '')
endfunction

set statusline=
set statusline^=%{StatusDiagnostic()}
set statusline+=\ %f
set statusline+=%=
set statusline+=\ %y
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\[%{&fileformat}\]
set statusline+=\ %p%%
set statusline+=\ %l:%c
set statusline+=\ "

"set statusline^=%{coc#status()}%{get(b:,coc_current_function','')}

"function! CocCurrentFunction()
	"return get(b:, 'coc_current_function', '')
"endfunction


"let g:lightline = {
			"\ 'colorscheme': 'default',
			"\ 'active': {
			"\   'left': [ [ 'mode', 'paste' ],
			"\             [ 'cocstatus', 'currentfunction', 'readonly', 'filename', 'modified' ] ]
			"\ },
			"\ 'component_function': {
			"\   'cocstatus': 'coc#status',
			"\   'currentfunction': 'CocCurrentFunction'
			"\ },
			"\ }