diff options
| -rw-r--r-- | .config/nvim/init.lua | 22 | ||||
| -rw-r--r-- | .config/vim/my/colors/ocean.vim | 16 | ||||
| -rw-r--r-- | .vimrc | 19 |
3 files changed, 51 insertions, 6 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4544fab..ca19030 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1293,6 +1293,28 @@ function vimrc.statusline.filetype(bufnr) return ft end end +-- Tabline {{{2 + +vim.o.tabline = '%!v:lua.vimrc.tabline.build()' + +vimrc.tabline = {} + +function vimrc.tabline.build() + local tal = '' + for tabnr = 1, vim.fn.tabpagenr('$') do + local is_active = tabnr == vim.fn.tabpagenr() + local buflist = vim.fn.tabpagebuflist(tabnr) + local bufnr = buflist[vim.fn.tabpagewinnr(tabnr)] + tal = tal .. string.format( + '%%#%s# %s%s ', + is_active and 'TabLineSel' or 'TabLine', + vimrc.statusline.filename(bufnr), + #buflist == 1 and '' or '+') + end + return tal .. '%#TabLineFill#' +end + + -- Plugins configuration {{{1 -- Disable standard plugins. {{{2 diff --git a/.config/vim/my/colors/ocean.vim b/.config/vim/my/colors/ocean.vim index 09866fd..360793f 100644 --- a/.config/vim/my/colors/ocean.vim +++ b/.config/vim/my/colors/ocean.vim @@ -19,7 +19,7 @@ if &background ==# 'dark' \ 'comment': '#8686bf', \ 'cursor': '#5b5bb6', \ 'gray': '#353535', - \ 'gray2': '#353536', + \ 'gray2': '#202020', \ 'green': '#c4e088', \ 'green-bg': '#204020', \ 'orange': '#deab52', @@ -42,7 +42,7 @@ else \ 'comment': '#a0a0e0', \ 'cursor': '#5b5bb6', \ 'gray': '#bebebe', - \ 'gray2': '#bebebf', + \ 'gray2': '#171717', \ 'green': '#6f9226', \ 'green-bg': '#204020', \ 'orange': '#e79230', @@ -98,7 +98,6 @@ call s:hl('Title', 'orange', 'NONE', 'NONE') call s:hl('UiCompletion', 'fg', 'gray', 'NONE') call s:hl('UiSelection', 'NONE', 'selection', 'NONE') call s:hl('UiStatusLine', 'fg', 'gray', 'NONE') -call s:hl('UiStatusLineNC', 'fg', 'gray2', 'NONE') call s:hl('UiStatusLineModeCommand', 'bg', 'blue', 'bold') call s:hl('UiStatusLineModeInsert', 'bg', 'green', 'bold') call s:hl('UiStatusLineModeNormal', 'bg', 'blue', 'bold') @@ -107,6 +106,9 @@ call s:hl('UiStatusLineModeOther', 'bg', 'blue', 'bold') call s:hl('UiStatusLineModeReplace', 'bg', 'red', 'bold') call s:hl('UiStatusLineModeTerminal', 'bg', 'blue', 'bold') call s:hl('UiStatusLineModeVisual', 'bg', 'orange', 'bold') +call s:hl('UiStatusLineNC', 'fg', 'gray2', 'NONE') +call s:hl('UiTabLine', 'fg', 'gray', 'NONE') +call s:hl('UiTabLineNC', 'fg', 'bg', 'NONE') call s:hl('UiTarget', 'orange2', 'NONE', 'underline') call s:hl('Warning', 'yellow2', 'NONE', 'NONE') @@ -134,7 +136,6 @@ hi! link DiffText oceanDiffText hi! link Error oceanError hi! link ErrorMsg oceanError hi! link EndOfBuffer oceanHidden -hi! link TabLineFill oceanHidden hi! link MatchParen oceanHidden hi! link CursorLineNr oceanNormal hi! link Normal oceanNormal @@ -155,9 +156,7 @@ hi! link Visual oceanUiSelection hi! link Special oceanSpecial hi! link NonText oceanSpecialKey hi! link SpecialKey oceanSpecialKey -hi! link TabLineSel oceanUiStatusLine hi! link VertSplit oceanUiStatusLine -hi! link TabLine oceanUiStatusLine hi! link Comment oceanSyntaxComment hi! link Folded oceanSyntaxComment hi! link ModeMsg oceanSyntaxComment @@ -195,6 +194,11 @@ hi! link statusLineModeTerminal oceanUiStatusLineModeTerminal hi! link statusLineModeOther oceanUiStatusLineModeOther +hi! link TabLineSel oceanUiTabLine +hi! link TabLine oceanUiTabLineNC +hi! link TabLineFill oceanHidden + + " Third-party plugins {{{2 hi! link YankRoundRegion oceanUiSelection @@ -1350,6 +1350,25 @@ endfunction +" Tabline {{{2 + +set tabline=%!Tabline_build() + +function! Tabline_build() abort + let tal = '' + for tabnr in range(1, tabpagenr('$')) + let is_active = tabnr ==# tabpagenr() + let buflist = tabpagebuflist(tabnr) + let bufnr = buflist[tabpagewinnr(tabnr) - 1] + let tal .= printf( + \ '%%#%s# %s%s ', + \ is_active ? 'TabLineSel' : 'TabLine', + \ s:statusline_filename(bufnr), + \ len(buflist) ==# 1 ? '' : '+') + endfor + return tal . '%#TabLineFill#' +endfunction + " Plugins configuration {{{1 |
