I do a lot of work in the terminal so I have learned a lot about my shell of choice, zsh. What features of zsh do you use to make yourself that much more productive at work? One of my favorites is the multi-dir autocomplete. So instead of typing cd /fo{tab}/ba{tab}/ba{tab} I can just do cd /fo/ba/ba{tab} and save that many keystrokes!
|
| |||||||||
feedback
|
closed as not constructive by Gareth, Sathya♦ Aug 31 '11 at 4:06
This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion. See the FAQ for guidance on how to improve it.
|
Just found this little gem:
This form of For example, if your working directory is
| |||||
feedback
|
|
zsh's ability to autocomplete things besides files and directories. For example, with the git package installed, git-sh{tab} brings up: - git command - shortlog -- summarizes git log output show-branch -- shows branches and their commits show-index -- displays contents of a pack idx file | |||||
feedback
|
|
I'll keep to things that, as far as I know, bash can't do.
function - {
if [[ $# -eq 0 ]]; then
cd "$OLDPWD"
else
builtin - "$@"
fi
}
alias zcp='noglob zmv -C' alias zln='noglob zmv -L' alias zmv='noglob zmv'
term_title_base='@%l: %1~'
preexec () {
print -nr $'\e]2;'"${(%)term_title_base} $*"'$\a'
}
precmd () {
print -nr $'\e]2;'"${(%)term_title_base} ($?)"'$\a'
}
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
bg
zle redisplay
else
zle push-input
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
| |||
feedback
|
|
I really like the global aliases so
let me do things like
and get paging. | |||
|
feedback
|
|
Enable auto-complete when using The right prompt for displaying additional info. | ||||
feedback
|
|
As mentioned by others, zsh's autocomplete is excellent. You can setup your own autocomplete for custom commands without too much hassle as well. To tab complete usernames as arguments to finger:
Other options I like to have set:
Pushd and popd are also pretty handy.
Annoyingly the home and end keys don't by default work on zsh like they do on other shells, but you can fix this.
| |||||||
feedback
|
