diff options
| author | Max Christian Pohle | 2021-05-17 00:26:38 +0200 |
|---|---|---|
| committer | Max Christian Pohle | 2021-05-17 00:26:38 +0200 |
| commit | b94eb99ad75d95219bd7100f66eb964709515d20 (patch) | |
| tree | 65e1b068c9fd0f48a0b4d3b0fe62d83e45bf9867 | |
| parent | bddd958ce81ec58c5e742dcdfde7bf1ba029b914 (diff) | |
| download | vim-fancy-line-b94eb99ad75d95219bd7100f66eb964709515d20.tar.bz2 vim-fancy-line-b94eb99ad75d95219bd7100f66eb964709515d20.zip | |
Improved compatibility
| -rw-r--r-- | README.md | 16 | ||||
| -rw-r--r-- | cgitrc | 3 | ||||
| -rwxr-xr-x | plugin/vim-fancy-line.vim | 15 |
3 files changed, 24 insertions, 10 deletions
| @@ -11,6 +11,22 @@ compatible. | |||
| 11 | 11 | ||
| 12 |  | 12 |  |
| 13 | 13 | ||
| 14 | |||
| 15 | ## TLDR; | ||
| 16 | |||
| 17 | Key features: | ||
| 18 | |||
| 19 | * Compatible (at least) with all pre-installed colorschemes | ||
| 20 | * Pure Vimscript, no overhead (this is critical with statuslines, because textlock is active during stl updates) | ||
| 21 | * Displays the tab bar in a different color for the `root` user: `:highlight Error` | ||
| 22 | |||
| 23 | |||
| 24 | ## Configuration | ||
| 25 | |||
| 26 | * It should be considered to add `showtabline=2` to the vimrc | ||
| 27 | * It looks nicer with proper fillchars, e.g. `fillchars+=eob:\ ,vert:\` | ||
| 28 | |||
| 29 | |||
| 14 | ## Installation | 30 | ## Installation |
| 15 | 31 | ||
| 16 | This should be sufficient: | 32 | This should be sufficient: |
| @@ -1,3 +0,0 @@ | |||
| 1 | owner=Max Christian Pohle | ||
| 2 | desc=vim plugin to display an improved status- and tabline | ||
| 3 | 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 | |||
| 36 | let w:cterm_bg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'bg', 'cterm') | 36 | let w:cterm_bg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'bg', 'cterm') |
| 37 | let w:cterm_fg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'fg', 'cterm') | 37 | let w:cterm_fg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'fg', 'cterm') |
| 38 | 38 | ||
| 39 | if(w:gui_bg ==# '') | let w:gui_bg = 'NONE' | endif | 39 | if(w:gui_bg ==# '') | let w:gui_bg = 'NONE' | endif |
| 40 | if(w:gui_fg ==# '') | let w:gui_fg = 'NONE' | endif | 40 | if(w:gui_fg ==# '') | let w:gui_fg = 'NONE' | endif |
| 41 | if(w:cterm_bg ==# '') | let w:cterm_bg = 'NONE' | endif | 41 | if(w:cterm_bg ==# '') | let w:cterm_bg = 'NONE' | endif |
| 42 | if(w:cterm_fg ==# '') | let w:cterm_fg = 'NONE' | endif | 42 | if(w:cterm_fg ==# '') | let w:cterm_fg = 'NONE' | endif |
| 43 | 43 | ||
| 44 | let l:retval=a:highlight_group.'_invert' | 44 | let l:retval=a:highlight_group.'_invert' |
| 45 | 45 | ||
| 46 | if(1 == synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse')) | 46 | if(0 == synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse', 'cterm')) |
| 47 | exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_fg.' ctermbg=NONE'.' guifg='.w:gui_fg.' guibg=NONE' | 47 | exec 'highlight! '.l:retval.' ctermfg='.w:cterm_bg.' ctermbg=0 guifg='.w:gui_bg.' guibg=NONE' |
| 48 | else | 48 | else |
| 49 | exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_bg.' ctermbg=NONE'.' guifg='.w:gui_bg.' guibg=NONE' | 49 | exec 'highlight! '.l:retval.' ctermfg='.w:cterm_fg.' ctermbg=0 guifg='.w:gui_fg.' guibg=NONE' |
| 50 | endif | 50 | endif |
| 51 | 51 | ||
| 52 | return l:retval | 52 | return l:retval |
| @@ -84,6 +84,7 @@ augroup MAX_FANCYLINE | |||
| 84 | \ .' ' | 84 | \ .' ' |
| 85 | \ .'%#'.l:invert_group.'#' | 85 | \ .'%#'.l:invert_group.'#' |
| 86 | \ .g:status_sym_end | 86 | \ .g:status_sym_end |
| 87 | \ .'%#Ignore#' | ||
| 87 | \ .'%<' | 88 | \ .'%<' |
| 88 | \ .'' | 89 | \ .'' |
| 89 | \ .'%=' | 90 | \ .'%=' |
| @@ -155,12 +156,12 @@ augroup MAX_FANCYLINE | |||
| 155 | set tabline=%!UpdateTabline(g:group_tabline) | 156 | set tabline=%!UpdateTabline(g:group_tabline) |
| 156 | 157 | ||
| 157 | " otherwise 'bold' can mess up icon sizes and I do not know why | 158 | " otherwise 'bold' can mess up icon sizes and I do not know why |
| 158 | highlight! StatusLine cterm=reverse | 159 | " highlight! StatusLine cterm=reverse |
| 159 | " exec 'highlight! User3 guifg=#D2A032 guibg='.l:fgcolor | 160 | " exec 'highlight! User3 guifg=#D2A032 guibg='.l:fgcolor |
| 160 | 161 | ||
| 161 | " workaround for VertSplit looking as a repeated slash, because its an | 162 | " workaround for VertSplit looking as a repeated slash, because its an |
| 162 | " italic bar... | 163 | " italic bar... |
| 163 | highlight! VertSplit gui=NONE cterm=NONE term=NONE | 164 | " highlight! VertSplit gui=NONE cterm=NONE term=NONE |
| 164 | endfunction | 165 | endfunction |
| 165 | call ApplyColorScheme() | 166 | call ApplyColorScheme() |
| 166 | 167 | ||
