#!/usr/bin/env bash # Bash configuration export BASH_SILENCE_DEPRECATION_WARNING=1 # XDG Base Directory export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export WORKSPACE_DIR="${WORKSPACE_DIR:-$HOME/.workspace}" # Homebrew (macOS) if [[ "$OSTYPE" == "darwin"* ]]; then if [ -f "/opt/homebrew/bin/brew" ]; then eval "$(/opt/homebrew/bin/brew shellenv)" elif [ -f "/usr/local/bin/brew" ]; then eval "$(/usr/local/bin/brew shellenv)" fi fi # Go if [ -d "/usr/local/go" ]; then export GOROOT="/usr/local/go" export GOPATH="${WORKSPACE_DIR}" export GOBIN="${WORKSPACE_DIR}/bin" export GO111MODULE=on export GOPRIVATE=github.com/jchenry/* export PATH=$PATH:$GOROOT/bin:$GOBIN fi # Plan 9 if [ -d "/usr/local/plan9" ]; then # acme visible clicks export visibleclicks=1 export PLAN9="/usr/local/plan9" export PATH="$PATH:$PLAN9/bin" fi # History settings shopt -s histappend export HISTSIZE=100000 export HISTFILESIZE=10000000 export HISTCONTROL=ignoreboth export PROMPT_COMMAND="history -a; history -n" export HISTIGNORE="ls:ll:cd:pwd:bg:fg:history" # Aliases alias ll='ls -lah' alias la='ls -A' alias l='ls -CF' # Modern replacements if command -v eza &> /dev/null; then alias ls='eza' alias ll='eza -la' alias lt='eza --tree' fi if command -v bat &> /dev/null; then alias cat='bat' fi # fd for Debian (named fd-find) if command -v fdfind &> /dev/null && ! command -v fd &> /dev/null; then alias fd='fdfind' fi # Git completions if [ -f /usr/share/bash-completion/completions/git ]; then . /usr/share/bash-completion/completions/git fi # Starship prompt if command -v starship &> /dev/null; then eval "$(starship init bash)" fi # Zoxide (smarter cd) if command -v zoxide &> /dev/null; then eval "$(zoxide init bash)" fi # fzf if command -v fzf &> /dev/null; then if [ -f ~/.fzf.bash ]; then source ~/.fzf.bash elif [ -f /usr/share/doc/fzf/examples/key-bindings.bash ]; then source /usr/share/doc/fzf/examples/key-bindings.bash fi fi