Everything you know from bash still applies, but zsh does a bunch of other useful things. I know that I use only a small subset of them, but these are especially useful for me:
- Extended globbing: For example,
*(.)
a*z(/)
a
z
**
- Inline glob expansion: For example, type
rm *.pdf
*.pdf
rm
- Interactive path expansion: Type
cd /u/l/b
/u*/l*/b*
/usr/local/bin
/usr/libexec/bootlog.d
/usr/l/b
l
o
/usr/local/bin
- Nice prompt configuration options: For example, my prompt is currently displayed as
tov@zyzzx:/..cts/research/alms/talk
The ones not already listed here are :
Advantages that I appreciate:
- Auto-correct on known commands
- Auto-complete : This is different from the default bash autocomplete
e.g
You typekilland press <tab>. Instead of a list of files in current directory, you'll see all your processes with their pids.- Remote auto-completion :
So I can view remote file listings :
Now if I press <tab>, I can view the remote directory listing on the remote server- Expand variables
~/ $PATH <tab>
you get =>
~/ /usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/mri dul/.rvm/bin
- Use Alt-/ (forward slash) to move through argument history
- Shared command history between all running shells.
This is something some people appreciate and some others wouldn't like. But I find it useful for myself.
Advantages that I appreciate:
- Much easier prompt definitions. Particularly dynamic/multine prompts.
- Right Prompt? Yes, thank you!
- Awesome set (more comprehensive than BASH) of Auto Completions are much faster and smarter (e.g. case insensitive completion, smart defaults)
- Path Expansion is pure win. (cd /v/w [tab] == cd /var/www)
- Path Replacement is pretty cool also.
- Spelling Correction (setopt correct) is mighty awesome for me.
- oh-my-zsh - Large, community driven framework for all sorts of bells and whistles.
- The Zsh Line Editor... just google it
- Key Bindings? Yes, thank you!
- Globbing
Comments
Post a Comment