From 0be66701aa74cdfd46ad19b6f1dd51dfdd516b2c Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 12 Jan 2023 18:50:06 +0000 Subject: [PATCH] Update 4 files - /home/.chezmoiexternal.toml - /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl - /home/dot_bashrc - /home/dot_zshrc --- home/.chezmoiexternal.toml | 6 ++ .../run_onchange_after_94-bash-it.tmpl | 15 +++++ home/dot_bashrc | 64 +++++++++---------- home/dot_zshrc | 32 +++++----- 4 files changed, 68 insertions(+), 49 deletions(-) create mode 100644 home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl diff --git a/home/.chezmoiexternal.toml b/home/.chezmoiexternal.toml index b9cc551f..1f87b65c 100644 --- a/home/.chezmoiexternal.toml +++ b/home/.chezmoiexternal.toml @@ -59,6 +59,12 @@ refreshPeriod = "{{ $refreshPeriod }}" clone.args = ["--depth", "1"] pull.args = ["--ff-only"] +#[".local/oh-my-bash"] +# type = "git-repo" +# url = "https://github.com/ohmybash/oh-my-bash.git" +# refreshPeriod = "{{ $refreshPeriod }}" +# clone.args = ["--depth", "1"] +# pull.args = ["--ff-only"] [".config/shell/lscolors.sh"] type = "file" url = "https://raw.githubusercontent.com/trapd00r/LS_COLORS/master/lscolors.sh" diff --git a/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl new file mode 100644 index 00000000..5e617cab --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl @@ -0,0 +1,15 @@ +{{- if (ne .host.distro.family "windows") -}} +#!/usr/bin/env bash + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +### Bash-it completions / plugins +if command -v bash-it; then + logg info 'Enabling bash-it completions' + bash-it enable completion defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant + logg info 'Enabling bash-it plugins' + bash-it enable plugin base blesh browser cht-sh dirs gitstatus powerline sudo xterm +fi + +{{ end -}} diff --git a/home/dot_bashrc b/home/dot_bashrc index d20689f9..3074b4a1 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -23,6 +23,33 @@ if [ -f "$HOME/.config/shell/profile.sh" ]; then . "$HOME/.config/shell/profile.sh" fi +# Prompt (on bash only) +if [ "$BASH_SUPPORT" = 'true' ]; then + if [[ "$(hostname)" != *'-minimal' ]]; then + ### Styled Terminal + export BASH_IT="$HOME/.local/bash_it" + export BASH_IT_THEME="powerline" + if [ -f "$BASH_IT/bash_it.sh" ]; then + . "$BASH_IT/bash_it.sh" + elif command -v oh-my-posh > /dev/null; then + # Oh My Posh (See: https://ohmyposh.dev/) + eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse.omp.json")" + else + # Basic styled terminal + case "$TERM" in + xterm* | rxvt* | Eterm | aterm | kterm | gnome* | alacritty) + PS1="\n \[\033[0;34m\]╭─\[\033[0;31m\]\[\033[0;37m\]\[\033[41m\] $OS_ICON \u \[\033[0m\]\[\033[0;31m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\] \w \[\033[0m\]\[\033[0;34m\] \n \[\033[0;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]" + ;; + esac + fi + else + # Minimal session + if command -v oh-my-posh > /dev/null; then + eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse-minimal.omp.json")" + fi + fi +fi + ### Fig / LC_ALL if [ "$BASH_SUPPORT" = 'true' ]; then if [ -f "$HOME/.fig/shell/bashrc.pre.bash" ]; then @@ -45,33 +72,6 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc fi -# Prompt (on bash only) -if [ "$BASH_SUPPORT" = 'true' ]; then - if [[ "$(hostname)" != *'-minimal' ]]; then - ### Styled Terminal - export BASH_IT="$HOME/.local/bash_it" - export BASH_IT_THEME=modern - if [ -f "$BASH_IT/bash_it.sh" ]; then - . "$BASH_IT/bash_it.sh" - elif command -v oh-my-posh > /dev/null; then - # Oh My Posh (See: https://ohmyposh.dev/) - eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse.omp.json")" - else - # Basic styled terminal - case "$TERM" in - xterm* | rxvt* | Eterm | aterm | kterm | gnome* | alacritty) - PS1="\n \[\033[0;34m\]╭─\[\033[0;31m\]\[\033[0;37m\]\[\033[41m\] $OS_ICON \u \[\033[0m\]\[\033[0;31m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\] \w \[\033[0m\]\[\033[0;34m\] \n \[\033[0;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]" - ;; - esac - fi - else - # Minimal session - if command -v oh-my-posh > /dev/null; then - eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse-minimal.omp.json")" - fi - fi -fi - ### Bash Initialization Hooks if [ "$BASH_SUPPORT" = 'true' ]; then ### Bash Completion @@ -89,11 +89,6 @@ if [ "$BASH_SUPPORT" = 'true' ]; then . "$ASDF_DATA_DIR/plugins/java/set-java-home.bash" fi - ### zoxide - if command -v zoxide > /dev/null; then - eval "$(zoxide init --cmd cd bash)" > /dev/null - fi - ### Fig if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then . "$HOME/.fig/shell/bashrc.post.bash" @@ -103,4 +98,9 @@ if [ "$BASH_SUPPORT" = 'true' ]; then if command -v vault > /dev/null; then complete -C vault vault fi + + ### zoxide + if command -v zoxide > /dev/null; then + eval "$(zoxide init --cmd cd bash)" > /dev/null + fi fi diff --git a/home/dot_zshrc b/home/dot_zshrc index f43bc65b..f70e45eb 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -259,13 +259,13 @@ if command -v antigen > /dev/null; then # Fix for oh-my-zsh overriding exa aliases export DISABLE_LS_COLORS=true antigen use oh-my-zsh - # antigen bundle adb + antigen bundle adb # antigen bundle colored-man-pages # antigen bundle command-not-found # antigen bundle copyfile # antigen bundle copybuffer # antigen bundle encode64 - # antigen bundle fd + antigen bundle fd # antigen bundle git-auto-fetch # antigen bundle gnu-utils # antigen bundle heroku @@ -274,29 +274,27 @@ if command -v antigen > /dev/null; then # antigen bundle macos # antigen bundle magic-enter # antigen bundle minikube - # antigen bundle ng + antigen bundle ng # antigen bundle nomad - # antigen bundle npm + antigen bundle npm # antigen bundle redis-cli - # antigen bundle ripgrep + antigen bundle ripgrep # antigen bundle rust # antigen bundle safe-paste # antigen bundle salt # antigen bundle shell-proxy # antigen bundle ssh-agent - # antigen bundle sudo + antigen bundle sudo # antigen bundle ufw # antigen bundle web-search - # antigen bundle docker - # antigen bundle docker-compose - # antigen bundle gem - # antigen bundle ionic - # antigen bundle microk8s + antigen bundle docker + antigen bundle docker-compose + antigen bundle ionic # antigen bundle multipass # antigen bundle pip # antigen bundle pm2 # antigen bundle terraform - # antigen bundle vagrant + antigen bundle vagrant # antigen bundle yarn # antigen bundle zsh-interactive-cd @@ -335,11 +333,6 @@ if command -v mcfly > /dev/null; then eval "$(mcfly init zsh)" fi -### zoxide -if command -v zoxide > /dev/null; then - eval "$(zoxide init --cmd cd zsh)" > /dev/null -fi - ### Fig if [ -f "$HOME/.fig/shell/zshrc.post.zsh" ]; then source "$HOME/.fig/shell/zshrc.post.zsh" @@ -357,3 +350,8 @@ autoload -U +X bashcompinit && bashcompinit if command -v vault > /dev/null; then complete -o nospace -C vault vault fi + +### zoxide +if command -v zoxide > /dev/null; then + eval "$(zoxide init --cmd cd zsh)" > /dev/null +fi