From 177eed7f9504d5e1c84caf6d94d1d94b70415555 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Mon, 25 Jun 2018 16:58:38 +0100 Subject: [vim] airline -> flagship --- vim/.vimrc | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index 09a84f0..7cc45b1 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -52,6 +52,7 @@ Plug 'tpope/vim-apathy' Plug 'tpope/vim-commentary' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-eunuch' +Plug 'tpope/vim-flagship' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-obsession' Plug 'tpope/vim-repeat' @@ -62,8 +63,6 @@ Plug 'tpope/vim-surround' Plug 'tpope/vim-unimpaired' Plug 'troydm/zoomwintab.vim' let g:zoomwintab_hidetabbar=0 -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' Plug 'vim-scripts/ReplaceWithRegister' Plug 'vim-scripts/gmsh.vim' Plug 'wellle/targets.vim' @@ -184,17 +183,6 @@ let g:neomake_gcc_args=[ " }}} "" Plugin configurations {{{ -" Airline -let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing', 'mixed-indent-file' ] -let g:airline_symbols_ascii = 1 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#show_splits = 0 -let g:airline#extensions#tabline#tab_nr_type = 1 -let g:airline#extensions#tabline#formatter = 'unique_tail' -let g:airline#extensions#tabline#tab_min_count = 2 -let g:airline#extensions#tabline#show_buffers = 0 - - " Deoplete let g:deoplete#enable_at_startup = 1 let g:deoplete#sources#jedi#show_docstring = 1 @@ -395,30 +383,26 @@ nmap co =o " }}} "" Colorscheme {{{ function! SaveColo(...) - if &runtimepath =~ 'airline' - execute 'set background='.a:1 - execute 'AirlineTheme' a:3 - execute 'colorscheme' a:2 - endif + execute 'set background='.a:1 + execute 'colorscheme' a:2 execute 'silent !echo "set background='.a:1.'" > ~/.local/colors.vim' execute 'silent !echo "colorscheme '.a:2.'" >> ~/.local/colors.vim' - execute 'silent !echo "let g:airline_theme=\"'.a:3.'\"" >> ~/.local/colors.vim' endfunction function! MyColo(colorscheme) if a:colorscheme == "solarized-light" - call SaveColo("light","solarized","solarized") + call SaveColo("light","solarized") elseif a:colorscheme == "solarized-dark" - call SaveColo("dark","solarized","solarized") + call SaveColo("dark","solarized") elseif a:colorscheme == "seoul" - call SaveColo("dark","seoul256","deus") + call SaveColo("dark","seoul256") elseif a:colorscheme == "nord" - call SaveColo("dark","nord","nord") + call SaveColo("dark","nord") endif endfunction if filereadable($HOME."/.local/colors.vim") source ~/.local/colors.vim endif -nnoremap ,c :call MyColo("") +nnoremap ,c :call MyColo("") nnoremap ,cl :call MyColo("solarized-light") nnoremap ,cd :call MyColo("solarized-dark") nnoremap ,cs :call MyColo("seoul") @@ -509,9 +493,29 @@ xnoremap ,g :let g:my_fillprg=g:my_searchprgs[g:my_searchprg] nnoremap ,f :let g:my_fillprg=g:my_findprgs[g:my_findprg]:call FillSearch() " Cycle search / find prgs -nnoremap cog :let g:my_searchprg=(g:my_searchprg+1)%len(g:my_searchprgs):echom g:my_searchprgs[g:my_searchprg] -nnoremap cof :let g:my_findprg=(g:my_findprg+1)%len(g:my_findprgs):echom g:my_findprgs[g:my_findprg] +nnoremap cog :let g:my_searchprg=(g:my_searchprg+1)%len(g:my_searchprgs) +nnoremap cof :let g:my_findprg=(g:my_findprg+1)%len(g:my_findprgs) + +" }}} +"" Status line {{{ +let g:tabprefix = "" +let g:tablabel = "%N%{flagship#tabmodified()} %{flagship#tabcwds('shorten',',')}" + +function! Mixed_indent() + let l:spaces=search('\v(^ +)','n') + let l:tabs=search('\v(^\t+)','n') + return (l:spaces * l:tabs > 0) +endfunction +augroup myflags + autocmd! + autocmd BufEnter,BufRead,BufWritePost * let b:trailing=search('\s\+$','n') + autocmd BufEnter,BufRead,BufWritePost * let b:mixed=Mixed_indent() + autocmd User Flags call Hoist("buffer", "%{b:trailing?'[tw]':''}") + autocmd User Flags call Hoist("buffer", "%{b:mixed?'[mixed]':''}") + autocmd User Flags call Hoist("buffer", "%{&paste?'[paste]':''}") + autocmd User Flags call Hoist("window", "[Search: %{g:my_searchprgs[g:my_searchprg]}, Find: %{g:my_findprgs[g:my_findprg]}]") +augroup END " }}} "" Neovim {{{ if has("nvim") -- cgit v1.2.3