reddit / emacs

Viper mode

AsterOps · 2022-04-30 15:32
Since I switched to 29.0.50 `emacs-version` I decided to give a chance to another built-it Emacs packages. As a long time Vi(m) user I gave a chance to `viper-mode`. I used a lot `evil` before and it's great, but unexpectedly viper mode does a good job also. Personally I am not a vim hacker, I just frequently use `dd`, `yyp`, `o` and `O` in command mode and all of this work very smooth. Also in "console" modes (eshell, vterm, shell and ansi-term) I didn't encounter major issue. One thing that I added is `viper-want-ctl-h-help` variable to not-nil because help keybindings (C-h) doesn't work by default which I use often. My current configuration: `~/.emacs.d/viper`: ``` (setq viper-inhibit-startup-message 't) (setq viper-expert-level '5) (setq viper-want-ctl-h-help 't) ``` and in `init.el`: ``` (setq viper-mode t) (require 'viper) ``` I encourage you to try :) link to [manual](https://www.gnu.org/software/emacs/manual/html_mono/viper.html)
LowCom · 2022-04-30 16:57
Viper emulates Vi and not vim. This makes many vim keys not work or work inconsistently.
martinslot · 2022-04-30 18:24
How is this compared to evil mode?
AsterOps · 2022-04-30 21:13
viper (or maybe vi) does not have VISUAL MODE which works together with emacs marking so if I type `y` and then `$` I don't see marked text. But `C-SPC` works so I can use emacs functions in viper mode as well.
oantolin · 2022-04-30 21:40
Right, but for people who are skeptical of Vim and want a nice classical vi this is welcome. :)
oantolin · 2022-04-30 21:41
Viper does have r to refer to the Emacs region, instead of the visual modes.
_noctuid · 2022-05-01 10:31
Is skeptical the right word? I can understand if you can't be bothered to learn more and just want something lightweight or builtin why you would use viper, but how many people are skeptical of vi improved but not vi? Vi has very limited editing capabilities by comparison. It's kind of like someone saying they use use microemacs over Emacs, not because they they don't need the extra functionality and want something small, but because they are skeptical Emacs adds any improvement. Not going to say it's an invalid opinion, but it would be a little bizarre for me to see someone say that. > a classical vi I wonder how many people have actually used a classical vi as opposed to just having vim-tiny or something similar. Not as relevant but also interesting to ask is how many people have actually used *the* vi as opposed to ex-vi, nvi, elvis, etc. Also not completely relevant but potentially interesting given the topic of vi: > An old Unix master came to Master Wq. “I am troubled, Wq. You teach the way of Vim. vi is holy but Vim is not; its code sprawls, its features crowd memory; its binaries are vast, its behavior inconsistent. This is not the way of Unix. I fear you mislead your students. What can be done?” > Master Wq nodded. “You are right,” he said. “Vim is broken. Let us fix it. Shall we begin?” > The old Unix master agreed, and opened a shell. He typed: > $ vi vim.c > He began to code. Master Wq watched for a while and then asked him, “Which implementation of vi are you using? Nvi? Vim? Elvis?” > “I don’t know,” said the Unix master. “It doesn’t matter.” > Master Wq nodded. The Unix master sat stunned for a moment and closed his document unsaved. The one case where it does matter is for someone who has only used vim as vi and mistaken vim functionality as vi functionality.
oantolin · 2022-05-01 14:47
I was just kidding, I assume the vast majority of people who like either vi or vim prefer vim. But maybe some tiny percentage of people are skeptical of vim's "bloat" and prefer vi for that reason. Of course, there's the problem of what editor is actually available for those hypothetical people. I understand `nvi` is probably the best widely-available choice for them (if they even exist).
_noctuid · 2022-05-01 15:32
Ah, seeing you favorably mention viper-ex the other day, I thought you might be serious. There is something to be said about it being comparably simple and builtin. Being skeptical of vim as a vi user definitely was a thing in the past, but now that skepticism has mostly shifted towards neovim or vim with (too many) plugins. A lot of vim community has a very different ideas from us about what is "bloat." If there are skeptics for reasons other than bloat, then viper definitely would be the way to go. Imagine a distro where vi is Emacs with viper.
oantolin · 2022-05-01 17:22
Ooh, I found someone looking to switch from vim or neovim to a smaller vi [over on the vim subbedit](https://www.reddit.com/r/vim/comments/uevybd/anyone_using_the_original_vi/). They do exist!
redguardtoo · 2022-05-02 00:30
EVIL has its ecosystem. It has more plugins and APIs. For example, you can use its API to define you own text object.
deaddyfreddy · 2022-05-02 22:39
I've been removing all `vim` flavours from my PC since 2010 or something, treating `vim` as a nonsense. Now I just don't care, since I don't run `vi` anymore.