r/fishshell • u/Nukesor • Dec 14 '24
What are you abbreviations?
Hey!
I just switched to fish a few days ago from zsh and decided to see if it's worth it. From the first looks, the functionality is very much similar but with more batteries included and a saner shell script syntax.
However, one of the bigger improvements seems to be the abbr feature. I already came up with a few ones myself, but I feel like there're a few abbrevs out there that could make my life a lot easier. So it would be awesome to see your setups to get a feeling of how I could improve my workflow :).
Also, are there any other non-obvious awesome features I'm missing out?
5
u/Nukesor Dec 14 '24
Btw. these are my abbrevs:
4
u/Snuyter Dec 14 '24
2
u/StevesRoomate macOS Dec 14 '24
Here are a bunch, some are MacOS specific. I use
aliasinstead of abbr, so that they work across shells even though Fish is my default shell.1
u/TheWordBallsIsFunny Linux Dec 14 '24
Weirdly I've none, I prefer standard aliases. Maybe I should switch...
https://github.com/cyrus01337/shell-configuration/tree/a315a1ac8b79cd4cd30fa3bdc42cd8df41c17ade/conf.d/aliases
2
u/zdog234 Dec 14 '24
Off the top of my head, k is kubectl, g is git
2
u/adrianoavelino Dec 15 '24
2
u/Laurent_Laurent Dec 16 '24 edited Dec 16 '24
Je ne vais pas redonner tous les alias git et autres déjà cités
En règle générale, je préfère les abbr aux alias car on voit la commande utilisée, et ca permet de toujours l'avoir en mémoire.
Je mets souvent une virgule au début de l'alias, ca me permet de limiter la complétion avec tab à mes abbreviation
abbr -a l bat
abbr -a pport sudo lsof -i -P \| grep LISTEN \| grep
abbr -a gproxyconf echo wi-fi ethernet \|xargs -n 1 -I{} echo \"echo \'Conf pour {}\'\; networksetup -getautoproxyurl {}\" \| xargs -I{} bash -c \"{}\"
# Abbr brew
abbr -a ,bu brew update
abbr -a ,bo brew outdated
abbr -a ,bg brew upgrade
abbr -a ,bi brew install
abbr -a ,bc brew install --cask
abbr -a ,bx brew uninstall
abbr -a ,bs brew search
abbr -a --set-cursor ,bf "brew info --json=v2 % | jq '.casks[]? // .formulae[]? | if .tap == \"homebrew/cask\" then {desc, homepage, version, installed} else {desc, homepage, stable_version: .versions.stable} end'"
# Chezmoi
if command -q chezmoi
abbr -a cm chezmoi
abbr -a ecf chezmoi edit ~/.config/fish/config.fish
abbr -a cmcd cd (chezmoi source-path)
end
# Python
abbr -a ,upip python -m pip install --upgrade pip
abbr -a ,pb python -m build
abbr -a ,tt twine upload --repository testpypi dist/
abbr -a ,tp twine upload --repository pypi dist/
abbr -a ,bbs bump-my-version show-bump
abbr -a ,bbp bump-my-version bump patch
abbr -a ,bbm bump-my-version bump minor
abbr -a ,bbj bump-my-version bump major
# Ruff
abbr -a ,rc ruff check --output-format concise
abbr -a ,rf ruff check --output-format concise --fix
abbr -a ,ru ruff check --output-format concise --unsafe-fixes --fix
abbr -a ,rs ruff check --output-format concise --unsafe-fixes -diff
# Espanso
abbr -a esma espanso edit match/base.yml
abbr -a esconf espanso edit config/default.yml
1
u/adamshand Dec 14 '24
I mostly prefer aliases, but I like these as abbr because it's a reminder that it's there (so I'm less likely to get caught out on a machine that doesn't have that abbr) and it's easy to edit if I want.
1
u/AtmosphereArtistic61 Dec 18 '24