# If not running interactively, don't do anything [[ $- != *i* ]] && return alias ls='ls -p --color=auto' alias ll='ls -Alh' alias cz='chezmoi' alias e="emacsclient --no-wait --quiet" alias ee="emacsclient --no-wait --quiet --create-frame" alias cmatrix="cmatrix -C blue" PS1='\[\e[36m\][\[\e[34m\]\u\[\e[36m\]@\[\e[34m\]\h\[\e[36m\]:\[\e[34m\]\w\[\e[36m\]] \[\e[95m\]\$\[\e[0m\] ' # Update window size after every command shopt -s checkwinsize # Prevent file overwrite on stdout redirection # Use `>|` to force redirection to an existing file set -o noclobber # Turn on recursive globbing (enables ** to recurse all directories) shopt -s globstar # Automatically trim long paths in the prompt (requires Bash 4.x) PROMPT_DIRTRIM=2 # Perform file completion in a case insensitive fashion bind "set completion-ignore-case on" # Treat hyphens and underscores as equivalent bind "set completion-map-case on" # Display matches for ambiguous patterns at first tab press bind "set show-all-if-ambiguous on" # Immediately add a trailing slash when autocompleting symlinks to directories bind "set mark-symlinked-directories on" # Append to the history file, don't overwrite it shopt -s histappend # Save multi-line commands as one command # shopt -s cmdhist # Record each line as it gets issued PROMPT_COMMAND='history -a' # Huge history. Doesn't appear to slow things down, so why not? HISTSIZE=500000 HISTFILESIZE=100000 # Avoid duplicate entries # HISTCONTROL="erasedups:ignoreboth" # Don't record some commands export HISTIGNORE="&:[ ]*:exit:bg:fg:history:clear" export HISTFILE="$XDG_CACHE_HOME/.bash_history" # Use standard ISO 8601 timestamp # %F equivalent to %Y-%m-%d # %T equivalent to %H:%M:%S (24-hours format) HISTTIMEFORMAT='%F %T ' # Prepend cd to directory names automatically shopt -s autocd # Correct spelling errors during tab-completion shopt -s dirspell # Correct spelling errors in arguments supplied to cd shopt -s cdspell # This defines where cd looks for targets # Add the directories you want to have fast access to, separated by colon # Ex: CDPATH=".:~:~/projects" will look for targets in the current working directory, in home and in the ~/projects folder CDPATH="." # This allows you to bookmark your favorite places across the file system # Define a variable containing a path and you will be able to cd into it regardless of the directory you're in shopt -s cdable_vars # export dotfiles="$HOME/dotfiles" export GPG_TTY=$(tty)