jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
3.08k stars 107 forks source link

Docs: Comparison to Existing zsh vi-mode Plugins #98

Open djanatyn opened 3 years ago

djanatyn commented 3 years ago

I'm interested in this project as a longtime zsh user. I've noticed a lot of different "vi-mode" plugins over the years, and have used several:

I'm currently using sharat87/zsh-vim-mode, which I picked for its small implementation. I also have b4b4r07/zsh-vimode-visual installed.

This project stands out to me, but I don't have a clear understanding of how it differs from other similar plugins. While the feature section is well documented (thank you!), I'm interested in an explicit comparison between this plugin and others.

Sometimes I see this presented with a feature matrix:

Another great example comparison I refer to sometimes:

As an example of a feature I'd like to see highlighted, it looks like this plugin provides a way to run commands when transitioning between states:

zvm_before_init_commands=()
zvm_after_init_commands=()
zvm_before_select_vi_mode_commands=()
zvm_after_select_vi_mode_commands=()
zvm_before_lazy_keybindings_commands=()
zvm_after_lazy_keybindings_commands=()

That's certainly a compelling reason for me to use it, but I had to read through almost all of the README to know.

Providing this information as quickly as possible helps zsh users who already have a vi-mode plugin installed, so they can make an informed choice about whether to switch.


Separately: thank you for your development and contributions! I'll be installing this morning to give the plugin a try myself.

jeffreytse commented 3 years ago

Hi @djanatyn

First of all, thank you very much for describing the issue carefully.

What I must say is that I haven't compared the other vi-mode plugins you mentioned very seriously. This plugin was born to solve the various problems of zsh's default vi mode. It pursues closer to native vim's behavior, it allows users to have a better user experience, so the object of comparison is the original default vi mode.

I have listed all the main features, but since there are many differences in specific details, I did not mention them. Here I can roughly explain some specific differences:

  1. You can get better cursor behavior, such as the cursor will become an underscore for pending operato (e.g. ciw, ci -> pending 3 seconds -> w)
  2. You can get better surrond behavior, such as surrounds will be highlight when you select surronds (e.g. content is "test" and you put cursor at e and type cs")
  3. You can get better replace mode behavior, such as you have multi-line content and you type R to replace some characters.
  4. You can get better highlight behavior, such as you have multi-line content and you put the cursor at the beginning of second line, then type shift-v to enter visual line mode, check the highlight behavior.
  5. You can get better escape behavior, such as you type ESC to escape insert mode to normal mode, check the speed.
  6. You can get better vi mode status, such as REPALCE, VISUAL, VISUAL LINE and show the current mode perfectly.

vi-mode-indicator

  1. You can get the ctrl-a increment and ctrl-xdecrement feature
  2. ...

In short, this plugin pursues a more native vim experience, you can have a further try on this plugin. Also, you are very welcome to do some contributions on the documentation, such as the comparision with other plugins. : D

Thanks and regards

stutterrrrer commented 2 years ago

Hi, could you let me know how to change the status prompt to the clear colorful look in your screen capture? I didn’t seem to find it in README or after some searching in zsh-vi-mode.zsh

jeffreytse commented 2 years ago

Hi, could you let me know how to change the status prompt to the clear colorful look in your screen capture? I didn’t seem to find it in README or after some searching in zsh-vi-mode.zsh

@stutterrrrer You should check how to change prompt of your theme, the screenshot is a demo from a custom theme. You can refer to here, this plugin provides you some aspects to change your prompt of your theme on vi mode changed.