[vim] inherit the shell's background (dark/light)

This commit is contained in:
Fernando Schauenburg 2016-02-07 14:43:04 +01:00
parent b78b20347b
commit 065ae919ee
2 changed files with 7 additions and 2 deletions

View file

@ -73,7 +73,7 @@ change_palette() (
# - prompt string # - prompt string
# - `ls` command output colors # - `ls` command output colors
do_solarize_shell() { do_solarize_shell() {
[ -z "$BACKGROUND" ] && BACKGROUND="dark" [ -z "$BACKGROUND" ] && export BACKGROUND="dark"
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
echo "tell application \"Terminal\" to set current settings of selected tab of front window to settings set \"solarized-$BACKGROUND\"" | osascript echo "tell application \"Terminal\" to set current settings of selected tab of front window to settings set \"solarized-$BACKGROUND\"" | osascript

5
vimrc
View file

@ -110,6 +110,11 @@ let mapleader = ","
" }}} " }}}
" vim-colors-solarized {{{ " vim-colors-solarized {{{
if $BACKGROUND == 'light' " use background from bash if available
set background=light
else
set background=dark " default is dark
endif
silent! colorscheme solarized silent! colorscheme solarized
" }}} " }}}