What Vim features are missing in Emacs with Viper

2019-03-08 11:18发布

问题:

There are important features of Emacs which are missing in Vim, such as the comint mode, and there are no scripts/plugins which can replace them.

There are also benefits of Vim over Emacs, such as modal editing and generally better default shortcuts. However, Viper mode gets me both. Vimpulse also enables visual mode. Unfortunately, no mode can make Emacs work as fast as Vim.

So I mostly learned Vim-in-Emacs. What Vim features am I missing?

回答1:

I'm a regular vim user but not an emacs user and haven't used vimpulse to confirm this.

But browsing the vimpulse code below I see no mention of text objects.

http://www.emacswiki.org/cgi-bin/wiki/vimpulse.el

Vim introduced some very useful idioms for selection and movement that aren't in regular vi

  • cat 'cut around tag' for xml/html tags
  • diw 'delete in word'
  • di( di" delete text within a "" () etc.

in the vim help see :he text-objects for more.



回答2:

Unfortunately, no mode can make Emacs work as fast as Vim.

If you mean that the emacs startup time is poor, you can cut it down dramatically by having an emacs session permanently open, and use gnuclient/emacsclient whenever you need to edit a file.

http://www.emacswiki.org/emacs/GnuClient



回答3:

One vi feature that I miss in emacs is the . (dot) command that repeats the last edit. There is dot-mode.el which implements C-. to simulate this but it didn't always work for me (I am not proficient in elisp to figure out why).

Even viper doesn't implement this command exactly like vi does (last time I checked), and even if it does, I don't think that is enough for me to start using viper.



回答4:

To get a complete list of what vimpulse may be missing type

:helpgrep not in Vi

Every feature in the help that is not vi compatible will be listed.

Theres about 700 matches.

Of course there will be a lot of duplicated functionality



回答5:

Vi motion everywhere - in Vi you can always navigate using the same shortcuts, whether you are inside a directory listing, a help file, a write only file or something you're allowed to edit.

Correct visual and delete behaviour - very similar to emacs marking but idiomatically different, so difficult for a Vi user to retrain. If you're already used to the emacs marking you're not really missing anything.

Correct escape behaviour - should cancel all other modal activity and return you to command mode. Again, if you're comfortable in emacs you're probably used to having modal inputs and such anyway.

The obvious chestnuts about Vi being deployed on every nix system in the world (Gentoo purists correct me?) - not a very strong argument in my eyes anyway.

Those are the ones that sprang out during my use of emacs+viper.



回答6:

Vim macros don't seem to work with viper/vimpulse:

Vim macros don't work when using viper + vimpulse in Emacs

(Btw, the killer emacs feature that makes me care about vim/vimpulse is that different frames can edit the same file. It's like having a split where the two pieces can be in different windows. If anyone knows how to accomplish that in vim, you'd be my hero.)



回答7:

Incremental search using / and ? is missing.



回答8:

Being a lover of emacs as an OS and vi as an input model, naturally I wanted to love viper. However within two seconds of using it I had to give it up: viper does not support C-[ as a substitute for the escape key–which is an essential shortcut for the most frequently used command in vi.