68 lines
1.7 KiB
VimL
68 lines
1.7 KiB
VimL
hi User1 guifg=DarkRed guibg=Black
|
|
hi User2 guifg=White guibg=Black
|
|
hi User3 guifg=Cyan guibg=Black
|
|
hi User4 guifg=Orange guibg=Black
|
|
hi User5 guifg=Red guibg=Black
|
|
hi User6 guifg=Gray guibg=Black
|
|
hi User7 guifg=Gray guibg=Black
|
|
hi User8 guifg=DarkYellow guibg=Black
|
|
|
|
" https://nest.pijul.com/tae/setup:master/
|
|
function! GetCursorPosition()
|
|
if &buftype == ''
|
|
let l:position = getcurpos()
|
|
return l:position[1] . 'Ⲷ ' . l:position[2] . 'Ⲽ'
|
|
endif
|
|
|
|
return &buftype ==# 'quickfix'
|
|
\ ? line('.') . '/' . line('$')
|
|
\ : ''
|
|
endfunction
|
|
|
|
function! GetFileStatus()
|
|
if &buftype != ''
|
|
return ''
|
|
endif
|
|
|
|
let l:file = expand('%:p')
|
|
let l:status =
|
|
\ (&readonly || (filereadable(l:file) && !filewritable(l:file))
|
|
\ ? 'RO'
|
|
\ : '')
|
|
\ . (&modified ? '+m' : '')
|
|
return len(l:status) > 0 ? ' ' . l:status : ''
|
|
endfunction
|
|
|
|
function! LspStatus() abort
|
|
if luaeval('#vim.lsp.buf_get_clients() > 0')
|
|
return luaeval("require('lsp-status').status()")
|
|
endif
|
|
return ''
|
|
endfunction
|
|
|
|
function! ActiveStatus() abort
|
|
let statusline=""
|
|
let statusline.="%1*\ %{winnr()}\ "
|
|
let statusline.="%4*\ %{GetFileStatus()}"
|
|
let statusline.="%2*\ %Y\ "
|
|
let statusline.="%3*%<%f"
|
|
let statusline.="%4%\ %{LspStatus()}"
|
|
let statusline.="%="
|
|
let statusline.="%4*\ %{GetCursorPosition()}\ (%3p%%)"
|
|
return statusline
|
|
endfunction
|
|
|
|
function! PassiveStatus() abort
|
|
let statusline=""
|
|
let statusline.="%5*\ %{winnr()}\ "
|
|
let statusline.="%8*\ %{GetFileStatus()}"
|
|
let statusline.="%6*\ %Y\ "
|
|
let statusline.="%7*%<%f"
|
|
let statusline.="%8%\ %{LspStatus()}"
|
|
let statusline.="%="
|
|
let statusline.="%8*\ %{GetCursorPosition()}\ (%3p%%)"
|
|
return statusline
|
|
endfunction
|
|
|
|
set statusline=%!ActiveStatus()
|