Skip to content

Instantly share code, notes, and snippets.

@xPMo
Last active May 18, 2020 16:09
Show Gist options
  • Save xPMo/292a4eadbdc34f61d4c9647cb4c82861 to your computer and use it in GitHub Desktop.
Save xPMo/292a4eadbdc34f61d4c9647cb4c82861 to your computer and use it in GitHub Desktop.
Comparison of Vi-mode plugins for Zsh
Functionality Nyquase/vi-mode laurenkt/zsh-vimto ohmyzsh/ohmyzsh sinetoami/vi-mode softmoth/zsh-vim-mode personal
vicmd: prefix search j k
vicmd: edit-command-line ^V v v ^V, ^X^E :e
substring-search ^k ^j ^p ^n
viins: up-/down-history ^P ^N ^P ^N ^P ^N ^P ^N ^P ^N
viins: bind emacs keys ^? ^a ^e ^h ^r ^U ^w ^? ^h ^r ^? ^a ^e ^h ^r ^w ^? ^a ^e ^h ^r ^w ^? ^a ^b ^e ^f ^k ^r ^s ^u ^w ^X^X ^y ^_ ^[u ^[l ^[g ^Q ^? ^a ^e ^h ^r ^w
cursor style: change on keymap-select, line-init, line-finish keymap-select, line-init precmd, line-pre-redraw, line-init, line-finish, isearch-update, isearch-exit keymap-select, line-init
cursor style: block/bar block/bar block/bar/underbar, blink, color block/bar/underbar
cursor style: tmux support
Mode indicator in prompt: RPROMPT unless non-empty only in command mode RPROMPT unless non-empty RPROMPT unless set
Mode indicator support: vicmd, viins, visual vicmd, viins vicmd, viins vicmd, replace, search, visual, visual-line, viins

Personal notes:

  • Some of the bindings are ^A instead of ^a, etc. I think ^$key bindings are case-insensitive, but I can't find documentation for this. I think it's a TTY thing, not a Zsh or Bash thing.
  • I use : mapped to execute-named-cmd. It is super intuitive to vi/vim, I am surprised other plugins don't do this. Then I can use :e as edit-command-line by aliasing the widget to e. I also have zle -A s replace-string for the same reason. Unfortunately, execute-named-cmd is horrible, I may write a new minibuffer-based function to replace it.
  • softmoth/zsh-vim-mode also enables some text objects and surround, which I do in zsh-vi-more/vi-motions.
  • softmoth/zsh-vim-mode has a lot more bindings exclusive to it which I haven't listed here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment