Merge branch 'master' of https://github.com/Bash-it/bash-it
commit
60509836d7
33
README.md
33
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`:
|
||||||
|
|
@ -312,6 +316,19 @@ Also, with this flag to false, Bash-it will not show the repository as dirty whe
|
||||||
|
|
||||||
**NOTE:** If you set in git configuration file the option to ignore *untracked* files, this flag has no effect, and Bash-it will ignore *untracked* files always.
|
**NOTE:** If you set in git configuration file the option to ignore *untracked* files, this flag has no effect, and Bash-it will ignore *untracked* files always.
|
||||||
|
|
||||||
|
### Stash item count
|
||||||
|
|
||||||
|
When `SCM_GIT_SHOW_DETAILS` is enabled, you can get the count of *stashed* items. This feature can be useful when a user has a lot of stash items.
|
||||||
|
This feature is controlled through the flag `SCM_GIT_SHOW_STASH_INFO` as follows:
|
||||||
|
|
||||||
|
Set `SCM_GIT_SHOW_STASH_INFO` to 'true' (the default value) to **show** the count of stashed items:
|
||||||
|
|
||||||
|
* `export SCM_GIT_SHOW_STASH_INFO=true`
|
||||||
|
|
||||||
|
Set `SCM_GIT_SHOW_STASH_INFO` to 'false' to **don't show** it:
|
||||||
|
|
||||||
|
* `export SCM_GIT_SHOW_STASH_INFO=false`
|
||||||
|
|
||||||
### Git user
|
### Git user
|
||||||
|
|
||||||
In some environments, it is useful to know the value of the current git user, which is used to mark all new commits.
|
In some environments, it is useful to know the value of the current git user, which is used to mark all new commits.
|
||||||
|
|
@ -333,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.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'puppet bolt aliases'
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
alias bolt='bolt command run --tty --no-host-key-check'
|
||||||
|
alias boltas='bolt -p -u'
|
||||||
|
alias sudobolt='bolt --run-as root --sudo-password'
|
||||||
|
alias sudoboltas='sudobolt -p -u'
|
||||||
|
|
@ -4,3 +4,4 @@ about-alias 'docker-compose abbreviations'
|
||||||
alias dco="docker-compose"
|
alias dco="docker-compose"
|
||||||
alias dcofresh="docker-compose-fresh"
|
alias dcofresh="docker-compose-fresh"
|
||||||
alias dcol="docker-compose logs -f --tail 100"
|
alias dcol="docker-compose logs -f --tail 100"
|
||||||
|
alias dcou="docker-compose up"
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,9 @@ alias dkrmi='docker-remove-images' # Delete images for supplied IDs or all if n
|
||||||
alias dkideps='docker-image-dependencies' # Output a graph of image dependencies using Graphiz
|
alias dkideps='docker-image-dependencies' # Output a graph of image dependencies using Graphiz
|
||||||
alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID
|
alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID
|
||||||
alias dkelc='docker exec -it `dklcid` bash' # Enter last container (works with Docker 1.3 and above)
|
alias dkelc='docker exec -it `dklcid` bash' # Enter last container (works with Docker 1.3 and above)
|
||||||
|
alias dkex='docker exec -it ' # Useful to run any commands into container without leaving host
|
||||||
|
|
||||||
|
# Added more recent cleanup options from newer docker versions
|
||||||
|
alias dkip='docker image prune -a -f'
|
||||||
|
alias dkvp='docker volume prune -f'
|
||||||
|
alias dksp='docker system prune -a -f'
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ alias bcin='brew cask install'
|
||||||
alias bcrm='brew cask uninstall'
|
alias bcrm='brew cask uninstall'
|
||||||
alias bczp='brew cask zap'
|
alias bczp='brew cask zap'
|
||||||
alias bccl='brew cask cleanup'
|
alias bccl='brew cask cleanup'
|
||||||
alias bcsr='brew cask search'
|
|
||||||
alias bcls='brew cask list'
|
alias bcls='brew cask list'
|
||||||
alias bcinf='brew cask info'
|
alias bcinf='brew cask info'
|
||||||
alias bcdr='brew cask doctor'
|
alias bcdr='brew cask doctor'
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# -binaryanomaly
|
||||||
|
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'kubectl aliases'
|
||||||
|
|
||||||
|
# set apt aliases
|
||||||
|
function _set_pkg_aliases()
|
||||||
|
{
|
||||||
|
if [ -x $(which kubectl) ]; then
|
||||||
|
alias kc='kubectl'
|
||||||
|
alias kcgp='kubectl get pods'
|
||||||
|
alias kcgd='kubectl get deployments'
|
||||||
|
alias kcgn='kubectl get nodes'
|
||||||
|
alias kcdp='kubectl describe pod'
|
||||||
|
alias kcdd='kubectl describe deployment'
|
||||||
|
alias kcdn='kubectl describe node'
|
||||||
|
alias kcgpan='kubectl get pods --all-namespaces'
|
||||||
|
alias kcgdan='kubectl get deployments --all-namespaces'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_set_pkg_aliases
|
||||||
|
|
@ -3,9 +3,12 @@ about-alias 'maven abbreviations'
|
||||||
|
|
||||||
alias mci='mvn clean install'
|
alias mci='mvn clean install'
|
||||||
alias mi='mvn install'
|
alias mi='mvn install'
|
||||||
|
alias mcp='mvn clean package'
|
||||||
|
alias mp='mvn package'
|
||||||
alias mrprep='mvn release:prepare'
|
alias mrprep='mvn release:prepare'
|
||||||
alias mrperf='mvn release:perform'
|
alias mrperf='mvn release:perform'
|
||||||
alias mrrb='mvn release:rollback'
|
alias mrrb='mvn release:rollback'
|
||||||
alias mdep='mvn dependency:tree'
|
alias mdep='mvn dependency:tree'
|
||||||
alias mpom='mvn help:effective-pom'
|
alias mpom='mvn help:effective-pom'
|
||||||
alias mcisk='mci -Dmaven.test.skip=true'
|
alias mcisk='mci -Dmaven.test.skip=true'
|
||||||
|
alias mcpsk='mcp -Dmaven.test.skip=true'
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'puppet aliases'
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
alias pupval="puppet parser validate *.pp"
|
||||||
|
alias puplint="puppet-lint *.pp"
|
||||||
|
alias pupagt="puppet agent -t"
|
||||||
|
alias pupagtd="puppet agent -t --debug"
|
||||||
|
alias pupapp="puppet apply"
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ __bundle() {
|
||||||
if [[ -z $bundle_command ]]; then
|
if [[ -z $bundle_command ]]; then
|
||||||
options="$options --version --help"
|
options="$options --version --help"
|
||||||
fi
|
fi
|
||||||
|
elif [[ $bundle_command = "exec" ]]; then
|
||||||
|
_bundle_exec_completions
|
||||||
|
return
|
||||||
else
|
else
|
||||||
if [[ -z $bundle_command || $bundle_command = help ]]; then
|
if [[ -z $bundle_command || $bundle_command = help ]]; then
|
||||||
options="help install update package exec config check list show
|
options="help install update package exec config check list show
|
||||||
|
|
@ -53,3 +56,10 @@ __bundle_get_command() {
|
||||||
|
|
||||||
complete -F __bundle -o bashdefault -o default bundle
|
complete -F __bundle -o bashdefault -o default bundle
|
||||||
# vim: ai ft=sh sw=4 sts=2 et
|
# vim: ai ft=sh sw=4 sts=2 et
|
||||||
|
|
||||||
|
_bundle_exec_completions()
|
||||||
|
{
|
||||||
|
if [[ $COMP_CWORD = 2 ]]; then
|
||||||
|
COMPREPLY=($(compgen -c -- "$2"))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Lerna autocompletion.
|
||||||
|
function _lerna_completions() {
|
||||||
|
local cur compls
|
||||||
|
|
||||||
|
# The currently-being-completed word.
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
|
||||||
|
# Options
|
||||||
|
compls="add bootstrap changed clean create diff exec \
|
||||||
|
import init link list publish run version \
|
||||||
|
--loglevel --concurrency --reject-cycles \
|
||||||
|
--progress --sort --no-sort --help \
|
||||||
|
--version"
|
||||||
|
|
||||||
|
# Tell complete what stuff to show.
|
||||||
|
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
||||||
|
}
|
||||||
|
complete -o default -F _lerna_completions lerna
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# minikube (Local Kubernetes) completion
|
||||||
|
|
||||||
|
if command -v minikube &>/dev/null
|
||||||
|
then
|
||||||
|
eval "$(minikube completion bash)"
|
||||||
|
fi
|
||||||
|
|
@ -27,10 +27,14 @@ _sdkman_complete()
|
||||||
esac
|
esac
|
||||||
elif [ $COMP_CWORD -eq 3 ]; then
|
elif [ $COMP_CWORD -eq 3 ]; then
|
||||||
case "${COMP_WORDS[COMP_CWORD-2]}" in
|
case "${COMP_WORDS[COMP_CWORD-2]}" in
|
||||||
"install" | "uninstall" | "rm" | "use" | "default" )
|
"uninstall" | "rm" | "use" | "default" )
|
||||||
_sdkman_candidate_versions ${COMP_WORDS[COMP_CWORD-1]}
|
_sdkman_candidate_versions ${COMP_WORDS[COMP_CWORD-1]}
|
||||||
COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) )
|
COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) )
|
||||||
;;
|
;;
|
||||||
|
"install")
|
||||||
|
_sdkman_candidate_not_installed_versions ${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) )
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -51,6 +55,14 @@ _sdkman_candidate_versions(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_sdkman_candidate_not_installed_versions(){
|
||||||
|
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions $1)
|
||||||
|
if [ "$SDKMAN_OFFLINE_MODE" = "false" ]; then
|
||||||
|
CANDIDATE_ONLINE_VERSIONS="$(__sdkman_list_versions $1 | grep " " | grep "\." | cut -c 6-)"
|
||||||
|
CANDIDATE_VERSIONS="$(echo $CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS | tr ' ' '\n' | sort | uniq -u) "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
__sdkman_cleanup_local_versions(){
|
__sdkman_cleanup_local_versions(){
|
||||||
|
|
||||||
__sdkman_build_version_csv $1 | tr ',' ' '
|
__sdkman_build_version_csv $1 | tr ',' ' '
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,16 @@ _sshcomplete() {
|
||||||
local OPTIONS=" -- ${CURRENT_PROMPT}"
|
local OPTIONS=" -- ${CURRENT_PROMPT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# parse all defined hosts from .ssh/config and files included there
|
||||||
# parse all defined hosts from .ssh/config
|
for fl in "$HOME/.ssh/config" \
|
||||||
if [ -r "$HOME/.ssh/config" ]; then
|
$(grep "^\s*Include" "$HOME/.ssh/config" |
|
||||||
COMPREPLY=($(compgen -W "$(grep -i ^Host "$HOME/.ssh/config" | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )
|
awk '{for (i=2; i<=NF; i++) print $i}' |
|
||||||
fi
|
sed "s|^~/|$HOME/|")
|
||||||
|
do
|
||||||
|
if [ -r "$fl" ]; then
|
||||||
|
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# parse all hosts found in .ssh/known_hosts
|
# parse all hosts found in .ssh/known_hosts
|
||||||
if [ -r "$HOME/.ssh/known_hosts" ]; then
|
if [ -r "$HOME/.ssh/known_hosts" ]; then
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ if [ $(uname) = "Darwin" ] && command -v brew &>/dev/null ; then
|
||||||
. "$BREW_PREFIX"/etc/bash_completion
|
. "$BREW_PREFIX"/etc/bash_completion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
||||||
if [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then
|
if [ "${BASH_VERSINFO}" -ge 4 ] && [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then
|
||||||
. "$BREW_PREFIX"/share/bash-completion/bash_completion
|
. "$BREW_PREFIX"/share/bash-completion/bash_completion
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ function reload_plugins() {
|
||||||
bash-it ()
|
bash-it ()
|
||||||
{
|
{
|
||||||
about 'Bash-it help and maintenance'
|
about 'Bash-it help and maintenance'
|
||||||
param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload ] '
|
param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload ] '
|
||||||
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
||||||
param '3: specific component [optional]'
|
param '3: specific component [optional]'
|
||||||
example '$ bash-it show plugins'
|
example '$ bash-it show plugins'
|
||||||
|
|
@ -79,28 +79,28 @@ bash-it ()
|
||||||
shift
|
shift
|
||||||
typeset func
|
typeset func
|
||||||
case $verb in
|
case $verb in
|
||||||
show)
|
show)
|
||||||
func=_bash-it-$component;;
|
func=_bash-it-$component;;
|
||||||
enable)
|
enable)
|
||||||
func=_enable-$component;;
|
func=_enable-$component;;
|
||||||
disable)
|
disable)
|
||||||
func=_disable-$component;;
|
func=_disable-$component;;
|
||||||
help)
|
help)
|
||||||
func=_help-$component;;
|
func=_help-$component;;
|
||||||
search)
|
search)
|
||||||
_bash-it-search $component "$@"
|
_bash-it-search $component "$@"
|
||||||
return;;
|
return;;
|
||||||
update)
|
update)
|
||||||
func=_bash-it_update;;
|
func=_bash-it_update;;
|
||||||
migrate)
|
migrate)
|
||||||
func=_bash-it-migrate;;
|
func=_bash-it-migrate;;
|
||||||
version)
|
version)
|
||||||
func=_bash-it-version;;
|
func=_bash-it-version;;
|
||||||
reload)
|
reload)
|
||||||
func=_bash-it-reload;;
|
func=_bash-it-reload;;
|
||||||
*)
|
*)
|
||||||
reference bash-it
|
reference bash-it
|
||||||
return;;
|
return;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# pluralize component if necessary
|
# pluralize component if necessary
|
||||||
|
|
@ -187,7 +187,7 @@ _bash-it_update() {
|
||||||
_bash-it-migrate
|
_bash-it-migrate
|
||||||
echo ""
|
echo ""
|
||||||
echo "All done, enjoy!"
|
echo "All done, enjoy!"
|
||||||
reload
|
bash-it reload
|
||||||
else
|
else
|
||||||
echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean."
|
echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean."
|
||||||
fi
|
fi
|
||||||
|
|
@ -270,7 +270,7 @@ _bash-it-reload() {
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cd - &> /dev/null || return
|
cd - &> /dev/null || return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'AWS helper functions'
|
about-plugin 'AWS helper functions'
|
||||||
|
|
||||||
|
AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-$HOME/.aws/config}"
|
||||||
|
AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-$HOME/.aws/credentials}"
|
||||||
|
|
||||||
function awskeys {
|
function awskeys {
|
||||||
about 'helper function for AWS credentials file'
|
about 'helper function for AWS credentials file'
|
||||||
group 'aws'
|
group 'aws'
|
||||||
|
|
||||||
if [[ ! -f ~/.aws/credentials ]]; then
|
if [[ ! -f "${AWS_SHARED_CREDENTIALS_FILE}" ]]; then
|
||||||
echo "AWS credentials file not found"
|
echo "AWS credentials file not found"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -35,14 +38,14 @@ function __awskeys_help {
|
||||||
}
|
}
|
||||||
|
|
||||||
function __awskeys_get {
|
function __awskeys_get {
|
||||||
local ln=$(grep -n "\[ *$1 *\]" ~/.aws/credentials | cut -d ":" -f 1)
|
local ln=$(grep -n "\[ *$1 *\]" "${AWS_SHARED_CREDENTIALS_FILE}" | cut -d ":" -f 1)
|
||||||
if [[ -n "${ln}" ]]; then
|
if [[ -n "${ln}" ]]; then
|
||||||
tail -n +${ln} ~/.aws/credentials | egrep -m 2 "aws_access_key_id|aws_secret_access_key"
|
tail -n +${ln} "${AWS_SHARED_CREDENTIALS_FILE}" | egrep -m 3 "aws_access_key_id|aws_secret_access_key|aws_session_token"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function __awskeys_list {
|
function __awskeys_list {
|
||||||
local credentials_list="$((egrep '^\[ *[a-zA-Z0-9_-]+ *\]$' ~/.aws/credentials; grep "\[profile" ~/.aws/config | sed "s|\[profile |\[|g") | sort | uniq)"
|
local credentials_list="$((egrep '^\[ *[a-zA-Z0-9_-]+ *\]$' "${AWS_SHARED_CREDENTIALS_FILE}"; grep "\[profile" "${AWS_CONFIG_FILE}" | sed "s|\[profile |\[|g") | sort | uniq)"
|
||||||
if [[ -n $"{credentials_list}" ]]; then
|
if [[ -n $"{credentials_list}" ]]; then
|
||||||
echo -e "Available credentials profiles:\n"
|
echo -e "Available credentials profiles:\n"
|
||||||
for profile in ${credentials_list}; do
|
for profile in ${credentials_list}; do
|
||||||
|
|
@ -72,14 +75,14 @@ function __awskeys_export {
|
||||||
export "$(echo ${key} | tr [:lower:] [:upper:])=${p_key#*=}"
|
export "$(echo ${key} | tr [:lower:] [:upper:])=${p_key#*=}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
export AWS_DEFAULT_PROFILE="$1"
|
export AWS_PROFILE="$1"
|
||||||
else
|
else
|
||||||
echo "Profile $1 not found in credentials file"
|
echo "Profile $1 not found in credentials file"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function __awskeys_unset {
|
function __awskeys_unset {
|
||||||
unset AWS_DEFAULT_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
|
unset AWS_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
|
||||||
}
|
}
|
||||||
|
|
||||||
function __awskeys_comp {
|
function __awskeys_comp {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ about-plugin 'load fzf, if you are using it'
|
||||||
|
|
||||||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
||||||
|
|
||||||
|
if [ -z ${FZF_DEFAULT_COMMAND+x} ]; then
|
||||||
|
command -v fd &> /dev/null && export FZF_DEFAULT_COMMAND='fd --type f'
|
||||||
|
fi
|
||||||
|
|
||||||
fe() {
|
fe() {
|
||||||
about "Open the selected file in the default editor"
|
about "Open the selected file in the default editor"
|
||||||
group "fzf"
|
group "fzf"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ about-plugin 'go environment variables & path configuration'
|
||||||
|
|
||||||
[ ! command -v go &>/dev/null ] && return
|
[ ! command -v go &>/dev/null ] && return
|
||||||
|
|
||||||
export GOROOT=${GOROOT:-$(go env | grep GOROOT | cut -d'"' -f2)}
|
export GOROOT=${GOROOT:-$(go env GOROOT)}
|
||||||
pathmunge "${GOROOT}/bin"
|
pathmunge "${GOROOT}/bin"
|
||||||
export GOPATH=${GOPATH:-"$HOME/go"}
|
export GOPATH=${GOPATH:-$(go env GOPATH)}
|
||||||
pathmunge "${GOPATH}/bin"
|
pathmunge "${GOPATH}/bin"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
cite about-plugin
|
||||||
|
about-plugin 'initialize jump (see https://github.com/gsamokovarov/jump)'
|
||||||
|
|
||||||
|
__init_jump() {
|
||||||
|
command -v jump &> /dev/null || return
|
||||||
|
eval "$(jump shell --bind=z)"
|
||||||
|
}
|
||||||
|
|
||||||
|
__init_jump
|
||||||
|
|
@ -5,7 +5,7 @@ about-plugin 'osx-specific functions'
|
||||||
if [ $(uname) = "Darwin" ]; then
|
if [ $(uname) = "Darwin" ]; then
|
||||||
if type update_terminal_cwd > /dev/null 2>&1 ; then
|
if type update_terminal_cwd > /dev/null 2>&1 ; then
|
||||||
if ! [[ $PROMPT_COMMAND =~ (^|;)update_terminal_cwd($|;) ]] ; then
|
if ! [[ $PROMPT_COMMAND =~ (^|;)update_terminal_cwd($|;) ]] ; then
|
||||||
PROMPT_COMMAND="$PROMPT_COMMAND;update_terminal_cwd"
|
PROMPT_COMMAND="${PROMPT_COMMAND%;};update_terminal_cwd"
|
||||||
declared="$(declare -p PROMPT_COMMAND)"
|
declared="$(declare -p PROMPT_COMMAND)"
|
||||||
[[ "$declared" =~ \ -[aAilrtu]*x[aAilrtu]*\ ]] 2>/dev/null
|
[[ "$declared" =~ \ -[aAilrtu]*x[aAilrtu]*\ ]] 2>/dev/null
|
||||||
[[ $? -eq 0 ]] && export PROMPT_COMMAND
|
[[ $? -eq 0 ]] && export PROMPT_COMMAND
|
||||||
|
|
|
||||||
|
|
@ -20,23 +20,23 @@ done
|
||||||
|
|
||||||
|
|
||||||
function postgres_start {
|
function postgres_start {
|
||||||
about 'Starts PostgresSQL server'
|
about 'Starts PostgreSQL server'
|
||||||
group 'postgres'
|
group 'postgres'
|
||||||
|
|
||||||
echo 'Starting PostgresSQL Server....';
|
echo 'Starting Postgres....';
|
||||||
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile start
|
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile start
|
||||||
}
|
}
|
||||||
|
|
||||||
function postgres_stop {
|
function postgres_stop {
|
||||||
about 'Steps PostgresSQL server'
|
about 'Stops PostgreSQL server'
|
||||||
group 'postgres'
|
group 'postgres'
|
||||||
|
|
||||||
echo 'Stopping PostgresSQL Server....';
|
echo 'Stopping Postgres....';
|
||||||
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile stop -s -m fast
|
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile stop -s -m fast
|
||||||
}
|
}
|
||||||
|
|
||||||
function postgres_status {
|
function postgres_status {
|
||||||
about 'Returns status of PostgresSQL server'
|
about 'Returns status of PostgreSQL server'
|
||||||
group 'postgres'
|
group 'postgres'
|
||||||
|
|
||||||
# $POSTGRES_BIN/pg_ctl -D $PGDATA status
|
# $POSTGRES_BIN/pg_ctl -D $PGDATA status
|
||||||
|
|
@ -55,7 +55,7 @@ function is_postgres_running {
|
||||||
|
|
||||||
|
|
||||||
function postgres_restart {
|
function postgres_restart {
|
||||||
about 'Restarts status of PostgresSQL server'
|
about 'Restarts status of PostgreSQL server'
|
||||||
group 'postgres'
|
group 'postgres'
|
||||||
|
|
||||||
echo 'Restarting Postgres....';
|
echo 'Restarting Postgres....';
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cite about-plugin
|
||||||
|
about-plugin 'enables powerline daemon'
|
||||||
|
|
||||||
|
command -v powerline-daemon &>/dev/null || return
|
||||||
|
powerline-daemon -q
|
||||||
|
|
||||||
|
#the following should not be executed if bashit powerline themes in use
|
||||||
|
case "$BASH_IT_THEME" in
|
||||||
|
*powerline*)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
POWERLINE_BASH_CONTINUATION=1
|
||||||
|
POWERLINE_BASH_SELECT=1
|
||||||
|
bashPowerlineInit=$(python -c \
|
||||||
|
"import os; \
|
||||||
|
import powerline;\
|
||||||
|
print(os.path.join(os.path.dirname(\
|
||||||
|
powerline.__file__),\
|
||||||
|
'bindings', \
|
||||||
|
'bash', \
|
||||||
|
'powerline.sh'))")
|
||||||
|
[ -e $bashPowerlineInit ] || return
|
||||||
|
. $bashPowerlineInit
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
# Load rbebv, if you are using it
|
|
||||||
|
|
||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'load rbenv, if you are using it'
|
about-plugin 'load rbenv, if you are using it'
|
||||||
|
|
||||||
pathmunge "$HOME"/.rbenv/bin
|
export RBENV_ROOT="$HOME/.rbenv"
|
||||||
[ -x `which rbenv` ] && eval "$(rbenv init -)"
|
pathmunge "$RBENV_ROOT/bin"
|
||||||
|
|
||||||
[ -d "$HOME"/.rbenv/plugins/ruby-build ] && pathmunge "$HOME"/.rbenv/plugins/ruby-build/bin
|
[[ `which rbenv` ]] && eval "$(rbenv init -)"
|
||||||
|
|
||||||
|
# Load the auto-completion script if rbenv was loaded.
|
||||||
|
[[ -e $RBENV_ROOT/completions/rbenv.bash ]] && source $RBENV_ROOT/completions/rbenv.bash
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ SCM_GIT_SHOW_REMOTE_INFO=${SCM_GIT_SHOW_REMOTE_INFO:=auto}
|
||||||
SCM_GIT_IGNORE_UNTRACKED=${SCM_GIT_IGNORE_UNTRACKED:=false}
|
SCM_GIT_IGNORE_UNTRACKED=${SCM_GIT_IGNORE_UNTRACKED:=false}
|
||||||
SCM_GIT_SHOW_CURRENT_USER=${SCM_GIT_SHOW_CURRENT_USER:=false}
|
SCM_GIT_SHOW_CURRENT_USER=${SCM_GIT_SHOW_CURRENT_USER:=false}
|
||||||
SCM_GIT_SHOW_MINIMAL_INFO=${SCM_GIT_SHOW_MINIMAL_INFO:=false}
|
SCM_GIT_SHOW_MINIMAL_INFO=${SCM_GIT_SHOW_MINIMAL_INFO:=false}
|
||||||
|
SCM_GIT_SHOW_STASH_INFO=${SCM_GIT_SHOW_STASH_INFO:=true}
|
||||||
|
|
||||||
SCM_GIT='git'
|
SCM_GIT='git'
|
||||||
SCM_GIT_CHAR='±'
|
SCM_GIT_CHAR='±'
|
||||||
|
|
@ -181,9 +182,11 @@ function git_prompt_vars {
|
||||||
[[ "${commits_ahead}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_AHEAD_CHAR}${commits_ahead}"
|
[[ "${commits_ahead}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_AHEAD_CHAR}${commits_ahead}"
|
||||||
[[ "${commits_behind}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_BEHIND_CHAR}${commits_behind}"
|
[[ "${commits_behind}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_BEHIND_CHAR}${commits_behind}"
|
||||||
|
|
||||||
local stash_count
|
if [[ "${SCM_GIT_SHOW_STASH_INFO}" = "true" ]]; then
|
||||||
stash_count="$(git stash list 2> /dev/null | wc -l | tr -d ' ')"
|
local stash_count
|
||||||
[[ "${stash_count}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_STASH_CHAR_PREFIX}${stash_count}${SCM_GIT_STASH_CHAR_SUFFIX}"
|
stash_count="$(git stash list 2> /dev/null | wc -l | tr -d ' ')"
|
||||||
|
[[ "${stash_count}" -gt 0 ]] && SCM_BRANCH+=" ${SCM_GIT_STASH_CHAR_PREFIX}${stash_count}${SCM_GIT_STASH_CHAR_SUFFIX}"
|
||||||
|
fi
|
||||||
|
|
||||||
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
|
SCM_STATE=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
|
||||||
if ! _git-hide-status; then
|
if ! _git-hide-status; then
|
||||||
|
|
@ -347,7 +350,7 @@ function condaenv_prompt {
|
||||||
}
|
}
|
||||||
|
|
||||||
function py_interp_prompt {
|
function py_interp_prompt {
|
||||||
py_version=$(python --version 2>&1 | awk '{print "py-"$2;}') || return
|
py_version=$(python --version 2>&1 | awk 'NR==1{print "py-"$2;}') || return
|
||||||
echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}"
|
echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -393,6 +396,7 @@ function user_host_prompt {
|
||||||
|
|
||||||
# backwards-compatibility
|
# backwards-compatibility
|
||||||
function git_prompt_info {
|
function git_prompt_info {
|
||||||
|
_git-hide-status && return
|
||||||
git_prompt_vars
|
git_prompt_vars
|
||||||
echo -e "${SCM_PREFIX}${SCM_BRANCH}${SCM_STATE}${SCM_SUFFIX}"
|
echo -e "${SCM_PREFIX}${SCM_BRANCH}${SCM_STATE}${SCM_SUFFIX}"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,7 @@ prompt() {
|
||||||
|
|
||||||
if [ $(uname) = "Linux" ];
|
if [ $(uname) = "Linux" ];
|
||||||
then
|
then
|
||||||
PS1="${TITLEBAR}
|
PS1="${TITLEBAR}${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT}
|
||||||
${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT}\
|
|
||||||
$(safe_battery_charge)${RESTORE_CURSOR}\
|
$(safe_battery_charge)${RESTORE_CURSOR}\
|
||||||
${D_USER_COLOR}\u ${D_INTERMEDIATE_COLOR}\
|
${D_USER_COLOR}\u ${D_INTERMEDIATE_COLOR}\
|
||||||
at ${D_MACHINE_COLOR}\h ${D_INTERMEDIATE_COLOR}\
|
at ${D_MACHINE_COLOR}\h ${D_INTERMEDIATE_COLOR}\
|
||||||
|
|
@ -113,7 +112,7 @@ ${D_INTERMEDIATE_COLOR}$ ${D_DEFAULT_COLOR}"
|
||||||
else
|
else
|
||||||
PS1="${TITLEBAR}
|
PS1="${TITLEBAR}
|
||||||
${D_USER_COLOR}\u ${D_INTERMEDIATE_COLOR}\
|
${D_USER_COLOR}\u ${D_INTERMEDIATE_COLOR}\
|
||||||
at ${D_MACHINE_COLOR}\h ${D_INTERMEDIATE_COLOR}\
|
at ${D_MACHINE_COLOR}\h ${D_INTERMEDIATE_COLOR}\
|
||||||
in ${D_DIR_COLOR}\w ${D_INTERMEDIATE_COLOR}\
|
in ${D_DIR_COLOR}\w ${D_INTERMEDIATE_COLOR}\
|
||||||
${LAST_COMMAND_FAILED}\
|
${LAST_COMMAND_FAILED}\
|
||||||
$(demula_vcprompt)\
|
$(demula_vcprompt)\
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ RVM_THEME_PROMPT_SUFFIX=" d|"
|
||||||
BOLD="\[\e[1m\]"
|
BOLD="\[\e[1m\]"
|
||||||
|
|
||||||
function prompt_command() {
|
function prompt_command() {
|
||||||
PS1="\n${bold_cyan}$(scm_prompt_char_info) ${bold_cyan}\w :${reset_color}${normal}${BOLD} "
|
PS1="\n${bold_cyan}$(scm_prompt_char_info)$(virtualenv_prompt) ${bold_cyan}\w :${reset_color}${normal}${BOLD} "
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_append_prompt_command prompt_command
|
safe_append_prompt_command prompt_command
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ The time/date is printed by the `date` command, so refer to its man page to chan
|
||||||
|
|
||||||
The contents of both prompt sides can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
The contents of both prompt sides can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||||
|
|
||||||
|
* `aws_profile` - Show the current value of the `AWS_PROFILE` environment variable
|
||||||
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
||||||
* `clock` - Current time in `HH:MM:SS` format
|
* `clock` - Current time in `HH:MM:SS` format
|
||||||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ PYTHON_VENV_THEME_PROMPT_COLOR=35
|
||||||
|
|
||||||
SCM_NONE_CHAR=""
|
SCM_NONE_CHAR=""
|
||||||
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
||||||
|
SCM_HG_CHAR=${POWERLINE_SCM_HG_CHAR:="☿ "}
|
||||||
SCM_THEME_PROMPT_CLEAN=""
|
SCM_THEME_PROMPT_CLEAN=""
|
||||||
SCM_THEME_PROMPT_DIRTY=""
|
SCM_THEME_PROMPT_DIRTY=""
|
||||||
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
||||||
|
|
@ -35,6 +36,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
||||||
RUBY_THEME_PROMPT_COLOR=161
|
RUBY_THEME_PROMPT_COLOR=161
|
||||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
||||||
|
|
||||||
|
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||||
|
AWS_PROFILE_PROMPT_COLOR=208
|
||||||
|
|
||||||
CWD_THEME_PROMPT_COLOR=240
|
CWD_THEME_PROMPT_COLOR=240
|
||||||
|
|
||||||
LAST_STATUS_THEME_PROMPT_COLOR=196
|
LAST_STATUS_THEME_PROMPT_COLOR=196
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ The time/date is printed by the `date` command, so refer to its man page to chan
|
||||||
|
|
||||||
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||||
|
|
||||||
|
* `aws_profile` - Show the current value of the `AWS_PROFILE` environment variable
|
||||||
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
||||||
* `clock` - Current time in `HH:MM:SS` format
|
* `clock` - Current time in `HH:MM:SS` format
|
||||||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ PYTHON_VENV_THEME_PROMPT_COLOR=35
|
||||||
|
|
||||||
SCM_NONE_CHAR=""
|
SCM_NONE_CHAR=""
|
||||||
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
||||||
|
SCM_HG_CHAR=${POWERLINE_SCM_HG_CHAR:="☿ "}
|
||||||
SCM_THEME_PROMPT_CLEAN=""
|
SCM_THEME_PROMPT_CLEAN=""
|
||||||
SCM_THEME_PROMPT_DIRTY=""
|
SCM_THEME_PROMPT_DIRTY=""
|
||||||
SCM_THEME_PROMPT_COLOR=238
|
SCM_THEME_PROMPT_COLOR=238
|
||||||
|
|
@ -32,6 +33,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
||||||
RUBY_THEME_PROMPT_COLOR=161
|
RUBY_THEME_PROMPT_COLOR=161
|
||||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
||||||
|
|
||||||
|
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||||
|
AWS_PROFILE_PROMPT_COLOR=208
|
||||||
|
|
||||||
CWD_THEME_PROMPT_COLOR=254
|
CWD_THEME_PROMPT_COLOR=254
|
||||||
|
|
||||||
LAST_STATUS_THEME_PROMPT_COLOR=124
|
LAST_STATUS_THEME_PROMPT_COLOR=124
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ The time/date is printed by the `date` command, so refer to its man page to chan
|
||||||
|
|
||||||
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||||
|
|
||||||
|
* `aws_profile` - Show the current value of the `AWS_PROFILE` environment variable
|
||||||
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
||||||
* `clock` - Current time in `HH:MM:SS` format
|
* `clock` - Current time in `HH:MM:SS` format
|
||||||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ PYTHON_VENV_THEME_PROMPT_COLOR=35
|
||||||
|
|
||||||
SCM_NONE_CHAR=""
|
SCM_NONE_CHAR=""
|
||||||
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:="⎇ "}
|
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:="⎇ "}
|
||||||
|
SCM_HG_CHAR=${POWERLINE_SCM_HG_CHAR:="☿ "}
|
||||||
SCM_THEME_PROMPT_CLEAN=""
|
SCM_THEME_PROMPT_CLEAN=""
|
||||||
SCM_THEME_PROMPT_DIRTY=""
|
SCM_THEME_PROMPT_DIRTY=""
|
||||||
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
||||||
|
|
@ -25,7 +26,10 @@ RVM_THEME_PROMPT_SUFFIX=""
|
||||||
RBENV_THEME_PROMPT_PREFIX=""
|
RBENV_THEME_PROMPT_PREFIX=""
|
||||||
RBENV_THEME_PROMPT_SUFFIX=""
|
RBENV_THEME_PROMPT_SUFFIX=""
|
||||||
RUBY_THEME_PROMPT_COLOR=161
|
RUBY_THEME_PROMPT_COLOR=161
|
||||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="ⓔ "}
|
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="💎 "}
|
||||||
|
|
||||||
|
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||||
|
AWS_PROFILE_PROMPT_COLOR=208
|
||||||
|
|
||||||
CWD_THEME_PROMPT_COLOR=240
|
CWD_THEME_PROMPT_COLOR=240
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ The time/date is printed by the `date` command, so refer to its man page to chan
|
||||||
|
|
||||||
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||||
|
|
||||||
|
* `aws_profile` - Show the current value of the `AWS_PROFILE` environment variable
|
||||||
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
* `battery` - Battery information (you'll need to enable the `battery` plugin)
|
||||||
* `clock` - Current time in `HH:MM:SS` format
|
* `clock` - Current time in `HH:MM:SS` format
|
||||||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,8 @@ function __powerline_scm_prompt {
|
||||||
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
|
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
|
||||||
elif [[ "${SCM_P4_CHAR}" == "${SCM_CHAR}" ]]; then
|
elif [[ "${SCM_P4_CHAR}" == "${SCM_CHAR}" ]]; then
|
||||||
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
|
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
|
||||||
|
elif [[ "${SCM_HG_CHAR}" == "${SCM_CHAR}" ]]; then
|
||||||
|
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
|
||||||
fi
|
fi
|
||||||
echo "${scm_prompt}${scm}|${color}"
|
echo "${scm_prompt}${scm}|${color}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -134,6 +136,12 @@ function __powerline_in_vim_prompt {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __powerline_aws_profile_prompt {
|
||||||
|
if [[ -n "${AWS_PROFILE}" ]]; then
|
||||||
|
echo "${AWS_PROFILE_CHAR}${AWS_PROFILE}|${AWS_PROFILE_PROMPT_COLOR}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function __powerline_left_segment {
|
function __powerline_left_segment {
|
||||||
local OLD_IFS="${IFS}"; IFS="|"
|
local OLD_IFS="${IFS}"; IFS="|"
|
||||||
local params=( $1 )
|
local params=( $1 )
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ PYTHON_VENV_THEME_PROMPT_COLOR=35
|
||||||
|
|
||||||
SCM_NONE_CHAR=""
|
SCM_NONE_CHAR=""
|
||||||
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "}
|
||||||
|
SCM_HG_CHAR=${POWERLINE_SCM_HG_CHAR:="☿ "}
|
||||||
SCM_THEME_PROMPT_CLEAN=""
|
SCM_THEME_PROMPT_CLEAN=""
|
||||||
SCM_THEME_PROMPT_DIRTY=""
|
SCM_THEME_PROMPT_DIRTY=""
|
||||||
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
SCM_THEME_PROMPT_CLEAN_COLOR=25
|
||||||
|
|
@ -30,6 +31,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
||||||
RUBY_THEME_PROMPT_COLOR=161
|
RUBY_THEME_PROMPT_COLOR=161
|
||||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
||||||
|
|
||||||
|
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||||
|
AWS_PROFILE_PROMPT_COLOR=208
|
||||||
|
|
||||||
CWD_THEME_PROMPT_COLOR=240
|
CWD_THEME_PROMPT_COLOR=240
|
||||||
|
|
||||||
LAST_STATUS_THEME_PROMPT_COLOR=52
|
LAST_STATUS_THEME_PROMPT_COLOR=52
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,12 @@ chroot(){
|
||||||
|
|
||||||
# show virtualenvwrapper
|
# show virtualenvwrapper
|
||||||
my_ve(){
|
my_ve(){
|
||||||
if [ -n "$VIRTUAL_ENV" ]
|
|
||||||
|
if [ -n "$CONDA_DEFAULT_ENV" ]
|
||||||
|
then
|
||||||
|
my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}";
|
||||||
|
echo "($my_ps_ve)";
|
||||||
|
elif [ -n "$VIRTUAL_ENV" ]
|
||||||
then
|
then
|
||||||
my_ps_ve="${bold_purple}$ve${normal}";
|
my_ps_ve="${bold_purple}$ve${normal}";
|
||||||
echo "($my_ps_ve)";
|
echo "($my_ps_ve)";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue