From ef8392f66fa5f11698364d75420ac038dc655e0c Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Thu, 16 Jun 2016 14:30:47 +0200 Subject: [PATCH] Migration from airline to lightline, some minor changes. --- vim/init.vim | 65 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/vim/init.vim b/vim/init.vim index a8355b3..fb6a93f 100644 --- a/vim/init.vim +++ b/vim/init.vim @@ -17,6 +17,7 @@ set nojoinspaces set nowritebackup set bs=2 +set diffopt+=vertical set tabstop=2 set scrolloff=5 set laststatus=2 @@ -36,8 +37,7 @@ map \ :setlocal nospell map pl :setlocal spell spelllang=pl map en :setlocal spell spelllang=en_gb map p :set paste! -map gs :Gstatus -map gc :Gcommit +map g :Gstatus map gp :Gpush au BufRead,BufNewFile *.pp @@ -51,12 +51,9 @@ Plug 'ctrlpvim/ctrlp.vim' Plug 'tpope/vim-fugitive' Plug 'scrooloose/syntastic' Plug 'edkolev/tmuxline.vim' +Plug 'itchyny/lightline.vim' Plug 'brendonrapp/smyck-vim' Plug 'bitc/vim-bad-whitespace' -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -" has to be called as last plugin -Plug 'ryanoasis/vim-devicons' call plug#end() syntax on @@ -65,18 +62,58 @@ set background=dark hi BadWhitespace ctermbg=lightblue guibg=lightblue if has("gui_running") + set guioptions-=e + set guioptions-=r + set guioptions-=L set guifont=MesloLGSDZ\ Nerd\ Font:h11 endif -let g:airline_theme = 'powerlineish' -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#left_sep = '' -let g:airline#extensions#tabline#left_alt_sep = '' -let g:airline#extensions#tabline#right_sep = '' -let g:airline#extensions#tabline#right_alt_sep = '' - let g:syntastic_auto_jump = 1 let g:syntastic_enable_signs = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_puppet_puppetlint_args = "--no-80chars-check --no-autoloader_layout-check --no-nested_classes_or_defines-check" + +let g:lightline = { + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ], + \ 'right': [ [ 'lineinfo' ], + \ [ 'percent' ], + \ [ 'fileformat', 'fileencoding' ] ] + \ }, + \ 'component_function': { + \ 'fugitive': 'LightLineFugitive', + \ 'readonly': 'LightLineReadonly', + \ 'modified': 'LightLineModified' + \ }, + \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, + \ 'tabline_separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'tabline_subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" } + \ } + +function! LightLineModified() + if &filetype == "help" + return "" + elseif &modified + return "+" + elseif &modifiable + return "" + else + return "" + endif +endfunction + +function! LightLineReadonly() + if &filetype == "help" || &filetype == "gitcommit" + return "" + elseif &readonly + return "" + else + return "" + endif +endfunction + +function! LightLineFugitive() + return exists('*fugitive#head') ? fugitive#head() : '' +endfunction