set -o vi

Category: Terminal Configuration

set -o vi

Enable vim keybindings in your shell

Switches bash/zsh to vi editing mode. Press Escape to enter normal mode (navigate with h/j/k/l, delete with d, etc.), press i to return to insert mode. Dramatically faster for editing long commands if you know vim. Add to .bashrc/.zshrc.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.