11 ms·
For more power try fish's abbreviations. With `--position anywhere` you can expand an abbreviation even if it's not at the beginning of a line.
by tester457 2y ago
For more power try fish's abbreviations.
With `--position anywhere` you can expand an abbreviation even if it's not at the beginning of a line.
- dmd 2y agoAnother great advantage of fish abbreviations is your history shows the actual command that was run (and in fact as soon as you've typed it, it expands, so you SEE what you're running).
- jacobsenscott 2y agoYes, essentially on the fly editable aliases. Fish is so good. I assume there's a zsh plugin that mimics that functionality - zsh people should try it.
- watusername 2y agoThis is the right way. I mentioned in another comment, but abbreviations also shine when screen sharing: Everyone can follow along quickly without having to ask the "what does this gcob command do" questions.
- mattgreenrocks 2y agoI like putting my "aliases" into the functions directory of my config. I have one that uses podman if it's available when I type `docker`. If I ever specifically need Docker I can use the fully-qualified path. I have a similar trick for `nvim`/`vim`.
- sisk 2y agozsh also supports the "alias anywhere" concept (their term is "global alias") by using the `-g` flag. alias -g ag='2>&1 | grep' some-command ag 'words' # equivalent to: some-command 2>&1 | grep 'words'
- alkh 2y agoYeah, it's very convenient. Here are a few of mine(tested on OS X): alias -g L="| less" alias -g T="| tee" alias -g C="| pbcopy" alias -g @all="> /dev/null 2>&1" if command -v rg > /dev/null; then alias -g G="| rg" else alias -g G="| grep" fi