```bash # Rust-based tools that should be in the path for this config to work function installIfDoesNotExist() { if ! command -v $1 --help &> /dev/null then echo "installing $1" cargo install $1 fi } installIfDoesNotExist "cargo-watch" installIfDoesNotExist "cargo-nextest" installIfDoesNotExist "exa" installIfDoesNotExist "cargo-expand" installIfDoesNotExist "zoxide" installIfDoesNotExist "loc" installIfDoesNotExist "bacon" # ripgrep installs as "rg" so its a bit different if ! command -v rg --help &> /dev/null then echo "installing $1" cargo install ripgrep fi export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion export PATH=$PATH:/opt/bin/:~/.cargo/bin:/usr/bin:/opt/homebrew/bin # aliases alias gs='git status' alias gd='git diff' alias qs='cd ~/code/qsharp' alias cb='cargo build' alias ctr='cargo nextest run' alias ct='cargo nextest' alias cr='cargo run' alias vim='nvim' alias rpete='(cd ~/code/petr/pete && cargo build && cp ../target/debug/pete ~/.cargo/bin)' alias rrpete='(cd ~/code/petr/pete && cargo build --release && cp ../target/release/pete ~/.cargo/bin)' alias dbgpete='(cd ~/code/petr/pete && cargo build --features=debug && cp ../target/debug/pete ~/.cargo/bin)' alias ls='exa' ## PS1 section ## Colors? Used for the prompt. #Regular text color BLACK='\[\e[0;30m\]' #Bold text color BBLACK='\[\e[1;30m\]' #background color BGBLACK='\[\e[40m\]' RED='\[\e[0;31m\]' BRED='\[\e[1;31m\]' BGRED='\[\e[41m\]' GREEN='\[\e[0;32m\]' BGREEN='\[\e[1;32m\]' BGGREEN='\[\e[1;32m\]' YELLOW='\[\e[0;33m\]' BYELLOW='\[\e[1;33m\]' BGYELLOW='\[\e[1;33m\]' BLUE='\[\e[0;34m\]' BBLUE='\[\e[1;34m\]' BGBLUE='\[\e[1;34m\]' MAGENTA='\[\e[0;35m\]' BMAGENTA='\[\e[1;35m\]' BGMAGENTA='\[\e[1;35m\]' CYAN='\[\e[0;36m\]' BCYAN='\[\e[1;36m\]' BGCYAN='\[\e[1;36m\]' WHITE='\[\e[0;37m\]' BWHITE='\[\e[1;37m\]' BGWHITE='\[\e[1;37m\]' PROMPT_COMMAND=smile_prompt function smile_prompt { if [ "$?" -eq "0" ] then #smiley SC="${GREEN}:)" else #frowney SC="${RED}:(" fi if [ $UID -eq 0 ] then #root user color UC="${RED}" else #normal user color UC="${BWHITE}" fi #hostname color HC="${BYELLOW}" #regular color RC="${BWHITE}" #default color DF='\[\e[0m\]' export PS1="[${UC}\u${RC}@${HC}\h ${RC}\W${DF}] ${SC}${DF} " } # ## Git branch in prompt. #parse_git_branch() { # git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' #} #export PS1="${'$(pwd)\033[32m\]\'}${"$(parse_git_branch)\[\033[00m\] λ "}" # for helix and nvim copilot completions # for zoxide `cd` replacement eval "$(zoxide init bash)" alias cd='z' export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion # Generated for envman. Do not edit. [ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh" ```