Some zsh notes

Last edited
Just some random notes on zsh

zsh Vi-mode

The line-editor of zsh can be put in two different modes:

  • Emacs-mode
  • Vi-mode

The default mode is Emacs-mode. However, as Vim-enthusiasts we choose for Vi-mode :) This mode has its quirks.

Like in vi, there different modes. Vi-mode in zsh knows two modes: insert mode and command mode. Hit Esc to enter the command mode.

history incremental search backward in vi-mode

Yes, it is possible to do a backward incremental search in the command history in vi-mode!

  • Press Esc
  • Press / (slash)
  • Type a part of the line your want to find in the history
  • Press Enter
  • The first found matching line is now shown
  • Press n (not N) to search backwards, repeat until the desired line is found

Editing the command line

Enter the command mode, and the normal movement keys work. b for beginning of word, e for end of word, x to delete character under cursor, 0 for begin of line, $ for end of line, etc.

The keys i and A help to go into insert mode at the appropriate place.