From eccf27e61a9a2864f25a1bebb6383a30efab83d3 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 8 Oct 2019 22:36:24 +0200 Subject: Refactord color scheme and statusbar --- .gitmodules | 1 + colors/coderonline.vim | 3 +- pack/_all/opt/jedi-vim | 2 +- pack/_all/opt/nerdtree | 2 +- pack/_all/opt/vim-signify | 2 +- pack/_all/opt/vim-snippets | 2 +- pack/_all/start/vim-fugitive | 2 +- pack/neovim/opt/LanguageClient-neovim | 2 +- pack/neovim/opt/ale | 2 +- pack/neovim/opt/deoplete.nvim | 2 +- pack/vim/opt/YouCompleteMe | 2 +- pack/vim/opt/syntastic | 2 +- pack/vim/opt/vimtex | 2 +- plugin/max-fix-colorschemes.vim | 83 ++++++++++++++--------------------- plugin/statusline.vim | 67 ++++++++++++++++------------ vimrc-common | 12 ++--- 16 files changed, 93 insertions(+), 95 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4759f0d..95820b4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,6 +40,7 @@ [submodule "pack/neovim/opt/LanguageClient-neovim"] path = pack/neovim/opt/LanguageClient-neovim url = https://github.com/autozimu/LanguageClient-neovim.git + branch = next [submodule "pack/neovim/opt/ale"] path = pack/neovim/opt/ale url = https://github.com/w0rp/ale.git diff --git a/colors/coderonline.vim b/colors/coderonline.vim index f842b28..d2ec135 100644 --- a/colors/coderonline.vim +++ b/colors/coderonline.vim @@ -3,7 +3,7 @@ " Last Change: 07.09.2015 " Web: http://max.coderonline.de/ -set background=dark +set background=light hi clear if exists("syntax_on") syntax reset @@ -105,6 +105,7 @@ highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white highlight! link SpellCap SpellBad highlight! link SpellLocal Todo highlight! link SpellRare Todo +highlight! EndOfBuffer guibg=white " *hl-Conceal* " *hl-DiffAdd* " DiffAdd diff mode: Added line |diff.txt| diff --git a/pack/_all/opt/jedi-vim b/pack/_all/opt/jedi-vim index 89c995e..b4b2f3e 160000 --- a/pack/_all/opt/jedi-vim +++ b/pack/_all/opt/jedi-vim @@ -1 +1 @@ -Subproject commit 89c995e7d964fb71c715e6f4ac330e4c59b44128 +Subproject commit b4b2f3ef54c02d6f8fb09cf1eb0f139d3a45bdb8 diff --git a/pack/_all/opt/nerdtree b/pack/_all/opt/nerdtree index 9193962..2d639b7 160000 --- a/pack/_all/opt/nerdtree +++ b/pack/_all/opt/nerdtree @@ -1 +1 @@ -Subproject commit 9193962ad88f15d9f426c3cfb8a274ff1dd0c5b2 +Subproject commit 2d639b70e73ecf3f62884a578fe5e5937e6d8a92 diff --git a/pack/_all/opt/vim-signify b/pack/_all/opt/vim-signify index 2b50704..80f64ea 160000 --- a/pack/_all/opt/vim-signify +++ b/pack/_all/opt/vim-signify @@ -1 +1 @@ -Subproject commit 2b5070441dea482cc4f88556b19002f2da6f3566 +Subproject commit 80f64eace5694413f9dfd8e70e4a7018b56c42b6 diff --git a/pack/_all/opt/vim-snippets b/pack/_all/opt/vim-snippets index db67e54..9e32331 160000 --- a/pack/_all/opt/vim-snippets +++ b/pack/_all/opt/vim-snippets @@ -1 +1 @@ -Subproject commit db67e54d5998dbfbe9fe4161a29d74323031b1fa +Subproject commit 9e323311e5fff93482aeaebd4ae3a1c6339ca6f8 diff --git a/pack/_all/start/vim-fugitive b/pack/_all/start/vim-fugitive index 1d8c0a3..6980655 160000 --- a/pack/_all/start/vim-fugitive +++ b/pack/_all/start/vim-fugitive @@ -1 +1 @@ -Subproject commit 1d8c0a38b2fc4ce9ca4204676573b6335725ff75 +Subproject commit 698065596c9ccee74825ac9667357ce8222ed7b0 diff --git a/pack/neovim/opt/LanguageClient-neovim b/pack/neovim/opt/LanguageClient-neovim index dd45e31..ee6cdb0 160000 --- a/pack/neovim/opt/LanguageClient-neovim +++ b/pack/neovim/opt/LanguageClient-neovim @@ -1 +1 @@ -Subproject commit dd45e31449511152f2127fe862d955237caa130f +Subproject commit ee6cdb0940d9c2c95f31488f7d463b2d12abcbc4 diff --git a/pack/neovim/opt/ale b/pack/neovim/opt/ale index e3784c4..f932211 160000 --- a/pack/neovim/opt/ale +++ b/pack/neovim/opt/ale @@ -1 +1 @@ -Subproject commit e3784c4c4ebb86bc0cdac3652b4f7e4b38ac554e +Subproject commit f9322113095ac01c00d4c38da6aca715663e35cf diff --git a/pack/neovim/opt/deoplete.nvim b/pack/neovim/opt/deoplete.nvim index 9856613..70a11ee 160000 --- a/pack/neovim/opt/deoplete.nvim +++ b/pack/neovim/opt/deoplete.nvim @@ -1 +1 @@ -Subproject commit 98566131d5f574ee2896138bdda08afa68bda416 +Subproject commit 70a11ee67f3c4353e48aad69812c34b5c8489f07 diff --git a/pack/vim/opt/YouCompleteMe b/pack/vim/opt/YouCompleteMe index bdbfdd9..94cfacd 160000 --- a/pack/vim/opt/YouCompleteMe +++ b/pack/vim/opt/YouCompleteMe @@ -1 +1 @@ -Subproject commit bdbfdd938fe711ff75155546fc0a0e0bebcb952a +Subproject commit 94cfacd11ff97643a32409671fed072e3b1412d6 diff --git a/pack/vim/opt/syntastic b/pack/vim/opt/syntastic index 0336c35..3b3f4ee 160000 --- a/pack/vim/opt/syntastic +++ b/pack/vim/opt/syntastic @@ -1 +1 @@ -Subproject commit 0336c35c0b10b46d85cdd9c3df721f978429e82c +Subproject commit 3b3f4ee8abf81191d1eca4350448148b86e8a741 diff --git a/pack/vim/opt/vimtex b/pack/vim/opt/vimtex index d3a9a1d..661c25d 160000 --- a/pack/vim/opt/vimtex +++ b/pack/vim/opt/vimtex @@ -1 +1 @@ -Subproject commit d3a9a1daf097d75195da3ea2a7b95c5f30cb5f4e +Subproject commit 661c25d14a8a9a41033d78387624acbedf1d5c5d diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim index 96b57e2..1535dc7 100644 --- a/plugin/max-fix-colorschemes.vim +++ b/plugin/max-fix-colorschemes.vim @@ -1,6 +1,34 @@ "======================================================================================================================= " COLOR SCHEME: "======================================================================================================================= +function! ExtendColorTheme() + highlight! Bold cterm=bold gui=bold + highlight! Italic cterm=italic gui=italic + highlight! Underline cterm=underline gui=underline + highlight! BoldUnderline cterm=bold,underline gui=bold,underline + highlight! BoldItalic cterm=bold,Italic gui=bold,italic + highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000 + highlight! Error cterm=NONE ctermbg=NONE gui=NONE guibg=NONE + highlight! SpellBad cterm=NONE gui=undercurl guibg=NONE guifg=red + highlight! Ignore cterm=NONE ctermbg=NONE ctermfg=NONE gui=NONE guibg=NONE guifg=NONE + highlight! LineNr cterm=italic gui=italic + highlight! PmenuThumb cterm=inverse + highlight! MoreMsg cterm=inverse + + highlight! link qfSeparator Normal | " reserve one space + highlight! link qfLineNr Normal | " informational line numbers should look different + highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing + highlight! link WildMenu Search + highlight! link Convention Error + highlight! link PmenuSbar Pmenu + highlight! link Tabline StatusLine + highlight! link VertSplit LineNr + highlight! link SignColumn LineNr + highlight! link FoldColumn LineNr + highlight! link Folded LineNr + highlight! link EndOfBuffer LineNr +endfunction +autocmd ColorScheme * call ExtendColorTheme() if &term == "linux" set notermguicolors @@ -8,64 +36,19 @@ else set termguicolors endif - -function! ExtendColorTheme() - highlight! Bold cterm=bold gui=bold - highlight! Italic cterm=italic gui=italic - highlight! Underline cterm=underline gui=underline - highlight! BoldUnderline cterm=bold,underline gui=bold,underline - highlight! BoldItalic cterm=bold,Italic gui=bold,italic - highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000 - highlight! Error ctermbg=NONE cterm=NONE gui=NONE guibg=NONE - highlight! SpellBad cterm=NONE gui=undercurl guibg=NONE guifg=red - highlight! Ignore ctermbg=NONE ctermfg=NONE cterm=NONE gui=NONE guibg=NONE guifg=NONE - highlight! LineNr cterm=italic gui=italic - - if has("gui_running") - highlight invisible gui=NONE guifg=background guibg=background - else - let w:color=synIDtrans(synIDattr(hlID("Normal"), "bg")) - silent! exec 'highlight invisible cterm=NONE ctermfg='.w:color.' ctermbg='.w:color - let w:color="NONE" - silent! exec 'highlight invisible cterm=NONE ctermbg='.w:color - endif - - highlight! link EndOfBuffer Invisible - - highlight! link qfSeparator Normal | " reserve one space - highlight! link qfLineNr Normal | " informational line numbers should look different - - highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing - highlight! link WildMenu Search - highlight! link Convention Error - - highlight! link VertSplit LineNr - highlight! link SignColumn LineNr - highlight! link FoldColumn LineNr - highlight! link Folded LineNr - - highlight! link PmenuSbar Pmenu - highlight! PmenuThumb cterm=inverse - highlight! MoreMsg cterm=inverse - - highlight! link Tabline StatusLine - -endfunction -autocmd ColorScheme * call ExtendColorTheme() - - -" set background=light -if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) - let g:base16_shell_path = "~/.config/base16-shell/scripts" +if filereadable(expand('~/.vimrc_background')) && filereadable(expand('~/.config/base16-shell/colortest')) + let g:base16_shell_path = '~/.config/base16-shell/scripts' let base16colorspace = 256 source ~/.vimrc_background else let g:PaperColor_Theme_Options = { \ 'theme': { - \ 'default': { + \ 'default.dark': { \ 'transparent_background': 1 \ } \ } \ } colorscheme PaperColor endif + + diff --git a/plugin/statusline.vim b/plugin/statusline.vim index 20d6b7e..db2bc28 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -1,11 +1,11 @@ augroup MAX_FANCYLINE - set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one + set noshowmode | " mode would otherwise be shown twice- in lightline and below. We want to deactivate one. set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split let g:status_sym_start = '' let g:status_sym_end = '' - let g:status_sym_sep_start = '' - let g:status_sym_sep_end = '' + let g:status_sym_sep_start = '│' + let g:status_sym_sep_end = '│' let g:symbol_branch = '' let g:symbol_screen_edge = '░' @@ -33,7 +33,7 @@ augroup MAX_FANCYLINE if(exists('w:color') && w:color == '') let w:color = 'NONE' endif - silent! exec 'highlight '.retval.' gui=NONE guifg='.w:color.' cterm=NONE ctermfg='.w:color + silent! exec 'highlight '.l:retval.' guifg='.w:color.' ctermfg='.w:color return l:retval endfunction @@ -52,60 +52,69 @@ augroup MAX_FANCYLINE \ "\" : 'select block', \ 't' : 'terminal' \ }, mode(), mode()) - let l:webdev_ft_icon = exists("*WebDevIconsGetFileTypeSymbol") ? - \ " ".WebDevIconsGetFileTypeSymbol('*.'.&filetype)." " : "" return '' \ ."%#StatusLineHighlight#" \ ."%#".a:highlight_group."#" \ .g:symbol_screen_edge.' ' \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" \ ."%{(&modified\ ?\ '\ \ 💾'\ :\ '')}" - \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start + \ ."%(%w%h%q%)".l:mode.' '.g:status_sym_sep_start \ ."%{(argc()>1\ ?\ ' '.(argidx()+1).':'.argc().' '.g:status_sym_sep_start:'')}" \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').'/ '\ \:'')}\ " - \ ."%{bufname('%')==''?'':substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}" + \ ."%{winbufnr(0).': '}" + \ ."%{bufname('%')==''?'':substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '')}" \ ."%{(&titlestring\ ?\ has('nvim')?b:term_title:expand(&titlestring):'')\ }" - \ ."%{'['.winbufnr(0).']'}" + \ .' ' \ ."%#".l:invert_group."#" \ .g:status_sym_end + \ .'%<' \ .'' \ ."%=" \ .'' \ ."%#".l:invert_group."#" \ .g:status_sym_start - \ ."%#".a:highlight_group."#" - \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_end.' '}" - \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_end.' '}" + \ ."%#".a:highlight_group."#".' ' + \ ."%{&buftype==''?'':&buftype.' '.g:status_sym_sep_end.' '}" + \ ."%{&filetype==''?'':&filetype.' '.g:status_sym_sep_end.' '}" \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}" \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}" \ ."%cx%-l: " - \ ."%p%% " + \ .g:status_sym_sep_end + \ .' ' + \ .'%p%% ' \ .g:symbol_screen_edge endfunction function! UpdateTabline(highlight_group) let l:invert_group = CreateInvertGroup(a:highlight_group) let l:git_branch = FugitiveHead() -"  return '' - \ ."%#".a:highlight_group."#" + \ .'%#'.a:highlight_group.'#' \ .g:symbol_screen_edge - \ ."%3( \ %)\ " - \ ."%{getcwd(-1)}\ " - \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}" - \ ."%#".l:invert_group."#" + \ .' ' + \ .'%#'.a:highlight_group.'#' + \ .'%-2( %)' + \ .'%{getcwd(-1)}' + \ .' ' + \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead()}" + \ .' ' + \ .'%#'.l:invert_group.'#' \ .g:status_sym_end - \ .'' - \ ."%=" - \ .'' - \ ."%#".l:invert_group."#" + \ .'%<' + \ .'%=' + \ .'%#'.l:invert_group.'#' \ .g:status_sym_start - \ ."%#".a:highlight_group."#" - \ ."%3(\ %)" - \ ."%(%{v:servername}\ %{v:this_session}%)" + \ .'%(%#'.a:highlight_group.'#%)' + \ .' ' + \ .'%-3(%)' + \ .'%(%#'.a:highlight_group.'#%)' + \ .'%(%{v:servername} %{v:this_session}%)' \ .g:status_sym_sep_end.' ' - \ ."%(\ \ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" + \ .'%-3(%)' + \ .'%#'.a:highlight_group.'#' + \ .'%{tabpagenr()}/%{tabpagenr()}' + \ .' ' \ .g:symbol_screen_edge \ ."%##" \ ."" " end @@ -119,6 +128,10 @@ augroup MAX_FANCYLINE setlocal statusline=%!UpdateStatus(g:group_active) " set up the tabline (match colors) set tabline=%!UpdateTabline(g:group_tabline) + + " otherwise 'bold' can mess up icon sizes and I do not know why + highlight! StatusLine cterm=reverse + " exec 'highlight! User3 guifg=#D2A032 guibg='.l:fgcolor endfunction " apply colors from the loaded colorscheme... " when changing the colorscheme also apply new colors to the statusbar... diff --git a/vimrc-common b/vimrc-common index 4b00369..77ebbdf 100644 --- a/vimrc-common +++ b/vimrc-common @@ -64,7 +64,7 @@ if has("multi_byte") set fillchars= | " initialize empty fillchars set listchars= | " initialize empty listchars - if &term == "linux" + if &term ==# 'linux' set fillchars+=vert:\│ | " cool vertical split char else set fillchars+=vert:\║ | " cool vertical split char @@ -143,11 +143,11 @@ set wildmode=longest:full | " do not preselect any entry and show all possib " set dictionary=/usr/share/dict/cracklib-small set complete+=d | " scan current and included files for defined name or macro set complete+=i | " scan current and included files for completions -set complete+=k " make default completer respect the dictionary -set complete-=u " scan current and included files -set complete+=i " scan current and included files -set complete+=d " scan current and included files for defined name or macro -" set complete=d " scan current and included files for defined name or macro +set complete+=k | " make default completer respect the dictionary +set complete-=u | " scan current and included files +set complete+=i | " scan current and included files +set complete+=d | " scan current and included files for defined name or macro +" set complete=d | " scan current and included files for defined name or macro set completeopt+=noinsert | " Do not insert any text for a match until the user selects one set completeopt+=noselect | " Do not select a completion from the menu, let the user do that set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] -- cgit v1.2.3