2.4 KiB
created | layout | layout_old | redirect_to | tags | title | toc | updated | |||
---|---|---|---|---|---|---|---|---|---|---|
2009-02-21 12:34:27 +0100 | redirect | default | https://blog.mbirth.de/archives/2009/02/21/zsh.html |
|
zsh | false | 2009-07-17 23:13:24 +0200 |
I recently switched to using the zsh instead of bash. The reasons were those comfort functions of zsh, such as:
- menu driven completion (you can navigate items using the cursor keys)
- command correction (typing
mkae
gives aDid you mean 'make'?
) - parameter completion (shows possible parameters for most commands incl. a short description)
- path name guessing (typing
tail /v/l/dmesg
gets corrected intotail /var/log/dmesg
)
So I installed the packages: zsh, zsh-doc and zsh-lovers. When starting it for the first time, you'll encounter a configuration tool which asks several questions to make your zsh experience a good one.
Bad thing is: This tool can't read the settings you made in a previous session, so be careful running it a second time.
I found an easy way to make the prompt show only 2 parts of the PWD using some zsh-magic: [Prompt with 2 directories]({% post_url 2009-02-20-prompt-with-2-dirs %}).
My full configuration file is here: [.zshrc]({{ site.url }}/assets/zshrc.txt).
DEL-key not working
Using the Del-key changed the 3 letters after the cursor to upper case and then made further editing of the
current line impossible. I found a solution to this problem over at gnegg.ch:
Just add the following bindings to the .zshrc
:
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
Problems with mc
zsh seems to cause problems with the Midnight Commander. The mc can't detect the PWD using zsh as a sub-shell
and therefore gives several "Warning: Cannot change directory to …
" although the path did change. But this
message moves the rest of the screen and makes mc almost unusable. You can use mc without a subshell by starting it
with mc -u
or just switch your login-shell back to bash (in your /etc/passwd
) and change the link of your
preferred console application to e.g. gnome-terminal -e zsh
- in the latter case, mc will use your login-shell
(bash) as a sub-shell and work as expected.