Home

Awesome

vi-mode

This plugin increase vi-like zsh functionality.

<p align="center"> <img src="screenshot.png" alt="preview"> </p>

Use ESC or CTRL-[ to enter Normal mode.

History

Mode indicators

Mode are indicated by the right prompt when not defined by theme. You can override the default by changing the corresponding variables:

$INSERT_MODE_INDICATOR
$NORMAL_MODE_INDICATOR
$VISUAL_MODE_INDICATOR

Example:

NORMAL_MODE_INDICATOR="%{$FX[italic]$FG[201]%}NORMAL%{$FX[reset]%}"

Will display NORMAL in italic purple when in vicmd (normal) mode

Vim edition

Movement

Insertion

Delete and Insert

Installation

Zplug

  1. Add this to your zplug section
zplug "nyquase/vi-mode"
zplug "b4b4r07/zsh-vimode-visual", defer:3

My recommended zplug plugins

zplug "nyquase/vi-mode"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-completions"
zplug "zdharma/fast-syntax-highlighting", defer:2
zplug "b4b4r07/zsh-vimode-visual", defer:3

Manual (Git Clone)

  1. Clone this repository somewhere on your machine.
git clone https://github.com/nyquase/vi-mode ~/.zsh/vi-mode
  1. Add the following to your .zshrc:
source ~/.zsh/vi-mode/vi-mode.zsh
  1. Start a new terminal session.

Oh My Zsh

  1. Clone this repository into ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
# If you want better visual mode
git clone https://github.com/b4b4r07/zsh-vimode-visual ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-vimode-visual

git clone https://github.com/nyquase/vi-mode ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/vi-mode
  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside .zshrc):
plugins=(vi-mode zsh-vimode-visual)

This will override the default Oh My Zsh vi-mode if you were using it

  1. Start a new terminal session.