Inspired by Daniels Blogpost, I had a look in my alias.zsh
file, that i use to keep all aliases in one place.
alias for all the aliases
alias aliases="cat ~/.dotfiles/zsh/.zsh/aliases.zsh"
Not sure if you have an alias? Can't remember the specific alias you're looking for? Just aliases
and you'll get the list.
git
For my git workflow, i'm relying heavily on aliases to reduce the typing necessary:
alias gc="git commit"
alias gs="git status"
alias gd="git diff"
alias gf="git fetch"
alias gm="git merge"
alias gma="git merge --abort"
alias gr="git rebase"
alias gp="git push"
alias gpf="git push --force-with-lease"
alias gu="git unstage"
alias gg="git graph"
alias gl="git log --pretty --oneline --graph"
alias gA="git add -A"
alias gri="git rebase -i"
alias grc="git rebase --continue"
alias gra="git rebase --abort"
sbt
Currently I'm working with scala and sbt most of the time, and due to that circumstance, I've added several aliases for that.
alias sfmt="sbt scalafmt test:scalafmt sbt:scalafmt"
alias sdt="sbt clean dependencyTree"
alias sdc="sbt clean dependencyCheck"
alias sdu="sbt clean dependencyUpdates"
alias ssg="sbt clean scapegoat"
alias sct="sbt clean test"
weather
Do you know the days, when you barely manage to glimpse the sun? Fear no more - with that alias you're informed about the weather in your <location>
!
alias weather="curl http://wttr.in/<location>"
picture credit to kevin ku
Top comments (8)
I'm not sure, but if you are using ZSH you don't need a special alias for listing all aliases, just type
alias
in the terminal, and you should get the list of all active aliases. Cool list tho :)Here are a few of mine (Manjaro & OSX, zsh):
holy cow. today i learned. thanks! I'm using zsh indeed - and did not know 'bout that.
also quite a nice list you got there - i'm diggin
df
and your spotify-controls!In bash
alias
command works to, but cat will give you more information, if you have good comments in your alias file :DI was writing the same!
I use grep on my bashrc files, this captures the comments inline with the alias too😁
These have saved me a lot of time:
the first time tried I use same as you, but when typing '..?', it will make me need to count how many dot and then it can hurt my eye. So better I switch to something like this:
less typo, easy to remember so it better
I've done something similar as well.
It's a time saver for sure!
Wise man!