2026-06-11 18:28:00 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Aliases used in all kinds of shells
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Manage the bare `git` repository in ~/ holding the dotfiles
|
|
|
|
|
alias dotfiles='git --git-dir=$DOTFILES_DIR --work-tree=$HOME'
|
|
|
|
|
|
|
|
|
|
|
2026-06-11 18:28:02 +02:00
|
|
|
|
|
|
|
|
forget() { # the current history and restore $HISTFILE from disk
|
|
|
|
|
if [ -n "$BASH_VERSION" ]; then
|
|
|
|
|
history -c
|
|
|
|
|
history -r
|
2026-06-11 18:28:02 +02:00
|
|
|
elif [ -n "$ZSH_VERSION" ]; then
|
|
|
|
|
local _histsize=$HISTSIZE
|
|
|
|
|
HISTSIZE=0 # because shrinking the list to 0 discards all entries
|
|
|
|
|
HISTSIZE=$_histsize
|
|
|
|
|
fc -R "$HISTFILE"
|
2026-06-11 18:28:02 +02:00
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-11 18:28:02 +02:00
|
|
|
if [ -n "$ZSH_VERSION" ]; then
|
|
|
|
|
alias forget=' forget' # Leading space => The invocation itself is forgotten
|
|
|
|
|
fi
|
|
|
|
|
|
2026-06-11 18:28:02 +02:00
|
|
|
|
|
|
|
|
|
2026-06-11 18:28:00 +02:00
|
|
|
alias grep='grep --exclude-dir=.git'
|
2026-06-11 18:28:02 +02:00
|
|
|
|