aboutsummaryrefslogtreecommitdiff
path: root/.local/share/nvim/site/autoload/statusbar.vim
diff options
context:
space:
mode:
Diffstat (limited to '.local/share/nvim/site/autoload/statusbar.vim')
-rw-r--r--.local/share/nvim/site/autoload/statusbar.vim34
1 files changed, 18 insertions, 16 deletions
diff --git a/.local/share/nvim/site/autoload/statusbar.vim b/.local/share/nvim/site/autoload/statusbar.vim
index 4dc8e31..8b9473c 100644
--- a/.local/share/nvim/site/autoload/statusbar.vim
+++ b/.local/share/nvim/site/autoload/statusbar.vim
@@ -1,27 +1,33 @@
function TabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
- return bufname(buflist[winnr - 1])
+ return fnamemodify(bufname(buflist[winnr - 1]), ':t')
endfunction
function! TabLine()
let s = ''
for i in range(tabpagenr('$'))
+ let s ..= '%#TabLineFill# '
+ " set the tab page number (for mouse clicks)
+ let s ..= '%' .. (i + 1) .. 'T'
" select the highlighting
if i + 1 == tabpagenr()
- let s ..= '%#TablineC#%#TabLineSel#'
+ let s ..= '%#TabLineSel# '
else
- let s ..= ' %#TabLine#'
+ let s ..= '%#TabLine# '
endif
- " set the tab page number (for mouse clicks)
- let s ..= '%' .. (i + 1) .. 'T'
+ " the label is made by TabLabel()
+ if TabLabel(i + 1) == ""
+ let s ..= "No Name"
+ else
+ let s ..= TabLabel(i + 1)
+ endif
- " the label is made by MyTabLabel()
- let s ..= '%{TabLabel(' .. (i + 1) .. ')}'
+ let s ..= " %" .. (i + 1) .. "X"
if i + 1 == tabpagenr()
- let s ..= '%#StatusLine#%#TabLine#'
+ let s ..= ' %#StatusLine#%#TabLine#'
else
let s ..= ' '
endif
@@ -30,11 +36,6 @@ function! TabLine()
" 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
@@ -52,13 +53,14 @@ function! statusbar#refresh()
\ 'R' : 'R',
\ 'Rv' : 'V·Replace',
\ 'c' : 'Command',
+ \ 's' : 'Snipped'
\}
set statusline=
- set statusline+=%#StatusLineBlock#\ %{toupper(g:currentmode[mode()])}%#StatusLine#
- set statusline+=\ %#StatusLine#%#StatusLineBlock#%f%#StatusLine#
+ set statusline+=%#StatusLineBlock#\ %{toupper(g:currentmode[mode()])}\ %#StatusLine#"
+ set statusline+=\ %#StatusLine#%#StatusLineBlock#\ %f\ %#StatusLine#
set statusline+=%=
- set statusline+=%#StatusLine#%#StatusLineBlock#%l/%L\ %p%%\
+ set statusline+=%#StatusLine#%#StatusLineBlock#\ %l/%L\ %p%%\
set tabline=%!TabLine()
endfunction