summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2023-05-05 15:59:22 +0200
committerAhmed Abdelhalim <[email protected]>2023-05-05 15:59:22 +0200
commit39d51a1a6693ef8efffa12fefdb4ddd6096fed99 (patch)
tree7054ec860bbed649586da257e649e6c60fd8097f
parent8cf7ac48170f22db1187e8e2aeb051c369b1eb0e (diff)
Fix the mutt/k8s sections to be only included when installed only
-rw-r--r--.bash_profile25
1 files changed, 15 insertions, 10 deletions
diff --git a/.bash_profile b/.bash_profile
index 02fa6ba..4046050 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -34,13 +34,6 @@ alias la='ls -a'
alias srv="python3 -m http.server" # start simple server
alias tagme='ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths)'
alias skipci='git commit --allow-empty -m "--skip-ci"'
-alias k='kubectl'
-complete -F __start_kubectl k
-alias ktx='kubectx'
-complete -F _kube_contexts ktx
-alias kns='kubens'
-complete -F _kube_namespaces kns
-
alias gpgkill='(
pkill pinentry-tty
pkill pinentry-curses
@@ -49,9 +42,6 @@ alias gpgkill='(
gpg-connect-agent /bye
)'
-# Fixes the pinentry-tty error https://github.com/neomutt/neomutt/issues/1014
-alias mutt='PINENTRY_USER_DATA=curses neomutt $@'
-
# alias g='git'
# # look up the original completion command and replace the last with the alias
# complete -o bashdefault -o default -o nospace -F __git_wrap__git_main g
@@ -70,6 +60,11 @@ alias htb="cd ~/Work/HTB/"
alias otw="cd ~/Work/OTW/"
alias obs="cd ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Vault/Work/"
+if command -v neomutt 1>/dev/null 2>&1; then
+ # Fixes the pinentry-tty error https://github.com/neomutt/neomutt/issues/1014
+ alias mutt='PINENTRY_USER_DATA=curses neomutt $@'
+fi
+
# ==== go config.
if command -v go 1>/dev/null 2>&1; then
export PATH="$HOME/go/bin:$PATH"
@@ -120,6 +115,16 @@ if command -v helm 1>/dev/null 2>&1; then
fi
fi
+# ==== k8s/ktx/kns completeion
+if command -v kubectl 1>/dev/null 2>&1; then
+ alias k='kubectl'
+ complete -F __start_kubectl k
+ alias ktx='kubectx'
+ complete -F _kube_contexts ktx
+ alias kns='kubens'
+ complete -F _kube_namespaces kns
+fi
+
# ==== load all bash completions
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion