diff options
author | Urbain Vaes <urbain@vaes.uk> | 2018-02-09 12:07:29 +0000 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2018-02-21 15:34:26 +0000 |
commit | a145fbc3710b0859638cd1e640d78b825b98a491 (patch) | |
tree | af0258c8642834700a3d8b9bef39852a45a31fe4 | |
parent | f938a84f6b9265f14e96dade6c6260ecf523c5dd (diff) |
Fix colorscheme in vim
-rw-r--r-- | vim/.vimrc | 27 | ||||
-rw-r--r-- | zsh/.zsh/.zshrc | 1 |
2 files changed, 26 insertions, 2 deletions
@@ -331,8 +331,31 @@ nnoremap <silent> ]B ]b:bd! #<cr> " }}} "" Colorscheme {{{ -let g:airline_theme='deus' -colo seoul256 +function! SaveColo(...) + if &runtimepath =~ 'airline' + execute 'set background='.a:1 + execute 'AirlineTheme' a:3 + execute 'colorscheme' a:2 + endif + execute 'silent !echo "set background='.a:1.'" > ~/.color.vim' + execute 'silent !echo "colorscheme '.a:2.'" >> ~/.color.vim' + execute 'silent !echo "let g:airline_theme=\"'.a:3.'\"" >> ~/.color.vim' +endfunction +function! MyColo(colorscheme) + if a:colorscheme == "solarized" + call SaveColo("light","solarized","solarized") + elseif a:colorscheme == "seoul" + call SaveColo("dark","seoul256","deus") + endif +endfunction +if filereadable($HOME."/.color.vim") + source ~/.color.vim +else + call MyColo("seoul") +endif +nnoremap ,c :call MyColo("")<Left><Left> +nnoremap ,cl :call MyColo("solarized")<cr> +nnoremap ,cs :call MyColo("seoul")<cr> " }}} "" Autocommands {{{ augroup vimrc diff --git a/zsh/.zsh/.zshrc b/zsh/.zsh/.zshrc index b69c258..95e989e 100644 --- a/zsh/.zsh/.zshrc +++ b/zsh/.zsh/.zshrc @@ -99,6 +99,7 @@ function colo { /usr/bin/cpp ${XRESOURCE_FILE} | tr -d ' \t' | sed -n \ -e "s/.*background:/${esc}]11;/p" \ -e "s/.*foreground:/${esc}]10;/p" \ + -e "s/.*cursorColor:/${esc}]12;/p" \ -e "s/.*borderColor:/${esc}]708;/p" \ -e "s/.*color\\([0-9][^:]*\\):/${esc}]4;\\1;/p" | tr \\n \\a |