I have a dotfiles repo that I have been pretending to maintain for about a decade. Most of what is in it I never use. These are the aliases I actually reach for, every day, without thinking.
Three shell aliases#
# move to the most recently modified subdirectory
alias cdr='cd "$(ls -dt */ | head -1)"'
# quickly stash and restore a working directory
alias work-pause='git stash push -u -m "pause-$(date +%s)"'
alias work-resume='git stash pop'
# tiny http server in the current directory
alias serve='python3 -m http.server 8080'
Two git habits#
# show me only the files I've actually changed
git diff --stat
# squash the last N commits into one
git rebase -i HEAD~N
None of this is clever. All of it has paid for itself fifty times over.
The longer I do this work, the more convinced I am that the high-value optimizations are almost never the dramatic ones. They are the three keystrokes I save eighty times a day, multiplied across a decade.