From 7a09b882a53e44125488f8aab750b8bffed7b8ea Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 1 May 2019 18:48:30 +0200 Subject: Improved statusline --- pack/vim/opt/YouCompleteMe | 2 +- plugin/max-fix-colorschemes.vim | 2 ++ plugin/statusline.vim | 26 ++++++++++++++------------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pack/vim/opt/YouCompleteMe b/pack/vim/opt/YouCompleteMe index 25ebc0b..d691404 160000 --- a/pack/vim/opt/YouCompleteMe +++ b/pack/vim/opt/YouCompleteMe @@ -1 +1 @@ -Subproject commit 25ebc0b9abb1b135c809ee850085a0305cbc5533 +Subproject commit d691404ae2f7c79ec5d053f2c22a4c775b4bf915 diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim index db8aad5..87c9efe 100644 --- a/plugin/max-fix-colorschemes.vim +++ b/plugin/max-fix-colorschemes.vim @@ -42,6 +42,8 @@ function! ExtendColorTheme() highlight! PmenuThumb cterm=inverse highlight! MoreMsg cterm=inverse + highlight! link Tabline StatusLine + endfunction autocmd ColorScheme * call ExtendColorTheme() diff --git a/plugin/statusline.vim b/plugin/statusline.vim index 270f666..e3c03ed 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -4,9 +4,9 @@ augroup MAX_FANCYLINE let g:status_sym_start = '' let g:status_sym_end = '' - let g:status_sym_sep_start = '᎒' - let g:status_sym_sep_end = '᎒' - let g:symbol_branch = '' + let g:status_sym_sep_start = '' + let g:status_sym_sep_end = '' + let g:symbol_branch = '' if &term == "linux" let g:status_sym_start = '' @@ -21,7 +21,8 @@ augroup MAX_FANCYLINE else let g:group_active = "StatusLine" let g:group_inactive = "StatusLineNC" - let g:group_tabline = "TabLine" + " let g:group_tabline = "TabLine" + let g:group_tabline = "StatusLine" endif " this function reverts foreground color and background color of a given @@ -63,12 +64,12 @@ augroup MAX_FANCYLINE \ ."%#".a:highlight_group."#" \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" \ ."%{(&modified\ ?\ '\ \ 💾'\ :\ '')}" - \ ."%(%w%h%q%)".' '.l:mode.' ' - \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" - \ ."%{(haslocaldir() ?\ g:status_sym_sep_start.' '.fnamemodify(getcwd(),\ ':.').'/ '\ \:\ '')}\ " - \ ."%{bufname('%')==''?'':g:status_sym_sep_start.' '.substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}" + \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start + \ ."%{(argc()>1\ ?\ ' '.(argidx()+1).':'.argc().' '.g:status_sym_sep_start:'')}" + \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').'/ '\ \:'')}\ " + \ ."%{bufname('%')==''?'':substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}" \ ."%{(&titlestring\ ?\ has('nvim')?b:term_title:expand(&titlestring):'')\ }" - \ ."%{g:status_sym_sep_start.' '.winbufnr(0).' '}" + \ ."%{'['.winbufnr(0).']'}" \ ."%#".l:invert_group."#" \ .g:status_sym_end \ .'' @@ -77,8 +78,8 @@ augroup MAX_FANCYLINE \ ."%#".l:invert_group."#" \ .g:status_sym_start \ ."%#".a:highlight_group."#" - \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_start.' '}" - \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_start.' '}" + \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_end.' '}" + \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_end.' '}" \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}" \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}" @@ -90,9 +91,10 @@ augroup MAX_FANCYLINE function! UpdateTabline(highlight_group) let l:invert_group = CreateInvertGroup(a:highlight_group) let l:git_branch = FugitiveHead() +"  return '' \ ."%#".a:highlight_group."#" - \ ."%3( 📂\ %)\ " + \ ."%3( \ %)\ " \ ."%{getcwd(-1)}\ " \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}" \ ."%#".l:invert_group."#" -- cgit v1.2.3