Last active
October 21, 2020 18:42
-
-
Save spazm/42f91818768f86b123de49f7a7ef5800 to your computer and use it in GitHub Desktop.
vimrc code for setting light/dark from environment variable and zsh aliases to set the ENV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" check ITERM_PROFILE for 'DARK' or 'LIGHT' substrings, set background to match. | |
if $ITERM_PROFILE =~? 'DARK\c' | |
set background=dark | |
endif | |
if $ITERM_PROFILE =~? 'LIGHT\c' | |
set background=light | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias light='echo "setting ITERM_PROFILE to light"; export ITERM_PROFILE="light"' | |
alias dark='echo "setting ITERM_PROFILE to dark"; export ITERM_PROFILE="dark"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edited .vimrc
By adding a
?
to the end of the comparator.=~
vs==
typo)see the "LOGIC OPERATIONS" section 41.4 of the vim documentation: http://vimdoc.sourceforge.net/htmldoc/usr_41.html