diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2022-12-22 17:01:59 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2022-12-22 17:01:59 +0100 |
| commit | 9fddd3c00242f3027068f95f93dcbdbc62baaffb (patch) | |
| tree | 2133f9233c909f0a5b5a41579b9b2a71f7ca40ae /.local/share | |
| parent | fe775bf3e9b05a1a4638bc540a2238421869e4d9 (diff) | |
rice up
Diffstat (limited to '.local/share')
| -rw-r--r-- | .local/share/nvim/site/autoload/statusbar.vim | 68 | ||||
| -rw-r--r-- | .local/share/nvim/site/colors/n8.vim | 4 |
2 files changed, 59 insertions, 13 deletions
diff --git a/.local/share/nvim/site/autoload/statusbar.vim b/.local/share/nvim/site/autoload/statusbar.vim index 59e63f5..4dc8e31 100644 --- a/.local/share/nvim/site/autoload/statusbar.vim +++ b/.local/share/nvim/site/autoload/statusbar.vim @@ -1,20 +1,64 @@ +function TabLabel(n) + let buflist = tabpagebuflist(a:n) + let winnr = tabpagewinnr(a:n) + return bufname(buflist[winnr - 1]) +endfunction + +function! TabLine() + let s = '' + for i in range(tabpagenr('$')) + " select the highlighting + if i + 1 == tabpagenr() + let s ..= '%#TablineC#%#TabLineSel#' + else + let s ..= ' %#TabLine#' + endif + + " set the tab page number (for mouse clicks) + let s ..= '%' .. (i + 1) .. 'T' + + " the label is made by MyTabLabel() + let s ..= '%{TabLabel(' .. (i + 1) .. ')}' + + if i + 1 == tabpagenr() + let s ..= '%#StatusLine#%#TabLine#' + else + let s ..= ' ' + endif + endfor + + " after the last tab fill with TabLineFill and reset tab page nr + let s ..= '%#TabLineFill#%T' + + " right-align the label to close the current tab page + if tabpagenr('$') > 1 + let s ..= '%=%#TablineC#%#TabLineSel#%999X ' + endif + + return s +endfunction + + function! statusbar#refresh() + set laststatus=3 + let g:currentmode={ - \ 'n' : 'NORMAL ', - \ 'v' : 'VISUAL ', - \ 'V' : 'V·Line ', - \ "\<C-V>" : 'V·Block ', - \ 'i' : 'INSERT ', - \ 'R' : 'R ', - \ 'Rv' : 'V·Replace ', - \ 'c' : 'Command ', + \ 'n' : 'NORMAL', + \ 'v' : 'VISUAL', + \ 'V' : 'V·Line', + \ "\<C-V>" : 'V·Block', + \ 'i' : 'INSERT', + \ 'R' : 'R', + \ 'Rv' : 'V·Replace', + \ 'c' : 'Command', \} set statusline= - set statusline+=\ %{toupper(g:currentmode[mode()])} - set statusline+=%= - set statusline+=\ %f + set statusline+=%#StatusLineBlock#\ %{toupper(g:currentmode[mode()])}%#StatusLine# + set statusline+=\ %#StatusLine#%#StatusLineBlock#%f%#StatusLine# set statusline+=%= - set statusline+=\ %l/%L\ %p%%\ + set statusline+=%#StatusLine#%#StatusLineBlock#%l/%L\ %p%%\ + + set tabline=%!TabLine() endfunction diff --git a/.local/share/nvim/site/colors/n8.vim b/.local/share/nvim/site/colors/n8.vim index cac3945..a54b619 100644 --- a/.local/share/nvim/site/colors/n8.vim +++ b/.local/share/nvim/site/colors/n8.vim @@ -20,11 +20,13 @@ hi FloatBorder guifg='darkgrey' guibg='#252525' " Statusline hi StatusLine cterm=NONE ctermbg=darkgreen guibg='#547f62' guifg='#181818' hi StatusLineNC cterm=NONE ctermbg=black guibg=background guifg='#252525' +hi StatusLineBlock cterm=NONE ctermbg=NONE guibg='#547f62' guifg='#181818' " Tab hi TabLine cterm=italic ctermbg=black ctermfg=darkgrey gui=italic guifg='#999999' guibg='#252525' hi TabLineFill cterm=bold ctermbg=black ctermfg=darkgrey guifg='#252525' guibg='#252525' -hi TabLineSel cterm=bold ctermbg=black ctermfg=darkgrey guibg=background guifg='#ffffff' +hi TabLineSel cterm=bold ctermbg=black ctermfg=darkgrey guibg='#547f62' guifg='#181818' +hi TabLineC cterm=bold ctermfg=darkgrey guifg='#547f62' " Highlight hi Visual ctermbg=235 guibg='#252525' |