9 ms·
My life was also improved with some additional aliases in my git config: [alias] dfif = diff idff = diff grpe = grep
by tych0 6y ago
My life was also improved with some additional aliases in my git config:
[alias]
dfif = diff
idff = diff
grpe = grep
- seqizz 6y agoI handle this case with auto-correction for all one off errors via <tab>.
- smichel17 6y agobashrc snippet (with extra newlines, for folks on mobile apps like materialistic that don't understand code formatting): # I do this an embarrassing amount alias fgf='fg' alias fgfg='fg' alias gf='fg' alias gfg='fg'
- twright0 6y agoThis resonates... from mine: alias emcas='emacs' alias emac='emacs' alias emasc='emacs' alias enacs='emacs' alias emas='emacs' alias emascs='emacs' alias eamcs='emacs' alias eemacs='emacs'
- Jtsummers 6y agoI have aliased `emacs --daemon` to `emacsd` and `emacsclient -t` to `e` because I use it so much.
- inetsee 6y agoYears ago Interlisp (does anybody here remember Interlisp?) had a function called DWIM (AKA Do What I Mean). It was an (optionally enabled) part of the REPL. If you typed something that made no sense, DWIM would try to figure out what you really meant to type, and offered to run the corrected command. 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?
- abhiyerra 6y agoZsh has this. But it mostly drives me mad.
- bitwize 6y agoQuaxity quuxity, 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.
- reificator 6y agohttps://github.com/nvbn/thefuck https://github.com/nvbn/thefuck
- adamredwoods 6y agoNice! I create two-letter aliases, it truly helps: gc = git checkout gs = git status etc...
- elwell 6y agoHere's mine: 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"
- thinkmassive 6y agoGood collection! I have many of these, plus a slightly longer one for quick fixups that happen all too often: alias gcane="git commit --amend --no-edit"
- jaeckel 6y agoprobably you will like function fixup() { git commit --fixup=$1 } function refixup() { git rebase -i --autosquash --autostash $1^1 }
- tejohnso 6y agoNice, I have those same aliases. 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
- ArtDev 6y agoI have a ton of aliases but I have them all proceeded by an underscore. That way, I don't muck up native commands. alias _up='sudo apt update -y && sudo apt upgrade -y'
- djmetzle 6y ago
- andrethegiant 6y agoYou might be interested in https://github.com/nvbn/thefuck https://github.com/nvbn/thefuck
- ufo 6y agoIn a similar theme, I'm really glad I added ":q" as an alias for "exit" in my shell.
- karatestomp 6y agoI must forget to give grep an filesystem path argument at least 10% of the time I invoke it. What I'm intending to do in all of those cases is recursively grep in the current directory. "Warning: recursive search of stdin" might be my most-seen console error message.
- 0xADEADBEE 6y agoThis used to happen to me constantly. I fixed it accidentally in switching to Ripgrep [0] which defaults to recursively searching the current directory. Bonus: it parallelises too! 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. [0] - https://github.com/BurntSushi/ripgrep https://github.com/BurntSushi/ripgrep [1] - https://github.com/junegunn/fzf https://github.com/junegunn/fzf
- jaeckel 6y agoI'm always puzzled how often the wheel gets re-invented ... https://git-scm.com/docs/git-config#Documentation/git-config.txt-helpautoCorrect https://git-scm.com/docs/git-config#Documentation/git-config...
- vfinn 6y agoheh, I should make an alias for no-break space (code point 160/00A0) + 'grep', because I type it so often when I pipe and get: Command ' grep' not found, but there are 17 similar ones. Maybe I'm not the only one :).