I still leave convenience aliases intact. Nobody needs to be typing --color=auto every time they ls.
Hm. All of my aliases are convenience aliases:
cls=clear # Yes, I started out in DOS
ls=ls --color=auto
ll=ls -l
ll.=ls -al
And that's it. It's amazing how different peoples' workflows become once a tool allows a certain level of customizability.
For example, I don't have `alias gs='git status'`. Just `alias g=git` works great, and git has its own awesome alias system with tab completion that gets me the rest of it. So instead of `gs` I type `g s`, and I get tab completion on all the flags.
alias gs='git status'
compdef _git gs=git-status
FYI: I also mapped g without parameters to `git status -sb` but g with parameters will simply execute everything as normal g () {
if [ $# -eq 0 ]
then
git status -sb
else
git $*
fi
}
compdef g=gitI've never messed with bash completion before, but it was as simple as adding this to my bash_aliases:
complete -o default -o nospace -F _git g git() { if [[ $@ == "status" ]]; then echo "NOT TODAY BUB (hint, use gs)"; else command git "$@"; fi; }
alias gs='git status -'
edit: removed ' | more'alias ch="ch ~/Repositories/my_project/foo"
alias cn="cd ~/Repositories/my_other_project"
(It lacks all of the magic of z -- it doesn't try to learn how you work. It's entirely explicit.)
However, I am wary of "smart" things that change with usage. I like my tools to be consistent and predicable. For example, I am constantly getting burned by alt-tab
That said, I imagine the "frecency" component of z makes it more reliable.
If you turn out not to like it, switch back.
It's a bit of a challenge to wrap something like 'git' with a shell script that spanks you for doing the wrong thing, but that's a good shell learning exercise.
A point scheme is still too diffuse and the feedback still too slow vs. It Didn't Work occurring instantly. You'd be amazed at how quickly you learn new keystrokes this way.
(The interesting logic happens elsewhere, but the above template demonstrates that one can wrap git without too much trouble and without reducing functionality.)
Primarily it is a way to help give my mate some experience programming, but I also hope that it will help kick my morning alarm snoozing habit.
In the future, I thought it would be cool if you could just pass it new config files to allow gamifying everything. For example, if you want to kick your fast-food-for-lunch-habit, then allow the gamify-everything app to award XP and trophies for things such as "Making your own lunch for X straight days"