disable theming by checking theme var for value
parent
fbefcb860b
commit
b03a93cd2b
20
README.md
20
README.md
|
|
@ -59,10 +59,10 @@ When you run without the `--no-modify-config` switch, the Bash-it installer auto
|
||||||
Use the `--no-modify-config` switch to avoid unwanted modifications, e.g. if your Bash config file already contains the code that loads Bash-it.
|
Use the `--no-modify-config` switch to avoid unwanted modifications, e.g. if your Bash config file already contains the code that loads Bash-it.
|
||||||
|
|
||||||
**NOTE**: Keep in mind how Bash load its configuration files,
|
**NOTE**: Keep in mind how Bash load its configuration files,
|
||||||
`.bash_profile` for login shells (and in macOS in terminal emulators like [Terminal.app](http://www.apple.com/osx/apps/) or
|
`.bash_profile` for login shells (and in macOS in terminal emulators like [Terminal.app](http://www.apple.com/osx/apps/) or
|
||||||
[iTerm2](https://www.iterm2.com/)) and `.bashrc` for interactive shells (default mode in most of the GNU/Linux terminal emulators),
|
[iTerm2](https://www.iterm2.com/)) and `.bashrc` for interactive shells (default mode in most of the GNU/Linux terminal emulators),
|
||||||
to ensure that Bash-it is loaded correctly.
|
to ensure that Bash-it is loaded correctly.
|
||||||
A good "practice" is sourcing `.bashrc` into `.bash_profile` to keep things working in all the scenarios.
|
A good "practice" is sourcing `.bashrc` into `.bash_profile` to keep things working in all the scenarios.
|
||||||
To achieve this, you can add this snippet in your `.bash_profile`:
|
To achieve this, you can add this snippet in your `.bash_profile`:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -76,8 +76,8 @@ Refer to the official [Bash documentation](https://www.gnu.org/software/bash/man
|
||||||
|
|
||||||
### Install using Docker
|
### Install using Docker
|
||||||
|
|
||||||
You can try Bash-it in an isolated environment without changing any local files via a [Docker](https://www.docker.com/) Container.
|
You can try Bash-it in an isolated environment without changing any local files via a [Docker](https://www.docker.com/) Container.
|
||||||
(Bash Shell v4.4 with Bash-it, [bats](https://github.com/sstephenson/bats) and bash-completion based on [Alpine Linux](https://alpinelinux.org/)).
|
(Bash Shell v4.4 with Bash-it, [bats](https://github.com/sstephenson/bats) and bash-completion based on [Alpine Linux](https://alpinelinux.org/)).
|
||||||
|
|
||||||
`docker pull ellerbrock/bash-it`
|
`docker pull ellerbrock/bash-it`
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ Currently enabled modules will be shown in green.
|
||||||
|
|
||||||
### Searching with Negations
|
### Searching with Negations
|
||||||
|
|
||||||
You can prefix a search term with a "-" to exclude it from the results.
|
You can prefix a search term with a "-" to exclude it from the results.
|
||||||
In the above example, if we wanted to hide `chruby` and `chruby-auto`,
|
In the above example, if we wanted to hide `chruby` and `chruby-auto`,
|
||||||
we could change the command as follows:
|
we could change the command as follows:
|
||||||
|
|
||||||
|
|
@ -189,6 +189,7 @@ There are over 50+ Bash-it themes to pick from in `$BASH_IT/themes`.
|
||||||
The default theme is `bobby`.
|
The default theme is `bobby`.
|
||||||
Set `BASH_IT_THEME` to the theme name you want, or if you've developed your own custom theme outside of `$BASH_IT/themes`,
|
Set `BASH_IT_THEME` to the theme name you want, or if you've developed your own custom theme outside of `$BASH_IT/themes`,
|
||||||
point the `BASH_IT_THEME` variable directly to the theme file.
|
point the `BASH_IT_THEME` variable directly to the theme file.
|
||||||
|
To disable theming completely, leave the variable empty.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
|
@ -198,6 +199,9 @@ export BASH_IT_THEME="powerline-multiline"
|
||||||
|
|
||||||
# Use a theme outside of the Bash-it folder
|
# Use a theme outside of the Bash-it folder
|
||||||
export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash"
|
export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash"
|
||||||
|
|
||||||
|
# Disable theming
|
||||||
|
export BASH_IT_THEME=""
|
||||||
```
|
```
|
||||||
|
|
||||||
You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`.
|
You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`.
|
||||||
|
|
@ -294,8 +298,8 @@ Set `SCM_GIT_SHOW_REMOTE_INFO` to 'false' to **disable the feature**:
|
||||||
|
|
||||||
### Untracked files
|
### Untracked files
|
||||||
|
|
||||||
By default, the `git status` command shows information about *untracked* files.
|
By default, the `git status` command shows information about *untracked* files.
|
||||||
This behavior can be controlled through command-line flags or git configuration files.
|
This behavior can be controlled through command-line flags or git configuration files.
|
||||||
For big repositories, ignoring *untracked* files can make git faster.
|
For big repositories, ignoring *untracked* files can make git faster.
|
||||||
Bash-it uses `git status` to gather the repo information it shows in the prompt, so in some circumstances, it can be useful to instruct Bash-it to ignore these files.
|
Bash-it uses `git status` to gather the repo information it shows in the prompt, so in some circumstances, it can be useful to instruct Bash-it to ignore these files.
|
||||||
You can control this behavior with the flag `SCM_GIT_IGNORE_UNTRACKED`:
|
You can control this behavior with the flag `SCM_GIT_IGNORE_UNTRACKED`:
|
||||||
|
|
@ -346,7 +350,7 @@ You can control the prefix and the suffix of this component using the two variab
|
||||||
|
|
||||||
And
|
And
|
||||||
|
|
||||||
* `export SCM_THEME_CURRENT_USER_SUFFIX=' ☺︎ '`
|
* `export SCM_THEME_CURRENT_USER_SUFFIX=' ☺︎ '`
|
||||||
|
|
||||||
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_CURRENT_USER` is ignored.
|
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_CURRENT_USER` is ignored.
|
||||||
|
|
||||||
|
|
|
||||||
27
bash_it.sh
27
bash_it.sh
|
|
@ -46,19 +46,22 @@ do
|
||||||
_load_bash_it_files $file_type
|
_load_bash_it_files $file_type
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load colors and helpers first so they can be used in base theme
|
# Load theme, if a theme was set
|
||||||
# shellcheck source=./themes/colors.theme.bash
|
if [[ ! -z "${BASH_IT_THEME}" ]]; then
|
||||||
source "${BASH_IT}/themes/colors.theme.bash"
|
# Load colors and helpers first so they can be used in base theme
|
||||||
# shellcheck source=./themes/githelpers.theme.bash
|
# shellcheck source=./themes/colors.theme.bash
|
||||||
source "${BASH_IT}/themes/githelpers.theme.bash"
|
source "${BASH_IT}/themes/colors.theme.bash"
|
||||||
# shellcheck source=./themes/p4helpers.theme.bash
|
# shellcheck source=./themes/githelpers.theme.bash
|
||||||
source "${BASH_IT}/themes/p4helpers.theme.bash"
|
source "${BASH_IT}/themes/githelpers.theme.bash"
|
||||||
# shellcheck source=./themes/base.theme.bash
|
# shellcheck source=./themes/p4helpers.theme.bash
|
||||||
source "${BASH_IT}/themes/base.theme.bash"
|
source "${BASH_IT}/themes/p4helpers.theme.bash"
|
||||||
|
# shellcheck source=./themes/base.theme.bash
|
||||||
|
source "${BASH_IT}/themes/base.theme.bash"
|
||||||
|
|
||||||
# appearance (themes) now, after all dependencies
|
# appearance (themes) now, after all dependencies
|
||||||
# shellcheck source=./lib/appearance.bash
|
# shellcheck source=./lib/appearance.bash
|
||||||
source "$APPEARANCE_LIB"
|
source "$APPEARANCE_LIB"
|
||||||
|
fi
|
||||||
|
|
||||||
# Load custom aliases, completion, plugins
|
# Load custom aliases, completion, plugins
|
||||||
for file_type in "aliases" "completion" "plugins"
|
for file_type in "aliases" "completion" "plugins"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
# Path to the bash it configuration
|
# Path to the bash it configuration
|
||||||
export BASH_IT="{{BASH_IT}}"
|
export BASH_IT="{{BASH_IT}}"
|
||||||
|
|
||||||
# Lock and Load a custom theme file
|
# Lock and Load a custom theme file.
|
||||||
|
# Leave empty to disable theming.
|
||||||
# location /.bash_it/themes/
|
# location /.bash_it/themes/
|
||||||
export BASH_IT_THEME='bobby'
|
export BASH_IT_THEME='bobby'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue