Articles in the zsh category

Change directories faster with zsh

Something I didn't know until recently:

zsh does not require cd to change directories.

Using the directory as a command implies "cd". For example, instead of doing:

me@server:/home/me $ cd /tmp
me@server:/tmp $

You can just do:

me@server:/home/me $ /tmp
me@server:/tmp $

That ...

zsh history expansion

Exploring zsh features made me want to figure out some of the history-editing wizardry. (Bash has similar history tricks, I just never bothered to dive too deeply into them.)

If you want to experiment with history expansion a bit, you can echo the result instead of executing it:

hostname:~/dir ...

Set Your zsh Prompt

Since the beginning of time, all the cool kids have had really cool shell prompts. It's a great place to display helpful information, and zsh has features that let you have a flexible, informative, unobtrusive prompt.

Set your prompt by setting $PROMPT. If you do PROMPT='foo ', the shell ...

Make the zsh zle handle "words" correctly

Snippet from my .zshrc:

# This controls what the line editor considers a word. By default it
# includes '/', which makes it so that when I M-del (attempting to erase
# a directory in a path), I erase the whole path. Annoying.
# WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # (default)
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'`

After living with this for a ...

Moving to zsh

To get started:

  1. sudo aptitude install zsh
  2. chsh /bin/zsh

That's pretty simple.

Of course, you're not running zsh yet... either logout and log back in or just run zsh at the prompt. You'll get a series of prompts to configure a .zshrc. It only takes a ...

Page 1 / 1