[nvim] adjust title

This commit is contained in:
Dmytro Meleshko 2019-06-21 02:28:22 +03:00
parent 3de164b9d1
commit 19c9f66519
1 changed files with 6 additions and 4 deletions

View File

@ -12,7 +12,9 @@ set belloff=
" title {{{ " title {{{
set title set title
let &titlestring = '%F%{&modified ? g:airline_symbols.modified : ""} (nvim)' let s:username = $USER
let s:hostname = substitute(hostname(), '\v^([^.]*).*$', '\1', '') " get hostname up to the first '.'
let &titlestring = $USER . '@' . s:hostname . ': %F%{&modified ? g:airline_symbols.modified : ""} (nvim)'
" }}} " }}}
" Yes, I occasionally use mouse. Sometimes it is handy for switching windows/buffers " Yes, I occasionally use mouse. Sometimes it is handy for switching windows/buffers
@ -132,9 +134,9 @@ endif
let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items) let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items)
endfunction endfunction
function s:tweak_airline() function s:tweak_airline()
if exists('*coc#status') " if exists('*coc#status')
call s:airline_section_prepend('x', ['coc#status']) " call s:airline_section_prepend('x', ['coc#status'])
endif " endif
call s:airline_section_append('y', ['filesize']) call s:airline_section_append('y', ['filesize'])
if exists('*airline#extensions#coc#get_error') if exists('*airline#extensions#coc#get_error')
call s:airline_section_prepend('error', ['coc_error_count']) call s:airline_section_prepend('error', ['coc_error_count'])