What's a smart way to use/maintain two separate bash_profile's and vimrc's
Use an environment variable. This way, you can set THEME=dark
or THEME=light
in a shell, and all programs started by that shell will use the desired scheme.
In bash or any other shell:
case $THEME in
light)
PS1='\[\e05m\]fancy stuff\[\e0m\]';;
*)
PS1='\w\$ ';;
esac
In your .vimrc
:
if $THEME == "light"
…
else
…
endif
You can use soft links. So create two sets of .bash_profile
and .vimrc
with the contents
touch .vimrc-light .vimrc-dark .bash_profile-light .bash_profile-dark
Then depending on your mood, change the softlinks to point to the right colorset
ln -sf .vimrc-light .vimrc
ln -sf .bash_profile-light .bash_profile
I'm developing a tool, shprofile, that helps you to manage a set of shell profiles. Each profile defines a set of scripts that can be loaded at any time within the current shell session.
To solve your issue, you can then define 2 profiles that contain your 2 versions of .profile
and .vimrc
. Then you can switch between them by calling shprofile
:
$ shprofile profileName
For more information, check out the associated Github project.