My `.bashrc` backup

November 23, 2024 note-to-self backup

Just a backup for my own sake.


eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="$PATH:$HOME/.docker/bin:$HOME/Code/bin"

alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias dfl="df -lH"

set histdup='all'
export HISTTIMEFORMAT="%d/%m/%y %T "
export EDITOR=vim

alias F="ssh <...>@<...>"
alias zd="lazydocker"
alias zg="lazygit"
alias zk="lazykube"
alias top="htop"

function DR() {
    if [ "$#" = 0 ]; then
        docker container ls
    else
        docker exec -t -i -u 0 "$@"
    fi
}

# https://gist.github.com/yesmar/17311d0aa7f39d954d31503aab4775f1
fgGreen=$(tput setaf 2)
fgBlue=$(tput setaf 4)
fgPowderBlue=$(tput setaf 33)
fgRed=$(tput setaf 1)
fgSilver=$(tput setaf 7)
fgBlack=$(tput setaf 0)
fgYellow=$(tput setaf 11)
fgWhite=$(tput setaf 15)

bgRed=$(tput setab 9)
bgGreen=$(tput setab 2)
bgYellow=$(tput setab 11)
bgSilver=$(tput setab 7)
bgPowderBlue=$(tput setab 33)
bgWhite=$(tput setab 15)
_RESET=$(tput sgr0)
_BOLD=$(tput bold)

source /usr/local/bin/git-prompt.sh
source /usr/local/bin/kube-prompt.sh

export PS1='${bgSilver}${fgBlack} \w ${bgPowderBlue}${fgWhite}$(__git_ps1) ${_BOLD}${bgYellow}${fgRed} $(__kube_ps1) ${_RESET}\n\$ '

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/ha/go/bin"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

export KUBECONFIG=""

kcontext() {
  KUBECONFIG=~/.kube/$1config

  if [[ $1 == 'none' ]]; then
    KUBECONFIG=""
  fi
}