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!
|
|
|||||||||
|
closed as not constructive by 8088, Sathya♦ Aug 31 '11 at 4:06
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
Just found this little gem:
This form of For example, if your working directory is
|
|||||
|
|
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
|
|||||
|
|
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 |
|||||
|
|
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.
|
|||||||
|
|
I really like the global aliases so
let me do things like
and get paging. |
|||
|
|
|
Enable auto-complete when using The right prompt for displaying additional info. |
||||
|