Home » Questions » Computers [ Ask a new question ]

How can I fix typing a command name twice in zsh?

How can I fix typing a command name twice in zsh?

So I have this (bad) habit of typing git, pausing for a sec to glance at the output of the git status command I just typed, then typing git add ... afterwards, resulting in the rather unsuccessful git git add ....

Asked by: Guest | Views: 318
Total answers/comments: 1
Guest [Entry]

"I can't edit comments, so here is a working version for all bourne shells:

git(){ if [ ""$1"" = git ]; then shift; fi; command git ""$@""; }"