#16 Hello Zsh! Part 1
Zsh is a great alternative to Bash and other Unix shells. It has programmable completion, paging, and many other great features.
We'll take a good look at paging and the completion that Zsh offers in this episode and explore more in the next episode.
As mentioned in the episode, the Zsh Wiki is an excellent source for Zsh information and help with your .zshrc.
Uploaded on Dec 18, 2009 | 6:10 | Tags: bash Linux OSX zsh
# ~/.zshrc
PS1="[%T][%n@%M][%d]$ "
zmodload zsh/complist
autoload -U compinit && compinit
### If you want zsh's completion to pick up new commands in $path automatically
### comment out the next line and un-comment the following 5 lines
zstyle ':completion:::::' completer _complete _approximate
#_force_rehash() {
# (( CURRENT == 1 )) && rehash
# return 1# Because we didn't really complete anything
#}
#zstyle ':completion:::::' completer _force_rehash _complete _approximate
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:descriptions' format "- %d -"
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes
local _myhosts
if [[ -f $HOME/.ssh/known_hosts ]]; then
_myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
zstyle ':completion:*' hosts $_myhosts
fi
zstyle ':completion:*:kill:*:processes' command "ps x"
If you enjoyed this episode, be sure to check out the newest Technicast on Apache2. All purchases support FOSSCasts.
I simply installed from the package source on Jaunty. It doesn't work on Ubuntu Jaunty as shown in the cast. Do I have to dig hard to make it work? coz I googled, gets a huge list of bugs problems. Any latest news on this coz the functionality is really awesome.
The last line is a killer command. Thank you. Keep them coming! I didn't know how much I've not been using since I switched.
@Millisami Hey - I gave the zshrc a fly on 9.10 and didn't run into any issues. Do you have any other customizations in there that may be causing issues? @Kieran Thanks :)
propecia 657 buy accutane 30451 cheap online aciphex :-P ambien cr aextch






Cool! Provides some of the completions I get in vim (that I miss when I'm in the shell), I'll give it a try! A quick tip I picked up recently - instead of typing "clear" to clear the console, Ctrl-L does the same thing (at least on Ubuntu!). Thanks for the screencast! Dave