├── docs ├── _static │ └── .keep ├── _templates │ └── .keep ├── themes-list │ ├── redline.png │ ├── nwinkler_random_colors.png │ ├── easy.rst │ ├── powerline-naked.rst │ ├── powerline.rst │ ├── bira.rst │ ├── powerline-plain.rst │ ├── radek.rst │ ├── oh-my-posh.rst │ ├── codeword.rst │ ├── inretio.rst │ ├── nwinkler_random_colors.rst │ └── redline.rst ├── requirements.txt ├── misc.rst ├── commands │ ├── index.rst │ ├── doctor.rst │ ├── reload.rst │ ├── profile.rst │ └── update.rst ├── uninstalling.rst ├── help_screens.rst ├── Makefile ├── custom.rst └── make.bat ├── .ackrc ├── test ├── fixtures │ ├── go │ │ ├── gopath │ │ │ └── bin │ │ │ │ └── .keep │ │ ├── go path │ │ │ └── bin │ │ │ │ └── .keep │ │ └── gopath2 │ │ │ └── bin │ │ │ └── .keep │ ├── svn │ │ ├── broken │ │ │ ├── xcrun │ │ │ └── svn │ │ └── working │ │ │ ├── xcrun │ │ │ └── svn │ ├── plugin │ │ └── xterm │ │ │ └── files │ │ │ ├── arg0 │ │ │ └── arg1 │ └── bash_it │ │ ├── aliases │ │ └── available │ │ │ ├── a.aliases.bash │ │ │ └── b.aliases.bash │ │ ├── plugins │ │ └── available │ │ │ └── c.plugin.bash │ │ └── profiles │ │ ├── test-bad-component.bash_it │ │ └── test-bad-type.bash_it ├── lint-requirements.txt ├── lib │ └── composure.bats ├── plugins │ ├── ruby.plugin.bats │ └── xterm.plugin.bats └── completion │ └── aliases.completion.bats ├── themes ├── 90210 │ └── 90210.theme.bash ├── liquidprompt │ └── .gitignore ├── barbuk │ └── README.rst ├── dos │ └── dos.theme.bash ├── minimal │ └── minimal.theme.bash ├── primer │ └── primer.theme.bash ├── tonotdo │ └── tonotdo.theme.bash ├── oh-my-posh │ └── oh-my-posh.theme.bash ├── candy │ └── candy.theme.bash ├── doubletime_multiline_pyonly │ └── doubletime_multiline_pyonly.theme.bash ├── doubletime_multiline │ └── doubletime_multiline.theme.bash ├── newin │ └── newin.theme.bash ├── roderik │ └── roderik.theme.bash ├── simple │ └── simple.theme.bash ├── pro │ └── pro.theme.bash ├── easy │ └── easy.theme.bash ├── duru │ └── duru.theme.bash ├── tylenol │ └── tylenol.theme.bash ├── envy │ └── envy.theme.bash ├── elixr │ └── elixr.theme.bash ├── radek │ └── radek.theme.bash ├── standard │ └── standard.theme.bash ├── sirup │ └── sirup.theme.bash ├── morris │ └── morris.theme.bash ├── codeword │ └── codeword.theme.bash ├── pete │ └── pete.theme.bash ├── bobby-python │ └── bobby-python.theme.bash ├── n0qorg │ └── n0qorg.theme.bash ├── norbu │ └── norbu.theme.bash ├── wanelo │ └── wanelo.theme.bash ├── robbyrussell │ └── robbyrussell.theme.bash ├── rainbowbrite │ └── rainbowbrite.theme.bash ├── bira │ └── bira.theme.bash ├── axin │ └── axin.theme.bash ├── luan │ └── luan.theme.bash ├── pure │ └── pure.theme.bash ├── brunton │ └── brunton.theme.bash ├── bobby │ └── bobby.theme.bash ├── emperor │ └── emperor.theme.bash ├── bakke │ └── bakke.theme.bash ├── powerline-naked │ └── powerline-naked.base.bash ├── p4helpers.theme.bash ├── clean │ └── clean.theme.bash ├── modern-time │ └── modern-time.theme.bash └── doubletime │ └── doubletime.theme.bash ├── vendor ├── github.com │ ├── erichs │ │ └── composure │ │ │ ├── .gitignore │ │ │ ├── composure.plugin.zsh │ │ │ ├── Makefile │ │ │ ├── .travis.yml │ │ │ ├── test │ │ │ ├── Makefile │ │ │ └── runshellcheck.sh │ │ │ └── LICENSE │ ├── django │ │ └── django │ │ │ └── extras │ │ │ ├── README.TXT │ │ │ └── Makefile │ ├── rcaloras │ │ └── bash-preexec │ │ │ ├── .travis.yml │ │ │ ├── test │ │ │ ├── include-test.bats │ │ │ └── README.md │ │ │ └── LICENSE.md │ ├── gaelicWizard │ │ └── bash-progcomp │ │ │ └── .editorconfig │ ├── rparree │ │ └── jboss-bash-completion │ │ │ ├── LICENSE │ │ │ └── README.md │ ├── vigo │ │ └── apm-bash-completion │ │ │ └── LICENSE │ └── ohmyzsh │ │ └── ohmyzsh │ │ └── LICENSE.txt └── .gitattributes ├── completion └── available │ ├── crystal.completion.bash │ ├── export.completion.bash │ ├── jboss5.completion.bash │ ├── jboss7.completion.bash │ ├── django.completion.bash │ ├── pipx.completion.bash │ ├── apm.completion.bash │ ├── yarn.completion.bash │ ├── nvm.completion.bash │ ├── drush.completion.bash │ ├── virsh.completion.bash │ ├── homesick.completion.bash │ ├── todo.completion.bash │ ├── kind.completion.bash │ ├── rvm.completion.bash │ ├── openshift.completion.bash │ ├── vault.completion.bash │ ├── awless.completion.bash │ ├── conda.completion.bash │ ├── packer.completion.bash │ ├── github-cli.completion.bash │ ├── npm.completion.bash │ ├── consul.completion.bash │ ├── minishift.completion.bash │ ├── pew.completion.bash │ ├── kontena.completion.bash │ ├── helm.completion.bash │ ├── jungle.completion.bash │ ├── kubectl.completion.bash │ ├── defaults.completion.bash │ ├── minikube.completion.bash │ ├── rustup.completion.bash │ ├── cargo.completion.bash │ ├── docker-machine.completion.bash │ ├── gcloud.completion.bash │ ├── awscli.completion.bash │ ├── flutter.completion.bash │ ├── dirs.completion.bash │ ├── pipenv.completion.bash │ ├── travis.completion.bash │ ├── dotnet.completion.bash │ ├── go.completion.bash │ ├── notify-send.completion.bash │ ├── lerna.completion.bash │ ├── laravel.completion.bash │ ├── rake.completion.bash │ ├── dmidecode.completion.bash │ ├── ng.completion.bash │ ├── pip.completion.bash │ ├── pip3.completion.bash │ ├── artisan.completion.bash │ ├── capistrano.completion.bash │ ├── terraform.completion.bash │ ├── test_kitchen.completion.bash │ ├── docker.completion.bash │ ├── makefile.completion.bash │ ├── brew.completion.bash │ ├── svn.completion.bash │ ├── gem.completion.bash │ └── ngrok.completion.bash ├── custom └── example.bash ├── aliases └── available │ ├── ansible.aliases.bash │ ├── hg.aliases.bash │ ├── tmux.aliases.bash │ ├── atom.aliases.bash │ ├── gitsvn.aliases.bash │ ├── bundler.aliases.bash │ ├── todo.aliases.bash │ ├── textmate.aliases.bash │ ├── bolt.aliases.bash │ ├── node.aliases.bash │ ├── fuck.aliases.bash │ ├── puppet.aliases.bash │ ├── docker-compose.aliases.bash │ ├── emacs.aliases.bash │ ├── homebrew-cask.aliases.bash │ ├── svn.aliases.bash │ ├── msys2.aliases.bash │ ├── uuidgen.aliases.bash │ ├── homebrew.aliases.bash │ ├── terragrunt.aliases.bash │ ├── vault.aliases.bash │ ├── editor.aliases.bash │ ├── ag.aliases.bash │ ├── clipboard.aliases.bash │ ├── terraform.aliases.bash │ ├── kubectl.aliases.bash │ ├── rails.aliases.bash │ ├── vagrant.aliases.bash │ ├── vim.aliases.bash │ ├── curl.aliases.bash │ ├── systemd.aliases.bash │ ├── yarn.aliases.bash │ ├── heroku.aliases.bash │ ├── bash-it.aliases.bash │ ├── directory.aliases.bash │ ├── maven.aliases.bash │ ├── homesick.aliases.bash │ ├── apt.aliases.bash │ ├── dnf.aliases.bash │ ├── git-omz.aliases.bash │ ├── jitsu.aliases.bash │ ├── composer.aliases.bash │ └── npm.aliases.bash ├── .readthedocs.yml ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── feature_request.yml └── no-response.yml ├── .git-blame-ignore-revs ├── plugins └── available │ ├── edit-mode-vi.plugin.bash │ ├── hub.plugin.bash │ ├── edit-mode-emacs.plugin.bash │ ├── fasd.plugin.bash │ ├── pipsi.plugin.bash │ ├── direnv.plugin.bash │ ├── chruby.plugin.bash │ ├── tmux.plugin.bash │ ├── todo.plugin.bash │ ├── textmate.plugin.bash │ ├── tmuxinator.plugin.bash │ ├── thefuck.plugin.bash │ ├── chruby-auto.plugin.bash │ ├── rbenv.plugin.bash │ ├── docker-machine.plugin.bash │ ├── nodenv.plugin.bash │ ├── git-subrepo.plugin.bash │ ├── zoxide.plugin.bash │ ├── gradle.plugin.bash │ ├── sdkman.plugin.bash │ ├── history-search.plugin.bash │ ├── man.plugin.bash │ ├── plenv.plugin.bash │ ├── jump.plugin.bash │ ├── alias-completion.plugin.bash │ ├── history-substring-search.plugin.bash │ ├── java.plugin.bash │ ├── basher.plugin.bash │ ├── node.plugin.bash │ ├── boot2docker.plugin.bash │ ├── latex.plugin.bash │ ├── subversion.plugin.bash │ ├── rails.plugin.bash │ ├── hg.plugin.bash │ ├── cmd-returned-notify.plugin.bash │ ├── ruby.plugin.bash │ ├── jenv.plugin.bash │ ├── powerline.plugin.bash │ ├── sudo.plugin.bash │ ├── autojump.plugin.bash │ ├── docker-compose.plugin.bash │ ├── blesh.plugin.bash │ ├── cht-sh.plugin.bash │ ├── rvm.plugin.bash │ ├── ssh.plugin.bash │ ├── less-pretty-cat.plugin.bash │ ├── explain.plugin.bash │ ├── z_autoenv.plugin.bash │ ├── gitstatus.plugin.bash │ ├── python.plugin.bash │ ├── pyenv.plugin.bash │ ├── percol.plugin.bash │ ├── history-eternal.plugin.bash │ ├── url.plugin.bash │ ├── nvm.plugin.bash │ ├── go.plugin.bash │ ├── nginx.plugin.bash │ ├── virtualenv.plugin.bash │ ├── javascript.plugin.bash │ ├── history.plugin.bash │ └── goenv.plugin.bash ├── .gitattributes ├── profiles └── default.bash_it ├── hooks ├── dot-sh.sh ├── dot-bash.sh └── check-clean-files-txt.sh ├── .gitignore ├── .gitmodules ├── clean_files.txt ├── lint_clean_files.sh ├── .editorconfig ├── lib ├── preview.bash ├── completion.bash └── history.bash └── LICENSE /docs/_static/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_templates/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ackrc: -------------------------------------------------------------------------------- 1 | --ignore-dir=enabled/ 2 | -------------------------------------------------------------------------------- /test/fixtures/go/gopath/bin/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/svn/broken/xcrun: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/svn/working/xcrun: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/go/go path/bin/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/go/gopath2/bin/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/plugin/xterm/files/arg0: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/plugin/xterm/files/arg1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/lint-requirements.txt: -------------------------------------------------------------------------------- 1 | pre-commit==2.3.0 2 | -------------------------------------------------------------------------------- /themes/liquidprompt/.gitignore: -------------------------------------------------------------------------------- 1 | liquidprompt 2 | -------------------------------------------------------------------------------- /themes/barbuk/README.rst: -------------------------------------------------------------------------------- 1 | ../../docs/themes-list/barbuk.rst -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/.gitignore: -------------------------------------------------------------------------------- 1 | composure_test/** 2 | -------------------------------------------------------------------------------- /vendor/.gitattributes: -------------------------------------------------------------------------------- 1 | * -whitespace 2 | init.d/*.bash text eol=lf 3 | -------------------------------------------------------------------------------- /docs/themes-list/redline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bash-it/bash-it/HEAD/docs/themes-list/redline.png -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==4.5.0 2 | sphinx-rtd-theme==0.5.0 3 | sphinxemoji==0.1.8 4 | docutils==0.17.1 5 | -------------------------------------------------------------------------------- /test/fixtures/bash_it/aliases/available/a.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | alias test_alias="a" 4 | -------------------------------------------------------------------------------- /test/fixtures/bash_it/aliases/available/b.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | alias test_alias="b" 4 | -------------------------------------------------------------------------------- /test/fixtures/bash_it/plugins/available/c.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | alias test_alias="c" 4 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/composure.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | source ${0:h}/{composure,c_extras}.sh 3 | -------------------------------------------------------------------------------- /vendor/github.com/django/django/extras/README.TXT: -------------------------------------------------------------------------------- 1 | This directory contains extra stuff that can improve your Django experience. 2 | -------------------------------------------------------------------------------- /docs/themes-list/nwinkler_random_colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bash-it/bash-it/HEAD/docs/themes-list/nwinkler_random_colors.png -------------------------------------------------------------------------------- /themes/dos/dos.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | PROMPT="\w>>" 4 | -------------------------------------------------------------------------------- /test/fixtures/svn/broken/svn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Simply return an error code to simulate a broken SVN installation 4 | exit 72 5 | -------------------------------------------------------------------------------- /docs/misc.rst: -------------------------------------------------------------------------------- 1 | .. _misc: 2 | 3 | Misc 4 | ---- 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | help_screens 10 | proxy_support 11 | -------------------------------------------------------------------------------- /completion/available/crystal.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | _log_warning 'Bash completion for "crystal" is now covered by "system".' 4 | _disable-completion "crystal" 5 | -------------------------------------------------------------------------------- /completion/available/export.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | _log_warning 'Bash completion for "export" is now covered by "system".' 4 | _disable-completion "export" 5 | -------------------------------------------------------------------------------- /custom/example.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This is an example file. Don't use this for your custom scripts. Instead, create another file within the 4 | # custom directory. 5 | -------------------------------------------------------------------------------- /aliases/available/ansible.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'ansible abbreviations' 3 | url "https://docs.ansible.com/" 4 | 5 | alias ans=ansible 6 | alias ap=ansible-playbook 7 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | builder: htmldir 5 | configuration: docs/conf.py 6 | 7 | python: 8 | version: 3.7 9 | install: 10 | - requirements: docs/requirements.txt 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Libera chat 4 | url: https://web.libera.chat/?channel=#bash-it 5 | about: You can ask and answer questions here 6 | -------------------------------------------------------------------------------- /vendor/github.com/django/django/extras/Makefile: -------------------------------------------------------------------------------- 1 | all: sdist bdist_wheel 2 | 3 | sdist: 4 | python setup.py sdist 5 | 6 | bdist_wheel: 7 | python setup.py bdist_wheel 8 | 9 | .PHONY : sdist bdist_wheel 10 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TARGET = tests 3 | all: $(TARGET) 4 | 5 | tests: 6 | cd test && make tests 7 | 8 | clean:: 9 | rm -f test/*~ test/t/*~ 10 | rm -rf test/composure_test 11 | -------------------------------------------------------------------------------- /completion/available/jboss5.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "jboss5 completion" 3 | # shellcheck disable=SC1090 4 | source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss5 5 | -------------------------------------------------------------------------------- /completion/available/jboss7.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "jboss7 completion" 3 | # shellcheck disable=SC1090 4 | source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7 5 | -------------------------------------------------------------------------------- /aliases/available/hg.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'mercurial abbreviations' 3 | url "https://www.mercurial-scm.org/" 4 | 5 | alias hs='hg status' 6 | alias hsum='hg summary' 7 | alias hcm='hg commit -m' 8 | -------------------------------------------------------------------------------- /aliases/available/tmux.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Tmux terminal multiplexer' 3 | url "https://github.com/tmux/tmux" 4 | 5 | alias txl='tmux ls' 6 | alias txn='tmux new -s' 7 | alias txa='tmux a -t' 8 | -------------------------------------------------------------------------------- /completion/available/django.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "django completion" 3 | # shellcheck disable=SC1090 4 | source "${BASH_IT}"/vendor/github.com/django/django/extras/django_bash_completion 5 | -------------------------------------------------------------------------------- /completion/available/pipx.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # pipx completion 3 | 4 | if _command_exists register-python-argcomplete && _command_exists pipx; then 5 | eval "$(register-python-argcomplete pipx)" 6 | fi 7 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Ignore shfmt related commits 2 | 003b0ce802c10ab6e161d7ba5a7d9b6722312cc5 3 | 7c2c2a5525557cbfee98e73de921fd7f7e6811a1 4 | d37505b636ca7bc95301d8daaf9c58a3186ce57a 5 | d7695d5456b980190b6d1c4a4715b13d1b63c332 6 | -------------------------------------------------------------------------------- /docs/themes-list/easy.rst: -------------------------------------------------------------------------------- 1 | .. _easy: 2 | 3 | Easy Theme 4 | ========== 5 | 6 | A simple theme 7 | 8 | Examples 9 | -------- 10 | 11 | .. code-block:: bash 12 | 13 | user@hostname ~/.bash_it 14 | [ master ✓ ] ❯ 15 | -------------------------------------------------------------------------------- /plugins/available/edit-mode-vi.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Enable vi editing mode' 4 | url "https://www.gnu.org/software/bash/manual/html_node/Readline-Interaction.html" 5 | 6 | set -o vi 7 | -------------------------------------------------------------------------------- /plugins/available/hub.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load hub, if you are using it' 4 | url "https://github.com/github/hub" 5 | 6 | if _command_exists hub; then 7 | eval "$(hub alias -s)" 8 | fi 9 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | script: make tests 3 | branches: 4 | only: 5 | - testing 6 | - master 7 | before_install: 8 | - sudo apt-get update -qq 9 | - sudo apt-get install -qq ksh zsh 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | *.bash text eol=lf 3 | *.bats text eol=lf 4 | 5 | # Docs allow trailing whitespaces 6 | *.md whitespace=-blank-at-eol 7 | *.rst whitespace=-blank-at-eol 8 | 9 | # Windows files 10 | *.bat text eol=crlf 11 | -------------------------------------------------------------------------------- /plugins/available/edit-mode-emacs.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Enable emacs editing mode' 4 | url "https://www.gnu.org/software/bash/manual/html_node/Readline-Interaction.html" 5 | 6 | set -o emacs 7 | -------------------------------------------------------------------------------- /plugins/available/fasd.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load fasd, if you are using it' 4 | url "https://github.com/clvv/fasd" 5 | 6 | _command_exists fasd || return 7 | 8 | eval "$(fasd --init auto)" 9 | -------------------------------------------------------------------------------- /aliases/available/atom.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Atom.io editor abbreviations' 3 | url "https://atom-editor.cc/" 4 | 5 | alias a='atom' 6 | alias ah='atom .' 7 | alias apmup='apm update --no-confirm' 8 | alias apmi='apm install' 9 | -------------------------------------------------------------------------------- /aliases/available/gitsvn.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'common git-svn abbreviations' 3 | url "https://git-scm.com/docs/git-svn" 4 | 5 | # Aliases 6 | alias gsr='git svn rebase' 7 | alias gsc='git svn dcommit' 8 | alias gsi='git svn info' 9 | -------------------------------------------------------------------------------- /completion/available/apm.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "apm completion" 3 | # shellcheck source-path=SCRIPTDIR/../../vendor/github.com/vigo/apm-bash-completion 4 | source "${BASH_IT?}/vendor/github.com/vigo/apm-bash-completion/apm" 5 | -------------------------------------------------------------------------------- /plugins/available/pipsi.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load pipsi, if you are using it' 4 | url "https://github.com/mitsuhiko/pipsi" 5 | 6 | if [[ -f "$HOME/.local/bin/pipsi" ]]; then 7 | pathmunge ~/.local/bin 8 | fi 9 | -------------------------------------------------------------------------------- /test/fixtures/bash_it/profiles/test-bad-component.bash_it: -------------------------------------------------------------------------------- 1 | # plugins 2 | plugins base 3 | 4 | # completion 5 | completion aliases 6 | completion bash-it 7 | completion system 8 | 9 | # aliases 10 | aliases general 11 | # Bad component 12 | aliases bla 13 | -------------------------------------------------------------------------------- /test/fixtures/bash_it/profiles/test-bad-type.bash_it: -------------------------------------------------------------------------------- 1 | # plugins 2 | plugins base 3 | # Bad type 4 | compleetion aliases 5 | 6 | # completion 7 | completion aliases 8 | completion bash-it 9 | completion system 10 | 11 | # aliases 12 | aliases general 13 | -------------------------------------------------------------------------------- /plugins/available/direnv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load direnv, if you are using it: https://direnv.net/' 4 | url "https://direnv.net/" 5 | 6 | if _command_exists direnv; then 7 | eval "$(direnv hook bash)" 8 | fi 9 | -------------------------------------------------------------------------------- /completion/available/yarn.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "yarn cli completions" 3 | 4 | # shellcheck disable=SC1090 source=../../vendor/github.com/dsifford/yarn-completion/yarn 5 | source "${BASH_IT}/vendor/github.com/dsifford/yarn-completion/yarn" 6 | -------------------------------------------------------------------------------- /completion/available/nvm.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "nvm (Node Version Manager) completion" 3 | 4 | if [[ -n "${NVM_DIR:-}" && -s "${NVM_DIR}/bash_completion" ]]; then 5 | # shellcheck disable=SC1091 6 | source "${NVM_DIR}/bash_completion" 7 | fi 8 | -------------------------------------------------------------------------------- /plugins/available/chruby.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC1091 3 | cite about-plugin 4 | about-plugin 'load chruby (from /usr/local/share/chruby)' 5 | url "https://github.com/postmodern/chruby" 6 | 7 | source /usr/local/share/chruby/chruby.sh 8 | -------------------------------------------------------------------------------- /plugins/available/tmux.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # make sure that tmux is launched in 256 color mode 3 | 4 | cite about-plugin 5 | about-plugin 'make sure that tmux is launched in 256 color mode' 6 | url "https://github.com/tmux/tmux" 7 | 8 | alias tmux="TERM=xterm-256color tmux" 9 | -------------------------------------------------------------------------------- /completion/available/drush.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | _log_warning 'Bash completion for "drush" is now deprecated, as it used code with incompatible license. 3 | Please disable this completion and use the instructions from "drush" developers instead.' 4 | _disable-completion "drush" 5 | -------------------------------------------------------------------------------- /completion/available/virsh.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | _log_warning 'Bash completion for "virsh" is now deprecated, as it used code with incompatible license. 3 | Please disable this completion and use the instructions from "virsh" developers instead.' 4 | _disable-completion "virsh" 5 | -------------------------------------------------------------------------------- /aliases/available/bundler.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'ruby bundler' 3 | url "https://bundler.io/" 4 | 5 | # Bundler Commands 6 | alias be='bundle exec' 7 | alias bi='bundle install' 8 | alias bl='bundle list' 9 | alias bu='bundle update' 10 | alias bp='bundle package' 11 | -------------------------------------------------------------------------------- /plugins/available/todo.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'Todo.txt integration' 3 | url "https://github.com/todotxt/todo.txt-cli" 4 | 5 | # you may override any of the exported variables below in your .bash_profile 6 | : "${TODOTXT_DEFAULT_ACTION:=ls}" 7 | export TODOTXT_DEFAULT_ACTION 8 | -------------------------------------------------------------------------------- /profiles/default.bash_it: -------------------------------------------------------------------------------- 1 | # This is the default profile of Bash-it 2 | 3 | # plugins 4 | plugins base 5 | 6 | # completion 7 | completion aliases 8 | completion bash-it 9 | completion system 10 | 11 | # aliases 12 | aliases general 13 | aliases bash-it 14 | aliases directory 15 | aliases editor 16 | -------------------------------------------------------------------------------- /completion/available/homesick.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | _log_warning 'Bash completion for "homesick" is now deprecated, as it used unlicensed code. 3 | Please disable this completion and use the instructions from "homesick" bash completion developers instead.' 4 | _disable-completion "homesick" 5 | -------------------------------------------------------------------------------- /completion/available/todo.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | _log_warning 'Bash completion for "todo.txt-cli" is now deprecated, as it used code with incompatible license. 3 | Please disable this completion and use the instructions from "todo.txt-cli" developers instead.' 4 | _disable-completion "todo" 5 | -------------------------------------------------------------------------------- /aliases/available/todo.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'todo.txt-cli abbreviations' 3 | url "https://github.com/todotxt/todo.txt-cli" 4 | 5 | alias tls='"${TODO?}" ls' 6 | alias ta='"${TODO?}" a' 7 | alias trm='"${TODO?}" rm' 8 | alias tdo='"${TODO?}" do' 9 | alias tpri='"${TODO?}" pri' 10 | -------------------------------------------------------------------------------- /plugins/available/textmate.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'set textmate as a default editor' 4 | url "https://macromates.com/" 5 | 6 | if _command_exists mate; then 7 | EDITOR="$(type -p mate) -w" 8 | GIT_EDITOR="$EDITOR" 9 | export EDITOR GIT_EDITOR 10 | fi 11 | -------------------------------------------------------------------------------- /test/fixtures/svn/working/svn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # If the info command is called 4 | # AND the parent folder contains the .svn folder 5 | # THEN return the current path, similar to what `svn info` does 6 | if [[ "$1" == "info" ]] && [[ -d "../.svn" ]]; then 7 | echo "$PWD" 8 | fi 9 | 10 | exit 0 11 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/test/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TARGET = tests 3 | 4 | all: $(TARGET) 5 | 6 | runtests: 7 | ./runtests.sh 8 | 9 | runshellcheck: 10 | ./runshellcheck.sh 11 | 12 | tests: 13 | ./wvtestrun $(MAKE) runshellcheck 14 | 15 | clean:: 16 | rm -f *~ t/*~ 17 | rm -rf composure_test 18 | 19 | -------------------------------------------------------------------------------- /completion/available/kind.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure kind is installed 4 | _bash-it-completion-helper-necessary kind || return 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient kind || return 8 | 9 | eval "$(kind completion bash)" 10 | -------------------------------------------------------------------------------- /plugins/available/tmuxinator.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'sources tmuxinator script if available' 4 | url "https://github.com/tmuxinator/tmuxinator" 5 | 6 | # shellcheck disable=SC1091 7 | [[ -s "$HOME/.tmuxinator/scripts/tmuxinator" ]] && . "$HOME/.tmuxinator/scripts/tmuxinator" 8 | -------------------------------------------------------------------------------- /plugins/available/thefuck.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Initialization for fuck' 4 | url "https://github.com/nvbn/thefuck" 5 | 6 | # https://github.com/nvbn/thefuck 7 | 8 | if _command_exists thefuck; then 9 | # shellcheck disable=SC2046 10 | eval $(thefuck --alias) 11 | fi 12 | -------------------------------------------------------------------------------- /completion/available/rvm.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "Bash completion support for RVM." 3 | # Source: https://rvm.io/workflow/completion 4 | 5 | if [[ -n "${rvm_path:-}" && -s "${rvm_path}/scripts/completion" ]]; then 6 | # shellcheck disable=SC1091 7 | source "${rvm_path}/scripts/completion" 8 | fi 9 | -------------------------------------------------------------------------------- /plugins/available/chruby-auto.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC1091 3 | cite about-plugin 4 | about-plugin 'load chruby + auto-switching (from /usr/local/share/chruby)' 5 | url "https://github.com/postmodern/chruby" 6 | 7 | source /usr/local/share/chruby/chruby.sh 8 | source /usr/local/share/chruby/auto.sh 9 | -------------------------------------------------------------------------------- /plugins/available/rbenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load rbenv, if you are using it' 4 | url "https://github.com/rbenv/rbenv" 5 | 6 | export RBENV_ROOT="$HOME/.rbenv" 7 | pathmunge "$RBENV_ROOT/bin" 8 | 9 | if _command_exists rbenv; then 10 | eval "$(rbenv init - bash)" 11 | fi 12 | -------------------------------------------------------------------------------- /aliases/available/textmate.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'textmate abbreviations' 3 | url "https://macromates.com/" 4 | 5 | case $OSTYPE in 6 | darwin*) 7 | # Textmate 8 | alias e='mate . &' 9 | alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &' 10 | ;; 11 | esac 12 | -------------------------------------------------------------------------------- /plugins/available/docker-machine.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Helpers to get Docker setup correctly for docker-machine' 4 | url "https://github.com/docker/machine" 5 | _log_warning '"docker-machine" is now deprecated, and as such the plugin for it is also deprecated. 6 | Please disable this plugin.' 7 | -------------------------------------------------------------------------------- /plugins/available/nodenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load nodenv, if you are using it' 4 | url "https://github.com/nodenv/nodenv" 5 | 6 | export NODENV_ROOT="$HOME/.nodenv" 7 | pathmunge "$NODENV_ROOT/bin" 8 | 9 | if _command_exists nodenv; then 10 | eval "$(nodenv init - bash)" 11 | fi 12 | -------------------------------------------------------------------------------- /aliases/available/bolt.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'puppet bolt aliases' 3 | url "https://www.puppet.com/docs/bolt/" 4 | 5 | # Aliases 6 | alias bolt='bolt command run --tty --no-host-key-check' 7 | alias boltas='bolt -p -u' 8 | alias sudobolt='bolt --run-as root --sudo-password' 9 | alias sudoboltas='sudobolt -p -u' 10 | -------------------------------------------------------------------------------- /plugins/available/git-subrepo.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'load git-subrepo if you are using it, and initialize completions' 3 | url "https://github.com/ingydotnet/git-subrepo" 4 | 5 | if [[ -s "${GIT_SUBREPO_ROOT:=$HOME/.git-subrepo}/init" ]]; then 6 | # shellcheck disable=SC1091 7 | source "$GIT_SUBREPO_ROOT/init" 8 | fi 9 | -------------------------------------------------------------------------------- /completion/available/openshift.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure oc is installed 4 | _bash-it-completion-helper-necessary oc || return 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient oc || return 8 | 9 | # shellcheck disable=SC1090 10 | source <(oc completion bash) 11 | -------------------------------------------------------------------------------- /docs/commands/index.rst: -------------------------------------------------------------------------------- 1 | .. _commands: 2 | 3 | Bash-it Commands 4 | ================ 5 | 6 | **Bash-it** boasts a wide range of available commands. 7 | You should be familiar with them in order to fully utilize Bash-it. 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | update 13 | search 14 | reload 15 | doctor 16 | profile 17 | -------------------------------------------------------------------------------- /aliases/available/node.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'the Node.js environment aliases' 3 | url "https://nodejs.org/" 4 | 5 | # alias to setup nodejs development environment 6 | alias node-dev='export NODE_ENV=development' 7 | 8 | # alias to setup nodejs production environment 9 | alias node-prod='export NODE_ENV=production' 10 | -------------------------------------------------------------------------------- /completion/available/vault.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "vault completion" 3 | 4 | # Make sure vault is installed 5 | _bash-it-completion-helper-necessary vault || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient vault || return 9 | 10 | complete -C vault vault 11 | -------------------------------------------------------------------------------- /aliases/available/fuck.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'fuck/please to retry last command with sudo' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | # Play nicely with 'thefuck' plugin 6 | if ! _command_exists fuck; then 7 | alias fuck='sudo $(fc -ln -1)' 8 | fi 9 | alias please=fuck 10 | alias plz=please 11 | alias fucking=sudo 12 | -------------------------------------------------------------------------------- /aliases/available/puppet.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'puppet aliases' 3 | url "https://www.puppet.com/docs/puppet/" 4 | 5 | # Aliases 6 | alias pupval="puppet parser validate *.pp" 7 | alias puplint="puppet-lint *.pp" 8 | alias pupagt="puppet agent -t" 9 | alias pupagtd="puppet agent -t --debug" 10 | alias pupapp="puppet apply" 11 | -------------------------------------------------------------------------------- /completion/available/awless.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure awless is installed 4 | _bash-it-completion-helper-necessary awless || return 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient awless || return 8 | 9 | # shellcheck disable=SC1090 10 | source <(awless completion bash) 11 | -------------------------------------------------------------------------------- /completion/available/conda.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "conda completion" 3 | 4 | if _command_exists conda; then 5 | if _command_exists register-python-argcomplete; then 6 | eval "$(register-python-argcomplete conda)" 7 | else 8 | _log_warning "Argcomplete not found. Please run 'conda install argcomplete'" 9 | fi 10 | fi 11 | -------------------------------------------------------------------------------- /completion/available/packer.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "packer completion" 3 | 4 | # Make sure packer is installed 5 | _bash-it-completion-helper-necessary packer || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient packer || return 9 | 10 | complete -C packer packer 11 | -------------------------------------------------------------------------------- /completion/available/github-cli.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "GitHub CLI completion" 3 | 4 | # Make sure gh is installed 5 | _bash-it-completion-helper-necessary gh || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient gh || return 9 | 10 | eval "$(gh completion --shell=bash)" 11 | -------------------------------------------------------------------------------- /completion/available/npm.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "npm (Node Package Manager) completion" 3 | 4 | # Make sure npm is installed 5 | _bash-it-completion-helper-necessary npm || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient npm || return 9 | 10 | eval "$(npm completion)" 11 | -------------------------------------------------------------------------------- /docs/themes-list/powerline-naked.rst: -------------------------------------------------------------------------------- 1 | .. _powerline_naked: 2 | 3 | Powerline Naked Theme 4 | ===================== 5 | 6 | A colorful theme, where shows a lot information about your shell session. 7 | The naked powerline theme provides a cleaner shell with less background colors. 8 | 9 | See :ref:`powerline_base` for general information about the powerline theme. 10 | -------------------------------------------------------------------------------- /completion/available/consul.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "Hashicorp consul completion" 3 | 4 | # Make sure consul is installed 5 | _bash-it-completion-helper-necessary consul || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient consul || return 9 | 10 | complete -C consul consul 11 | -------------------------------------------------------------------------------- /completion/available/minishift.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure minishift is installed 4 | _bash-it-completion-helper-necessary minishift || return 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient minishift || return 8 | 9 | # shellcheck disable=SC1090 10 | source <(minishift completion bash) 11 | -------------------------------------------------------------------------------- /completion/available/pew.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC1090 3 | 4 | # Make sure pew is installed 5 | _bash-it-completion-helper-necessary pew || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient pew || return 9 | 10 | # shellcheck disable=SC1090 11 | source "$(pew shell_config)" 12 | -------------------------------------------------------------------------------- /completion/available/kontena.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure kontena is installed 4 | _bash-it-completion-helper-necessary kontena || return 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient kontena || return 8 | 9 | # shellcheck disable=SC1090 10 | source "$(kontena whoami --bash-completion-path)" 11 | -------------------------------------------------------------------------------- /plugins/available/zoxide.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'zoxide is a smarter cd command for your shell.' 4 | url "https://github.com/ajeetdsouza/zoxide" 5 | 6 | if _command_exists zoxide; then 7 | eval "$(zoxide init bash)" 8 | else 9 | _log_error 'zoxide not found, please install it from https://github.com/ajeetdsouza/zoxide' 10 | fi 11 | -------------------------------------------------------------------------------- /completion/available/helm.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "helm (Kubernetes Package Manager) completion" 3 | 4 | # Make sure helm is installed 5 | _bash-it-completion-helper-necessary helm || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient helm || return 9 | 10 | eval "$(helm completion bash)" 11 | -------------------------------------------------------------------------------- /test/lib/composure.bats: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bats 2 | 3 | load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash" 4 | 5 | function local_setup_file() { 6 | true 7 | # don't load any libraries as the tests here test the *whole* kit 8 | } 9 | 10 | @test "lib composure: _composure_keywords()" { 11 | run _composure_keywords 12 | assert_output "about author example group param version" 13 | } 14 | -------------------------------------------------------------------------------- /completion/available/jungle.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "jungle(AWS cli tool) completion" 3 | 4 | # Make sure jungle is installed 5 | _bash-it-completion-helper-necessary jungle || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient jungle || return 9 | 10 | eval "$(_JUNGLE_COMPLETE=source jungle)" 11 | -------------------------------------------------------------------------------- /completion/available/kubectl.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "kubectl (Kubernetes CLI) completion" 3 | 4 | # Make sure kubectl is installed 5 | _bash-it-completion-helper-necessary kubectl || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient kubectl || return 9 | 10 | eval "$(kubectl completion bash)" 11 | -------------------------------------------------------------------------------- /completion/available/defaults.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC1090 3 | 4 | if [[ -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash" ]]; then 5 | # shellcheck source-path=SCRIPTDIR/../../vendor/github.com/gaelicWizard/bash-progcomp 6 | source "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash" 7 | fi 8 | -------------------------------------------------------------------------------- /completion/available/minikube.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "minikube (Local Kubernetes) completion" 3 | 4 | # Make sure minikube is installed 5 | _bash-it-completion-helper-necessary minikube || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient minikube || return 9 | 10 | eval "$(minikube completion bash)" 11 | -------------------------------------------------------------------------------- /completion/available/rustup.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "rustup (Rust toolchain installer) completion" 3 | 4 | # Make sure rustup is installed 5 | _bash-it-completion-helper-necessary rustup || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient rustup || return 9 | 10 | eval "$(rustup completions bash)" 11 | -------------------------------------------------------------------------------- /plugins/available/gradle.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Add a gw command to use gradle wrapper if present, else use system gradle' 4 | url "https://gradle.org/" 5 | 6 | function gw() { 7 | local file="gradlew" 8 | local result 9 | 10 | result="$(_bash-it-find-in-ancestor "${file}")" 11 | 12 | # Call gradle 13 | "${result:-gradle}" "$@" 14 | } 15 | -------------------------------------------------------------------------------- /completion/available/cargo.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "cargo (Rust package manager) completion" 3 | 4 | # Make sure cargo is installed 5 | _bash-it-completion-helper-necessary rustup cargo || return 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient cargo || return 9 | 10 | eval "$(rustup completions bash cargo)" 11 | -------------------------------------------------------------------------------- /completion/available/docker-machine.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "docker-machine - deprecated tool for provisioning Docker hosts (DEPRECATED)" 5 | group "docker" 6 | url "https://github.com/docker/machine" 7 | 8 | _log_warning '"docker-machine" is now deprecated, and as such the bash completion for it is also deprecated. 9 | Please disable this completion.' 10 | -------------------------------------------------------------------------------- /plugins/available/sdkman.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Load Software Development Kit Manager' 4 | url "https://sdkman.io/" 5 | 6 | # Use $SDKMAN_DIR if defined, 7 | # otherwise default to ~/.sdkman 8 | export SDKMAN_DIR=${SDKMAN_DIR:-$HOME/.sdkman} 9 | 10 | # shellcheck disable=SC1091 11 | [[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh" 12 | -------------------------------------------------------------------------------- /docs/themes-list/powerline.rst: -------------------------------------------------------------------------------- 1 | .. _powerline: 2 | 3 | Powerline Theme 4 | =============== 5 | 6 | A colorful theme, where shows a lot information about your shell session. 7 | 8 | See :ref:`powerline_base` for general information about the powerline theme. 9 | 10 | Soft Separators 11 | ^^^^^^^^^^^^^^^ 12 | 13 | Adjacent segments having the same background color will use a less-pronouced (i.e. soft) separator between them. 14 | -------------------------------------------------------------------------------- /plugins/available/history-search.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'search history using the prefix already entered' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | # enter a few characters and press UpArrow/DownArrow 6 | # to search backwards/forwards through the history 7 | if [[ ${SHELLOPTS} =~ (vi|emacs) ]]; then 8 | bind '"\e[A":history-search-backward' 9 | bind '"\e[B":history-search-forward' 10 | fi 11 | -------------------------------------------------------------------------------- /aliases/available/docker-compose.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'docker-compose abbreviations' 3 | url "https://docs.docker.com/compose/" 4 | 5 | alias dco="docker-compose" 6 | 7 | # Defined in the `docker-compose` plugin, please check there for details. 8 | alias dcofresh="docker-compose-fresh" 9 | alias dcol="docker-compose logs -f --tail 100" 10 | alias dcou="docker-compose up" 11 | alias dcouns="dcou --no-start" 12 | -------------------------------------------------------------------------------- /plugins/available/man.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'colorize man pages for better readability' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | alias man="\ 6 | LESS_TERMCAP_mb=$'\e[1;32m' \ 7 | LESS_TERMCAP_md=$'\e[1;32m' LESS_TERMCAP_me=$'\e[0m' \ 8 | LESS_TERMCAP_se=$'\e[0m' LESS_TERMCAP_so=$'\e[01;33m' \ 9 | LESS_TERMCAP_ue=$'\e[0m' LESS_TERMCAP_us=$'\e[1;4;31m' \ 10 | LESS=--RAW-CONTROL-CHARS \man" 11 | -------------------------------------------------------------------------------- /themes/minimal/minimal.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX="${cyan?}(${green?}" 5 | SCM_THEME_PROMPT_SUFFIX="${cyan?})" 6 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 7 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 8 | 9 | prompt() { 10 | PS1="$(scm_prompt_info)${reset_color?} ${cyan?}\W${reset_color?} " 11 | } 12 | 13 | safe_append_prompt_command prompt 14 | -------------------------------------------------------------------------------- /aliases/available/emacs.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'emacs editor' 3 | url "https://www.gnu.org/software/emacs/" 4 | 5 | case $OSTYPE in 6 | linux*) 7 | alias em='emacs' 8 | alias en='emacs -nw' 9 | alias e='emacsclient -n' 10 | alias et='emacsclient -t' 11 | alias ed='emacs --daemon' 12 | alias E='SUDO_EDITOR=emacsclient sudo -e' 13 | ;; 14 | darwin*) 15 | alias em='open -a emacs' 16 | ;; 17 | esac 18 | -------------------------------------------------------------------------------- /aliases/available/homebrew-cask.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Some aliases for Homebrew Cask' 3 | url "https://github.com/Homebrew/homebrew-cask" 4 | 5 | alias bcin='brew cask install' 6 | alias bcrm='brew cask uninstall' 7 | alias bczp='brew cask zap' 8 | alias bccl='brew cask cleanup' 9 | alias bcls='brew cask list' 10 | alias bcinf='brew cask info' 11 | alias bcdr='brew cask doctor' 12 | alias bced='brew cask edit' 13 | -------------------------------------------------------------------------------- /aliases/available/svn.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'common svn abbreviations' 3 | url "https://subversion.apache.org/" 4 | 5 | # Aliases 6 | alias svs='svn status' 7 | alias sa='svn add' 8 | alias sci='svn ci -m' 9 | alias sco='svn co' 10 | alias sup='svn up' 11 | alias scu='svn cleanup' 12 | alias sli='svn list' 13 | alias sdel='svn delete' 14 | alias sdif='svn diff' 15 | alias slog='svn log' 16 | alias smv='svn move' 17 | -------------------------------------------------------------------------------- /docs/uninstalling.rst: -------------------------------------------------------------------------------- 1 | .. _uninstalling: 2 | 3 | Uninstalling 4 | ------------ 5 | 6 | To uninstall Bash-it, run the ``uninstall.sh`` script found in the ``$BASH_IT`` directory: 7 | 8 | .. code-block:: 9 | 10 | cd $BASH_IT 11 | ./uninstall.sh 12 | 13 | This will restore your previous Bash profile. 14 | After the uninstall script finishes, remove the Bash-it directory from your machine (\ ``rm -rf $BASH_IT``\ ) and start a new shell. 15 | -------------------------------------------------------------------------------- /plugins/available/plenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # plugin for plenv 4 | 5 | cite about-plugin 6 | about-plugin 'plenv plugin for Perl' 7 | url "https://github.com/tokuhirom/plenv" 8 | 9 | if [[ -d "${HOME}/.plenv/bin" ]]; then 10 | # load plenv bin dir into path if it exists 11 | pathmunge "${HOME}/.plenv/bin" 12 | fi 13 | 14 | if _command_exists plenv; then 15 | # init plenv 16 | eval "$(plenv init - bash)" 17 | fi 18 | -------------------------------------------------------------------------------- /plugins/available/jump.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2016 3 | cite about-plugin 4 | about-plugin 'initialize jump (see https://github.com/gsamokovarov/jump). Add `export JUMP_OPTS=("--bind=z")` to change keybinding' 5 | url "https://github.com/gsamokovarov/jump" 6 | 7 | function __init_jump() { 8 | if _command_exists jump; then 9 | eval "$(jump shell bash "${JUMP_OPTS[@]}")" 10 | fi 11 | } 12 | 13 | __init_jump 14 | -------------------------------------------------------------------------------- /plugins/available/alias-completion.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-plugin" 4 | about-plugin "Compatibility stub - redirects to aliases completion (DEPRECATED)" 5 | group "bash-it" 6 | url "https://github.com/Bash-it/bash-it" 7 | 8 | # stub for renamed file 9 | 10 | _enable-completion aliases && _disable-plugin alias-completion 11 | # shellcheck disable=SC1091 12 | source "${BASH_IT?}/completion/available/aliases.completion.bash" 13 | -------------------------------------------------------------------------------- /aliases/available/msys2.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'MSYS2 aliases' 3 | url "https://www.msys2.org/" 4 | 5 | LS_COMMON="-hG" 6 | LS_COMMON="$LS_COMMON --color=auto" 7 | LS_COMMON="$LS_COMMON -I NTUSER.DAT\* -I ntuser.dat\*" 8 | 9 | # alias 10 | # setup the main ls alias if we've established common args 11 | alias ls='command ls ${LS_COMMON:-}' 12 | alias ll="ls -l" 13 | alias la="ls -a" 14 | alias lal="ll -a" 15 | alias lf="ls -F" 16 | -------------------------------------------------------------------------------- /aliases/available/uuidgen.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'uuidgen aliases' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | if _command_exists uuid; then # Linux 6 | alias uuidu="uuid | tr '[:lower:]' '[:upper:]'" 7 | alias uuidl=uuid 8 | elif _command_exists uuidgen; then # macOS/BSD 9 | alias uuidu="uuidgen" 10 | alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING 11 | alias uuidl=uuid 12 | fi 13 | -------------------------------------------------------------------------------- /completion/available/gcloud.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "Google Cloud SDK completion" 3 | 4 | if _command_exists gcloud; then 5 | # get install path 6 | GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")} 7 | 8 | # source all the bash completion file that are available 9 | for i in "${GOOGLE_SDK_ROOT}"/*.bash.inc; do 10 | # shellcheck disable=SC1090 11 | source "$i" 12 | done 13 | fi 14 | -------------------------------------------------------------------------------- /plugins/available/history-substring-search.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'search history using the substring already entered' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | # enter a few characters and press UpArrow/DownArrow 6 | # to search backwards/forwards through the history 7 | if [[ ${SHELLOPTS} =~ (vi|emacs) ]]; then 8 | bind '"\e[A":history-substring-search-backward' 9 | bind '"\e[B":history-substring-search-forward' 10 | fi 11 | -------------------------------------------------------------------------------- /plugins/available/java.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'Java and JAR helper functions' 3 | url "https://www.java.com/" 4 | 5 | function jar_manifest { 6 | about "extracts the specified JAR file's MANIFEST file and prints it to stdout" 7 | group 'java' 8 | param '1: JAR file to extract the MANIFEST from' 9 | example 'jar_manifest lib/foo.jar' 10 | 11 | unzip -c "${1:?${FUNCNAME[0]}: JAR file must be specified}" META-INF/MANIFEST.MF 12 | } 13 | -------------------------------------------------------------------------------- /completion/available/awscli.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "aws - Amazon Web Services command-line interface" 5 | group "cloud" 6 | url "https://aws.amazon.com/cli/" 7 | 8 | # Make sure aws is installed 9 | _bash-it-completion-helper-necessary aws aws_completer || return 10 | 11 | # Don't handle completion if it's already managed 12 | _bash-it-completion-helper-sufficient aws || return 13 | 14 | complete -C aws_completer aws 15 | -------------------------------------------------------------------------------- /plugins/available/basher.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'initializes basher, the shell package manager' 4 | url "https://github.com/basherpm/basher" 5 | 6 | # https://github.com/basherpm/basher 7 | 8 | if ! _command_exists basher; then 9 | if [[ -x "$HOME/.basher/bin/basher" ]]; then 10 | pathmunge "$HOME/.basher/bin" 11 | else 12 | _log_warning 'basher not found' 13 | return 0 14 | fi 15 | fi 16 | 17 | eval "$(basher init - bash)" 18 | -------------------------------------------------------------------------------- /aliases/available/homebrew.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Some aliases for Homebrew' 3 | url "https://brew.sh/" 4 | 5 | if _command_exists brew; then 6 | alias bed='brew edit' 7 | alias bls='brew list' 8 | alias bsr='brew search' 9 | alias bdr='brew doctor' 10 | alias bin='brew install' 11 | alias bcl='brew cleanup' 12 | alias brm='brew uninstall' 13 | alias bout='brew outdated' 14 | alias binf='brew info' 15 | alias bup='brew update && brew upgrade' 16 | fi 17 | -------------------------------------------------------------------------------- /aliases/available/terragrunt.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Aliases for Terraform and Terragrunt' 3 | url "https://terragrunt.gruntwork.io/" 4 | 5 | alias tg='terragrunt' 6 | alias tgv='terragrunt validate' 7 | alias tgp='terragrunt plan' 8 | alias tga='terragrunt apply' 9 | alias tgd='terragrunt destroy' 10 | 11 | alias tgva='terragrunt validate-all' 12 | alias tgpa='terragrunt plan-all' 13 | alias tgaa='terragrunt apply-all' 14 | alias tgda='terragrunt destroy-all' 15 | -------------------------------------------------------------------------------- /docs/themes-list/bira.rst: -------------------------------------------------------------------------------- 1 | .. _bira: 2 | 3 | Bira Theme 4 | ========== 5 | 6 | This is a port of Oh My Zsh's `'Bira' `_ theme. It looks the same as the original, except for the following changes: 7 | 8 | 9 | * Exit code of last command is not shown 10 | * More informative git prompt (if you want to keep it minimal, please read: :ref:`git_prompt`) 11 | * Position and colour of virtualenv prompt 12 | * No ruby version prompt 13 | -------------------------------------------------------------------------------- /aliases/available/vault.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'vault aliases' 3 | url "https://www.vaultproject.io/" 4 | 5 | # Aliases 6 | alias vad="vault delete" 7 | alias val="vault list" 8 | alias var="vault read" 9 | alias varn="vault renew" 10 | alias varv="vault revoke" 11 | alias vasrv="vault server" 12 | alias vas="vault status" 13 | alias vav="vault version" 14 | alias vaw="vault write" 15 | alias vag="vault login -method=github" 16 | alias varv="vault read -field=value" 17 | -------------------------------------------------------------------------------- /completion/available/flutter.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "flutter - Google's UI toolkit for building cross-platform applications" 5 | group "mobile" 6 | url "https://flutter.dev" 7 | 8 | # Make sure flutter is installed 9 | _bash-it-completion-helper-necessary flutter || return 10 | 11 | # Don't handle completion if it's already managed 12 | _bash-it-completion-helper-sufficient flutter || return 13 | 14 | eval "$(flutter bash-completion)" 15 | -------------------------------------------------------------------------------- /hooks/dot-sh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exit_code=0 4 | for file in "$@"; do 5 | # Confirm file is executable 6 | # 7 | if [[ ! -x "${file}" ]]; then 8 | echo "Bash file \`${file}\` is not executable" 9 | exit_code=1 10 | fi 11 | 12 | # Confirm expected #! header 13 | # 14 | LINE1="$(head -n 1 "${file}")" 15 | if [[ "${LINE1}" != "#!/usr/bin/env bash" ]]; then 16 | echo "Bash file \`${file}\` has bad/missing #! header" 17 | exit_code=1 18 | fi 19 | done 20 | 21 | exit "${exit_code:-0}" 22 | -------------------------------------------------------------------------------- /plugins/available/node.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Node.js helper functions' 4 | url "https://nodejs.org/" 5 | 6 | # Check that we have npm 7 | _command_exists npm || return 8 | 9 | # Ensure local modules are preferred in PATH 10 | pathmunge "./node_modules/.bin" "after" 11 | 12 | # If not using nodenv, ensure global modules are in PATH 13 | if [[ ! "$(type -p npm)" == *"nodenv/shims"* ]]; then 14 | pathmunge "$(npm config get prefix)/bin" "after" 15 | fi 16 | -------------------------------------------------------------------------------- /completion/available/dirs.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "Bash completion support for the 'dirs' plugin (commands G, R)." 3 | 4 | function _dirs-complete() { 5 | # parse all defined shortcuts ${BASH_IT_DIRS_BKS} 6 | if [[ -s "${BASH_IT_DIRS_BKS:-/dev/null}" ]]; then 7 | IFS=$'\n' read -d '' -ra COMPREPLY < <(grep -v '^#' "${BASH_IT_DIRS_BKS?}" | sed -e 's/\(.*\)=.*/\1/') 8 | fi 9 | 10 | return 0 11 | } 12 | 13 | complete -o default -o nospace -F _dirs-complete -X '!&*' G R 14 | -------------------------------------------------------------------------------- /themes/primer/primer.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # based of the candy theme, but minimized by odbol 5 | function prompt_command() { 6 | PS1="$(clock_prompt) ${reset_color?}${white?}\w${reset_color?}$(scm_prompt_info)${blue?} →${bold_blue?} ${reset_color?} " 7 | } 8 | 9 | THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${blue?}"} 10 | THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"} 11 | 12 | safe_append_prompt_command prompt_command 13 | -------------------------------------------------------------------------------- /completion/available/pipenv.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "pipenv - Python development workflow tool combining pip and virtualenv" 5 | group "python" 6 | url "https://pipenv.pypa.io/" 7 | 8 | # Make sure pipenv is installed 9 | _bash-it-completion-helper-necessary pipenv || return 10 | 11 | # Don't handle completion if it's already managed 12 | _bash-it-completion-helper-sufficient pipenv || return 13 | 14 | eval "$(_PIPENV_COMPLETE=bash_source pipenv)" 15 | -------------------------------------------------------------------------------- /aliases/available/editor.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'shortcuts for editing' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}' 6 | alias e='edit' 7 | 8 | # sudo editors 9 | alias svim='sudo ${VISUAL:-vim}' 10 | alias snano='sudo ${ALTERNATE_EDITOR:-nano}' 11 | alias sedit='sudo ${EDITOR:-${ALTERNATE_EDITOR:-nano}}' 12 | 13 | # Shortcuts to edit startup files 14 | alias vbrc='${VISUAL:-vim} ~/.bashrc' 15 | alias vbpf='${VISUAL:-vim} ~/.bash_profile' 16 | -------------------------------------------------------------------------------- /docs/themes-list/powerline-plain.rst: -------------------------------------------------------------------------------- 1 | .. _powerline_plain: 2 | 3 | Powerline Plain Theme 4 | ===================== 5 | 6 | A colorful theme, where shows a lot information about your shell session. 7 | The plain powerline theme provides a simpler shell with less information. 8 | 9 | See :ref:`powerline_base` for general information about the powerline theme. 10 | 11 | Soft Separators 12 | ^^^^^^^^^^^^^^^ 13 | 14 | Adjacent segments having the same background color will use a less-pronouced (i.e. soft) separator between them. 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .atom-build.json 2 | */enabled/* 3 | .DS_Store 4 | custom/* 5 | !custom/example.bash 6 | .rvmrc 7 | aliases/custom.aliases.bash 8 | completion/custom.completion.bash 9 | lib/custom.bash 10 | plugins/custom.plugins.bash 11 | *.swp 12 | .*.un~ 13 | bats 14 | .idea 15 | *.sublime-workspace 16 | *.sublime-project 17 | enabled/* 18 | /enabled 19 | tmp/ 20 | 21 | # Do not save profiles 22 | profiles/* 23 | # apart from the default one 24 | !profiles/default.bash_it 25 | 26 | /vendor/github.com/nojhan/liquidprompt 27 | .trunk/ 28 | -------------------------------------------------------------------------------- /themes/tonotdo/tonotdo.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX=" ${purple?}" 5 | SCM_THEME_PROMPT_SUFFIX=" ${normal?}" 6 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 7 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 8 | SCM_GIT_SHOW_DETAILS="false" 9 | 10 | function prompt_command() { 11 | PS1="${yellow?}\u${normal?}${cyan?}@\h${normal?}${purple?} ${normal?}${green?}\w${normal?}$(scm_prompt_info)> " 12 | } 13 | 14 | safe_append_prompt_command prompt_command 15 | -------------------------------------------------------------------------------- /themes/oh-my-posh/oh-my-posh.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | if _command_exists oh-my-posh; then 5 | export POSH_THEME=${POSH_THEME:-https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json} 6 | eval "$(oh-my-posh init bash --config "${POSH_THEME}")" 7 | else 8 | _log_warning "The oh-my-posh binary was not found on your PATH. Falling back to your existing PS1, please see the docs for more info." 9 | fi 10 | -------------------------------------------------------------------------------- /completion/available/travis.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC1090 3 | 4 | # Make sure travis is installed 5 | _bash-it-completion-helper-necessary travis || : 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient travis || return 9 | 10 | if [[ -s "${_travis_bash_completion_script:=${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh}" ]]; then 11 | # shellcheck disable=SC1090 12 | source "${_travis_bash_completion_script}" 13 | fi 14 | unset "${!_travis_bash_completion@}" 15 | -------------------------------------------------------------------------------- /plugins/available/boot2docker.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Helpers to get Docker setup correctly for boot2docker' 4 | url "https://github.com/boot2docker/boot2docker" 5 | 6 | # Note, this might need to be different if you have an older version 7 | # of boot2docker, or its configured for a different IP 8 | if [[ "$OSTYPE" == 'darwin'* ]]; then 9 | export DOCKER_HOST="tcp://192.168.59.103:2376" 10 | export DOCKER_CERT_PATH="${HOME}/.boot2docker/certs/boot2docker-vm" 11 | export DOCKER_TLS_VERIFY=1 12 | fi 13 | -------------------------------------------------------------------------------- /aliases/available/ag.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'the silver searcher (ag) aliases' 3 | url "https://geoff.greer.fm/ag/" 4 | 5 | ## Summary for args to less: 6 | # less(1) 7 | # -M (-M or --LONG-PROMPT) Prompt very verbosely 8 | # -I (-I or --IGNORE-CASE) Searches with '/' ignore case 9 | # -R (-R or --RAW-CONTROL-CHARS) For handling ANSI colors 10 | # -F (-F or --quit-if-one-screen) Auto exit if <1 screen 11 | # -X (-X or --no-init) Disable termcap init & deinit 12 | 13 | alias ag='ag --smart-case --pager="less -MIRFX"' 14 | -------------------------------------------------------------------------------- /docs/commands/doctor.rst: -------------------------------------------------------------------------------- 1 | .. _doctor: 2 | 3 | Bash-it doctor 4 | ^^^^^^^^^^^^^^ 5 | 6 | If you encounter problems with any part of Bash-it, run the following command: 7 | 8 | .. code-block:: bash 9 | 10 | bash-it doctor 11 | 12 | This will reload your bash profile and print out logs of various parts in Bash-it. 13 | Note that this command at default will print all logs, including debug logs. 14 | You can call it like this: 15 | 16 | .. code-block:: bash 17 | 18 | bash-it doctor [errors/warnings/all] 19 | 20 | In order to get wanted verbosity. 21 | -------------------------------------------------------------------------------- /docs/help_screens.rst: -------------------------------------------------------------------------------- 1 | .. _help_screens: 2 | 3 | Help Screens 4 | ^^^^^^^^^^^^ 5 | 6 | .. code-block:: bash 7 | 8 | bash-it show aliases # shows installed and available aliases 9 | bash-it show completions # shows installed and available completions 10 | bash-it show plugins # shows installed and available plugins 11 | bash-it help aliases # shows help for installed aliases 12 | bash-it help completions # shows help for installed completions 13 | bash-it help plugins # shows help for installed plugins 14 | -------------------------------------------------------------------------------- /vendor/github.com/rcaloras/bash-preexec/.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | 3 | before_install: 4 | # To install bats and test our shell/bash functions 5 | - git clone -b "v1.1.0" "https://github.com/bats-core/bats-core.git" 6 | - sudo ./bats-core/install.sh /usr/local 7 | - rm -rf ./bats-core 8 | - sudo apt-get install -qq zsh 9 | 10 | # For bats functional tests 11 | env: 12 | - functional_test="true" 13 | 14 | # command to run tests 15 | script: 16 | - /usr/local/bin/bats test 17 | 18 | notifications: 19 | email: 20 | on_success: never 21 | -------------------------------------------------------------------------------- /docs/themes-list/radek.rst: -------------------------------------------------------------------------------- 1 | .. _radek: 2 | 3 | Radek Theme 4 | =========== 5 | 6 | A colorful theme for Python developers. 7 | It does not have any requirements. 8 | 9 | Provided Information 10 | -------------------- 11 | 12 | 13 | * Current username and hostname 14 | * Current path 15 | * Git repository status 16 | * Current Python environment (venv, Conda ) 17 | * Current Python version 18 | 19 | Examples 20 | -------- 21 | 22 | .. code-block:: bash 23 | 24 | [radek@photon][~/src/nokia2/cbis] ±[master → origin ↑1 {1}✓][venv-cbis][py-3.7.5] 25 | → 26 | -------------------------------------------------------------------------------- /aliases/available/clipboard.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'xclip shortcuts' 3 | url "https://github.com/astrand/xclip" 4 | 5 | alias pbcopy="xclip -selection clipboard" 6 | alias pbpaste="xclip -selection clipboard -o" 7 | 8 | alias xcpy="xclip -selection clipboard" 9 | alias xpst="xclip -selection clipboard -o" 10 | # to use it just install xclip on your distribution and it would work like: 11 | # $ echo "hello" | xcpy 12 | # $ xpst 13 | # hello 14 | 15 | # very useful for things like: 16 | # cat ~/.ssh/id_rsa.pub | xcpy 17 | # have fun! 18 | -------------------------------------------------------------------------------- /themes/candy/candy.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | function prompt_command() { 5 | local clock_prompt scm_prompt_info 6 | clock_prompt="$(clock_prompt)" 7 | scm_prompt_info="$(scm_prompt_info)" 8 | PS1="${green?}\u@\h ${clock_prompt} ${reset_color?}${white?}\w${reset_color?}${scm_prompt_info}${blue?} →${bold_blue?} ${reset_color?} ${normal?}" 9 | } 10 | 11 | : "${THEME_CLOCK_COLOR:=${blue?}}" 12 | : "${THEME_CLOCK_FORMAT:="%I:%M:%S"}" 13 | 14 | safe_append_prompt_command prompt_command 15 | -------------------------------------------------------------------------------- /themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | source "$BASH_IT/themes/doubletime/doubletime.theme.bash" 5 | 6 | function prompt_setter() { 7 | # Save history 8 | _save-and-reload-history 1 9 | PS1=" 10 | $(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}${reset_color?}] $(virtualenv_prompt) 11 | \w 12 | $(scm_prompt)${reset_color?} $ " 13 | PS2='> ' 14 | PS4='+ ' 15 | } 16 | 17 | safe_append_prompt_command prompt_setter 18 | -------------------------------------------------------------------------------- /themes/doubletime_multiline/doubletime_multiline.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | source "$BASH_IT/themes/doubletime/doubletime.theme.bash" 5 | 6 | function prompt_setter() { 7 | # Save history 8 | _save-and-reload-history 1 9 | PS1=" 10 | $(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}${reset_color?}] $(virtualenv_prompt)$(ruby_version_prompt) 11 | \w 12 | $(scm_prompt)${reset_color?} $ " 13 | PS2='> ' 14 | PS4='+ ' 15 | } 16 | 17 | safe_append_prompt_command prompt_setter 18 | -------------------------------------------------------------------------------- /themes/newin/newin.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" ${purple?}|${green?} " 7 | SCM_THEME_PROMPT_SUFFIX="${purple?} |" 8 | 9 | prompt() { 10 | exit_code=$? 11 | PS1="$(if [[ ${exit_code} = 0 ]]; then echo "${green?}${exit_code}"; else echo "${red?}${exit_code}"; fi) ${yellow?}\t ${cyan?}\w$(scm_prompt_info)${reset_color?}\n${orange?}$ ${reset_color?}" 12 | } 13 | 14 | safe_append_prompt_command prompt 15 | -------------------------------------------------------------------------------- /hooks/dot-bash.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exit_code=0 4 | for file in "$@"; do 5 | # Confirm file is not executable 6 | # 7 | if [[ -x "${file}" ]]; then 8 | echo "Bash include file \`${file}\` should not be executable" 9 | exit_code=1 10 | fi 11 | 12 | # Confirm expected schellcheck header 13 | # 14 | LINE1="$(head -n 1 "${file}")" 15 | SCSH="${file##*.}" 16 | if [[ "${LINE1}" != "# shellcheck shell=${SCSH}" ]]; then 17 | echo "Bash include file \`${file}\` has bad/missing shellcheck header" 18 | exit_code=1 19 | fi 20 | done 21 | 22 | exit "${exit_code:-0}" 23 | -------------------------------------------------------------------------------- /completion/available/dotnet.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "bash parameter completion for the dotnet CLI" 3 | # see https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bash 4 | 5 | function _dotnet_bash_complete() { 6 | local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n' 7 | local candidates 8 | 9 | read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2> /dev/null) 10 | 11 | read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur") 12 | } 13 | 14 | complete -f -F _dotnet_bash_complete dotnet 15 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 14 5 | # Label requiring a response 6 | responseRequiredLabel: waiting-for-response 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. 11 | You can always reopen the issue if needed. 12 | -------------------------------------------------------------------------------- /plugins/available/latex.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'add MacTeX to PATH' 3 | url "https://www.latex-project.org/" 4 | 5 | _bash_it_plugin_latex_paths=( 6 | # Standard locations 7 | /usr/local/texbin 8 | # MacOS locations 9 | /Library/TeX/texbin 10 | ) 11 | 12 | # add mactex to the path if its present 13 | for _bash_it_plugin_latex_path in "${_bash_it_plugin_latex_paths[@]}"; do 14 | if [[ -d "$_bash_it_plugin_latex_path/" ]]; then 15 | pathmunge "$_bash_it_plugin_latex_path" after && break 16 | fi 17 | done 18 | 19 | # Cleanup 20 | unset "${!_bash_it_plugin_latex_@}" 21 | -------------------------------------------------------------------------------- /plugins/available/subversion.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'svn helper functions' 4 | url "https://subversion.apache.org/" 5 | 6 | rm_svn() { 7 | about 'remove ".svn" files from directory' 8 | param '1: directory to search for files' 9 | group 'svn' 10 | 11 | if [ -z "$1" ]; then 12 | reference rm_svn 13 | return 14 | fi 15 | find "$1" -name .svn -print0 | xargs -0 rm -rf 16 | } 17 | 18 | svn_add() { 19 | about 'add to svn repo' 20 | group 'svn' 21 | 22 | svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add 23 | } 24 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "test_lib/bats-core"] 2 | path = test_lib/bats-core 3 | url = https://github.com/bats-core/bats-core 4 | branch = tags/v1.11.1 5 | [submodule "test_lib/bats-support"] 6 | path = test_lib/bats-support 7 | url = https://github.com/bats-core/bats-support 8 | branch = master 9 | #branch = tags/v0.3.0 10 | [submodule "test_lib/bats-assert"] 11 | path = test_lib/bats-assert 12 | url = https://github.com/bats-core/bats-assert 13 | branch = tags/v2.1.0 14 | [submodule "test_lib/bats-file"] 15 | path = test_lib/bats-file 16 | url = https://github.com/bats-core/bats-file 17 | branch = master 18 | -------------------------------------------------------------------------------- /completion/available/go.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "completion for go command using gocomplete" 3 | 4 | # bash completion for go tool 5 | # https://github.com/posener/complete 6 | 7 | # Test `go version` because goenv creates shim scripts that will be found in PATH 8 | # but do not always resolve to a working install. 9 | if _command_exists go && go version &> /dev/null; then 10 | # Same idea here, but no need to test a subcommand 11 | if _command_exists gocomplete && gocomplete &> /dev/null; then 12 | # finally, apply completion 13 | complete -C gocomplete go 14 | fi 15 | fi 16 | -------------------------------------------------------------------------------- /plugins/available/rails.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Helper functions for Ruby on Rails' 4 | url "https://rubyonrails.org/" 5 | 6 | # Quick function to kill a daemonized Rails server 7 | function killrails() { 8 | about 'Searches for a daemonized Rails server in tmp/pids and attempts to kill it.' 9 | group 'rails' 10 | 11 | railsPid="$(cat tmp/pids/server.pid)" 12 | if [ -n "$railsPid" ]; then 13 | echo "[OK] Rails Server Process Id : ${railsPid}" 14 | kill -9 "$railsPid" 15 | echo "[OK] Process Killed" 16 | else 17 | echo "[FAIL] Error killing Rails server" 18 | return 1 19 | fi 20 | } 21 | -------------------------------------------------------------------------------- /docs/themes-list/oh-my-posh.rst: -------------------------------------------------------------------------------- 1 | .. _oh-my-posh: 2 | 3 | Oh-My-Posh Theme 4 | ================ 5 | 6 | The oh-my-posh ״theme״ is really a plug to a whole other system 7 | of managing your prompt. To use it please start here: 8 | `Oh-My-Posh homepage `_ 9 | 10 | It is beyond the scope of bash-it to install and manage oh-my-posh, 11 | this theme is here just to make sure your OMP setup doesn't clash 12 | with other bash-it themes. Once installed, OMP will load a default 13 | OMP theme (jandedobbeleer), which you can then customize or override. 14 | 15 | Note: Nerd Fonts are highly recommended, as most of the themes are graphic candies. 16 | -------------------------------------------------------------------------------- /themes/roderik/roderik.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | export GIT_PS1_SHOWDIRTYSTATE=true 5 | export GIT_PS1_SHOWUNTRACKEDFILES=true 6 | export GIT_PS1_SHOWSTASHSTATE=true 7 | 8 | export PROMPT_DIRTRIM=3 9 | 10 | function prompt_command() { 11 | if [[ ${EUID} == 0 ]]; then 12 | PS1="[$(clock_prompt)]${yellow?}[${red?}\u@\h ${green?}\w${yellow?}]${red?}$(__git_ps1 "(%s)")${normal?}\\$ " 13 | else 14 | PS1="[$(clock_prompt)]${yellow?}[${cyan?}\u@\h ${green?}\w${yellow?}]${red?}$(__git_ps1 "(%s)")${normal?}\\$ " 15 | fi 16 | } 17 | 18 | safe_append_prompt_command prompt_command 19 | -------------------------------------------------------------------------------- /plugins/available/hg.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'hg helper functions' 4 | url "https://www.mercurial-scm.org/" 5 | 6 | hg_dirty() { 7 | about 'displays dirty status of hg repository' 8 | group 'hg' 9 | 10 | hg status --no-color 2> /dev/null \ 11 | | awk '$1 == "?" { print "?" } $1 != "?" { print "!" }' \ 12 | | sort | uniq | head -c1 13 | } 14 | 15 | hg_in_repo() { 16 | about 'determine if pwd is an hg repo' 17 | group 'hg' 18 | 19 | [[ $(hg branch 2> /dev/null) ]] && echo 'on ' 20 | } 21 | 22 | hg_branch() { 23 | about 'display current hg branch' 24 | group 'hg' 25 | 26 | hg branch 2> /dev/null 27 | } 28 | -------------------------------------------------------------------------------- /themes/simple/simple.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # prompt themeing 5 | 6 | #added TITLEBAR for updating the tab and window titles with the pwd 7 | case $TERM in 8 | xterm*) 9 | TITLEBAR="\[\033]0;\w\007\]" 10 | ;; 11 | *) 12 | TITLEBAR="" 13 | ;; 14 | esac 15 | 16 | function prompt_command() { 17 | PS1="${TITLEBAR}${orange?}${reset_color?}${green?}\w${bold_blue?}\[$(scm_prompt_info)\]${normal?} " 18 | } 19 | 20 | # scm themeing 21 | SCM_THEME_PROMPT_DIRTY=" ✗" 22 | SCM_THEME_PROMPT_CLEAN=" ✓" 23 | SCM_THEME_PROMPT_PREFIX="(" 24 | SCM_THEME_PROMPT_SUFFIX=")" 25 | 26 | safe_append_prompt_command prompt_command 27 | -------------------------------------------------------------------------------- /vendor/github.com/rcaloras/bash-preexec/test/include-test.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | @test "should not import if it's already defined" { 4 | __bp_imported="defined" 5 | source "${BATS_TEST_DIRNAME}/../bash-preexec.sh" 6 | [ -z $(type -t __bp_preexec_and_precmd_install) ] 7 | } 8 | 9 | @test "should import if not defined" { 10 | unset __bp_imported 11 | source "${BATS_TEST_DIRNAME}/../bash-preexec.sh" 12 | [ -n $(type -t __bp_install) ] 13 | } 14 | 15 | @test "bp should stop installation if HISTTIMEFORMAT is readonly" { 16 | readonly HISTTIMEFORMAT 17 | run source "${BATS_TEST_DIRNAME}/../bash-preexec.sh" 18 | [ $status -ne 0 ] 19 | [[ "$output" =~ "HISTTIMEFORMAT" ]] || return 1 20 | } 21 | -------------------------------------------------------------------------------- /themes/pro/pro.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" ${blue?}scm:( " 7 | SCM_THEME_PROMPT_SUFFIX="${blue?} )" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${green?}✓" 11 | GIT_THEME_PROMPT_PREFIX="${green?}git:( " 12 | GIT_THEME_PROMPT_SUFFIX="${green?} )" 13 | 14 | function git_prompt_info { 15 | git_prompt_vars 16 | echo -e "$SCM_PREFIX$SCM_BRANCH$SCM_STATE$SCM_SUFFIX" 17 | } 18 | 19 | function prompt() { 20 | PS1="\h: \W $(scm_prompt_info)${reset_color?} $ " 21 | } 22 | 23 | safe_append_prompt_command prompt 24 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /completion/available/notify-send.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure notify-send is installed 4 | _bash-it-completion-helper-necessary notify-send || : 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient notify-send || return 8 | 9 | function _notify-send() { 10 | local prev="${COMP_WORDS[COMP_CWORD - 1]}" 11 | 12 | case $prev in 13 | -u | --urgency) 14 | COMPREPLY=("low" "normal" "critical") 15 | ;; 16 | *) 17 | COMPREPLY=("-?" "--help" "-u" "--urgency" "-t" "--expire-time" "-a" "--app-name" "-i" "--icon" "-c" "--category" "-h" "--hint" "-v" "--version") 18 | ;; 19 | esac 20 | } 21 | 22 | complete -F _notify-send -X '!&*' notify-send 23 | -------------------------------------------------------------------------------- /plugins/available/cmd-returned-notify.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Alert (BEL) when process ends after a threshold of seconds' 4 | url "https://github.com/Bash-it/bash-it" 5 | 6 | function precmd_return_notification() { 7 | local command_start="${COMMAND_DURATION_START_SECONDS:=0}" 8 | local current_time 9 | current_time="$(_shell_duration_en)" 10 | local -i command_duration="$((${current_time%.*} - ${command_start%.*}))" 11 | if [[ "${command_duration}" -gt "${NOTIFY_IF_COMMAND_RETURNS_AFTER:-5}" ]]; then 12 | printf '\a' 13 | fi 14 | return 0 15 | } 16 | 17 | safe_append_prompt_command 'precmd_return_notification' 18 | safe_append_preexec '_command_duration_pre_exec' 19 | -------------------------------------------------------------------------------- /aliases/available/terraform.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Aliases for Terraform/OpenTofu and Terragrunt' 3 | url "https://www.terraform.io/" 4 | 5 | if _command_exists terraform; then 6 | alias tf='terraform' 7 | elif _command_exists tofu; then 8 | alias tf='tofu' 9 | fi 10 | 11 | if _command_exists tf; then 12 | alias tfa='tf apply' 13 | alias tfp='tf plan' 14 | alias tfd='tf destroy' 15 | alias tfv='tf validate' 16 | alias tfi='tf init' 17 | alias tfo='tf output' 18 | alias tfr='tf refresh' 19 | alias tfw='tf workspace' 20 | alias tfae='tf apply -auto-approve' 21 | alias tfpa='tf plan -out=tfplan && tf apply tfplan' 22 | alias tfpaf='tf plan -out=tfplan && tf apply -auto-approve tfplan' 23 | fi 24 | -------------------------------------------------------------------------------- /aliases/available/kubectl.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'kubectl aliases' 3 | url "https://kubernetes.io/docs/reference/kubectl/" 4 | 5 | if _command_exists kubectl; then 6 | alias kc='kubectl' 7 | alias kcgp='kubectl get pods' 8 | alias kcgd='kubectl get deployments' 9 | alias kcgn='kubectl get nodes' 10 | alias kcdp='kubectl describe pod' 11 | alias kcdd='kubectl describe deployment' 12 | alias kcdn='kubectl describe node' 13 | alias kcgpan='kubectl get pods --all-namespaces' 14 | alias kcgdan='kubectl get deployments --all-namespaces' 15 | # launches a disposable netshoot pod in the k8s cluster 16 | alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash' 17 | fi 18 | -------------------------------------------------------------------------------- /aliases/available/rails.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'rails abbreviations' 3 | url "https://guides.rubyonrails.org/" 4 | 5 | # Rails Commands 6 | alias r='rails' 7 | alias rg='rails g' 8 | alias rs='rails s' 9 | alias rc='rails c' 10 | alias rn='rails new' 11 | alias rb='rails dbconsole' 12 | alias rp='rails plugin' 13 | alias ra='rails application' 14 | alias rd='rails destroy' 15 | alias dbm='rake db:migrate' 16 | 17 | alias ss='script/server' 18 | alias ts="thin start" # thin server 19 | alias sc='script/console' 20 | alias restartapp='touch tmp/restart.txt' 21 | alias restart='touch tmp/restart.txt' # restart passenger 22 | alias devlog='tail -f log/development.log' 23 | alias taild='tail -f log/development.log' # tail dev log 24 | -------------------------------------------------------------------------------- /aliases/available/vagrant.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'vagrant aliases' 3 | url "https://www.vagrantup.com/" 4 | 5 | # Aliases 6 | alias vhl='vagrant hosts list' 7 | alias vscp='vagrant scp' 8 | alias vsl='vagrant snapshot list' 9 | alias vst='vagrant snapshot take' 10 | alias vup="vagrant up" 11 | alias vupl="vagrant up 2>&1 | tee vagrant.log" 12 | alias vh="vagrant halt" 13 | alias vs="vagrant suspend" 14 | alias vr="vagrant resume" 15 | alias vrl="vagrant reload" 16 | alias vssh="vagrant ssh" 17 | alias vst="vagrant status" 18 | alias vp="vagrant provision" 19 | alias vdstr="vagrant destroy" 20 | # requires vagrant-list plugin 21 | alias vl="vagrant list" 22 | # requires vagrant-hostmanager plugin 23 | alias vhst="vagrant hostmanager" 24 | -------------------------------------------------------------------------------- /aliases/available/vim.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'vim abbreviations' 3 | url "https://www.vim.org/" 4 | 5 | alias v='${VISUAL:-vim}' 6 | 7 | if ! _command_exists vim; then 8 | _log_warning "Without 'vim', these aliases just aren't that useful..." 9 | fi 10 | # open the vim help in fullscreen incorporated from 11 | # https://stackoverflow.com/a/4687513 12 | alias vimh='vim -c ":h | only"' 13 | 14 | # open vim in new tab is taken from 15 | # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek 16 | _command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } 17 | _command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } 18 | -------------------------------------------------------------------------------- /plugins/available/ruby.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'ruby and rubygems specific functions and settings' 4 | url "https://www.ruby-lang.org/" 5 | 6 | # Make commands installed with 'gem install --user-install' available 7 | # ~/.gem/ruby/${RUBY_VERSION}/bin/ 8 | if _command_exists ruby && _command_exists gem; then 9 | pathmunge "$(ruby -e 'print Gem.user_dir')/bin" after || true 10 | else 11 | _log_warning "Unable to load Ruby plugin as a working 'ruby', or 'gem', was not found." 12 | fi 13 | 14 | function remove_gem() { 15 | about 'removes installed gem' 16 | param '1: installed gem name' 17 | group 'ruby' 18 | 19 | gem list | grep "${1:?${FUNCNAME[0]}: no gem name provided}" | awk '{ print $1; }' | xargs sudo gem uninstall 20 | } 21 | -------------------------------------------------------------------------------- /aliases/available/curl.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Curl aliases for convenience.' 3 | url "https://curl.se/" 4 | 5 | # set apt aliases 6 | function _set_pkg_aliases() { 7 | if _command_exists curl; then 8 | # follow redirects 9 | alias cl='curl -L' 10 | # follow redirects, download as original name 11 | alias clo='curl -L -O' 12 | # follow redirects, download as original name, continue 13 | alias cloc='curl -L -C - -O' 14 | # follow redirects, download as original name, continue, retry 5 times 15 | alias clocr='curl -L -C - -O --retry 5' 16 | # follow redirects, fetch banner 17 | alias clb='curl -L -I' 18 | # see only response headers from a get request 19 | alias clhead='curl -D - -so /dev/null' 20 | fi 21 | } 22 | 23 | _set_pkg_aliases 24 | -------------------------------------------------------------------------------- /themes/easy/easy.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX="${bold_green?}[ ${normal?}" 5 | SCM_THEME_PROMPT_SUFFIX="${bold_green?} ] " 6 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 7 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 8 | 9 | function prompt_command() { 10 | local scm_prompt_info 11 | if [ "${USER:-${LOGNAME?}}" = root ]; then 12 | cursor_color="${bold_red?}" 13 | user_color="${green?}" 14 | else 15 | cursor_color="${bold_green?}" 16 | user_color="${white?}" 17 | fi 18 | scm_prompt_info="$(scm_prompt_info)" 19 | PS1="${user_color}\u${normal?}@${white?}\h ${bold_black?}\w\n${reset_color?}${scm_prompt_info}${cursor_color}❯ ${normal?}" 20 | } 21 | 22 | safe_append_prompt_command prompt_command 23 | -------------------------------------------------------------------------------- /aliases/available/systemd.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'systemd service' 3 | url "https://systemd.io/" 4 | 5 | case $OSTYPE in 6 | linux*) 7 | # Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user 8 | alias sc='systemctl' 9 | alias scu='systemctl --user' 10 | alias scdr='systemctl daemon-reload' 11 | alias scdru='systemctl --user daemon-reload' 12 | alias scr='systemctl restart' 13 | alias scru='systemctl --user restart' 14 | alias sce='systemctl stop' 15 | alias sceu='systemctl --user stop' 16 | alias scs='systemctl start' 17 | alias scsu='systemctl --user start' 18 | # Keeping previous aliases for a non-breaking change. 19 | alias scue='sceu' 20 | alias scus='scsu' 21 | alias scur='scdru' 22 | ;; 23 | esac 24 | -------------------------------------------------------------------------------- /aliases/available/yarn.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'yarn package manager aliases' 3 | url "https://yarnpkg.com/" 4 | 5 | # Aliases 6 | alias ya='yarn' 7 | alias yai='yarn init' 8 | alias yaa='yarn add' 9 | alias yaga='yarn global add' 10 | alias yaad='yarn add --dev' 11 | alias yau='yarn upgrade' 12 | alias yarm='yarn remove' 13 | alias yagrm='yarn global remove' 14 | alias yaod='yarn outdated' 15 | alias yapa='yarn pack' 16 | alias yap='yarn publish' 17 | alias yasu='yarn self-update' 18 | alias yaru='yarn run' 19 | alias yat='yarn test' 20 | alias yas='yarn serve' 21 | alias yacc='yarn cache clean' 22 | alias yack='yarn check' 23 | alias yals='yarn list' 24 | alias yain='yarn info' 25 | alias yali='yarn licenses ls' 26 | alias yaloi='yarn login' 27 | alias yaloo='yarn logout' 28 | -------------------------------------------------------------------------------- /completion/available/lerna.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite "about-completion" 3 | about-completion "lerna(javascript project manager tool) completion" 4 | group "javascript" 5 | url "https://lerna.js.org/" 6 | 7 | function __lerna_completion() { 8 | local cur compls 9 | 10 | # The currently-being-completed word. 11 | cur="${COMP_WORDS[COMP_CWORD]}" 12 | 13 | # Options 14 | compls="add bootstrap changed clean create diff exec \ 15 | import init link list publish run version \ 16 | --loglevel --concurrency --reject-cycles \ 17 | --progress --sort --no-sort --help \ 18 | --version" 19 | 20 | # Tell complete what stuff to show. 21 | # shellcheck disable=2207 22 | COMPREPLY=($(compgen -W "$compls" -- "$cur")) 23 | } 24 | complete -o default -F __lerna_completion lerna 25 | -------------------------------------------------------------------------------- /themes/duru/duru.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX="${cyan?} on ${green?}" 5 | SCM_THEME_PROMPT_SUFFIX="" 6 | SCM_THEME_PROMPT_DIRTY=" ${red?}with changes" 7 | SCM_THEME_PROMPT_CLEAN="" 8 | 9 | venv() { 10 | if [ -n "$VIRTUAL_ENV" ]; then 11 | local env=$VIRTUAL_ENV 12 | echo "${gray?} in ${orange?}${env##*/} " 13 | fi 14 | } 15 | 16 | last_two_dirs() { 17 | # shellcheck disable=SC2001 18 | pwd | rev | awk -F / '{print $1,$2}' | rev | sed s_\ _/_ | sed "s|$(sed 's,\/,,' <<< "$HOME")|~|g" 19 | } 20 | 21 | prompt() { 22 | PS1="${yellow?}# ${reset_color?}$(last_two_dirs)$(scm_prompt_info)${reset_color?}$(venv)${reset_color?} ${cyan?}\n> ${reset_color?}" 23 | } 24 | 25 | safe_append_prompt_command prompt 26 | -------------------------------------------------------------------------------- /themes/tylenol/tylenol.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # Based on 'bobby' theme with the addition of virtualenv_prompt 5 | # 6 | 7 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 8 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 9 | SCM_THEME_PROMPT_PREFIX=" ${yellow?}|${reset_color?}" 10 | SCM_THEME_PROMPT_SUFFIX="${yellow?}|" 11 | 12 | RVM_THEME_PROMPT_PREFIX="|" 13 | RVM_THEME_PROMPT_SUFFIX="|" 14 | VIRTUALENV_THEME_PROMPT_PREFIX='|' 15 | VIRTUALENV_THEME_PROMPT_SUFFIX='|' 16 | 17 | function prompt_command() { 18 | PS1="\n${green?}$(virtualenv_prompt)${red?}$(ruby_version_prompt) ${reset_color?}\h ${orange?}in ${reset_color?}\w\n${yellow?}$(scm_char)$(scm_prompt_info) ${yellow?}→${white?} " 19 | } 20 | 21 | safe_append_prompt_command prompt_command 22 | -------------------------------------------------------------------------------- /docs/custom.rst: -------------------------------------------------------------------------------- 1 | .. _custom: 2 | 3 | Custom Content 4 | -------------- 5 | 6 | For custom scripts, and aliases, just create the following files (they'll be ignored by the git repo): 7 | 8 | 9 | * ``aliases/custom.aliases.bash`` 10 | * ``completion/custom.completion.bash`` 11 | * ``lib/custom.bash`` 12 | * ``plugins/custom.plugins.bash`` 13 | * ``custom/themes//.theme.bash`` 14 | 15 | Anything in the custom directory will be ignored, with the exception of ``custom/example.bash``. 16 | 17 | Alternately, if you would like to keep your custom scripts under version control, you can set ``BASH_IT_CUSTOM`` in your ``~/.bashrc`` to another location outside of the ``$BASH_IT`` folder. 18 | In this case, any ``*.bash`` file under every directory below ``BASH_IT_CUSTOM`` folder will be used. 19 | -------------------------------------------------------------------------------- /plugins/available/jenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load jenv, if you are using it' 4 | url "https://www.jenv.be/" 5 | 6 | # Don't modify the environment if we can't find the tool: 7 | # - Check if in $PATH already 8 | # - Check if installed manually to $JENV_ROOT 9 | # - Check if installed manually to $HOME 10 | _command_exists jenv \ 11 | || [[ -n "$JENV_ROOT" && -x "$JENV_ROOT/bin/jenv" ]] \ 12 | || [[ -x "$HOME/.jenv/bin/jenv" ]] \ 13 | || return 14 | 15 | # Set JENV_ROOT, if not already set 16 | export JENV_ROOT="${JENV_ROOT:-$HOME/.jenv}" 17 | 18 | # Add JENV_ROOT/bin to PATH, if that's where it's installed 19 | ! _command_exists jenv \ 20 | && [[ -x "$JENV_ROOT/bin/jenv" ]] \ 21 | && pathmunge "$JENV_ROOT/bin" 22 | 23 | # Initialize jenv 24 | eval "$(jenv init - bash)" 25 | -------------------------------------------------------------------------------- /themes/envy/envy.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | VIRTUALENV_THEME_PROMPT_PREFIX="${green?}ⓔ " 15 | VIRTUALENV_THEME_PROMPT_SUFFIX="" 16 | 17 | function prompt_command() { 18 | PS1="\n$(virtualenv_prompt)${yellow?}$(ruby_version_prompt) ${purple?}\h ${reset_color?}in ${green?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green?}→${reset_color?} " 19 | } 20 | 21 | safe_append_prompt_command prompt_command 22 | -------------------------------------------------------------------------------- /clean_files.txt: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # Allow-list of files to be lint-checked by CI 3 | # 4 | # Directory Support 5 | # Directory references are allowed within the file, ie: 6 | # 7 | # themes/powerline 8 | # 9 | # All files under the referenced directory will be checked 10 | # 11 | # Checking Files Locally 12 | # You can manually invoke the check via: 13 | # 14 | # lint_clean_files.sh 15 | # 16 | 17 | # root directories 18 | # 19 | aliases/ 20 | completion/ 21 | docs/ 22 | hooks/ 23 | lib/ 24 | plugins/ 25 | scripts/ 26 | template/ 27 | test/ 28 | themes/ 29 | 30 | # root files 31 | # 32 | .gitattributes 33 | bash_it.sh 34 | clean_files.txt 35 | install.sh 36 | lint_clean_files.sh 37 | uninstall.sh 38 | 39 | # vendor init files 40 | # 41 | vendor/.gitattributes 42 | -------------------------------------------------------------------------------- /plugins/available/powerline.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 3 | 4 | cite about-plugin 5 | about-plugin 'enables powerline daemon' 6 | url "https://github.com/powerline/powerline" 7 | 8 | _command_exists powerline-daemon || return 9 | powerline-daemon -q 10 | 11 | #the following should not be executed if bashit powerline themes in use 12 | case "$BASH_IT_THEME" in 13 | *powerline*) 14 | return 15 | ;; 16 | esac 17 | POWERLINE_BASH_CONTINUATION=1 18 | POWERLINE_BASH_SELECT=1 19 | bashPowerlineInit="$(python -c \ 20 | "import os; \ 21 | import powerline;\ 22 | print(os.path.join(os.path.dirname(\ 23 | powerline.__file__),\ 24 | 'bindings', \ 25 | 'bash', \ 26 | 'powerline.sh'))")" 27 | [ -e "$bashPowerlineInit" ] || return 28 | # shellcheck disable=SC1090 29 | source "$bashPowerlineInit" 30 | -------------------------------------------------------------------------------- /themes/elixr/elixr.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" ${green?}| " 7 | SCM_THEME_PROMPT_SUFFIX="${green?} |" 8 | SCM_NONE_CHAR='◐ ' 9 | SCM_GIT_SHOW_MINIMAL_INFO=true 10 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 11 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 12 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 13 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 14 | 15 | RVM_THEME_PROMPT_PREFIX="|" 16 | RVM_THEME_PROMPT_SUFFIX=" d|" 17 | 18 | BOLD="\[\e[1m\]" 19 | 20 | function prompt_command() { 21 | PS1="\n${bold_cyan?}$(scm_prompt_char_info)$(virtualenv_prompt) ${bold_cyan?}\w :${reset_color?}${normal?}${BOLD} " 22 | } 23 | 24 | safe_append_prompt_command prompt_command 25 | -------------------------------------------------------------------------------- /themes/radek/radek.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | GIT_THEME_PROMPT_DIRTY="${red?}✗" 5 | GIT_THEME_PROMPT_CLEAN="${bold_green?}✓" 6 | GIT_THEME_PROMPT_PREFIX="${bold_cyan?}[" 7 | GIT_THEME_PROMPT_SUFFIX="${bold_cyan?}]" 8 | 9 | VIRTUALENV_THEME_PROMPT_PREFIX="${bold_green?}[" 10 | VIRTUALENV_THEME_PROMPT_SUFFIX="${bold_green?}]" 11 | CONDAENV_THEME_PROMPT_PREFIX="${bold_green?}[" 12 | CONDAENV_THEME_PROMPT_SUFFIX="${bold_green?}]" 13 | PYTHON_THEME_PROMPT_PREFIX="${bold_green?}[" 14 | PYTHON_THEME_PROMPT_SUFFIX="${bold_green?}]" 15 | 16 | function prompt_command() { 17 | PS1="\n${bold_white?}[\u@\h]${bold_yellow?}[\w] ${bold_cyan?}$(scm_prompt_char_info)$(python_version_prompt)${green?}\n→${reset_color?} " 18 | } 19 | 20 | safe_append_prompt_command prompt_command 21 | -------------------------------------------------------------------------------- /themes/standard/standard.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # scm themeing 5 | SCM_THEME_PROMPT_DIRTY="×" 6 | SCM_THEME_PROMPT_CLEAN="✓" 7 | SCM_THEME_PROMPT_PREFIX="" 8 | SCM_THEME_PROMPT_SUFFIX="" 9 | 10 | # TODO: need a check for OS before adding this to the prompt 11 | # ${debian_chroot:+($debian_chroot)} 12 | 13 | #added TITLEBAR for updating the tab and window titles with the pwd 14 | case $TERM in 15 | xterm*) 16 | TITLEBAR='\[\033]0;\w\007\]' 17 | ;; 18 | *) 19 | TITLEBAR="" 20 | ;; 21 | esac 22 | 23 | function prompt_command() { 24 | # shellcheck disable=SC2016 25 | PROMPT='${green?}\u${normal?}@${green?}\h${normal?}:${blue?}\w${normal?}${red?}$(prompt_char)$(git_prompt_info)${normal?}\$ ' 26 | } 27 | 28 | safe_append_prompt_command prompt_command 29 | -------------------------------------------------------------------------------- /themes/sirup/sirup.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # For unstaged(*) and staged(+) values next to branch name in __git_ps1 5 | GIT_PS1_SHOWDIRTYSTATE="enabled" 6 | 7 | function rvm_version_prompt { 8 | local gemset version 9 | gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}') 10 | [[ -n "$gemset" ]] && gemset="@$gemset" 11 | version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}') 12 | [[ "$version" == "1.9.2" ]] && version="" 13 | local full="$version$gemset" 14 | [[ -n "$full" ]] && echo "$full" 15 | } 16 | 17 | function prompt_command() { 18 | # Check http://github.com/Sirupsen/dotfiles for screenshot 19 | PS1="${blue?}\W/${bold_blue?}$(rvm_version_prompt)${bold_green?}$(__git_ps1 " (%s)") ${normal?}$ " 20 | } 21 | 22 | safe_append_prompt_command prompt_command 23 | -------------------------------------------------------------------------------- /themes/90210/90210.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | # Nicely formatted terminal prompt 15 | function prompt_command() { 16 | local scm_prompt_info 17 | scm_prompt_info="$(scm_prompt_info)" 18 | PS1="\n${bold_black?}[${blue?}\@${bold_black?}]-${bold_black?}[${green?}\u${yellow?}@${green?}\h${bold_black?}]-${bold_black?}[${purple?}\w${bold_black?}]-${scm_prompt_info?}\n${reset_color?}\$ " 19 | } 20 | 21 | safe_append_prompt_command prompt_command 22 | -------------------------------------------------------------------------------- /completion/available/laravel.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "laravel - PHP web application framework installer and command-line tool" 5 | group "php" 6 | url "https://laravel.com/" 7 | 8 | # Make sure laravel is installed 9 | _bash-it-completion-helper-necessary laravel || : 10 | 11 | # Don't handle completion if it's already managed 12 | _bash-it-completion-helper-sufficient laravel || return 13 | 14 | function __laravel_completion() { 15 | local OPTS=('-h' '--help' '-q' '--quiet' '--ansi' '--no-ansi' '-n' '--no-interaction' '-v' '-vv' '-vvv' '--verbose' 'help' 'list' 'new') 16 | local _opt_ 17 | COMPREPLY=() 18 | for _opt_ in "${OPTS[@]}"; do 19 | if [[ "$_opt_" == "$2"* ]]; then 20 | COMPREPLY+=("$_opt_") 21 | fi 22 | done 23 | } 24 | 25 | complete -F __laravel_completion laravel 26 | -------------------------------------------------------------------------------- /lint_clean_files.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Pull list of checkable files from clean_files.txt 4 | # - Folder references are allowed 5 | # - Empty lines are ignored 6 | # - Comment lines (#) are ignored 7 | # 8 | # shellcheck disable=SC2002 # Prefer 'cat' for cleaner script 9 | FILES=() 10 | while IFS='' read -r line; do FILES+=("$line"); done < <( 11 | cat clean_files.txt \ 12 | | grep -E -v '^\s*$' \ 13 | | grep -E -v '^\s*#' \ 14 | | xargs -I{} find "{}" -type f 15 | ) 16 | 17 | # We clear the BASH_IT variable to help the shellcheck checker 18 | # identify source includes within our scripts that require a 19 | # 'source' directive. For more information, see: 20 | # 21 | # "Shellcheck SC1090 - Can't follow non-constant source" 22 | # https://www.shellcheck.net/wiki/SC1090 23 | # 24 | BASH_IT='' pre-commit run --files "${FILES[@]}" 25 | -------------------------------------------------------------------------------- /completion/available/rake.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "rake - Ruby task automation and build tool" 5 | group "ruby" 6 | url "https://ruby.github.io/rake/" 7 | 8 | # Bash completion support for Rake, Ruby Make. 9 | 10 | export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} 11 | 12 | _rakecomplete() { 13 | if [ -f Rakefile ]; then 14 | #shellcheck disable=SC2012 15 | recent=$(ls -t -- .rake_tasks~ Rakefile **/*.rake 2> /dev/null | head -n 1) 16 | if [[ $recent != '.rake_tasks~' ]]; then 17 | rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~ 18 | fi 19 | local line 20 | while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$(cat .rake_tasks~)" -- "${COMP_WORDS[COMP_CWORD]}") 21 | return 0 22 | fi 23 | } 24 | 25 | complete -o default -o nospace -F _rakecomplete rake 26 | -------------------------------------------------------------------------------- /plugins/available/sudo.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Toggle sudo at the beginning of the current or the previous command by hitting the ESC key twice' 4 | url "https://www.sudo.ws/" 5 | 6 | function sudo-command-line() { 7 | about "toggle sudo at the beginning of the current or the previous command by hitting the ESC key twice" 8 | group "sudo" 9 | 10 | [[ ${#READLINE_LINE} -eq 0 ]] && READLINE_LINE=$(fc -l -n -1 | xargs) 11 | if [[ $READLINE_LINE == sudo\ * ]]; then 12 | READLINE_LINE="${READLINE_LINE#sudo }" 13 | else 14 | READLINE_LINE="sudo $READLINE_LINE" 15 | fi 16 | READLINE_POINT=${#READLINE_LINE} 17 | } 18 | 19 | # Define shortcut keys: [Esc] [Esc] 20 | 21 | # Readline library requires bash version 4 or later 22 | if [ "${BASH_VERSINFO[0]}" -ge 4 ]; then 23 | bind -x '"\e\e": sudo-command-line' 24 | fi 25 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [**.{md,rst}] 13 | trim_trailing_whitespace = false 14 | 15 | [.git*] 16 | indent_size = tab 17 | indent_style = tab 18 | 19 | [{**.*sh,test/run,**.bats}] 20 | indent_size = tab 21 | indent_style = tab 22 | 23 | shell_variant = bash 24 | binary_next_line = true # like -bn 25 | switch_case_indent = true # like -ci 26 | space_redirects = true # like -sr 27 | keep_padding = false # like -kp 28 | end_of_line = lf 29 | charset = utf-8 30 | trim_trailing_whitespace = true 31 | insert_final_newline = true 32 | 33 | [**.bats] 34 | indent_size = tab 35 | indent_style = tab 36 | shell_variant = bats 37 | -------------------------------------------------------------------------------- /aliases/available/heroku.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'heroku task abbreviations' 3 | url "https://devcenter.heroku.com/" 4 | 5 | # heroku 6 | alias h='heroku' 7 | alias hl='heroku list' 8 | alias hi='heroku info' 9 | alias ho='heroku open' 10 | 11 | # dynos and workers 12 | alias hd='heroku dynos' 13 | alias hw='heroku workers' 14 | 15 | # rake console 16 | alias hr='heroku rake' 17 | alias hcon='heroku console' 18 | 19 | # new and restart 20 | alias hnew='heroku create' 21 | alias hrestart='heroku restart' 22 | 23 | # logs 24 | alias hlog='heroku logs' 25 | alias hlogs='heroku logs' 26 | 27 | # maint 28 | alias hon='heroku maintenance:on' 29 | alias hoff='heroku maintenance:off' 30 | 31 | # heroku configs 32 | alias hc='heroku config' 33 | alias hca='heroku config:add' 34 | alias hcr='heroku config:remove' 35 | alias hcc='heroku config:clear' 36 | -------------------------------------------------------------------------------- /plugins/available/autojump.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Autojump configuration, see https://github.com/wting/autojump for more details' 4 | url "https://github.com/wting/autojump" 5 | 6 | # Only supports the Homebrew variant, Debian and Arch at the moment. 7 | # Feel free to provide a PR to support other install locations 8 | # shellcheck disable=SC1090 9 | if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" ]]; then 10 | # shellcheck disable=SC1091 11 | source "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" 12 | elif _command_exists dpkg && dpkg -s autojump &> /dev/null; then 13 | source "$(dpkg-query -S autojump.sh | cut -d' ' -f2)" 14 | elif _command_exists pacman && pacman -Q autojump &> /dev/null; then 15 | source "$(pacman -Ql autojump | grep autojump.sh | cut -d' ' -f2)" 16 | fi 17 | -------------------------------------------------------------------------------- /themes/morris/morris.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # prompt theming 5 | 6 | # added TITLEBAR for updating the tab and window titles with the pwd 7 | case $TERM in 8 | xterm*) 9 | TITLEBAR=$(printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") 10 | ;; 11 | screen) 12 | TITLEBAR=$(printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") 13 | ;; 14 | *) 15 | TITLEBAR="" 16 | ;; 17 | esac 18 | 19 | function prompt_command() { 20 | PS1="${TITLEBAR}[\u@\h \W $(scm_prompt_info)]\$ " 21 | } 22 | 23 | # scm theming 24 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 25 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 26 | SCM_THEME_PROMPT_PREFIX="${green?}(" 27 | SCM_THEME_PROMPT_SUFFIX="${green?})${reset_color?}" 28 | 29 | safe_append_prompt_command prompt_command 30 | -------------------------------------------------------------------------------- /plugins/available/docker-compose.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Helper functions for using docker-compose' 4 | url "https://docs.docker.com/compose/" 5 | 6 | function docker-compose-fresh() { 7 | about 'Shut down, remove and start again the docker-compose setup, then tail the logs' 8 | group 'docker-compose' 9 | param '1: name of the docker-compose.yaml file to use (optional). Default: docker-compose.yaml' 10 | example 'docker-compose-fresh docker-compose-foo.yaml' 11 | 12 | local DCO_FILE_PARAM=() 13 | if [ -n "$1" ]; then 14 | echo "Using docker-compose file: $1" 15 | DCO_FILE_PARAM=(--file "$1") 16 | fi 17 | 18 | docker-compose "${DCO_FILE_PARAM[@]}" stop 19 | docker-compose "${DCO_FILE_PARAM[@]}" rm -f 20 | docker-compose "${DCO_FILE_PARAM[@]}" up -d 21 | docker-compose "${DCO_FILE_PARAM[@]}" logs -f --tail 100 22 | } 23 | -------------------------------------------------------------------------------- /themes/codeword/codeword.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX="${SCM_THEME_PROMPT_SUFFIX:-}" 5 | SCM_THEME_PROMPT_DIRTY="${bold_red?} ✗${normal?}" 6 | SCM_THEME_PROMPT_CLEAN="${bold_green?} ✓${normal?}" 7 | SCM_GIT_CHAR="${green?}±${normal?}" 8 | 9 | function mark_prompt() { 10 | echo "${green?}\$${normal?}" 11 | } 12 | 13 | function user_host_path_prompt() { 14 | ps_user="${green?}\u${normal?}" 15 | ps_host="${blue?}\H${normal?}" 16 | ps_path="${yellow?}\w${normal?}" 17 | echo "${ps_user?}@${ps_host?}:${ps_path?}" 18 | } 19 | 20 | function prompt() { 21 | local SCM_PROMPT_FORMAT=' [%s%s]' 22 | PS1="$(user_host_path_prompt)$(virtualenv_prompt)$(scm_prompt) $(mark_prompt) " 23 | } 24 | 25 | safe_append_prompt_command '_save-and-reload-history 1' 26 | safe_append_prompt_command prompt 27 | -------------------------------------------------------------------------------- /docs/commands/reload.rst: -------------------------------------------------------------------------------- 1 | .. _reload: 2 | 3 | Bash-it reload 4 | ^^^^^^^^^^^^^^ 5 | 6 | Bash-it creates a ``reload`` alias that makes it convenient to reload 7 | your Bash profile when you make changes. 8 | 9 | Additionally, if you export ``BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE`` as a non-null value, 10 | Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions. 11 | 12 | .. warning:: 13 | When changing theme, do not use ``bash-it reload``. Instead, use :ref:`restart`. 14 | 15 | .. _restart: 16 | 17 | Bash-it restart 18 | ^^^^^^^^^^^^^^^ 19 | 20 | Similar to :ref:`reload`, ``bash-it restart`` can be used to restart your shell. 21 | Instead of reloading your Bash profile, this command re-runs Bash (using exec). 22 | 23 | This is stronger than simple reload, and is similar to the effect of closing and reopening your terminal. 24 | -------------------------------------------------------------------------------- /themes/pete/pete.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | function prompt_setter() { 5 | local clock_prompt scm_char scm_prompt_info ruby_version_prompt 6 | clock_prompt="$(clock_prompt)" 7 | scm_char="$(scm_char)" 8 | scm_prompt_info="$(scm_prompt_info)" 9 | ruby_version_prompt="$(ruby_version_prompt)" 10 | _save-and-reload-history 1 # Save history 11 | PS1="(${clock_prompt}) ${scm_char} [${blue?}\u${reset_color?}@${green?}\H${reset_color?}] ${yellow?}\w${reset_color?}${scm_prompt_info}${ruby_version_prompt} ${reset_color?} " 12 | PS2='> ' 13 | PS4='+ ' 14 | } 15 | 16 | safe_append_prompt_command prompt_setter 17 | 18 | SCM_THEME_PROMPT_DIRTY=" ✗" 19 | SCM_THEME_PROMPT_CLEAN=" ✓" 20 | SCM_THEME_PROMPT_PREFIX=" (" 21 | SCM_THEME_PROMPT_SUFFIX=")" 22 | RVM_THEME_PROMPT_PREFIX=" (" 23 | RVM_THEME_PROMPT_SUFFIX=")" 24 | -------------------------------------------------------------------------------- /plugins/available/blesh.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'load ble.sh, the Bash line editor!' 3 | url "https://github.com/akinomyoga/ble.sh" 4 | 5 | if [[ -n "${BLE_VERSION-}" ]]; then 6 | _log_warning "ble.sh is already loaded!" 7 | return 8 | fi 9 | 10 | _bash_it_ble_path=${XDG_DATA_HOME:-$HOME/.local/share}/blesh/ble.sh 11 | if [[ -f $_bash_it_ble_path ]]; then 12 | # shellcheck disable=1090 13 | source "$_bash_it_ble_path" --attach=prompt 14 | if _bash-it-component-item-is-enabled plugin fzf; then 15 | ble-import -d integration/fzf-key-bindings 16 | ble-import -d integration/fzf-completion 17 | fi 18 | else 19 | _log_error "Could not find ble.sh in $_bash_it_ble_path" 20 | _log_error "Please install using the following command:" 21 | _log_error "git clone https://github.com/akinomyoga/ble.sh && make -C ble.sh install" 22 | fi 23 | unset _bash_it_ble_path 24 | -------------------------------------------------------------------------------- /completion/available/dmidecode.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Make sure dmidecode is installed 4 | _bash-it-completion-helper-necessary dmidecode || : 5 | 6 | # Don't handle completion if it's already managed 7 | _bash-it-completion-helper-sufficient dmidecode || return 8 | 9 | function _dmidecode() { 10 | local prev="${COMP_WORDS[COMP_CWORD - 1]}" 11 | 12 | case $prev in 13 | -s | --string | -t | --type) 14 | OPTS=$(dmidecode "$prev" 2>&1 | grep -E '^ ' | sed 's/ *//g') 15 | # shellcheck disable=SC2207 16 | COMPREPLY=("${OPTS[@]}") 17 | ;; 18 | dmidecode) 19 | # shellcheck disable=SC2207 20 | COMPREPLY=("-d" "--dev-mem" "-h" "--help" "-q" "--quiet" "-s" "--string" "-t" "--type" "-H" "--handle" "-u" "--dump" "-dump-bin" "--from-dump" "--no-sysfs" "--oem-string" "-V" "--version") 21 | ;; 22 | esac 23 | } 24 | 25 | complete -F _dmidecode -X '!&*' dmidecode 26 | -------------------------------------------------------------------------------- /docs/themes-list/codeword.rst: -------------------------------------------------------------------------------- 1 | .. _codeword: 2 | 3 | Codeword Theme 4 | ============== 5 | 6 | Single line PS1 theme w/realtime history among windows. 7 | Minimal theme overrides from bash_it base theming 8 | 9 | ``user@host:path[virt-env][scm] $`` 10 | --------------------------------------- 11 | 12 | Breakdown of the segments: 13 | 14 | 15 | * **user@host:path** - *convienient for LAN based ``ssh`` and ``scp`` tasks* 16 | * [\ **virtualenv**\ ] - *only appears when activated* 17 | * [\ **scm**\ ] - *only appears when activated* 18 | * **marker** - *$ or # depending on current user* 19 | 20 | Examples 21 | ^^^^^^^^ 22 | 23 | .. code-block:: bash 24 | 25 | user@example.lan:~ $ cd /tmp/foo/bar/baz 26 | user@example.lan:/tmp/foo/bar/baz $ cd $HOME/workspace 27 | user@example.lan:~/workspace $ cd sampleRepo/ 28 | user@example.lan:~/workspace/sampleRepo [± |master ↑1 ↓3 {1} S:2 ?:1 ✗|] $ 29 | -------------------------------------------------------------------------------- /themes/bobby-python/bobby-python.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | CONDAENV_THEME_PROMPT_SUFFIX="|" 15 | 16 | function prompt_command() { 17 | PS1="\n${yellow?}$(python_version_prompt) " # Name of virtual env followed by python version 18 | PS1+="${purple?}\h " 19 | PS1+="${reset_color?}in " 20 | PS1+="${green?}\w\n" 21 | PS1+="${bold_cyan?}$(scm_char)" 22 | PS1+="${green?}$(scm_prompt_info) " 23 | PS1+="${green?}→${reset_color?} " 24 | } 25 | 26 | safe_append_prompt_command prompt_command 27 | -------------------------------------------------------------------------------- /plugins/available/cht-sh.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | # shellcheck disable=SC2016 4 | about-plugin 'Simplify `curl cht.sh/` to `cht.sh `' 5 | url "https://cht.sh/" 6 | 7 | # Play nicely if user already installed cht.sh cli tool 8 | if ! _command_exists cht.sh; then 9 | function cht.sh() { 10 | about 'Executes a cht.sh curl query using the provided arguments' 11 | param ' [ ( topic [sub-topic] ) | ~keyword ] [ :list | :help | :learn ]' 12 | example '$ cht.sh :help' 13 | example '$ cht.sh :list' 14 | example '$ cht.sh tar' 15 | example '$ cht.sh js "parse json"' 16 | example '$ cht.sh python :learn' 17 | example '$ cht.sh rust :list' 18 | group 'cht-sh' 19 | 20 | # Separate arguments with '/', preserving spaces within them 21 | local query 22 | query=$( 23 | IFS=/ 24 | echo "$*" 25 | ) 26 | curl "cht.sh/${query}" 27 | } 28 | fi 29 | -------------------------------------------------------------------------------- /themes/n0qorg/n0qorg.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # n0qorg theme by Florian Baumann 5 | 6 | ## look-a-like 7 | # host directory (branch*)» 8 | # for example: 9 | # ananas ~/Code/bash-it/themes (master*)» 10 | function prompt_command() { 11 | PS1="${bold_blue?}[$(hostname)]${normal?} \w${normal?} ${bold_white?}[$(git_prompt_info)]${normal?}» " 12 | } 13 | 14 | safe_append_prompt_command prompt_command 15 | 16 | ## git-theme 17 | # feel free to change git chars. 18 | GIT_THEME_PROMPT_DIRTY="${bold_blue?}*${bold_white?}" 19 | GIT_THEME_PROMPT_CLEAN="" 20 | GIT_THEME_PROMPT_PREFIX="${bold_blue?}(${bold_white?}" 21 | GIT_THEME_PROMPT_SUFFIX="${bold_blue?})" 22 | 23 | ## alternate chars 24 | # 25 | SCM_THEME_PROMPT_DIRTY="*" 26 | SCM_THEME_PROMPT_CLEAN="" 27 | SCM_THEME_PROMPT_PREFIX="(" 28 | SCM_THEME_PROMPT_SUFFIX=")" 29 | -------------------------------------------------------------------------------- /aliases/available/bash-it.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | # Common misspellings of bash-it 6 | alias shit='bash-it' 7 | alias batshit='bash-it' 8 | alias bashit='bash-it' 9 | alias batbsh='bash-it' 10 | alias babsh='bash-it' 11 | alias bash_it='bash-it' 12 | alias bash_ti='bash-it' 13 | 14 | # Additional bash-it aliases for help/show 15 | alias bshsa='bash-it show aliases' 16 | alias bshsc='bash-it show completions' 17 | alias bshsp='bash-it show plugins' 18 | alias bshha='bash-it help aliases' 19 | alias bshhc='bash-it help completions' 20 | alias bshhp='bash-it help plugins' 21 | alias bshsch="bash-it search" 22 | alias bshenp="bash-it enable plugin" 23 | alias bshena="bash-it enable alias" 24 | alias bshenc="bash-it enable completion" 25 | -------------------------------------------------------------------------------- /aliases/available/directory.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'Shortcuts for directory commands: ls, cd, &c.' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | if command ls --color -d . &> /dev/null; then 6 | alias ls='ls --color=auto' 7 | # BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set. 8 | fi 9 | 10 | # List directory contents 11 | alias sl=ls 12 | alias la='ls -AF' # Compact view, show hidden 13 | alias ll='ls -Al' 14 | alias l='ls -A' 15 | alias l1='ls -1' 16 | alias lf='ls -F' 17 | 18 | # Change directory 19 | alias ..='cd ..' # Go up one directory 20 | alias cd..='cd ..' # Common misspelling for going up one directory 21 | alias ...='cd ../..' # Go up two directories 22 | alias ....='cd ../../..' # Go up three directories 23 | alias -- -='cd -' # Go back 24 | 25 | # Create or remove directory 26 | alias md='mkdir -p' 27 | alias rd='rmdir' 28 | -------------------------------------------------------------------------------- /completion/available/ng.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "ng - Angular CLI for scaffolding and managing Angular applications" 5 | group "javascript" 6 | url "https://angular.io/cli" 7 | 8 | # Make sure ng is installed 9 | _bash-it-completion-helper-necessary ng || : 10 | 11 | # Don't handle completion if it's already managed 12 | _bash-it-completion-helper-sufficient ng || return 13 | 14 | # No longer supported, please see https://github.com/angular/angular-cli/issues/11043 15 | # Fix courtesy of https://stackoverflow.com/questions/50194674/ng-completion-no-longer-exists 16 | # source <(ng completion --bash) 17 | 18 | _ng_bash_completion_candidates=("add" "build" "config" "doc" "e2e" "generate" "help" "lint" "new" "run" "serve" "test" "update" "version" "xi18n") 19 | complete -W "${_ng_bash_completion_candidates[*]}" ng 20 | unset "${!_ng_bash_completion@}" 21 | -------------------------------------------------------------------------------- /aliases/available/maven.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'maven abbreviations' 3 | url "https://maven.apache.org/" 4 | 5 | alias mci='mvn clean install' 6 | alias mi='mvn install' 7 | alias mc='mvn clean' 8 | alias mct='mvn clean test' 9 | alias mcc='mvn clean compile' 10 | alias mccnt='mvn clean compile -DskipTests=true' 11 | alias mp='mvn package' 12 | alias mcp='mvn clean package' 13 | alias mcpnt='mvn clean package -DskipTests=true' 14 | alias mrprep='mvn release:prepare' 15 | alias mrperf='mvn release:perform' 16 | alias mrrb='mvn release:rollback' 17 | alias mdep='mvn dependency:tree' 18 | alias mpom='mvn help:effective-pom' 19 | alias mcisk='mci -Dmaven.test.skip=true' 20 | alias mcpsk='mcp -Dmaven.test.skip=true' 21 | 22 | # Maven service plugin aliases 23 | alias mspring='mvn spring-boot:run' 24 | alias mjetty='mvn jetty:run' 25 | alias mquark='mvn quarkus:dev' 26 | alias mmicro='mvn mn:run' 27 | -------------------------------------------------------------------------------- /themes/norbu/norbu.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | function set_prompt_symbol() { 5 | if [[ $1 -eq 0 ]]; then 6 | prompt_symbol=">_" 7 | else 8 | prompt_symbol="${orange?}>_${normal?}" 9 | fi 10 | } 11 | 12 | function prompt_command() { 13 | local ret_val="$?" prompt_symbol scm_prompt_info 14 | if [[ -n "${VIRTUAL_ENV:-}" ]]; then 15 | PYTHON_VIRTUALENV="${bold_yellow?}[${VIRTUAL_ENV##*/}]" 16 | fi 17 | 18 | scm_prompt_info="$(scm_prompt_info)" 19 | set_prompt_symbol "${ret_val}" 20 | PS1="${bold_orange?}${PYTHON_VIRTUALENV:-}${reset_color?}${bold_green?}[\w]${bold_blue?}[${scm_prompt_info}]${normal?} \n${prompt_symbol} " 21 | } 22 | 23 | # scm themeing 24 | SCM_THEME_PROMPT_DIRTY=" ✗" 25 | SCM_THEME_PROMPT_CLEAN=" ✓" 26 | SCM_THEME_PROMPT_PREFIX="[" 27 | SCM_THEME_PROMPT_SUFFIX="]" 28 | 29 | safe_append_prompt_command prompt_command 30 | -------------------------------------------------------------------------------- /aliases/available/homesick.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'homesick aliases' 3 | url "https://github.com/technicalpickles/homesick" 4 | 5 | # Aliases 6 | alias sikhm="homesick cd dotfiles" 7 | alias sikclone="homesick clone" 8 | alias sikcomt="homesick commit dotfiles" 9 | alias sikdstry="homesick destroy" 10 | alias sikdif="homesick diff dotfiles" 11 | alias sikexec="homesick exec dotfiles" 12 | alias sikexeca="homesick exec_all" 13 | alias sikgen="homesick generate" 14 | alias sikhlp="homesick help" 15 | alias siklnk="homesick link dotfiles" 16 | alias sikls="homesick list" 17 | alias sikopn="homesick open dotfiles" 18 | alias sikpll="homesick pull dotfiles" 19 | alias sikpsh="homesick push dotfiles" 20 | alias sikrc="homesick rc dotfiles" 21 | alias sikpth="homesick show_path dotfiles" 22 | alias sikst="homesick status dotfiles" 23 | alias sikulnk="homesick unlink dotfiles" 24 | alias sikv="homesick version" 25 | -------------------------------------------------------------------------------- /plugins/available/rvm.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # Load RVM, if you are using it 3 | 4 | cite about-plugin 5 | about-plugin 'load rvm, if you are using it' 6 | url "https://rvm.io/" 7 | 8 | # shellcheck disable=SC1091 9 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 10 | 11 | # Check to make sure that RVM is actually loaded before adding 12 | # the customizations to it. 13 | if [ "$rvm_path" ]; then 14 | # Load the auto-completion script if RVM was loaded. 15 | # shellcheck disable=SC1091 16 | [[ -r "$rvm_path/scripts/completion" ]] && . "$rvm_path/scripts/completion" 17 | 18 | switch() { 19 | rvm "$1" 20 | local v 21 | v=$(rvm_version) 22 | rvm wrapper "$1" textmate 23 | echo "Switch to Ruby version: $v" 24 | } 25 | 26 | rvm_default() { 27 | rvm --default "$1" 28 | rvm wrapper "$1" textmate 29 | } 30 | 31 | function rvm_version() { 32 | ruby --version 33 | } 34 | 35 | fi 36 | -------------------------------------------------------------------------------- /themes/wanelo/wanelo.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | RVM_THEME_PROMPT_PREFIX="|" 15 | RVM_THEME_PROMPT_SUFFIX="|" 16 | 17 | function prompt_command() { 18 | if [ $? -eq 0 ]; then 19 | status=❤️ 20 | else 21 | status=💔 22 | fi 23 | PS1="\n${yellow?}$(ruby_version_prompt) ${purple?}\h ${reset_color?}in ${green?}\w $status \n${bold_cyan?} ${blue?}|$(clock_prompt)|${green?}$(scm_prompt_info) ${green}→${reset_color?} " 24 | } 25 | 26 | THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${blue?}"} 27 | 28 | PROMPT_COMMAND=prompt_command 29 | -------------------------------------------------------------------------------- /completion/available/pip.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "pip - Python package installer and dependency manager" 5 | group "python" 6 | url "https://pip.pypa.io/" 7 | 8 | # https://pip.pypa.io/en/stable/user_guide/#command-completion 9 | # Of course, you should first install pip, say on Debian: 10 | # sudo apt-get install python-pip 11 | # If the pip package is installed within virtual environments, say, python managed by pyenv, 12 | # you should first initialize the corresponding environment. 13 | # So that pip is in the system's path. 14 | _command_exists pip || return 15 | 16 | function __bash_it_complete_pip() { 17 | if _command_exists _pip_completion; then 18 | complete -o default -F _pip_completion pip 19 | _pip_completion "$@" 20 | else 21 | eval "$(pip completion --bash)" 22 | _pip_completion "$@" 23 | fi 24 | } 25 | complete -o default -F __bash_it_complete_pip pip 26 | -------------------------------------------------------------------------------- /completion/available/pip3.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "pip3 - Python 3 package installer and dependency manager" 5 | group "python" 6 | url "https://pip.pypa.io/" 7 | 8 | # https://pip.pypa.io/en/stable/user_guide/#command-completion 9 | # Of course, you should first install pip, say on Debian: 10 | # sudo apt-get install python3-pip 11 | # If the pip package is installed within virtual environments, say, python managed by pyenv, 12 | # you should first initialize the corresponding environment. 13 | # So that pip3 is in the system's path. 14 | _command_exists pip3 || return 15 | 16 | function __bash_it_complete_pip3() { 17 | if _command_exists _pip_completion; then 18 | complete -o default -F _pip_completion pip3 19 | _pip_completion "$@" 20 | else 21 | eval "$(pip3 completion --bash)" 22 | _pip_completion "$@" 23 | fi 24 | } 25 | complete -o default -F __bash_it_complete_pip3 pip3 26 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /hooks/check-clean-files-txt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | file=$1 4 | # Should only be run on clean_files.txt 5 | if [ "$file" != "clean_files.txt" ]; then 6 | echo "Please run this script on clean_files.txt only!" 7 | exit 1 8 | fi 9 | 10 | function compare_lines() { 11 | prev="" 12 | local line 13 | while read -r line; do 14 | # Skip unimportant lines 15 | [[ $line =~ "#" ]] && continue 16 | [[ $line == "" ]] && continue 17 | # Actual check 18 | if [[ $prev > $line ]]; then 19 | echo "$line should be before $prev" 20 | exit 1 21 | fi 22 | prev=$line 23 | done <<< "$1" 24 | } 25 | 26 | # We compare using the legacy way 27 | shopt -s compat31 28 | 29 | # Test root files 30 | compare_lines "$(grep -v "/" "$file")" 31 | 32 | # Test root directory 33 | compare_lines "$(grep "/$" "$file")" 34 | 35 | # Test non root directories 36 | compare_lines "$(grep "/." "$file")" 37 | 38 | shopt -u compat31 39 | # Yay, all good! 40 | exit 0 41 | -------------------------------------------------------------------------------- /aliases/available/apt.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # -binaryanomaly 4 | 5 | cite 'about-alias' 6 | about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.' 7 | url "https://wiki.debian.org/Apt" 8 | 9 | # set apt aliases 10 | function _set_pkg_aliases() { 11 | if _command_exists apt; then 12 | alias apts='apt-cache search' 13 | alias aptshow='apt-cache show' 14 | alias aptinst='sudo apt-get install -V' 15 | alias aptupd='sudo apt-get update' 16 | alias aptupg='sudo apt-get dist-upgrade -V && sudo apt-get autoremove' 17 | alias aptupgd='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo apt-get autoremove' 18 | alias aptrm='sudo apt-get remove' 19 | alias aptpurge='sudo apt-get remove --purge' 20 | 21 | alias chkup='/usr/lib/update-notifier/apt-check -p --human-readable' 22 | alias chkboot='cat /var/run/reboot-required' 23 | 24 | alias pkgfiles='dpkg --listfiles' 25 | fi 26 | } 27 | 28 | _set_pkg_aliases 29 | -------------------------------------------------------------------------------- /plugins/available/ssh.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'ssh helper functions' 4 | url "https://www.openssh.com/" 5 | 6 | function add_ssh() { 7 | about 'add entry to ssh config' 8 | param '1: host' 9 | param '2: hostname' 10 | param '3: user' 11 | group 'ssh' 12 | 13 | [[ $# -ne 3 ]] && echo "add_ssh host hostname user" && return 1 14 | [[ ! -d ~/.ssh ]] && mkdir -m 700 ~/.ssh 15 | [[ ! -e ~/.ssh/config ]] && touch ~/.ssh/config && chmod 600 ~/.ssh/config 16 | echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config 17 | } 18 | 19 | function sshlist() { 20 | about 'list hosts defined in ssh config' 21 | group 'ssh' 22 | 23 | awk '$1 ~ /Host$/ {for (i=2; i<=NF; i++) print $i}' ~/.ssh/config 24 | } 25 | 26 | function ssh-add-all() { 27 | about 'add all ssh private keys to agent' 28 | group 'ssh' 29 | 30 | grep -slR "PRIVATE" ~/.ssh | xargs ssh-add 31 | } 32 | -------------------------------------------------------------------------------- /aliases/available/dnf.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'dnf aliases for fedora 22+ distros' 3 | url "https://dnf.readthedocs.io/" 4 | 5 | if _command_exists dnf; then 6 | alias dnfp="dnf info" # Show package information 7 | alias dnfl="dnf list" # List packages 8 | alias dnfli="dnf list installed" # List installed packages 9 | alias dnfgl="dnf grouplist" # List package groups 10 | alias dnfmc="dnf makecache" # Generate metadata cache 11 | alias dnfs="dnf search" # Search package 12 | 13 | alias dnfi="sudo dnf install" # Install package 14 | alias dnfr="sudo dnf remove" # Remove package 15 | alias dnfu="sudo dnf upgrade" # Upgrade package 16 | alias dnfc="sudo dnf clean all" # Clean cache 17 | alias dnfri="sudo dnf reinstall" # Reinstall package 18 | alias dnfgi="sudo dnf groupinstall" # Install package group 19 | alias dnfgr="sudo dnf groupremove" # Remove package group 20 | fi 21 | -------------------------------------------------------------------------------- /test/plugins/ruby.plugin.bats: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bats 2 | 3 | load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash" 4 | 5 | function local_setup_file() { 6 | setup_libs "helpers" 7 | } 8 | 9 | @test "plugins ruby: remove_gem is defined" { 10 | run load "${BASH_IT?}/plugins/available/ruby.plugin.bash" 11 | assert_success 12 | load "${BASH_IT?}/plugins/available/ruby.plugin.bash" 13 | 14 | run type remove_gem 15 | assert_line -n 1 "remove_gem () " 16 | } 17 | 18 | @test "plugins ruby: PATH includes ~/.gem/ruby/bin" { 19 | local last_path_entry 20 | if ! type ruby > /dev/null; then 21 | skip 'ruby not installed' 22 | fi 23 | 24 | mkdir -p "$(ruby -e 'print Gem.user_dir')/bin" 25 | 26 | run load "${BASH_IT?}/plugins/available/ruby.plugin.bash" 27 | assert_success 28 | load "${BASH_IT?}/plugins/available/ruby.plugin.bash" 29 | 30 | last_path_entry="$(tail -1 <<< "${PATH//:/$'\n'}")" 31 | [[ "${last_path_entry}" == "$(ruby -e 'print Gem.user_dir')/bin" ]] 32 | } 33 | -------------------------------------------------------------------------------- /themes/robbyrussell/robbyrussell.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034,SC2154 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${bold_yellow?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" ${bold_blue?}scm:(" 7 | SCM_THEME_PROMPT_SUFFIX="${bold_blue?})" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${bold_yellow?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${bold_blue?}git:(" 12 | GIT_THEME_PROMPT_SUFFIX="${bold_blue?})" 13 | 14 | RVM_THEME_PROMPT_PREFIX="|" 15 | RVM_THEME_PROMPT_SUFFIX="|" 16 | 17 | VIRTUALENV_THEME_PROMPT_PREFIX='(' 18 | VIRTUALENV_THEME_PROMPT_SUFFIX=') ' 19 | 20 | function git_prompt_info() { 21 | git_prompt_vars 22 | echo -e "$SCM_PREFIX${bold_red?}$SCM_BRANCH$SCM_STATE$SCM_SUFFIX" 23 | } 24 | 25 | function prompt_command() { 26 | PS1="$(conda_or_venv_prompt)${bold_green?}➜ ${bold_cyan?}\W${reset_color?}$(scm_prompt_info)${normal?} " 27 | } 28 | 29 | PROMPT_COMMAND=prompt_command 30 | -------------------------------------------------------------------------------- /plugins/available/less-pretty-cat.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'pygmentize instead of cat to terminal if possible' 4 | url "https://pygments.org/" 5 | 6 | _command_exists pygmentize || return 7 | 8 | # pigmentize cat and less outputs - call them ccat and cless to avoid that 9 | # especially cat'ed output in scripts gets mangled with pygemtized meta characters 10 | function ccat() { 11 | about 'runs pygmentize on each file passed in' 12 | param '*: files to concatenate (as normally passed to cat)' 13 | example 'ccat mysite/manage.py dir/text-file.txt' 14 | 15 | pygmentize -f 256 -O style="${BASH_IT_CCAT_STYLE:-default}" -g "$@" 16 | } 17 | 18 | function cless() { 19 | about 'pigments the files passed in and passes to less for pagination' 20 | param '*: the files to paginate with less' 21 | example 'cless mysite/manage.py' 22 | 23 | pygmentize -f 256 -O style="${BASH_IT_CLESS_STYLE:-default}" -g "$@" | command less -R 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/test/runshellcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # run code quality metrics 4 | echo "Testing \"code quality\" with shellcheck.net in ../composure.sh:" 5 | datafile=shellcheck.raw 6 | metricfile=shellcheck.out 7 | 8 | curl -s --data-urlencode script="$(cat ../composure.sh)" \ 9 | www.shellcheck.net/shellcheck.php > $datafile 10 | cat $datafile | python -mjson.tool > $metricfile 11 | rm $datafile 12 | cat $metricfile 13 | 14 | # check for shellcheck.net errors 15 | cat $metricfile | grep -q error 16 | if [ $? -eq 0 ]; then 17 | echo "! shellcheck.net:../composure.sh:0 [ errors ] FAILED" 18 | rm $metricfile 19 | exit 2 20 | fi 21 | 22 | # check for shellcheck.net warnings 23 | cat $metricfile | grep -q warning 24 | if [ $? -eq 0 ]; then 25 | echo "! shellcheck.net:../composure.sh:0 [ warnings ] FAILED" 26 | rm $metricfile 27 | exit 2 28 | fi 29 | 30 | echo "! shellcheck.net:../composure.sh:0 [ no errors or warnings ] ok" 31 | rm $metricfile 32 | -------------------------------------------------------------------------------- /completion/available/artisan.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite "about-completion" 3 | about-completion "Laravel artisan completion" 4 | group "php" 5 | url "https://laravel.com/docs/artisan" 6 | 7 | # Completion function for Laravel artisan 8 | _artisan_completion() { 9 | local cur artisan_commands 10 | COMPREPLY=() 11 | cur="${COMP_WORDS[COMP_CWORD]}" 12 | 13 | # Only provide completions if artisan file exists in current directory 14 | if [[ ! -f "artisan" ]]; then 15 | return 0 16 | fi 17 | 18 | # Get list of available artisan commands 19 | # Use command prefix to bypass user aliases 20 | # shellcheck disable=SC2034 21 | artisan_commands=$(command php artisan --raw --no-ansi list 2> /dev/null | command sed "s/[[:space:]].*//") 22 | 23 | # shellcheck disable=SC2016,SC2207 24 | COMPREPLY=($(compgen -W '${artisan_commands}' -- "${cur}")) 25 | return 0 26 | } 27 | 28 | # Complete for both 'artisan' and common alias 'art' 29 | complete -F _artisan_completion artisan art 30 | -------------------------------------------------------------------------------- /vendor/github.com/rcaloras/bash-preexec/test/README.md: -------------------------------------------------------------------------------- 1 | Testing `bash-preexec` 2 | ====================== 3 | 4 | **Note on test conditions** 5 | 6 | When writing test conditions, use `[ ... ]` instead of `[[ ... ]]` since the 7 | former are supported by Bats on Bash versions before 4.1. In particular, macOS 8 | uses Bash 3.2, and `[[ ... ]]` tests always pass on macOS. 9 | 10 | In some cases, you may want to use a feature unique to `[[ ... ]]` such as 11 | pattern matching (`[[ $name = a* ]]`) or regular expressions (`[[ $(date) =~ 12 | ^Fri\ ...\ 13 ]]`). In those cases, use the following pattern to replace “bare” 13 | `[[ ... ]]`. 14 | 15 | ``` 16 | [[ ... ]] || return 1 17 | ``` 18 | 19 | References: 20 | * [Differences between `[` and `[[`](http://mywiki.wooledge.org/BashFAQ/031) 21 | * [Problems with `[[` in Bats](https://github.com/sstephenson/bats/issues/49) 22 | * [Using `|| return 1` instead of `|| false`](https://github.com/bats-core/bats-core/commit/e5695a673faad4d4d33446ed5c99d70dbfa6d8be) 23 | -------------------------------------------------------------------------------- /docs/themes-list/inretio.rst: -------------------------------------------------------------------------------- 1 | .. _inretio: 2 | 3 | Inretio Theme 4 | ============= 5 | 6 | Simple theme showing date and time, username and hostname, current folder, Git details and as a bonus - virtual environment along with Python version available in it. 7 | 8 | Inspired by existing themes: 9 | - metal 10 | - bobby 11 | 12 | Examples 13 | -------- 14 | 15 | In Git-tracked folder: 16 | 17 | .. code-block:: bash 18 | 19 | ┌──[2024-03-20 12:05:07] 🐧 gytis 💻 gytis-legion 📂 bash-it on 🌵 theme-inretio ⌀1 ✗ 20 | └> ls 21 | aliases clean_files.txt custom hooks lib lint_clean_files.sh profiles template test_lib uninstall.sh 22 | bash_it.sh completion docs install.sh LICENSE plugins scripts test themes vendor 23 | 24 | 25 | In Python virtual environment: 26 | 27 | .. code-block:: bash 28 | 29 | ┌──[2024-03-20 12:07:32] 🐧 gytis 💻 gytis-legion 🐍 3.12.2 on [general] 📂 general 30 | └> ls 31 | bin include lib lib64 pyvenv.cfg share 32 | -------------------------------------------------------------------------------- /plugins/available/explain.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'mankier.com explain function to explain other commands' 4 | url "https://www.mankier.com/" 5 | 6 | explain() { 7 | about 'explain any bash command via mankier.com manpage API' 8 | param '1: Name of the command to explain' 9 | example '$ explain # interactive mode. Type commands to explain in REPL' 10 | example '$ explain '"'"'cmd -o | ...'"'"' # one quoted command to explain it.' 11 | group 'explain' 12 | 13 | if [ "$#" -eq 0 ]; then 14 | while read -r -p "Command: " cmd; do 15 | curl -Gs "https://www.mankier.com/api/explain/?cols=$(tput cols)" --data-urlencode "q=$cmd" 16 | done 17 | echo "Bye!" 18 | elif [ "$#" -eq 1 ]; then 19 | curl -Gs "https://www.mankier.com/api/explain/?cols=$(tput cols)" --data-urlencode "q=$1" 20 | else 21 | echo "Usage" 22 | echo "explain interactive mode." 23 | echo "explain 'cmd -o | ...' one quoted command to explain it." 24 | fi 25 | } 26 | -------------------------------------------------------------------------------- /themes/rainbowbrite/rainbowbrite.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # based off of n0qorg 5 | # looks like, if you're in a git repo: 6 | # ± ~/path/to (branch ✓) $ 7 | # in glorious red / blue / yellow color scheme 8 | 9 | prompt_setter() { 10 | # Save history 11 | _save-and-reload-history 1 12 | # displays user@server in purple 13 | # PS1="${red?}$(scm_char) ${purple?}\u@\h${reset_color?}:${blue?}\w${yellow?}$(scm_prompt_info)$(ruby_version_prompt) ${black?}\$${reset_color?} " 14 | # no user@server 15 | PS1="${red?}$(scm_char) ${blue?}\w${yellow?}$(scm_prompt_info)$(ruby_version_prompt) ${black?}\$${reset_color?} " 16 | PS2='> ' 17 | PS4='+ ' 18 | } 19 | 20 | safe_append_prompt_command prompt_setter 21 | 22 | SCM_NONE_CHAR='·' 23 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 24 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓" 25 | SCM_THEME_PROMPT_PREFIX=" (" 26 | SCM_THEME_PROMPT_SUFFIX="${yellow?})" 27 | RVM_THEME_PROMPT_PREFIX=" (" 28 | RVM_THEME_PROMPT_SUFFIX=")" 29 | -------------------------------------------------------------------------------- /themes/bira/bira.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX=" ${yellow?}‹" 5 | SCM_THEME_PROMPT_SUFFIX="›${reset_color?}" 6 | 7 | VIRTUALENV_THEME_PROMPT_PREFIX=" ${cyan?}‹" 8 | VIRTUALENV_THEME_PROMPT_SUFFIX="›${reset_color?}" 9 | CONDAENV_THEME_PROMPT_PREFIX=" ${cyan?}‹" 10 | CONDAENV_THEME_PROMPT_SUFFIX="›${reset_color?}" 11 | 12 | bold="\[\e[1m\]" 13 | 14 | if [[ ${UID} -eq 0 ]]; then 15 | user_host="${bold_red?}\u@\h${normal?}${reset_color?}" 16 | else 17 | user_host="${bold_green?}\u@\h${normal?}${reset_color?}" 18 | fi 19 | 20 | function prompt_command() { 21 | local current_dir=" ${bold_blue?}\w${normal?}${reset_color?}" 22 | local virtualenv_prompt scm_prompt_info 23 | virtualenv_prompt="${virtualenv_prompt:-$(condaenv_prompt)}" 24 | scm_prompt_info="$(scm_prompt_info)" 25 | PS1="╭─${user_host?}${current_dir}${virtualenv_prompt}${scm_prompt_info}\n╰─${bold?}\\$ ${normal?}" 26 | } 27 | 28 | safe_append_prompt_command prompt_command 29 | -------------------------------------------------------------------------------- /vendor/github.com/gaelicWizard/bash-progcomp/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [**.md] 10 | indent_style = space 11 | indent_size = 2 12 | trim_trailing_whitespace = false 13 | 14 | [.git*] 15 | indent_style = tab 16 | 17 | [**.*sh] 18 | indent_style = tab 19 | indent_size = tab 20 | 21 | shell_variant = bash 22 | binary_next_line = true # like -bn 23 | switch_case_indent = false # like -ci 24 | space_redirects = true # like -sr 25 | keep_padding = false # like -kp 26 | function_next_line = true # like -fn 27 | end_of_line = lf 28 | charset = utf-8 29 | trim_trailing_whitespace = true 30 | insert_final_newline = true 31 | 32 | [**.bats] 33 | indent_style = tab 34 | indent_size = tab 35 | 36 | shell_variant = bash 37 | end_of_line = lf 38 | charset = utf-8 39 | trim_trailing_whitespace = true 40 | insert_final_newline = true 41 | -------------------------------------------------------------------------------- /completion/available/capistrano.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "capistrano - remote server automation and deployment tool for Ruby" 5 | group "deployment" 6 | url "https://capistranorb.com/" 7 | 8 | # Bash completion support for Capistrano. 9 | 10 | export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} 11 | 12 | _capcomplete() { 13 | if [ -f Capfile ]; then 14 | # shellcheck disable=SC2012 15 | recent=$(ls -t .cap_tasks~ Capfile ./**/*.cap 2> /dev/null | head -n 1) 16 | if [[ $recent != '.cap_tasks~' ]]; then 17 | if cap --version | grep -q 'Capistrano v2.'; then 18 | # Capistrano 2.x 19 | cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~ 20 | else 21 | # Capistrano 3.x 22 | cap --all --tasks | cut -d " " -f 2 > .cap_tasks~ 23 | fi 24 | fi 25 | # shellcheck disable=SC2207 26 | COMPREPLY=($(compgen -W "$(cat .cap_tasks~)" -- "${COMP_WORDS[COMP_CWORD]}")) 27 | return 0 28 | fi 29 | } 30 | 31 | complete -o default -o nospace -F _capcomplete cap 32 | -------------------------------------------------------------------------------- /completion/available/terraform.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "terraform/tofu completion" 3 | 4 | # Note, this is not using the _bash-it-completion-helper-necessary function 5 | # because it's a multiple choice case, and will therefore produce more 6 | # sensible log messages. 7 | 8 | # Check if at least one of the binaries is available (OR logic) 9 | if ! _binary_exists terraform && ! _binary_exists tofu; then 10 | _log_warning "Without 'terraform' or 'tofu' installed, this completion won't be too useful." 11 | return 1 12 | fi 13 | 14 | # Handle terraform completion if available and not already managed 15 | if _binary_exists terraform; then 16 | _bash-it-completion-helper-sufficient terraform || { 17 | # Terraform completes itself 18 | complete -C terraform terraform 19 | } 20 | fi 21 | 22 | # Handle tofu completion if available and not already managed 23 | if _binary_exists tofu; then 24 | _bash-it-completion-helper-sufficient tofu || { 25 | # OpenTofu completes itself 26 | complete -C tofu tofu 27 | } 28 | fi 29 | -------------------------------------------------------------------------------- /lib/preview.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # Displays the prompt from each _Bash It_ theme. 4 | 5 | function _bash-it-preview() { 6 | local BASH_IT_THEME BASH_IT_LOG_LEVEL 7 | local themes IFS=$'\n' cur 8 | 9 | if [[ $# -gt '0' ]]; then 10 | themes=("$@") 11 | else 12 | themes=("${BASH_IT?}/themes"/*/*.theme.bash) 13 | themes=("${themes[@]##*/}") 14 | themes=("${themes[@]%.theme.bash}") 15 | fi 16 | 17 | if [[ ${COMP_CWORD:-} -gt '0' ]]; then 18 | cur="${COMP_WORDS[COMP_CWORD]}" 19 | read -d '' -ra COMPREPLY < <(compgen -W "all${IFS}${themes[*]}" -- "${cur}") 20 | return 21 | fi 22 | printf '\n\n\t%s\n\n' "Previewing Bash-it Themes" 23 | 24 | # shellcheck disable=SC2034 25 | for BASH_IT_THEME in "${themes[@]}"; do 26 | BASH_IT_LOG_LEVEL=0 27 | bash --init-file "${BASH_IT?}/bash_it.sh" -i <<< '_bash-it-flash-term "${#BASH_IT_THEME}" "${BASH_IT_THEME}"' 28 | done 29 | } 30 | 31 | if [[ -n "${BASH_PREVIEW:-}" ]]; then 32 | _bash-it-preview "${BASH_PREVIEW}" "$@" 33 | unset BASH_PREVIEW #Prevent infinite looping 34 | fi 35 | -------------------------------------------------------------------------------- /completion/available/test_kitchen.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2120,SC2207 3 | __kitchen_instance_list() { 4 | # cache to .kitchen.list.yml 5 | if [[ .kitchen.yml -nt .kitchen.list.yml || .kitchen.local.yml -nt .kitchen.list.yml ]]; then 6 | # update list if config has updated 7 | kitchen list --bare > .kitchen.list.yml 8 | fi 9 | cat .kitchen.list.yml 10 | } 11 | 12 | __kitchen_options() { 13 | cur="${COMP_WORDS[COMP_CWORD]}" 14 | prev="${COMP_WORDS[COMP_CWORD - 1]}" 15 | COMPREPLY=() 16 | 17 | case $prev in 18 | converge | create | destroy | diagnose | list | login | setup | test | verify) 19 | COMPREPLY=($(compgen -W "$(__kitchen_instance_list)" -- "${cur}")) 20 | return 0 21 | ;; 22 | driver) 23 | COMPREPLY=($(compgen -W "create discover help" -- "${cur}")) 24 | return 0 25 | ;; 26 | *) 27 | COMPREPLY=($(compgen -W "console converge create destroy driver help init list login setup test verify version" -- "${cur}")) 28 | return 0 29 | ;; 30 | esac 31 | } 32 | complete -F __kitchen_options kitchen 33 | -------------------------------------------------------------------------------- /plugins/available/z_autoenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2207,SC2120,SC2034 3 | cite about-plugin 4 | about-plugin 'source into environment when cding to directories' 5 | url "https://github.com/Bash-it/bash-it" 6 | 7 | if [[ -n "${ZSH_VERSION}" ]]; then 8 | __array_offset=0 9 | else 10 | __array_offset=1 11 | fi 12 | 13 | autoenv_init() { 14 | typeset target home _file 15 | typeset -a _files 16 | target=$1 17 | home="${HOME%/*}" 18 | 19 | _files=($( 20 | while [[ "$PWD" != "/" && "$PWD" != "$home" ]]; do 21 | _file="$PWD/.env" 22 | if [[ -e "${_file}" ]]; then 23 | echo "${_file}" 24 | fi 25 | builtin cd .. || true 26 | done 27 | )) 28 | 29 | _file=${#_files[@]} 30 | while ((_file > 0)); do 31 | #shellcheck disable=SC1090 32 | source "${_files[_file - __array_offset]}" 33 | : $((_file -= 1)) 34 | done 35 | } 36 | 37 | cd() { 38 | local return_code 39 | if builtin cd "$@"; then 40 | autoenv_init 41 | return 0 42 | else 43 | return_code=$? 44 | echo "else?" 45 | return "$return_code" 46 | fi 47 | } 48 | -------------------------------------------------------------------------------- /completion/available/docker.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-completion "docker completion" 3 | 4 | # Make sure docker is installed 5 | _bash-it-completion-helper-necessary docker || : 6 | 7 | # Don't handle completion if it's already managed 8 | _bash-it-completion-helper-sufficient docker || return 9 | 10 | _docker_bash_completion_paths=( 11 | # MacOS App 12 | '/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion' 13 | # Command Line 14 | '/usr/share/bash-completion/completions/docker' 15 | ) 16 | 17 | # Load the first completion file found 18 | _docker_bash_completion_found=false 19 | for _comp_path in "${_docker_bash_completion_paths[@]}"; do 20 | if [[ -r "$_comp_path" ]]; then 21 | _docker_bash_completion_found=true 22 | # shellcheck disable=SC1090 23 | source "$_comp_path" 24 | break 25 | fi 26 | done 27 | 28 | # Cleanup 29 | if [[ "${_docker_bash_completion_found}" == false ]]; then 30 | _log_warning "no completion files found - please try enabling the 'system' completion instead." 31 | fi 32 | unset "${!_docker_bash_completion@}" 33 | -------------------------------------------------------------------------------- /aliases/available/git-omz.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite 'about-alias' 3 | about-alias 'git aliases from oh-my-zsh (incompatible with regular git aliases option)' 4 | url "https://git-scm.com/" 5 | 6 | if _bash-it-component-item-is-enabled aliases git; then 7 | _log_warning "git-omz aliases are incompatible with regular git aliases" 8 | return 1 9 | fi 10 | 11 | # Load after regular git aliases 12 | # BASH_IT_LOAD_PRIORITY: 160 13 | 14 | # Setup git version 15 | read -ra git_version_arr <<< "$(git version 2> /dev/null)" 16 | # shellcheck disable=SC2034 17 | git_version="${git_version_arr[2]}" 18 | 19 | # Setup is-at-least 20 | function is-at-least { 21 | local expected_version=$1 22 | local actual_version=$2 23 | local versions 24 | 25 | printf -v versions '%s\n%s' "$expected_version" "$actual_version" 26 | [[ $versions = "$(sort -V <<< "$versions")" ]] 27 | } 28 | 29 | # Setup git_current_branch 30 | function git_current_branch { 31 | _git-branch 32 | } 33 | 34 | # shellcheck disable=SC1090 35 | source "${BASH_IT}"/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh 36 | -------------------------------------------------------------------------------- /plugins/available/gitstatus.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'speeds up your life by using gitstatus for git status calculations. install from https://github.com/romkatv/gitstatus' 4 | url "https://github.com/romkatv/gitstatus" 5 | 6 | function gitstatus_on_disable() { 7 | about 'Destructor of gitstatus plugin' 8 | group 'gitstatus' 9 | 10 | unset SCM_GIT_USE_GITSTATUS 11 | _command_exists gitstatus_stop && gitstatus_stop 12 | } 13 | 14 | # No scm-check 15 | [[ $SCM_CHECK == "true" ]] || return 16 | 17 | # non-interactive shell 18 | [[ $- == *i* ]] || return 19 | 20 | : "${SCM_GIT_GITSTATUS_DIR:="$HOME/gitstatus"}" 21 | if [[ -d ${SCM_GIT_GITSTATUS_DIR} ]]; then 22 | # shellcheck disable=SC1091 23 | source "${SCM_GIT_GITSTATUS_DIR}/gitstatus.plugin.sh" 24 | # Start the actual gitstatus binary 25 | gitstatus_stop && gitstatus_start -s -1 -u -1 -c -1 -d -1 26 | export SCM_GIT_USE_GITSTATUS=true 27 | else 28 | _log_warning "Could not find gitstatus directory in ${SCM_GIT_GITSTATUS_DIR}. Please specify directory location using SCM_GIT_GITSTATUS_DIR." 29 | fi 30 | -------------------------------------------------------------------------------- /lib/completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # Functions for working with _Bash_'s Programmable Completion 3 | 4 | # 5 | ## 6 | # Testing Completion Functions 7 | ## 8 | # 9 | 10 | # 11 | 12 | # 13 | ## 14 | # Generating Completion Results 15 | ## 16 | # 17 | 18 | # 19 | 20 | # 21 | ## 22 | # Loading _Bash It_'s Completion Plugins 23 | ## 24 | 25 | function _bash-it-completion-helper-necessary() { 26 | local requirement _result=0 27 | for requirement in "$@"; do 28 | if ! _binary_exists "${requirement}"; then 29 | _result=1 30 | fi 31 | done 32 | if [[ ${_result} -gt 0 ]]; then 33 | _log_warning "Without '${!#}' installed, this completion won't be too useful." 34 | fi 35 | return "${_result}" 36 | } 37 | 38 | function _bash-it-completion-helper-sufficient() { 39 | local completion _result=0 40 | for completion in "$@"; do 41 | if _completion_exists "${completion}"; then 42 | _result=1 43 | fi 44 | done 45 | if [[ ${_result} -gt 0 ]]; then 46 | _log_warning "completion already loaded - this usually means it is safe to stop using this completion." 47 | fi 48 | return "${_result}" 49 | } 50 | -------------------------------------------------------------------------------- /themes/axin/axin.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Axin Bash Prompt, inspired by theme "Sexy" and "Bobby" 4 | # thanks to them 5 | 6 | if tput setaf 1 &> /dev/null; then 7 | if [[ $(tput colors) -ge 256 ]] 2> /dev/null; then 8 | MAGENTA=$(tput setaf 9) 9 | ORANGE=$(tput setaf 172) 10 | GREEN=$(tput setaf 190) 11 | PURPLE=$(tput setaf 141) 12 | WHITE=$(tput setaf 0) 13 | else 14 | MAGENTA=$(tput setaf 5) 15 | ORANGE=$(tput setaf 4) 16 | GREEN=$(tput setaf 2) 17 | PURPLE=$(tput setaf 1) 18 | WHITE=$(tput setaf 7) 19 | fi 20 | BOLD=$(tput bold) 21 | RESET=$(tput sgr0) 22 | else 23 | MAGENTA="\033[1;31m" 24 | ORANGE="\033[1;33m" 25 | GREEN="\033[1;32m" 26 | PURPLE="\033[1;35m" 27 | WHITE="\033[1;37m" 28 | BOLD="" 29 | RESET="\033[m" 30 | fi 31 | 32 | function prompt_command() { 33 | PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]@ \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\[$SCM_THEME_PROMPT_PREFIX\]$(clock_prompt) \[$PURPLE\]$(scm_prompt_info) \n\$ \[$RESET\]" 34 | } 35 | 36 | THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${white?}"} 37 | 38 | safe_append_prompt_command prompt_command 39 | -------------------------------------------------------------------------------- /docs/commands/profile.rst: -------------------------------------------------------------------------------- 1 | .. _profile: 2 | 3 | Bash-it Profile 4 | --------------- 5 | 6 | Have you ever wanted to port your *Bash-it* configuration into another machine? 7 | 8 | If you did, then ``bash-it profile`` is for you! 9 | 10 | This command can save and load custom *"profile"* files, that can be later 11 | used to load and recreate your configuration, in any machine you would like |:smile:| 12 | 13 | When porting your configuration into a new machine, you just need to save your current profile, copy the resulting *"profile"* file, and load it in the other machine. 14 | 15 | Example 16 | ^^^^^^^ 17 | 18 | .. code-block:: bash 19 | 20 | # Saves your current profile 21 | bash-it profile save my_profile 22 | # Load the default profile, which is the one used in the default installation. 23 | bash-it profile load default 24 | 25 | # Do whatever you want: 26 | # Disable stuff 27 | bash-it disable ... 28 | # Enable stuff 29 | bash-it enable ... 30 | # If you want to get back into your original configuration, you can do it easily 31 | bash-it profile load my_profile 32 | -------------------------------------------------------------------------------- /completion/available/makefile.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Bash completion for Makefile 4 | # Loosely adapted from http://stackoverflow.com/a/38415982/1472048 5 | 6 | function _makecomplete() { 7 | local cur="${COMP_WORDS[COMP_CWORD]}" 8 | local files=() targets=() line f 9 | COMPREPLY=() 10 | 11 | # https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html 12 | for f in 'GNUmakefile' 'makefile' 'Makefile'; do 13 | [[ -f "$f" ]] && files+=("$f") 14 | done 15 | 16 | [[ "${#files[@]}" -eq 0 ]] && return 0 17 | 18 | # collect all targets 19 | for f in "${files[@]}"; do 20 | while IFS='' read -r line; do 21 | targets+=("$line") 22 | done < <(grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' "$f" | cut -d':' -f1) 23 | done 24 | 25 | [[ "${#targets[@]}" -eq 0 ]] && return 0 26 | 27 | # use the targets for completion 28 | while IFS='' read -r line; do 29 | COMPREPLY+=("$line") 30 | done < <(compgen -W "$(tr ' ' '\n' <<< "${targets[@]}" | sort -u)" -- "${cur}") 31 | 32 | return 0 33 | } 34 | 35 | complete -o nospace -F _makecomplete make 36 | complete -o nospace -F _makecomplete gnumake 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2021 Bash-it 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/commands/update.rst: -------------------------------------------------------------------------------- 1 | .. _update: 2 | 3 | Bash-it update 4 | ^^^^^^^^^^^^^^ 5 | 6 | To update Bash-it to the latest stable version, simply run: 7 | 8 | .. code-block:: bash 9 | 10 | bash-it update stable 11 | 12 | If you want to update to the latest dev version (directly from master), run: 13 | 14 | .. code-block:: bash 15 | 16 | bash-it update dev 17 | 18 | If you want to update automatically and unattended, you can add the optional 19 | ``-s/--silent`` flag, for example: 20 | 21 | .. code-block:: bash 22 | 23 | bash-it update dev --silent 24 | 25 | .. _migrate: 26 | 27 | Bash-it migrate 28 | ^^^^^^^^^^^^^^^ 29 | 30 | If you are using an older version of Bash-it, it's possible that some functionality has changed, or that the internal structure of how Bash-it organizes its functionality has been updated. 31 | For these cases, we provide a ``migrate`` command: 32 | 33 | .. code-block:: bash 34 | 35 | bash-it migrate 36 | 37 | This command will automatically migrate the Bash-it structure to the latest version. 38 | The ``migrate`` command is run automatically if you run the ``update``\ , ``enable`` or ``disable`` commands. 39 | -------------------------------------------------------------------------------- /vendor/github.com/erichs/composure/LICENSE: -------------------------------------------------------------------------------- 1 | License: The MIT License 2 | Copyright © 2012, 2016 Erich Smith 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so, subject to the following 8 | conditions: 9 | The above copyright notice and this permission notice shall be included in all copies 10 | or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 12 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 13 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 14 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 15 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 16 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /plugins/available/python.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'alias "shttp" to SimpleHTTPServer' 3 | url "https://docs.python.org/3/library/http.server.html" 4 | 5 | if _command_exists python3; then 6 | alias shttp='python3 -m http.server' 7 | elif _command_exists python; then 8 | alias shttp='python -m http.server' 9 | else 10 | _log_warning "Unable to load 'plugin/python' due to being unable to find a working 'python'" 11 | return 1 12 | fi 13 | 14 | function pyedit() { 15 | about 'opens python module in your EDITOR' 16 | param '1: python module to open' 17 | example '$ pyedit requests' 18 | group 'python' 19 | 20 | xpyc="$(python -c "import os, sys; f = open(os.devnull, 'w'); sys.stderr = f; module = __import__('$1'); sys.stdout.write(module.__file__)")" 21 | 22 | if [[ "$xpyc" == "" ]]; then 23 | echo "Python module $1 not found" 24 | return 1 25 | elif [[ "$xpyc" == *__init__.py* ]]; then 26 | xpydir="${xpyc%/*}" 27 | echo "$EDITOR $xpydir" 28 | ${VISUAL:-${EDITOR:-${ALTERNATE_EDITOR:-nano}}} "$xpydir" 29 | else 30 | echo "$EDITOR ${xpyc%.*}.py" 31 | ${VISUAL:-${EDITOR:-${ALTERNATE_EDITOR:-nano}}} "${xpyc%.*}.py" 32 | fi 33 | } 34 | -------------------------------------------------------------------------------- /plugins/available/pyenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load pyenv, if you are using it' 4 | url "https://github.com/pyenv/pyenv" 5 | 6 | # https://github.com/pyenv/pyenv 7 | 8 | # Load after basher 9 | # BASH_IT_LOAD_PRIORITY: 260 10 | 11 | # Don't modify the environment if we can't find the tool: 12 | # - Check if in $PATH already 13 | # - Check if installed manually to $PYENV_ROOT 14 | # - Check if installed manually to $HOME 15 | _command_exists pyenv \ 16 | || [[ -n "$PYENV_ROOT" && -x "$PYENV_ROOT/bin/pyenv" ]] \ 17 | || [[ -x "$HOME/.pyenv/bin/pyenv" ]] \ 18 | || return 0 19 | 20 | # Set PYENV_ROOT, if not already set 21 | export PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}" 22 | 23 | # Add PYENV_ROOT/bin to PATH, if that's where it's installed 24 | if ! _command_exists pyenv && [[ -x "$PYENV_ROOT/bin/pyenv" ]]; then 25 | pathmunge "$PYENV_ROOT/bin" 26 | fi 27 | 28 | # Initialize pyenv 29 | pathmunge "$PYENV_ROOT/shims" 30 | eval "$(pyenv init - bash)" 31 | 32 | # Load pyenv virtualenv if the virtualenv plugin is installed. 33 | if pyenv virtualenv-init - &> /dev/null; then 34 | eval "$(pyenv virtualenv-init - bash)" 35 | fi 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: 💡 Feature request 2 | title: "[Feature]: " 3 | description: Suggest an idea for this project 4 | labels: "feature request" 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Expected behavior 9 | description: Tell us how your feature should work. 10 | validations: 11 | required: true 12 | - type: textarea 13 | attributes: 14 | label: Current behavior 15 | description: Explain the difference your feature will have from current behavior. 16 | validations: 17 | required: true 18 | - type: textarea 19 | attributes: 20 | label: Possible solution 21 | description: Tell us how it could be fixed at your glance. 22 | validations: 23 | required: false 24 | - type: textarea 25 | attributes: 26 | label: Context 27 | description: > 28 | How has this issue affected you? What are you trying to accomplish? 29 | Providing context helps us come up with a solution that is most useful in the real world. 30 | - type: textarea 31 | attributes: 32 | label: Notes 33 | description: > 34 | Provide any extra details here. 35 | -------------------------------------------------------------------------------- /plugins/available/percol.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Search&Select history with percol' 4 | url "https://github.com/mooz/percol" 5 | 6 | # Notice 7 | ## You have to upgrade bash to bash 4.x on Mac OS X. 8 | ## http://stackoverflow.com/questions/16416195/how-do-i-upgrade-bash-in-mac-osx-mountain-lion-and-set-it-the-correct-path 9 | 10 | # Install 11 | ## (sudo) pip install percol 12 | ## bash-it enable percol 13 | 14 | # Usage 15 | ## C-r to search&select from history 16 | 17 | _command_exists percol || return 18 | 19 | if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then 20 | _log_warning "You have to upgrade Bash to Bash v4.x to use the 'percol' plugin." 21 | _log_warning "Disabling percol plugin (current version: $BASH_VERSION)" 22 | _disable-plugin percol 23 | return 0 24 | fi 25 | 26 | function _replace_by_history() { 27 | local HISTTIMEFORMAT= # Ensure we can parse history properly 28 | #TODO: "${histlines[@]/*( )+([[:digit:]])*( )/}" 29 | local l 30 | l="$(history | tail -r | sed -e 's/^\ *[0-9]*\ *//' | percol --query "${READLINE_LINE:-}")" 31 | READLINE_LINE="${l}" 32 | READLINE_POINT=${#l} 33 | } 34 | bind -x '"\C-r": _replace_by_history' 35 | -------------------------------------------------------------------------------- /vendor/github.com/rparree/jboss-bash-completion/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Raphael Parree 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /themes/luan/luan.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX="(${yellow?}" 7 | SCM_THEME_PROMPT_SUFFIX="${normal?})" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX="(${yellow?}" 12 | GIT_THEME_PROMPT_SUFFIX="${normal?})" 13 | 14 | RVM_THEME_PROMPT_PREFIX="" 15 | RVM_THEME_PROMPT_SUFFIX="" 16 | 17 | function prompt_command() { 18 | dtime="$(clock_prompt)" 19 | user_host="${green?}\u@${cyan?}\h${normal?}" 20 | current_dir="${bold_blue?}\w${normal?}" 21 | rvm_ruby="${bold_red?}$(ruby_version_prompt)${normal?}" 22 | git_branch="$(scm_prompt_info)${normal?}" 23 | prompt="${bold_green?}\$${normal?} " 24 | arrow="${bold_white?}▶${normal?} " 25 | prompt="${bold_green?}\$${normal?} " 26 | 27 | PS1="${dtime}${user_host}:${current_dir} ${rvm_ruby} ${git_branch} 28 | $arrow $prompt" 29 | } 30 | 31 | THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${yellow?}"} 32 | THEME_CLOCK_FORMAT=${THEME_TIME_FORMAT:-"%I:%M:%S "} 33 | 34 | safe_append_prompt_command prompt_command 35 | -------------------------------------------------------------------------------- /vendor/github.com/vigo/apm-bash-completion/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Uğur "vigo" Özyılmazel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugins/available/history-eternal.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'eternal bash history' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then 6 | _log_warning "Bash version 4.3 introduced the 'unlimited' history size capability." 7 | _log_warning "Disabling history-eternal plugin (current version: $BASH_VERSION)" 8 | _disable-plugin history-eternal 9 | return 0 10 | fi 11 | 12 | # Modify history sizes before changing location to avoid unintentionally 13 | # truncating the history file early. 14 | 15 | # "Numeric values less than zero result in every command being saved on the history list (there is no limit)" 16 | HISTSIZE=-1 2> /dev/null || true 17 | 18 | # "Non-numeric values and numeric values less than zero inhibit truncation" 19 | HISTFILESIZE='unlimited' 2> /dev/null || true 20 | 21 | # Use a custom history file location so history is not truncated 22 | # if the environment ever loses this "eternal" configuration. 23 | HISTDIR="${XDG_STATE_HOME:-${HOME?}/.local/state}/bash" 24 | [[ -d ${HISTDIR?} ]] || mkdir -p "${HISTDIR?}" 25 | HISTFILE="${HISTDIR?}/history" 2> /dev/null || true 26 | -------------------------------------------------------------------------------- /vendor/github.com/rparree/jboss-bash-completion/README.md: -------------------------------------------------------------------------------- 1 | jboss-bash-completion 2 | ===================== 3 | 4 | JBoss Bash Completion for JBoss 5 and 7 (EAP 6) 5 | 6 | 7 | 8 | Overview 9 | -------- 10 | 11 | Completion for the `run.sh` (JBoss5) and `standalone.sh`/`domain.sh` 12 | 13 | Some of the options available in jboss7: 14 | 15 | 16 | * `--admin-only` `-h` `-help` `-version` `-V` `-v` 17 | * `-Djboss.home.dir` 18 | * `--server-config` (options the xml files in the configuration directory relative to -Djboss.server.base.dir) 19 | * `-b` `-bmanagement` `-bunsecure` `-bpublic` `-Djboss.domain.master.address` `-Djboss.bind.address.*` (options: your local IP addresses and 0.0.0.0) 20 | * `-Djboss.socket.binding.port-offset` (options: 100 200 300 400 10000 20000 30000 40000) 21 | * `-u` (options 239.255.0.1 239.255.0.2 239.255.0.3) 22 | * `-P` -Djboss.node.name 23 | 24 | 25 | Install 26 | ------- 27 | 28 | Make sure you have installed bash_completion 1.3 (or higher): 29 | 30 | Debian/Ubuntu: `apt-get install bash-completion` 31 | RHEL/CentOS: `yum install bash-completion` 32 | 33 | Copy the file(s) to your `/etc/bash_completion.d` folder: 34 | 35 | `sudo cp jboss* /etc/bash_completion.d` 36 | 37 | 38 | -------------------------------------------------------------------------------- /plugins/available/url.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'Basic url handling and manipulation functions' 4 | url "https://github.com/Bash-it/bash-it" 5 | 6 | function slugify() { 7 | about 'takes the text and transform to slug url, also supports formats like (html,link,rst,md)' 8 | group 'url' 9 | param "1: Text to transform (optional)" 10 | param "2: Output format (html,rst,link,md). Omit or pass any text to return only output" 11 | 12 | local TXT=$1 13 | local OUTPUT=$2 14 | local SLUG 15 | 16 | if [[ -z $TXT ]]; then 17 | read -rp "Enter the valid string: " TXT 18 | fi 19 | 20 | # Pass 1 - Clean the url 21 | # Credits: https://stackoverflow.com/a/20007549/10362396 22 | SLUG=$(echo -n "$TXT" | tr -cd ' [:alnum:]._-' | tr -s ' ') 23 | 24 | # Pass 2 - Transformation 25 | SLUG=$(echo -n "$SLUG" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') 26 | 27 | case "$OUTPUT" in 28 | html | htm) 29 | echo "$TXT" 30 | ;; 31 | href | link) 32 | echo "#$SLUG" 33 | ;; 34 | md) 35 | echo "[$TXT](#$SLUG)" 36 | ;; 37 | rst) 38 | echo "\`$TXT <#$SLUG>\`_" 39 | ;; 40 | 41 | *) 42 | echo "$SLUG" 43 | ;; 44 | esac 45 | 46 | } 47 | -------------------------------------------------------------------------------- /themes/pure/pure.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # scm theming 5 | SCM_THEME_PROMPT_PREFIX="|" 6 | SCM_THEME_PROMPT_SUFFIX="" 7 | 8 | SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" 9 | SCM_THEME_PROMPT_CLEAN=" ${green?}✓${normal?}" 10 | SCM_GIT_CHAR="${green?}±${normal?}" 11 | SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" 12 | SCM_HG_CHAR="${bold_red?}☿${normal?}" 13 | 14 | VIRTUALENV_THEME_PROMPT_PREFIX="(" 15 | VIRTUALENV_THEME_PROMPT_SUFFIX=")" 16 | 17 | function pure_prompt() { 18 | local ps_host="${bold_blue?}\h${normal?}" 19 | local ps_user="${green?}\u${normal?}" 20 | local ps_user_mark="${green?} \$ ${normal?}" 21 | local ps_root="${red?}\u${red?}" 22 | local ps_root_mark="${red?} \$ ${normal?}" 23 | local ps_path="${yellow?}\w${normal?}" 24 | local virtualenv_prompt scm_prompt 25 | virtualenv_prompt="$(virtualenv_prompt)" 26 | scm_prompt="$(scm_prompt)" 27 | # make it work 28 | case "${EUID:-$UID}" in 29 | 0) 30 | ps_user_mark="${ps_root_mark}" 31 | ps_user="${ps_root}" 32 | ;; 33 | esac 34 | PS1="${virtualenv_prompt}${ps_user}@${ps_host}${scm_prompt}:${ps_path}${ps_user_mark}" 35 | } 36 | 37 | safe_append_prompt_command pure_prompt 38 | -------------------------------------------------------------------------------- /themes/brunton/brunton.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_PREFIX="" 5 | SCM_THEME_PROMPT_SUFFIX="" 6 | 7 | SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" 8 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" 9 | SCM_GIT_CHAR="${bold_green?}±${normal?}" 10 | SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" 11 | SCM_HG_CHAR="${bold_red?}☿${normal?}" 12 | 13 | function is_vim_shell() { 14 | if [[ -n "${VIMRUNTIME:-}" ]]; then 15 | echo "[${cyan?}vim shell${normal?}]" 16 | fi 17 | } 18 | 19 | function prompt() { 20 | local SCM_PROMPT_FORMAT=' %s (%s)' clock_prompt battery_charge scm_prompt is_vim_shell 21 | clock_prompt="$(clock_prompt)" 22 | battery_charge="$(battery_charge)" 23 | scm_prompt="$(scm_prompt)" 24 | is_vim_shell="$(is_vim_shell)" 25 | PS1="${white?}${background_blue?} \u${normal?}${background_blue?}@${red?}${background_blue?}\h ${clock_prompt} ${reset_color?}${normal?} ${battery_charge}\n${bold_black?}${background_white?} \w ${normal?}${scm_prompt}${is_vim_shell}\n${white?}>${normal?} " 26 | } 27 | 28 | : "${THEME_CLOCK_COLOR:=${blue?}${background_white?}}" 29 | : "${THEME_CLOCK_FORMAT:=" %H:%M:%S"}" 30 | 31 | safe_append_prompt_command prompt 32 | -------------------------------------------------------------------------------- /vendor/github.com/ohmyzsh/ohmyzsh/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2009-2021 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/rcaloras/bash-preexec/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Ryan Caloras and contributors (see https://github.com/rcaloras/bash-preexec) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugins/available/nvm.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # BASH_IT_LOAD_PRIORITY: 225 4 | # 5 | # Bash-it no longer bundles nvm, as this was quickly becoming outdated. 6 | # Please install nvm from https://github.com/creationix/nvm.git if you want to use it. 7 | 8 | cite about-plugin 9 | about-plugin 'node version manager configuration' 10 | url "https://github.com/nvm-sh/nvm" 11 | 12 | export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" 13 | 14 | # first check if NVM is managed by brew 15 | NVM_BREW_PREFIX="" 16 | if _bash_it_homebrew_check; then 17 | NVM_BREW_PREFIX=$(brew --prefix nvm 2> /dev/null) 18 | fi 19 | 20 | # This loads nvm 21 | if [[ -n "$NVM_BREW_PREFIX" && -s "${NVM_BREW_PREFIX}/nvm.sh" ]]; then 22 | # shellcheck disable=SC1091 23 | source "${NVM_BREW_PREFIX}/nvm.sh" 24 | else 25 | # shellcheck disable=SC1091 26 | [[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" 27 | fi 28 | 29 | if ! _command_exists nvm; then 30 | function nvm() { 31 | echo "Bash-it no longer bundles the nvm script. Please install the latest version from" 32 | echo "" 33 | echo "https://github.com/creationix/nvm.git" 34 | echo "" 35 | echo "if you want to use nvm. You can keep this plugin enabled once you have installed nvm." 36 | } 37 | 38 | nvm 39 | fi 40 | -------------------------------------------------------------------------------- /completion/available/brew.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite "about-completion" 3 | about-completion "brew completion" 4 | group "package-manager" 5 | url "https://brew.sh/" 6 | 7 | # Load late to make sure `system` completion loads first 8 | # BASH_IT_LOAD_PRIORITY: 375 9 | 10 | if [[ "$OSTYPE" != 'darwin'* ]]; then 11 | _log_warning "unsupported operating system - only 'Darwin' is supported" 12 | return 0 13 | fi 14 | 15 | # Make sure brew is installed 16 | _bash_it_homebrew_check || return 0 17 | 18 | if [[ -r "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" ]]; then 19 | # shellcheck disable=1090,1091 20 | source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" 21 | 22 | elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then 23 | # shellcheck disable=1090,1091 24 | source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" 25 | 26 | elif [[ -f "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" ]]; then 27 | # For the git-clone based installation, see here for more info: 28 | # https://github.com/Bash-it/bash-it/issues/1458 29 | # https://docs.brew.sh/Shell-Completion 30 | # shellcheck disable=1090,1091 31 | source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" 32 | fi 33 | -------------------------------------------------------------------------------- /plugins/available/go.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'go environment variables & path configuration' 4 | url "https://golang.org/" 5 | 6 | # Load after basher and goenv 7 | # BASH_IT_LOAD_PRIORITY: 270 8 | 9 | # Test `go version` because goenv creates shim scripts that will be found in PATH 10 | # but do not always resolve to a working install. 11 | { _command_exists go && go version &> /dev/null; } || return 0 12 | 13 | export GOROOT="${GOROOT:-$(go env GOROOT)}" 14 | export GOPATH="${GOPATH:-$(go env GOPATH)}" 15 | 16 | # $GOPATH/bin is the default location for binaries. Because GOPATH accepts a list of paths and each 17 | # might be managed differently, we add each path's /bin folder to PATH using pathmunge, 18 | # while preserving ordering. 19 | # e.g. GOPATH=foo:bar -> PATH=foo/bin:bar/bin 20 | _bash-it-gopath-pathmunge() { 21 | _about 'Ensures paths in GOPATH are added to PATH using pathmunge, with /bin appended' 22 | _group 'go' 23 | if [[ -z "${GOPATH:-}" ]]; then 24 | _log_warning 'GOPATH empty' 25 | return 1 26 | fi 27 | local paths apath 28 | IFS=: read -r -a paths <<< "$GOPATH" 29 | for apath in "${paths[@]}"; do 30 | pathmunge "${apath}/bin" || true 31 | done 32 | } 33 | _bash-it-gopath-pathmunge 34 | -------------------------------------------------------------------------------- /themes/bobby/bobby.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" ${green?}|" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | RVM_THEME_PROMPT_PREFIX="|" 15 | RVM_THEME_PROMPT_SUFFIX="|" 16 | 17 | function __bobby_clock() { 18 | printf '%s' "$(clock_prompt) " 19 | 20 | if [[ "${THEME_SHOW_CLOCK_CHAR:-}" == "true" ]]; then 21 | printf '%s' "$(clock_char) " 22 | fi 23 | } 24 | 25 | function prompt_command() { 26 | PS1="\n$(battery_char) $(__bobby_clock)" 27 | PS1+="${yellow?}$(ruby_version_prompt) " 28 | PS1+="${purple?}\h " 29 | PS1+="${reset_color?}in " 30 | PS1+="${green?}\w\n" 31 | PS1+="${bold_cyan?}$(scm_prompt_char_info) " 32 | PS1+="${green?}→${reset_color?} " 33 | } 34 | 35 | : "${THEME_SHOW_CLOCK_CHAR:="true"}" 36 | : "${THEME_CLOCK_CHAR_COLOR:=${red?}}" 37 | : "${THEME_CLOCK_COLOR:=${bold_cyan?}}" 38 | : "${THEME_CLOCK_FORMAT:="%Y-%m-%d %H:%M:%S"}" 39 | 40 | safe_append_prompt_command prompt_command 41 | -------------------------------------------------------------------------------- /test/completion/aliases.completion.bats: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bats 2 | 3 | load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash" 4 | 5 | function local_setup_file() { 6 | setup_libs "helpers" 7 | # Load something, anything... 8 | load ../../completion/available/capistrano.completion 9 | } 10 | 11 | @test "alias-completion: See that aliases with double quotes and brackets do not break the plugin" { 12 | alias gtest="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative" 13 | run load "${BASH_IT?}/completion/available/aliases.completion.bash" 14 | 15 | assert_success 16 | } 17 | 18 | @test "alias-completion: See that aliases with single quotes and brackets do not break the plugin" { 19 | alias gtest='git log --graph --pretty=format:"%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset" --abbrev-commit --date=relative' 20 | run load "${BASH_IT?}/completion/available/aliases.completion.bash" 21 | 22 | assert_success 23 | } 24 | 25 | @test "alias-completion: See that having aliased rm command does not output unnecessary output" { 26 | alias rm='rm -v' 27 | run load "${BASH_IT?}/completion/available/aliases.completion.bash" 28 | 29 | assert_output "" 30 | } 31 | -------------------------------------------------------------------------------- /test/plugins/xterm.plugin.bats: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bats 2 | # shellcheck disable=SC2034 3 | 4 | load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash" 5 | 6 | function local_setup_file() { 7 | setup_libs "helpers" 8 | load "${BASH_IT?}/plugins/available/xterm.plugin.bash" 9 | } 10 | 11 | @test "plugins xterm: shorten command output" { 12 | SHORT_TERM_LINE=true 13 | run _short-command "${BASH_IT}/test/fixtures/plugin/xterm/files"/* 14 | assert_success 15 | assert_output "${BASH_IT}/test/fixtures/plugin/xterm/files/arg0" 16 | } 17 | 18 | @test "plugins xterm: full command output" { 19 | SHORT_TERM_LINE=false 20 | run _short-command "${BASH_IT}/test/fixtures/plugin/xterm/files"/* 21 | assert_success 22 | assert_output "$(echo "${BASH_IT}/test/fixtures/plugin/xterm/files"/*)" 23 | } 24 | 25 | @test "plugins xterm: shorten dirname output" { 26 | SHORT_TERM_LINE=true 27 | run _short-dirname 28 | assert_success 29 | assert_output "$(basename "${PWD}")" 30 | } 31 | 32 | @test "plugins xterm: full dirname output" { 33 | SHORT_TERM_LINE=false 34 | run _short-dirname 35 | assert_success 36 | assert_output "${PWD}" 37 | } 38 | 39 | @test "plugins xterm: set xterm title" { 40 | run set_xterm_title title 41 | assert_success 42 | assert_output $'\033]0;title\007' 43 | } 44 | -------------------------------------------------------------------------------- /docs/themes-list/nwinkler_random_colors.rst: -------------------------------------------------------------------------------- 1 | .. _nwinkler_random_color: 2 | 3 | Nwinkler Random Color Theme 4 | =========================== 5 | 6 | Description 7 | ----------- 8 | 9 | The *Nwinkler Random Color* Theme is based on the :ref:`Nwinkler Theme ` , but it randomizes the colors for: 10 | 11 | 12 | * time 13 | * username 14 | * hostname 15 | * path 16 | 17 | The random colors are chosen the first time this theme is used and saved to the ``~/.nwinkler_random_colors`` file. So, the next time you connect to the same machine, you will get the same colors. 18 | 19 | To force new random colors to be selected, run the command: 20 | 21 | .. code-block:: sh 22 | 23 | randomize_nwinkler 24 | 25 | Screenshot 26 | ---------- 27 | 28 | Here it is in action: 29 | 30 | 31 | .. image:: nwinkler_random_colors.png 32 | :target: nwinkler_random_colors.png 33 | :alt: alt text 34 | 35 | 36 | Usage Scenario 37 | -------------- 38 | 39 | This theme is especially useful when connecting to many different machines and switching between them often. Yes, the hostname *is* present in the prompt. But I argue that it's a lot faster to get a "feel" of what machine you are currently on because of the custom colors on that machine's prompt than by reading the hostname. 40 | -------------------------------------------------------------------------------- /themes/emperor/emperor.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | RVM_THEME_PROMPT_PREFIX="|" 15 | RVM_THEME_PROMPT_SUFFIX="|" 16 | 17 | function get_hour_color { 18 | hour_color=${red?} 19 | min=$(date +%M) 20 | if [ "$min" -lt "15" ]; then 21 | hour_color=${white?} 22 | elif [ "$min" -lt "30" ]; then 23 | hour_color=${green?} 24 | elif [ "$min" -lt "45" ]; then 25 | hour_color=${yellow?} 26 | else 27 | hour_color=${red?} 28 | fi 29 | echo "$hour_color" 30 | } 31 | 32 | __emperor_clock() { 33 | THEME_CLOCK_COLOR=$(get_hour_color) 34 | clock_prompt 35 | } 36 | 37 | function prompt_command() { 38 | PS1="\n$(__emperor_clock)${purple?}\h ${reset_color?}in ${prompt_color?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green?}→${reset_color?} " 39 | } 40 | 41 | THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H "} 42 | 43 | safe_append_prompt_command prompt_command 44 | -------------------------------------------------------------------------------- /plugins/available/nginx.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'manage your nginx service' 3 | url "https://nginx.org/" 4 | 5 | pathmunge "${NGINX_PATH:=/opt/nginx}/sbin" after 6 | export NGINX_PATH 7 | 8 | function nginx_reload() { 9 | about 'reload your nginx config' 10 | group 'nginx' 11 | 12 | local FILE="${NGINX_PATH?}/logs/nginx.pid" 13 | if [[ -s $FILE ]]; then 14 | echo "Reloading NGINX..." 15 | read -r PID < "${FILE}" 16 | sudo kill -HUP "${PID?}" 17 | else 18 | echo "Nginx pid file not found" 19 | return 0 20 | fi 21 | } 22 | 23 | function nginx_stop() { 24 | about 'stop nginx' 25 | group 'nginx' 26 | 27 | local FILE="${NGINX_PATH?}/logs/nginx.pid" 28 | if [[ -s $FILE ]]; then 29 | echo "Stopping NGINX..." 30 | read -r PID < "${FILE}" 31 | sudo kill -INT "${PID?}" 32 | else 33 | echo "Nginx pid file not found" 34 | return 0 35 | fi 36 | } 37 | 38 | function nginx_start() { 39 | about 'start nginx' 40 | group 'nginx' 41 | 42 | local FILE="${NGINX_PATH?}/sbin/nginx" 43 | if [[ -x $FILE ]]; then 44 | echo "Starting NGINX..." 45 | sudo "${FILE}" 46 | else 47 | echo "Couldn't start nginx" 48 | fi 49 | } 50 | 51 | function nginx_restart() { 52 | about 'restart nginx' 53 | group 'nginx' 54 | 55 | nginx_stop && nginx_start 56 | } 57 | -------------------------------------------------------------------------------- /themes/bakke/bakke.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | SCM_THEME_PROMPT_DIRTY=" ${red?}✗" 5 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 6 | SCM_THEME_PROMPT_PREFIX=" |" 7 | SCM_THEME_PROMPT_SUFFIX="${green?}|" 8 | 9 | GIT_THEME_PROMPT_DIRTY=" ${red?}✗" 10 | GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" 11 | GIT_THEME_PROMPT_PREFIX=" ${green?}|" 12 | GIT_THEME_PROMPT_SUFFIX="${green?}|" 13 | 14 | RVM_THEME_PROMPT_PREFIX="|" 15 | RVM_THEME_PROMPT_SUFFIX="|" 16 | 17 | function prompt_command() { 18 | #PS1="${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info)${purple?}$(ruby_version_prompt) ${yellow?}\h ${reset_color?}in ${green?}\w ${reset_color?}\n${green}→${reset_color?} " 19 | #PS1="\n${purple?}\h: ${reset_color?} ${green?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green}→${reset_color?} " 20 | #PS1="\n${cyan?}\h: ${reset_color?} ${yellow?}\w\n${red?}$(scm_char)${red?}$(scm_prompt_info) ${green?}→${reset_color?} " 21 | local virtualenv_prompt scm_prompt_info 22 | virtualenv_prompt="$(virtualenv_prompt)" 23 | scm_prompt_info="$(scm_prompt_info)" 24 | PS1="\n${cyan?}\h:${virtualenv_prompt} ${reset_color?} ${yellow?}\w ${green?}${scm_prompt_info}\n${reset_color?}→ " 25 | } 26 | 27 | safe_append_prompt_command prompt_command 28 | -------------------------------------------------------------------------------- /aliases/available/jitsu.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'jitsu task abbreviations' 3 | url "https://github.com/nodejitsu/jitsu" 4 | 5 | # jitsu 6 | alias j='jitsu' 7 | alias jl='jitsu login' 8 | alias jo='jitsu logout' 9 | 10 | # deploy and update 11 | alias jd='jitsu apps deploy' 12 | alias ju='jitsu apps update' 13 | 14 | # new and start, restart, stop 15 | alias jn='jitsu apps create' 16 | alias js='jitsu apps start' 17 | alias jr='jitsu apps restart' 18 | alias jx='jitsu apps stop' 19 | 20 | # logs 21 | alias jll='jitsu logs' 22 | alias jlog='jitsu logs' 23 | alias jlogs='jitsu logs' 24 | 25 | # env 26 | alias je='jitsu env' 27 | alias jel='jitsu env list' 28 | alias jes='jitsu env set' 29 | alias jeg='jitsu env get' 30 | alias jed='jitsu env delete' 31 | alias jec='jitsu env clear' 32 | alias jesv='jitsu env save' 33 | alias jeld='jitsu env load' 34 | 35 | # configuration 36 | alias jc='jitsu conf' 37 | alias jcl='jitsu config list' 38 | alias jcs='jitsu config set' 39 | alias jcg='jitsu config get' 40 | alias jcd='jitsu config delete' 41 | 42 | # list and install, view 43 | alias jls='jitsu list' 44 | alias jin='jitsu install' 45 | alias jv='jitsu apps view' 46 | 47 | # Database, Snapshots and Tokens 48 | alias jdb='jitsu databases' 49 | alias jss='jitsu snapshots' 50 | alias jto='jitsu tokens' 51 | -------------------------------------------------------------------------------- /lib/history.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # Functions for working with Bash's command history. 4 | 5 | function _bash-it-history-init() { 6 | safe_append_preexec '_bash-it-history-auto-save' 7 | safe_append_prompt_command '_bash-it-history-auto-load' 8 | } 9 | 10 | function _bash-it-history-auto-save() { 11 | case $HISTCONTROL in 12 | *'noauto'* | *'autoload'*) 13 | : # Do nothing, as configured. 14 | ;; 15 | *'auto'*) 16 | # Append new history from this session to the $HISTFILE 17 | history -a 18 | ;; 19 | *) 20 | # Append *only* if shell option `histappend` has been enabled. 21 | shopt -q histappend && history -a && return 22 | ;; 23 | esac 24 | } 25 | 26 | function _bash-it-history-auto-load() { 27 | case $HISTCONTROL in 28 | *'noauto'*) 29 | : # Do nothing, as configured. 30 | ;; 31 | *'autosave'*) 32 | # Append new history from this session to the $HISTFILE 33 | history -a 34 | ;; 35 | *'autoloadnew'*) 36 | # Read new entries from $HISTFILE 37 | history -n 38 | ;; 39 | *'auto'*) 40 | # Blank in-memory history, then read entire $HISTFILE fresh from disk. 41 | history -a && history -c && history -r 42 | ;; 43 | *) 44 | : # Do nothing, default. 45 | ;; 46 | esac 47 | } 48 | 49 | _bash_it_library_finalize_hook+=('_bash-it-history-init') 50 | -------------------------------------------------------------------------------- /plugins/available/virtualenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # 3 | # make sure virtualenvwrapper is enabled if available 4 | 5 | cite about-plugin 6 | url "https://virtualenvwrapper.readthedocs.io/" 7 | about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions' 8 | 9 | # Check for whole command instead of just pyenv 10 | if [ -n "$(command pyenv virtualenvwrapper --help 2> /dev/null)" ]; then 11 | pyenv virtualenvwrapper 12 | elif _command_exists virtualenvwrapper.sh; then 13 | # shellcheck disable=SC1091 14 | source virtualenvwrapper.sh 15 | else 16 | _log_debug "${2:-'virtualenvwrapper' was not found}" 17 | fi 18 | 19 | function mkvenv { 20 | about 'create a new virtualenv for this directory' 21 | group 'virtualenv' 22 | 23 | local cwd="${PWD##*/}" 24 | mkvirtualenv --distribute "$cwd" 25 | } 26 | 27 | function mkvbranch { 28 | about 'create a new virtualenv for the current branch' 29 | group 'virtualenv' 30 | 31 | local cwd="${PWD##*/}" 32 | mkvirtualenv --distribute "${cwd}@${SCM_BRANCH}" 33 | } 34 | 35 | function wovbranch { 36 | about 'sets workon branch' 37 | group 'virtualenv' 38 | 39 | local cwd="${PWD##*/}" 40 | workon "${cwd}@${SCM_BRANCH}" 41 | } 42 | 43 | function wovenv { 44 | about 'works on the virtualenv for this directory' 45 | group 'virtualenv' 46 | 47 | workon "${PWD##*/}" 48 | } 49 | -------------------------------------------------------------------------------- /plugins/available/javascript.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # The install directory is hard-coded. TODO: allow the directory to be specified on the command line. 3 | 4 | cite about-plugin 5 | about-plugin 'download jquery files into current project' 6 | url "https://jquery.com/" 7 | 8 | [[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1" 9 | [[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13" 10 | 11 | function rails_jquery { 12 | about 'download rails.js into public/javascripts' 13 | group 'javascript' 14 | 15 | curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js 16 | } 17 | 18 | function jquery_install { 19 | about 'download jquery.js into public/javascripts' 20 | group 'javascript' 21 | 22 | if [ -z "$1" ]; then 23 | version=$JQUERY_VERSION_NUMBER 24 | else 25 | version="$1" 26 | fi 27 | curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js" 28 | } 29 | 30 | function jquery_ui_install { 31 | about 'download jquery_us.js into public/javascripts' 32 | group 'javascript' 33 | 34 | if [ -z "$1" ]; then 35 | version=$JQUERY_UI_VERSION_NUMBER 36 | else 37 | version="$1" 38 | fi 39 | 40 | curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js" 41 | } 42 | -------------------------------------------------------------------------------- /docs/themes-list/redline.rst: -------------------------------------------------------------------------------- 1 | .. _redline: 2 | 3 | Redline Theme 4 | ============= 5 | 6 | changed up the powerline base a little. 7 | 8 | It plays nicest with this font: `DroidSansMonoForPowerline `_ 9 | 10 | Read the :ref:`powerline theme documentation ` 11 | 12 | added 13 | ----- 14 | 15 | 16 | * hostname 17 | * distro logo 18 | 19 | changed 20 | ------- 21 | 22 | 23 | * sudo credential check 24 | * required font 25 | * some icons 26 | 27 | Works real good like with: 28 | 29 | .. code-block:: bash 30 | 31 | ## set the theme 32 | export BASH_IT_THEME='redline' 33 | 34 | # Set this to false to turn off version control status checking within the prompt for all themes 35 | export SCM_CHECK=true 36 | 37 | ## Set Xterm/screen/Tmux title with only a short hostname. 38 | export SHORT_HOSTNAME=$(hostname -s) 39 | 40 | ## enable sudo prompt 41 | export POWERLINE_PROMPT_USER_INFO_MODE="sudo" 42 | 43 | ## prompt part string 44 | export POWERLINE_PROMPT="python_venv user_info hostname cwd scm" 45 | 46 | enable your distro logo with 47 | ---------------------------- 48 | 49 | .. code-block:: bash 50 | 51 | export POWERLINE_PROMPT_DISTRO_LOGO="yes" 52 | 53 | 54 | .. image:: redline.png 55 | :target: redline.png?raw=true 56 | :alt: screenshot 57 | -------------------------------------------------------------------------------- /plugins/available/history.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-plugin 'improve history handling with sane defaults' 3 | url "https://github.com/Bash-it/bash-it" 4 | 5 | # Append the history list to the file named by the value of the HISTFILE 6 | # variable when the shell exits, rather than overwriting the file. 7 | shopt -s histappend 8 | 9 | # 'ignorespace': don't save command lines which begin with a space to history 10 | # 'erasedups' (alternative 'ignoredups'): don't save duplicates to history 11 | # 'autoshare': automatically share history between multiple running shells 12 | : "${HISTCONTROL:=ignorespace:erasedups:autoshare}" 13 | 14 | # resize history to 100x the default (500) 15 | : "${HISTSIZE:=50000}" 16 | 17 | function top-history() { 18 | about 'print the name and count of the most commonly run tools' 19 | 20 | # - Make sure formatting doesn't interfer with our parsing 21 | # - Use awk to count how many times the first command on each line has been called 22 | # - Truncate to 10 lines 23 | # - Print in column format 24 | HISTTIMEFORMAT='' history \ 25 | | awk '{ 26 | a[$2]++ 27 | }END{ 28 | for(i in a) 29 | printf("%s\t%s\n", a[i], i) 30 | }' \ 31 | | sort --reverse --numeric-sort \ 32 | | head \ 33 | | column \ 34 | --table \ 35 | --table-columns 'Command Count,Command Name' \ 36 | --output-separator ' | ' 37 | } 38 | -------------------------------------------------------------------------------- /aliases/available/composer.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'common composer abbreviations' 3 | url "https://getcomposer.org/" 4 | 5 | # Aliases 6 | alias coab='composer about' 7 | alias coar='composer archive' 8 | alias cob='composer browser' 9 | alias cocpr='composer check-platform-reqs' 10 | alias cocc='composer clear-cache' 11 | alias cocfg='composer config' 12 | alias cocp='composer create-project' 13 | alias codp='composer depends' 14 | alias codiag='composer diagnose' 15 | alias codmp='composer dump-autoload' 16 | alias coex='composer exec' 17 | alias coglob='composer global' 18 | alias coh='composer help' 19 | alias cohome='composer home' 20 | alias coi='composer install' 21 | alias coinf='composer info' 22 | alias coini='composer init' 23 | alias coli='composer license' 24 | alias colis='composer list' 25 | alias coout='composer outdated' 26 | alias cop='composer prohibits' 27 | alias corem='composer remove' 28 | alias coreq='composer require' 29 | alias coreqd='composer require --dev' 30 | alias cors='composer run-script' 31 | alias cos='composer search' 32 | alias cosu='composer self-update' 33 | alias coshow='composer show' 34 | alias costat='composer status' 35 | alias cosugg='composer suggest' 36 | alias coup='composer update' 37 | alias coupg='composer upgrade' 38 | alias coval='composer validate' 39 | alias cowhy='composer why' 40 | alias cowhyn='composer why-not' 41 | -------------------------------------------------------------------------------- /completion/available/svn.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | cite "about-completion" 4 | about-completion "svn - Apache Subversion version control system" 5 | group "version-control" 6 | url "https://subversion.apache.org/" 7 | 8 | # Locate and load completions for `svn`. 9 | 10 | # Make sure svn is installed 11 | _bash-it-completion-helper-necessary svn || : 12 | 13 | # Don't handle completion if it's already managed 14 | _bash-it-completion-helper-sufficient svn || return 15 | 16 | _svn_bash_completion_xcrun_svn= 17 | if _command_exists xcrun; then 18 | _svn_bash_completion_xcrun_svn="$(xcrun --find svn)" 19 | fi 20 | _svn_bash_completion_paths=( 21 | # Standard locations 22 | "${SVN_EXE%/*}/../etc/bash_completion.d/subversion" 23 | # MacOS non-system locations 24 | "${_svn_bash_completion_xcrun_svn%/bin/svn}/etc/bash_completion.d/subversion" 25 | ) 26 | 27 | # Load the first completion file found 28 | _svn_bash_completion_found=false 29 | for _comp_path in "${_svn_bash_completion_paths[@]}"; do 30 | if [[ -r "$_comp_path" ]]; then 31 | _svn_bash_completion_found=true 32 | # shellcheck disable=SC1090 # don't follow 33 | source "$_comp_path" 34 | break 35 | fi 36 | done 37 | 38 | # Cleanup 39 | if [[ "${_svn_bash_completion_found}" == false ]]; then 40 | _log_warning "no completion files found - please try enabling the 'system' completion instead." 41 | fi 42 | unset "${!_svn_bash_completion@}" 43 | -------------------------------------------------------------------------------- /themes/powerline-naked/powerline-naked.base.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034,SC1091 # Expected behavior for themes. 3 | source "${BASH_IT?}/themes/powerline/powerline.base.bash" 4 | 5 | function __powerline_left_segment { 6 | local OLD_IFS="${IFS}" params=() 7 | # shellcheck disable=SC2206 # not needed because we are splitting on "|" 8 | IFS="|" params=($1) 9 | IFS="${OLD_IFS}" 10 | local separator="" 11 | local pad_before_segment=" " 12 | 13 | if [[ "${SEGMENTS_AT_LEFT}" -eq 0 ]]; then 14 | if [[ "${POWERLINE_COMPACT_BEFORE_FIRST_SEGMENT}" -ne 0 ]]; then 15 | pad_before_segment="" 16 | fi 17 | else 18 | if [[ "${POWERLINE_COMPACT_AFTER_SEPARATOR}" -ne 0 ]]; then 19 | pad_before_segment="" 20 | fi 21 | # Since the previous segment wasn't the last segment, add padding, if needed 22 | # 23 | if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR:-0}" -eq 0 ]]; then 24 | LEFT_PROMPT+=" " 25 | fi 26 | LEFT_PROMPT+="${POWERLINE_LEFT_SEPARATOR}" 27 | fi 28 | 29 | #change here to cahnge fg color 30 | LEFT_PROMPT+="$(set_color "${params[1]:-}" -)${pad_before_segment}${params[0]}${normal?}" 31 | #seperator char color == current bg 32 | LAST_SEGMENT_COLOR="${params[1]:-}" 33 | ((SEGMENTS_AT_LEFT += 1)) 34 | 35 | _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" 36 | } 37 | 38 | function __powerline_left_last_segment_padding { 39 | LEFT_PROMPT+="$(set_color "${LAST_SEGMENT_COLOR?}" -) ${normal?}" 40 | } 41 | -------------------------------------------------------------------------------- /completion/available/gem.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite "about-completion" 3 | about-completion "gem completion" 4 | group "ruby" 5 | url "https://rubygems.org/" 6 | 7 | __gem_completion() { 8 | local cur=${COMP_WORDS[COMP_CWORD]} 9 | local prev=${COMP_WORDS[COMP_CWORD - 1]} 10 | case $prev in 11 | install) 12 | # list the remote gems and add to completion 13 | if [ -z "$REMOTE_GEMS" ]; then 14 | read -r -a REMOTE_GEMS <<< "$(gem list --remote --no-versions | sed 's/\*\*\* REMOTE GEMS \*\*\*//' | tr '\n' ' ')" 15 | fi 16 | 17 | local cur=${COMP_WORDS[COMP_CWORD]} 18 | # shellcheck disable=SC2207 19 | COMPREPLY=($(compgen -W "${REMOTE_GEMS[*]}" -- "$cur")) 20 | return 0 21 | ;; 22 | uninstall) 23 | # list all local installed gems and add to completion 24 | read -r -a LOCAL_GEMS <<< "$(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ')" 25 | 26 | local cur=${COMP_WORDS[COMP_CWORD]} 27 | # shellcheck disable=SC2207 28 | COMPREPLY=($(compgen -W "${LOCAL_GEMS[*]}" -- "$cur")) 29 | return 0 30 | ;; 31 | esac 32 | local commands=(build cert check cleanup contents dependency environment fetch generate_index help install list lock outdated owner pristine push query rdoc search server sources specification stale uninstall unpack update which) 33 | # shellcheck disable=SC2207 34 | COMPREPLY=($(compgen -W "${commands[*]}" -- "$cur")) 35 | } 36 | 37 | complete -F __gem_completion gem 38 | -------------------------------------------------------------------------------- /themes/p4helpers.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | function _p4-opened { 4 | timeout 2.0s p4 opened -s 2> /dev/null 5 | } 6 | 7 | function _p4-opened-counts { 8 | # Return the following counts seperated by tabs: 9 | # - count of opened files 10 | # - count of pending changesets (other than defaults) 11 | # - count of files in the default changeset 12 | # - count of opened files in add mode 13 | # - count of opened files in edit mode 14 | # - count of opened files in delete mode 15 | _p4-opened | awk ' 16 | BEGIN { 17 | opened=0; 18 | type_array["edit"]=0; 19 | type_array["add"]=0; 20 | type_array["delete"]=0; 21 | change_array["change"]=0; 22 | } 23 | { 24 | # p4 opened prints one file per line, and all lines begin with "//" 25 | # Here is an examples: 26 | # 27 | # $ p4 opened 28 | # //depot/some/file.py#4 - edit change 716431 (text) 29 | # //depot/another/file.py - edit default change (text) 30 | # //now/add/a/newfile.sh - add change 435645 (text+k) 31 | # 32 | # 33 | if ($1 ~ /^\/\//) { 34 | opened += 1 35 | change_array[$5] += 1 36 | type_array[$3] += 1 37 | } 38 | } 39 | END { 40 | default_changes=change_array["change"]; 41 | non_default_changes=length(change_array) - 1; 42 | print opened "\t" non_default_changes "\t" default_changes "\t" type_array["add"] "\t" type_array["edit"] "\t" type_array["delete"] 43 | } 44 | ' 45 | } 46 | -------------------------------------------------------------------------------- /aliases/available/npm.aliases.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | about-alias 'common npm abbreviations' 3 | url "https://docs.npmjs.com/" 4 | 5 | # Aliases 6 | 7 | # npm 8 | alias ni='npm install' 9 | alias nis='npm install --save' 10 | alias nid='npm install --save-dev' 11 | alias nit='npm install-test' 12 | alias nits='npm install-test --save' 13 | alias nitd='npm install-test --save-dev' 14 | alias nu='npm uninstall' 15 | alias nus='npm uninstall --save' 16 | alias nusd='npm uninstall --save-dev' 17 | alias np='npm publish' 18 | alias nup='npm unpublish' 19 | alias nlk='npm link' 20 | alias nod='npm outdated' 21 | alias nrb='npm rebuild' 22 | alias nud='npm update' 23 | alias nr='npm run' 24 | alias nls='npm list --depth=0 2>/dev/null' 25 | alias nlsg='npm list -g --depth=0 2>/dev/null' 26 | alias nt='npm test' 27 | 28 | # npx 29 | alias nx='npx' 30 | alias nxplease='npx $(fc -ln -1)' 31 | alias nxn='npx --no-install ' 32 | alias nxp='npx -p ' 33 | alias nxnp='npx --no-install -p ' 34 | alias nxq='npx -q ' 35 | alias nxnq='npx --no-install -q ' 36 | alias nxqp='npx -q -p ' 37 | alias nxnqp='npx --no-install -q -p ' 38 | alias nxni='npx --no-install --ignore-existing ' 39 | alias nxip='npx --ignore-existing -p ' 40 | alias nxnip='npx --no-install --ignore-existing -p ' 41 | alias nxqi='npx -q --ignore-existing ' 42 | alias nxniq='npx --no-install --ignore-existing -q ' 43 | alias nxiqp='npx --ignore-existing -q -p ' 44 | alias nxniqp='npx --no-install --ignore-existing -q -p ' 45 | -------------------------------------------------------------------------------- /completion/available/ngrok.completion.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | __ngrok_completion() { 4 | # shellcheck disable=SC2155 5 | local prev=$(_get_pword) 6 | # shellcheck disable=SC2155 7 | local curr=$(_get_cword) 8 | 9 | local BASE_NO_CONF="--log --log-format --log-level --help" 10 | local BASE="--config $BASE_NO_CONF" 11 | local DEFAULT="$BASE --authtoken --region" 12 | 13 | case $prev in 14 | authtoken) 15 | # shellcheck disable=SC2207 16 | COMPREPLY=($(compgen -W "$BASE" -- "$curr")) 17 | ;; 18 | http) 19 | # shellcheck disable=SC2207 20 | COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr")) 21 | ;; 22 | start) 23 | # shellcheck disable=SC2207 24 | COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr")) 25 | ;; 26 | tcp) 27 | # shellcheck disable=SC2207 28 | COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr")) 29 | ;; 30 | tls) 31 | # shellcheck disable=SC2207 32 | COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr")) 33 | ;; 34 | update) 35 | # shellcheck disable=SC2207 36 | COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr")) 37 | ;; 38 | ngrok) 39 | # shellcheck disable=SC2207 40 | COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr")) 41 | ;; 42 | *) ;; 43 | 44 | esac 45 | } 46 | 47 | complete -F __ngrok_completion ngrok 48 | -------------------------------------------------------------------------------- /themes/clean/clean.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # git theming 5 | SCM_THEME_PROMPT_PREFIX="${bold_blue?}(${yellow?}" 6 | SCM_THEME_PROMPT_SUFFIX="${bold_blue?})${reset_color?} " 7 | SCM_THEME_PROMPT_CLEAN="" 8 | SCM_THEME_PROMPT_DIRTY="${bold_red?}✗" 9 | 10 | # LS colors, made with http://geoff.greer.fm/lscolors/ 11 | export LSCOLORS="Gxfxcxdxbxegedabagacad" 12 | export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' 13 | 14 | function prompt_command() { 15 | local no_color 16 | if [ "$(whoami)" = root ]; then 17 | no_color=${red?} 18 | else 19 | no_color=${white?} 20 | fi 21 | 22 | PS1="${no_color}\u${reset_color?}:${blue?}\W/${reset_color?} $(scm_prompt_info)${normal?}$ " 23 | } 24 | 25 | safe_append_prompt_command prompt_command 26 | -------------------------------------------------------------------------------- /themes/modern-time/modern-time.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034 # Expected behavior for themes. 3 | 4 | # Modified version of the original modern theme in bash-it 5 | # Removes the battery charge and adds the current time 6 | 7 | SCM_THEME_PROMPT_PREFIX="" 8 | SCM_THEME_PROMPT_SUFFIX="" 9 | 10 | SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" 11 | SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" 12 | SCM_GIT_CHAR="${bold_green?}±${normal?}" 13 | SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" 14 | SCM_HG_CHAR="${bold_red?}☿${normal?}" 15 | 16 | case ${TERM} in 17 | xterm*) 18 | TITLEBAR="\[\033]0;\w\007\]" 19 | ;; 20 | *) 21 | TITLEBAR="" 22 | ;; 23 | esac 24 | 25 | PS3=">> " 26 | 27 | is_vim_shell() { 28 | if [[ -n "$VIMRUNTIME" ]]; then 29 | echo "[${cyan?}vim shell${normal?}]" 30 | fi 31 | } 32 | 33 | modern_current_time_prompt() { 34 | echo "[$(date '+%l:%M%p')]" 35 | } 36 | 37 | prompt() { 38 | if [ $? -ne 0 ]; then 39 | SCM_PROMPT_FORMAT='[%s][%s]' 40 | # Yes, the indenting on these is weird, but it has to be like 41 | # this otherwise it won't display properly. 42 | 43 | PS1="${TITLEBAR}${bold_red?}┌─${reset_color?}$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) 44 | ${bold_red?}└─▪${normal?} " 45 | else 46 | SCM_PROMPT_FORMAT='[%s][%s]' 47 | PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) 48 | └─▪ " 49 | fi 50 | } 51 | 52 | PS2="└─▪ " 53 | 54 | safe_append_prompt_command prompt 55 | -------------------------------------------------------------------------------- /themes/doubletime/doubletime.theme.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | # shellcheck disable=SC2034,SC2154 3 | 4 | SCM_THEME_PROMPT_DIRTY='' 5 | SCM_THEME_PROMPT_CLEAN='' 6 | SCM_GIT_CHAR="${bold_cyan?}±${normal?}" 7 | SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" 8 | SCM_HG_CHAR="${bold_red?}☿${normal?}" 9 | SCM_THEME_PROMPT_PREFIX="" 10 | SCM_THEME_PROMPT_SUFFIX="" 11 | if [[ -n "$RVM_THEME_PROMPT_COLOR" ]]; then 12 | RVM_THEME_PROMPT_COLOR=$(eval "echo $$(echo ${RVM_THEME_PROMPT_COLOR})") 13 | else 14 | RVM_THEME_PROMPT_COLOR="${red?}" 15 | fi 16 | RVM_THEME_PROMPT_PREFIX="(${RVM_THEME_PROMPT_COLOR}rb${normal?}: " 17 | RVM_THEME_PROMPT_SUFFIX=") " 18 | if [[ -n "$VIRTUALENV_THEME_PROMPT_COLOR" ]]; then 19 | VIRTUALENV_THEME_PROMPT_COLOR=$(eval "echo $$(echo ${VIRTUALENV_THEME_PROMPT_COLOR})") 20 | else 21 | VIRTUALENV_THEME_PROMPT_COLOR="${green?}" 22 | fi 23 | VIRTUALENV_THEME_PROMPT_PREFIX="(${VIRTUALENV_THEME_PROMPT_COLOR}py${normal?}: " 24 | VIRTUALENV_THEME_PROMPT_SUFFIX=") " 25 | 26 | if [[ -n "$THEME_PROMPT_HOST_COLOR" ]]; then 27 | THEME_PROMPT_HOST_COLOR=$(eval "echo $$(echo ${THEME_PROMPT_HOST_COLOR})") 28 | else 29 | THEME_PROMPT_HOST_COLOR="${blue?}" 30 | fi 31 | 32 | function prompt_setter() { 33 | # Save history 34 | _save-and-reload-history 1 35 | PS1=" 36 | $(clock_prompt) $(scm_char) [${THEME_PROMPT_HOST_COLOR}\u@${THEME_PROMPT_HOST}${reset_color?}] $(virtualenv_prompt)$(ruby_version_prompt)\w 37 | $(scm_prompt)${reset_color?} $ " 38 | PS2='> ' 39 | PS4='+ ' 40 | } 41 | 42 | safe_append_prompt_command prompt_setter 43 | -------------------------------------------------------------------------------- /plugins/available/goenv.plugin.bash: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | cite about-plugin 3 | about-plugin 'load goenv, if you are using it' 4 | url "https://github.com/syndbg/goenv" 5 | 6 | # https://github.com/syndbg/goenv 7 | 8 | # Load after basher 9 | # BASH_IT_LOAD_PRIORITY: 260 10 | 11 | # Don't modify the environment if we can't find the tool: 12 | # - Check if in $PATH already 13 | # - Check if installed manually to $GOENV_ROOT 14 | # - Check if installed manually to $HOME 15 | _command_exists goenv \ 16 | || [[ -n "$GOENV_ROOT" && -x "$GOENV_ROOT/bin/goenv" ]] \ 17 | || [[ -x "$HOME/.goenv/bin/goenv" ]] \ 18 | || return 0 19 | 20 | # Set GOENV_ROOT, if not already set 21 | export GOENV_ROOT="${GOENV_ROOT:-$HOME/.goenv}" 22 | 23 | # Add GOENV_ROOT/bin to PATH, if that's where it's installed 24 | if ! _command_exists goenv && [[ -x "$GOENV_ROOT/bin/goenv" ]]; then 25 | pathmunge "$GOENV_ROOT/bin" 26 | fi 27 | 28 | # Initialize goenv 29 | eval "$(goenv init - bash)" 30 | 31 | # If moving to a directory with a goenv version set, reload the shell 32 | # to ensure the shell environment matches expectations. 33 | _bash-it-goenv-preexec() { 34 | GOENV_OLD_VERSION="$(goenv version-name)" 35 | } 36 | _bash-it-goenv-precmd() { 37 | if [[ -n $GOENV_OLD_VERSION ]] && [[ "$GOENV_OLD_VERSION" != "$(goenv version-name)" ]]; then 38 | exec env -u PATH -u GOROOT -u GOPATH -u GOENV_OLD_VERSION "${0/-/}" --login 39 | fi 40 | unset GOENV_OLD_VERSION 41 | } 42 | preexec_functions+=(_bash-it-goenv-preexec) 43 | precmd_functions+=(_bash-it-goenv-precmd) 44 | --------------------------------------------------------------------------------