From 9e5450f25b94a85fc1cf8fc6f3e88b0a36c6c2d3 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 19 Oct 2018 01:07:27 -0400 Subject: [PATCH] Update lightline config in .vimrc wal.vim includes a color scheme for lightline, but it only plays nicely with neovim. This commit conditionally loads the wal color scheme since using it in vim will throw multiple errors. --- .vimrc | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.vimrc b/.vimrc index 0d9a940..8c8c337 100644 --- a/.vimrc +++ b/.vimrc @@ -94,23 +94,6 @@ set mouse=a " Enable mouse support in (a)ll modes colorscheme wal -" Wal Themes: Tomorrow, Tomorrow_Night, one, materia, material, nord -" Other Themes: wombat, solarized, powerline, jellybeans, Tomorrow_Night_Blue, -" Tomorrow_Night_Eighties, PaperColor, seoul256, landscape, -" darcula, molokai, OldHope, deus -let g:lightline = { -\ 'colorscheme': 'Tomorrow_Night', -\ 'active': { -\ 'left': [ -\ [ 'mode', 'paste' ], [ 'gitbranch' ], -\ ['readonly', 'filename', 'modified'] -\ ] -\ }, -\ 'component_function': { -\ 'gitbranch': 'fugitive#head' -\ }, -\ } - " Don't show the separator for vertical splits highlight vertsplit ctermfg=0 ctermbg=none @@ -125,6 +108,36 @@ call matchadd('OverLength', '\%80v') autocmd BufNewFile,BufRead *.ecr setlocal syntax=html autocmd BufNewFile,BufRead *.slang setlocal filetype=slim +" ============================= +" ========= lightline ========= +" ============================= + +" Add the current branch to the status line +let g:lightline = { +\ 'active': { +\ 'left': [ +\ [ 'mode', 'paste' ], [ 'gitbranch' ], +\ ['readonly', 'filename', 'modified'] +\ ] +\ }, +\ 'component_function': { +\ 'gitbranch': 'fugitive#head' +\ } +\ } + +" Note that wal.vim's lightline theme uses some options that are incompatible +" with regular vim and are only supported by neovim. +" +" Wal Themes: Tomorrow, Tomorrow_Night, one, materia, material, nord +" Other Themes: wombat, solarized, powerline, jellybeans, Tomorrow_Night_Blue, +" Tomorrow_Night_Eighties, PaperColor, seoul256, landscape, +" darcula, molokai, OldHope, deus +if has('nvim') + let g:lightline.colorscheme = 'wal' +else + let g:lightline.colorscheme = 'Tomorrow_Night' +endif + " ============================ " ========= keybinds ========= " ============================