bash and shell

set -o vi

.zshrc

This re-enables -Support (auto-complete backwards on history) and opening the current command in vi (via v).

bindkey '^R' history-incremental-search-backward
export VISUAL=vim
autoload edit-command-line; zle -N edit-command-line
bindkey -M vicmd v edit-command-line

inputrc

This enables vi-mode in e.g. mysql, postgres or irb.

set editing-mode vi