I would like to share a simple productivity tip that probably helped me save thousands of keystrokes so far.
I’ve been using this technique for a while now to maximize my laziness (productivity) during work and so, recently I wrapped it up in an easy to use Ruby Gem. It simply counts your shell commands and displays them sorted by usage frequency. Using it is as simple as typing:
gem install lazyme
This is how my most used commands look now. Top hits are usually a good candidate for new aliases:
“vi Podfile”=>24, “pod install”=>42, “gst”=>47, “gpstg”=>50,
“gpshh”=>56, “gms”=>57, “zs”=>59, “..”=>63,
“c”=>64, “zrr”=>68, “s”=>76, “gl”=>76,
“cd”=>85, “rss”=>104, “ls”=>129, “gp”=>313,
“gds”=>324, “gaa”=>529, “g”=>1759
With almost all top commands being aliases, I am now sure I work as lazily as possible.
I know that some developers don’t like using aliases because they worry that they might keep forgetting them. To fix this problem, I have a special alias called aliases which displays a list of all my aliases (btw gr is an alias for grep).
aliases | gr aliases
=> alias 'aliases'='cat ~/.dotfiles/settings/shell/aliases.sh'
Some say that if you get used to using aliases too much you might have a problem with working efficiently on remote servers which lack your custom config settings. I solved this problem with a couple of aliases which upload a list of my most essential aliases to remote servers (ubash, uvim and ugit). Just be careful not to overwrite some important settings if you don’t own the server. Whether you want to sacrifice your productivity when working locally, to avoid some possible problems when working on remote server is entirely up to you.
You can set aliases by adding following lines into your .bashrc or .zshrc files:
alias gr='grep — color'
alias gaa='git add . -A'
I, therefore, encourage you to show your fingers some love and treat them to a couple of nice aliases.