diff options
author | Ryan Rueger <git@rueg.re> | 2025-04-16 16:39:14 +0200 |
---|---|---|
committer | Ryan Rueger <git@rueg.re> | 2025-04-16 16:39:14 +0200 |
commit | 5ef83e6671e6436b4e0e5953c67a49bb0e73ea3f (patch) | |
tree | 117675d4c130e4b6d4c9a2f18fd6c7f943648ac4 | |
parent | 8b8e09a4c364fa10641c1f6c04e55245f1c7533c (diff) | |
download | statusryne-master.tar.gz statusryne-master.tar.bz2 statusryne-master.zip |
-rw-r--r-- | README.md | 48 | ||||
-rw-r--r-- | plugin/statusryne.vim | 98 |
2 files changed, 124 insertions, 22 deletions
@@ -26,6 +26,13 @@ Features: * *(Git information)* Display git branch with insertions and deletions +##### Statusline Options + +``` +let g:statusryne_word_char_count = '0' +let g:statusryne_change_colors = '1' +``` + #### Tabline  @@ -49,8 +56,45 @@ Features: displayed. If a tab is open on two open buffers, the active buffer will be highlighted in a darker colour. +##### Tabline Options + +``` +let g:statusryne_tabline_equal_width = '0' +``` + #### Colours +``` +" Focused window +let g:statusryne_colorfg_statusline='008' +let g:statusryne_colorbg_statusline='007' + +" Non-focused window ('non-current' in vim nomenclature) +let g:statusryne_colorfg_statusline_nc='008' +let g:statusryne_colorbg_statusline_nc='007' + +" Colors of additional statistics/filetype section +let g:statusryne_colorfg_extra='015' +let g:statusryne_colorbg_extra='014' +let g:statusryne_colorfg_mode='015' +let g:statusryne_colorbg_mode='008' + +" Background colors for different modes +let g:statusryne_colorbg_mode_normal='008' +let g:statusryne_colorbg_mode_visual='005' +let g:statusryne_colorbg_mode_insert='004' +let g:statusryne_colorbg_mode_replace='001' +let g:statusryne_colorbg_mode_other='010' + +" Tabline colors +" Selected tab +let g:statusryne_colorfg_tablinesel='007' +let g:statusryne_colorbg_tablinesel='008' +" Non-Selected tab +let g:statusryne_colorfg_tabline='008' +let g:statusryne_colorbg_tabline='007' +``` + I am using Ethan Schoonover's light solarized colour scheme with a slight modification of the base colour. This is done by setting the colours in the terminal emulator (`alacritty` in my case) explicitly, and then using relative @@ -83,3 +127,7 @@ colors: cyan: '0x93a1a1' white: '0xf2f1f0' # Original: 0xfdf6e3 ``` + +#### Bugs + + diff --git a/plugin/statusryne.vim b/plugin/statusryne.vim index 0a1b9e4..111b590 100644 --- a/plugin/statusryne.vim +++ b/plugin/statusryne.vim @@ -80,32 +80,77 @@ endfunction " }}} " (f) Colours {{{ " 'bg' is text colour, 'fg' is the bar colour. -" -hi StatusLine ctermbg=010 -hi StatusLine ctermfg=007 -hi StatusLineExtra ctermbg=014 -hi StatusLineExtra ctermfg=007 +if !exists("g:statusryne_colorfg_statusline") + let g:statusryne_colorfg_statusline='008' +endif +if !exists("g:statusryne_colorbg_statusline") + let g:statusryne_colorbg_statusline='007' +endif + +if !exists("g:statusryne_colorfg_statusline_nc") + let g:statusryne_colorfg_statusline_nc='008' +endif +if !exists("g:statusryne_colorbg_statusline_nc") + let g:statusryne_colorbg_statusline_nc='007' +endif + +if !exists("g:statusryne_colorfg_extra") + let g:statusryne_colorfg_extra='015' +endif +if !exists("g:statusryne_colorbg_extra") + let g:statusryne_colorbg_extra='014' +endif + +if !exists("g:statusryne_colorfg_mode") + let g:statusryne_colorfg_mode='015' +endif +if !exists("g:statusryne_colorbg_mode") + let g:statusryne_colorbg_mode='008' +endif + +if !exists("g:statusryne_colorbg_mode_normal") + let g:statusryne_colorbg_mode_normal='008' +endif +if !exists("g:statusryne_colorbg_mode_visual") + let g:statusryne_colorbg_mode_visual='005' +endif +if !exists("g:statusryne_colorbg_mode_insert") + let g:statusryne_colorbg_mode_insert='004' +endif +if !exists("g:statusryne_colorbg_mode_replace") + let g:statusryne_colorbg_mode_replace='001' +endif +if !exists("g:statusryne_colorbg_mode_other") + let g:statusryne_colorbg_mode_other='010' +endif + +hi clear StatusLine +hi clear StatusLineExtra +hi clear StatusLineMode -hi StatusLineMode ctermfg=015 +exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode . ' ctermfg=' . g:statusryne_colorfg_mode +exe 'hi! StatusLineExtra ctermbg=' . g:statusryne_colorbg_extra . ' ctermfg=' . g:statusryne_colorfg_extra +exe 'hi! StatusLineNC ctermbg=' . g:statusryne_colorbg_statusline_nc . ' ctermfg=' . g:statusryne_colorfg_statusline_nc +exe 'hi! StatusLine ctermbg=' . g:statusryne_colorbg_statusline . ' ctermfg=' . g:statusryne_colorfg_statusline " Automatically change the statusline color depending on mode. function! ChangeStatuslineColor() if (mode() =~# '\v(n|no)') " Normal Mode. - exe 'hi! StatusLineMode ctermbg=010' + exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode_normal elseif (mode() =~# '\v(v|V)') " Visual Mode. - exe 'hi! StatusLineMode ctermbg=005' + exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode_visual elseif (mode() ==# 'i') " Insert Mode. - exe 'hi! StatusLineMode ctermbg=004' + exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode_insert elseif (mode() ==# 'R') " Replace Mode. - exe 'hi! StatusLineMode ctermbg=001' + exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode_replace else " Other Mode. - exe 'hi! StatusLineMode ctermbg=010' + exe 'hi! StatusLineMode ctermbg=' . g:statusryne_colorbg_mode_other endif return '' @@ -234,7 +279,10 @@ endfunction " Status Line Format String. set statusline= -set statusline+=%{ChangeStatuslineColor()} +if exists("g:statusryne_change_colors") && g:statusryne_change_colors == "0" +else + set statusline+=%{ChangeStatuslineColor()} +endif set statusline+=%#StatusLineMode# " Set colour. set statusline+=\ %{g:currentmode[mode()]} " Get Mode. set statusline+=\ %* " Default colour. @@ -262,17 +310,23 @@ set tabline=%!TabLine() let g:padding = 2 let g:mintablabellen = 5 -hi TabLineSel ctermfg=007 cterm=None -hi TabLineSel ctermbg=010 cterm=None - -hi TabLineNum ctermfg=015 cterm=None -hi TabLineNum ctermbg=014 cterm=None +if !exists("g:statusryne_colorfg_tabline") + let g:statusryne_colorfg_tabline='008' +endif +if !exists("g:statusryne_colorbg_tabline") + let g:statusryne_colorbg_tabline='007' +endif +if !exists("g:statusryne_colorfg_tablinesel") + let g:statusryne_colorfg_tablinesel='007' +endif +if !exists("g:statusryne_colorbg_tablinesel") + let g:statusryne_colorbg_tablinesel='008' +endif -hi TabLineBuffer ctermbg=014 -hi TabLineBuffer ctermfg=007 +exe 'hi! TabLine cterm=None ctermbg=' . g:statusryne_colorbg_tabline . ' ctermfg=' . g:statusryne_colorfg_tabline +exe 'hi! TabLineSel cterm=None ctermbg=' . g:statusryne_colorbg_tablinesel . ' ctermfg=' . g:statusryne_colorfg_tablinesel -hi TabLine cterm=None -hi TabLineFill cterm=None +hi! TabLineFill cterm=None " }}} " (f) LabelName {{{ function! LabelName(n) @@ -377,7 +431,7 @@ function! TabLine() " Number of buffers in tab. let t:bcount = len(tabpagebuflist(t+1)) " Total amount of whitespace to fill, after considering curent tab label. - if exists("g:statusryne_adaptive_padding") && g:statusryne_adaptive_padding == "1" + if exists("g:statusryne_tabline_equal_width") && g:statusryne_tabline_equal_width == "1" " Total amount of whitespace to fill, after considering curent tab label. let t:remainder = g:maxlabellen - len(g:tablabels[t]) else |