[alias] dfif = diff idff = diff grpe = grep
[alias] dfif = diff idff = diff grpe = grep
I have often wondered why that functionality disappeared, and why no one has tried to resurrect it. Search engines offer corrections all the time; why doesn't bash?
Teitelman's Interlisp
Has a DWIM feature that's
Really a screw;
MACLISP has evident
Superiority
Letting its customer
Mean what he do.
--The Great Quux (Guy L. Steele)
This poem indicates the frustrations that hackers had with DWIM at the time, which may explain why no one tried to resurrect it. Too-clever-by-half features intended to help tend to drive people nuts, especially when they fail. Even when they succeed, they interrupt the user's flow and become like that dialog box Windows users just dismiss.
# I do this an embarrassing amount
alias fgf='fg'
alias fgfg='fg'
alias gf='fg'
alias gfg='fg' alias emcas='emacs'
alias emac='emacs'
alias emasc='emacs'
alias enacs='emacs'
alias emas='emacs'
alias emascs='emacs'
alias eamcs='emacs'
alias eemacs='emacs'Honourable mention also to FZF [1] which not only makes it trivial to locate a file in a directory tree, but has revolutionised my history use with its fuzzy matching.
gc = git checkout
gs = git status
etc...
alias g="git"
__git_complete g _git # enable git autocompletion (braches, etc.)
alias gc="git commit -am"
alias gp="git push"
__git_complete gp _git_checkout # checkout is more useful than _git_push because it autocompletes the branch
alias ga="git add -A"
alias gd="git diff"
alias gb="git branch"
alias gx="git checkout"
__git_complete gx _git_checkout
alias gs="git status"
alias gl="git log" alias gcane="git commit --amend --no-edit" function fixup() {
git commit --fixup=$1
}
function refixup() {
git rebase -i --autosquash --autostash $1^1
}Also not afraid to add multi-letter aliases if I find myself typing the same multi-word command over and over.
For example git diff master HEAD becomes gdmh
alias _up='sudo apt update -y && sudo apt upgrade -y'
And then define one and two letter aliases for the things you do often:
st=status
l=log --with-prettiness
ap=add --patch
shit=reset
co=checkout
Command ' grep' not found, but there are 17 similar ones. Maybe I'm not the only one :).