From 06f8655392e3cf1fee926c29f767a60feb0dcec8 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Sun, 3 Jan 2021 22:21:05 +0100 Subject: [PATCH] vim: replace airline with lightline --- files/vimrc | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/files/vimrc b/files/vimrc index b7a080d..6af7142 100644 --- a/files/vimrc +++ b/files/vimrc @@ -108,28 +108,30 @@ call plug#begin('$XDG_DATA_HOME/vim/plugged') let g:ctrlp_show_hidden = 1 " show hidden files Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-commentary' - Plug 'tpope/vim-fugitive' - Plug 'vim-airline/vim-airline' - Plug 'vim-airline/vim-airline-themes' - function! VimrcAirlineInit() - let g:airline_section_c = airline#section#create(['%{bufnr("%")}: %f %r%m']) - let g:airline_section_z = airline#section#create_right(['%p%%', '%l/%L', '%v']) - endfunction - autocmd User AirlineAfterInit call VimrcAirlineInit() - if !exists('g:airline_symbols') - let g:airline_symbols = {} - endif - let g:airline_left_sep = ' ' - let g:airline_left_alt_sep = '' - let g:airline_right_sep = ' ' - let g:airline_right_alt_sep = '' - let g:airline_symbols.crypt = 'C' " section A - let g:airline_symbols.spell = 'S' " section A - let g:airline_symbols.paste = 'P' " section A - let g:airline_symbols.branch = '' " section B - let g:airline_symbols.dirty = ' !' " section B, VCS: file changed - let g:airline_symbols.notexists = ' ?' " section B, VCS: file not tracked - let g:airline_symbols.whitespace = '✗' " section [...] + Plug 'itchyny/vim-gitbranch' + Plug 'itchyny/lightline.vim' + let g:lightline = { + \ 'colorscheme': 'solarized', + \ 'active': { + \ 'left': [ + \ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'modified' ], + \ [ 'relativepath' ], + \ ], + \ 'right': [ + \ [ 'lineinfo' ], + \ [ 'percent' ], + \ [ 'filetype', 'fileencoding', 'fileformat' ], + \ ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'gitbranch#name', + \ }, + \ 'subseparator': { + \ 'left': '', + \ 'right': '|', + \ }, + \ } Plug 'vim-scripts/srec.vim' highlight link srecStart Comment highlight link srecType Comment