From b94eb99ad75d95219bd7100f66eb964709515d20 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 17 May 2021 00:26:38 +0200 Subject: Improved compatibility --- README.md | 16 ++++++++++++++++ cgitrc | 3 --- plugin/vim-fancy-line.vim | 15 ++++++++------- 3 files changed, 24 insertions(+), 10 deletions(-) delete mode 100644 cgitrc diff --git a/README.md b/README.md index 40f8001..e19460e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,22 @@ compatible. ![screenshot](https://git.entwicklerseite.de/vim-fancy-line/plain/screenshot.png) + +## TLDR; + +Key features: + +* Compatible (at least) with all pre-installed colorschemes +* Pure Vimscript, no overhead (this is critical with statuslines, because textlock is active during stl updates) +* Displays the tab bar in a different color for the `root` user: `:highlight Error` + + +## Configuration + +* It should be considered to add `showtabline=2` to the vimrc +* It looks nicer with proper fillchars, e.g. `fillchars+=eob:\ ,vert:\` + + ## Installation This should be sufficient: diff --git a/cgitrc b/cgitrc deleted file mode 100644 index a8ee18e..0000000 --- a/cgitrc +++ /dev/null @@ -1,3 +0,0 @@ -owner=Max Christian Pohle -desc=vim plugin to display an improved status- and tabline -readme=master:readme.md diff --git a/plugin/vim-fancy-line.vim b/plugin/vim-fancy-line.vim index 410912d..8ec97a2 100755 --- a/plugin/vim-fancy-line.vim +++ b/plugin/vim-fancy-line.vim @@ -36,17 +36,17 @@ augroup MAX_FANCYLINE let w:cterm_bg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'bg', 'cterm') let w:cterm_fg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'fg', 'cterm') - if(w:gui_bg ==# '') | let w:gui_bg = 'NONE' | endif - if(w:gui_fg ==# '') | let w:gui_fg = 'NONE' | endif + if(w:gui_bg ==# '') | let w:gui_bg = 'NONE' | endif + if(w:gui_fg ==# '') | let w:gui_fg = 'NONE' | endif if(w:cterm_bg ==# '') | let w:cterm_bg = 'NONE' | endif if(w:cterm_fg ==# '') | let w:cterm_fg = 'NONE' | endif let l:retval=a:highlight_group.'_invert' - if(1 == synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse')) - exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_fg.' ctermbg=NONE'.' guifg='.w:gui_fg.' guibg=NONE' + if(0 == synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse', 'cterm')) + exec 'highlight! '.l:retval.' ctermfg='.w:cterm_bg.' ctermbg=0 guifg='.w:gui_bg.' guibg=NONE' else - exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_bg.' ctermbg=NONE'.' guifg='.w:gui_bg.' guibg=NONE' + exec 'highlight! '.l:retval.' ctermfg='.w:cterm_fg.' ctermbg=0 guifg='.w:gui_fg.' guibg=NONE' endif return l:retval @@ -84,6 +84,7 @@ augroup MAX_FANCYLINE \ .' ' \ .'%#'.l:invert_group.'#' \ .g:status_sym_end + \ .'%#Ignore#' \ .'%<' \ .'' \ .'%=' @@ -155,12 +156,12 @@ augroup MAX_FANCYLINE set tabline=%!UpdateTabline(g:group_tabline) " otherwise 'bold' can mess up icon sizes and I do not know why - highlight! StatusLine cterm=reverse + " highlight! StatusLine cterm=reverse " exec 'highlight! User3 guifg=#D2A032 guibg='.l:fgcolor " workaround for VertSplit looking as a repeated slash, because its an " italic bar... - highlight! VertSplit gui=NONE cterm=NONE term=NONE + " highlight! VertSplit gui=NONE cterm=NONE term=NONE endfunction call ApplyColorScheme() -- cgit v1.2.3