Watch
1
0
Fork
You've already forked dotfiles
0
dotfiles/.config/shell/aliases
Alexander Hess d7f709931b
Add configuration for zsh
- Add ~/.zshrc
  + Configure on how the `history` works
  + Enable nicer `cd` and globbing behavior
  + Enable tab completion, and make them feel nicer
  + Enable VI mode and add some VI-like key bindings
- Add ~/.zlogout clearing the screen
- Add ~/.config/zsh/.zshrc and make it dispatch to ~/.zshrc
  to make `zsh` use the same configuration even on more
  recent Debian/Ubuntu machines that do not look for
  ~/.zshrc any more
- Ensure ~/.local/state/zsh/ exists
2026-08-20 21:20:14 +02:00

30 lines
686 B
Shell

#!/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'
forget() { # the current history and restore $HISTFILE from disk
if [ -n "$BASH_VERSION" ]; then
history -c
history -r
elif [ -n "$ZSH_VERSION" ]; then
local _histsize=$HISTSIZE
HISTSIZE=0 # because shrinking the list to 0 discards all entries
HISTSIZE=$_histsize
fc -R "$HISTFILE"
fi
}
if [ -n "$ZSH_VERSION" ]; then
alias forget=' forget' # Leading space => The invocation itself is forgotten
fi
alias grep='grep --exclude-dir=.git'