Merge pull request #764 from antisilent/autoreload

763: Automatically reload shell after enabling and disabling things.
pull/773/head
Nils Winkler 2016-08-02 08:23:17 +02:00 committed by GitHub
commit e64cc5b6f1
3 changed files with 14 additions and 0 deletions

View File

@ -157,6 +157,8 @@ Please take a look at the [Contribution Guidelines](CONTRIBUTING.md) before repo
Bash-it creates a `reload` alias that makes it convenient to reload Bash-it creates a `reload` alias that makes it convenient to reload
your Bash profile when you make changes. your Bash profile when you make changes.
Additionally, if you export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE as a non-null value, Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions.
### Prompt Version Control Check ### Prompt Version Control Check
Bash-it provides prompt themes the ability to check and display version control information for the current directory. The information is retrieved for each directory and can slow down the navigation of projects with a large number of files and folders. Turn version control checking off to prevent slow directory navigation within large projects. Bash-it provides prompt themes the ability to check and display version control information for the current directory. The information is retrieved for each directory and can slow down the navigation of projects with a large number of files and folders. Turn version control checking off to prevent slow directory navigation within large projects.

View File

@ -243,6 +243,10 @@ _disable-thing ()
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin) rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi fi
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
exec ${0/-/}
fi
printf '%s\n' "$file_entity disabled." printf '%s\n' "$file_entity disabled."
} }
@ -321,6 +325,10 @@ _enable-thing ()
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi fi
if [ -n "$BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE" ]; then
exec ${0/-/}
fi
printf '%s\n' "$file_entity enabled." printf '%s\n' "$file_entity enabled."
} }

View File

@ -30,5 +30,9 @@ export SCM_CHECK=true
# https://github.com/djl/vcprompt # https://github.com/djl/vcprompt
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt #export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
# (Advanced): Uncomment this to make Bash-it reload itself automatically
# after enabling or disabling aliases, plugins, and completions.
# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1
# Load Bash It # Load Bash It
source $BASH_IT/bash_it.sh source $BASH_IT/bash_it.sh