Daemon starts in the background when a new shell opens so 'e' always connects to an existing server rather than launching a new instance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
58 lines
1.8 KiB
Bash
58 lines
1.8 KiB
Bash
# Completion
|
|
autoload -Uz compinit
|
|
compinit
|
|
|
|
# History
|
|
HISTSIZE=1000
|
|
SAVEHIST=1000
|
|
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh_history"
|
|
mkdir -p "$(dirname "$HISTFILE")"
|
|
|
|
setopt HIST_FCNTL_LOCK HIST_IGNORE_DUPS HIST_IGNORE_SPACE SHARE_HISTORY
|
|
unsetopt HIST_IGNORE_ALL_DUPS HIST_EXPIRE_DUPS_FIRST EXTENDED_HISTORY
|
|
|
|
# Prompt: blue host+path, then green λ (success) or red ? (failure)
|
|
PROMPT="%F{blue}%m %~%b"$'\n'"%(?.%F{green}%Bλ%b |.%F{red}?) %f"
|
|
|
|
# PATH
|
|
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$PATH"
|
|
|
|
# Aliases
|
|
alias e="emacsclient -t -a \"\""
|
|
alias mailsync="mbsync -a"
|
|
alias c="clear"
|
|
alias cat="bat --paging=never --style=plain"
|
|
alias cp="cp -riv"
|
|
alias ls="eza -al --icons"
|
|
alias mkdir="mkdir -vp"
|
|
alias mv="mv -iv"
|
|
alias rm="rm -rifv"
|
|
alias tree="eza --tree --icons"
|
|
|
|
# Compilation aliases (debug build / optimized build)
|
|
alias g++="g++ -ggdb -pedantic-errors -Wall -Weffc++ -Wextra -Wconversion -Wsign-conversion -std=c++23"
|
|
alias 'g+++'="g++ -O2 -DNDEBUG -pedantic-errors -Wall -Weffc++ -Wextra -Wconversion -Wsign-conversion -std=c++23"
|
|
alias gcc="gcc -ggdb -pedantic-errors -Wall -Wextra -Wconversion -Wsign-conversion -std=c23"
|
|
alias gccc="g++ -O2 -DNDEBUG -pedantic-errors -Wall -Wextra -Wconversion -Wsign-conversion -std=c23"
|
|
|
|
# Named directory shortcuts
|
|
hash -d dots="$HOME/.dotfiles"
|
|
hash -d src="$HOME/src"
|
|
|
|
# Load SSH keys
|
|
eval "$(keychain --eval --quiet github git)"
|
|
|
|
# direnv hook
|
|
eval "$(direnv hook zsh)"
|
|
|
|
# Start Emacs daemon if not already running
|
|
if ! emacsclient -e nil &>/dev/null; then
|
|
emacs --daemon &>/dev/null &
|
|
fi
|
|
|
|
echo -ne '\e[1 q'
|
|
|
|
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
|