zefei / vim-wintabs

Modern buffer manager for Vim
MIT License
325 stars 25 forks source link

This plugin overrides the airline theme for the tabline #40

Closed dylan-chong closed 6 years ago

dylan-chong commented 6 years ago

Before installing this plug in:

screen shot 2018-06-27 at 1 41 53 pm

After installing this plugin:

screen shot 2018-06-27 at 1 40 49 pm

Semi minimal vimrc that replicates this behaviour

set encoding=utf-8
" Vundle
" {{{

set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" PLUGINS GO HERE
" {
"
" Themes
Plugin 'chriskempson/base16-vim'

" Airline
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

" Wintabs (must be after vim-airline)
" --------------- Comment out the next two lines to get the tabline theme back
Plugin 'zefei/vim-wintabs'
Plugin 'zefei/vim-wintabs-powerline'

" Miscellaneous
Plugin 'xolox/vim-misc'
Plugin 'dylan-chong/vim-session'

" }

call vundle#end()            " required
filetype plugin indent on    " required

" }}}

" Plugin Config
" {{{

" Vim Airline Plugin
let g:airline_detect_modified=0
let g:airline_powerline_fonts=1
let g:airline_theme='base16'
set laststatus=2 " Always show status line

" }}}

" Coloring
" {{{

" General
syntax on
let g:enable_bold_font = 1

" Colorscheme
set background=dark
let base16colorspace=256  " Access colors present in 256 colorspace
colorscheme base16-materia

" Highlight line/column
" set cursorline

" End column
hi ColorColumn ctermbg=52
" Highlight only if there is a character on the column
cal matchadd('ColorColumn', '\%81v', 100)

" }}}

" Other
" {{{
"

" Get bg color to work in tmux
set t_ut=

" Colors in neovim
set termguicolors

" }}}
zefei commented 6 years ago

It's a bit hard to tell from the screenshots, but is the "after" screenshot showing wintabs on tabline, or airline on tabline? The explanation below assumes you are showing wintabs on tabline and airline on statusline.

Wintabs can coexist with vim-airline, but it doesn't use vim-airline themes or other airline functionalities. Instead, wintabs relies on native vim colorschemes, which can be easily customized. So in this case, wintabs is just showing what's defined by base16-materia.

Looking at the airline theme you are using, the settings to mimic it is probably

highlight! link WintabsActive Visual
highlight! link WintabsInactive CursorLine

or probably better

highlight! link TabLineSel Visual
highlight! link TabLine CursorLine

See https://github.com/zefei/vim-wintabs-powerline/blob/master/README.md for details.

dylan-chong commented 6 years ago

Ah i remember trying the highlight on the readme before by pasting into the : commandline! I didn't realise that it works when pasting into the vimrc (or when using highlight!).

Using all four of your highlight commands above looks pretty good! Just one last question, how would you change the colour? Currently looks like this:

screen shot 2018-06-28 at 8 41 24 pm

It's a bit hard to tell from the screenshots, but is the "after" screenshot showing wintabs on tabline, or airline on tabline? The explanation below assumes you are showing wintabs on tabline and airline on statusline.

Airline is on the status line and win tabs is on the tab line

zefei commented 6 years ago

This is just to recreate the airline theme:

highlight! link Tabline Visual
call g:Base16hi('TablineSel', g:base16_gui00, g:base16_gui0D, g:base16_cterm00, g:base16_cterm0D, '', '')
dylan-chong commented 6 years ago

Thank you! I made some small changes(I added the auto command to make it work inside vimrc and added the bold to make it look a bit nicer)

colorscheme base16-materia
" ...
call g:Base16hi(
      \ 'TablineSel',
      \ g:base16_gui00,
      \ g:base16_gui0D,
      \ g:base16_cterm00,
      \ g:base16_cterm0D,
      \ 'bold',
      \ ''
      \ )
call g:Base16hi(
      \ 'Tabline',
      \ g:base16_gui04,
      \ g:base16_gui02,
      \ g:base16_cterm04,
      \ g:base16_cterm02,
      \ '',
      \ ''
      \ )

So it looks like this now:

screen shot 2018-06-30 at 1 52 21 pm

This is a really cool plug in by the way, I've been using it for a few weeks now and it's ready been useful for my workflow! Definitely deserves more popularity


In case anyone encounters the same problem in the future, base 16 variables can be found here for example https://github.com/chriskempson/base16-vim/blob/master/colors/base16-materia.vim and the colour variables can be seen (close enough) in this link here http://chriskempson.com/projects/base16/#styling-guidelines