News for hackers. Stuff that matters.
Re:How Did Vim Become So Popular? by stragies on Tuesday June 30, 2020 @07:02PM (#23695801)
Same here, and then i discovered EVIL, the vi layer for emacs. The best of all worlds: Vim text manipulation grammar over the emacs engine.
Re:How Did Vim Become So Popular? by generalk on Tuesday June 30, 2020 @08:06PM (#23696280)
I've used Emacs for many years, and recently switched to Spacemacs, a set of configs that kind of takes over Emacs and puts a great platform on top of it.

I frequently describe Spacemacs as a better vim than vim. Don't get me wrong, I've used vim for ages; I'll never stop editing server config with vi, nor will I stop getting mad when vi is actually vi and not vim.

But for a day to day code editor? Spacemacs is astonishingly good.

(Of course, Spacemacs is built on top of EVIL, as well as dozens of other packages. On the shoulders of giants, as we say.)

Re:How Did Vim Become So Popular? by alpaca128 on Wednesday July 01, 2020 @03:39AM (#23698873)
The problem with Emacs and all its modifications is that it cannot match Vim's flexible system for custom keybindings. And because of that Evil mode has the same limitation, beside its insistence to prefer using builtin Emacs functionality over emulating Vim behaviour correctly.

And the other thing that I could never get used to is that Emacs' terminals can't handle ncurses applications. I usually like to run Vim in a terminal multiplexer and combine it with various terminal utilities when needed, and Emacs doesn't support that - unless you run it in a terminal, but then Evil mode stops working properly...

I'm fine with Vim, but I'm glad I tried Emacs for a while because it does have some nice ideas.

Re:How Did Vim Become So Popular? by jabirali on Wednesday July 01, 2020 @06:00AM (#23699773)
> The problem with Emacs and all its modifications is that it cannot match Vim's flexible system for custom keybindings.

Interesting, my impression was that custom keybindings was more flexible in Emacs + Evil than in Vim. It seemed easier to e.g. define new modes with separate keybindings, and if you use the GUI version, more distinct keybindings are available.

> And the other thing that I could never get used to is that Emacs' terminals can't handle ncurses applications.

It can now. The problem is that there are a lot of shells and terminals available in Emacs, so it's not always obvious which one supports what. But emacs-libvterm [1] is a "real" terminal inside Emacs, and supports ncurses apps well. (The website warns about being alpha level, but I used Emacs + Evil for about half a year, and it worked fine for me.)

[1]: https://github.com/akermu/emacs-libvterm

> I'm fine with Vim, but I'm glad I tried Emacs for a while because it does have some nice ideas.

I ended up with the same conclusion :).

Re:How Did Vim Become So Popular? by slightwinder on Wednesday July 01, 2020 @06:42AM (#23700016)
> The problem with Emacs and all its modifications is that it cannot match Vim's flexible system for custom keybindings. And because of that Evil mode has the same limitation

Can you explain what limitations you mean? What keybindings has vim over emacs?

> And the other thing that I could never get used to is that Emacs' terminals can't handle ncurses applications.

libvterm seems to have solved this problem recently. Works well enough that I can use vim inside emacs.

Re:How Did Vim Become So Popular? by hellofunk on Wednesday July 01, 2020 @05:43AM (#23699676)
I have to agree. Emacs w/ Evil is a nice solution and gets almost there, but there are enough edge cases that interfere with the elegance of pure Vim. Everytime you install a new emacs plugin, you have to consider that it will use Emacs keybindings, not Vim, and you jump through hoops to remedy that, or, more often, you find yourself having to mix the emacs ways and the Vim way, which I personally found annoying after awhile.

Emacs is awesome and more powerful overall, but actually using Vim is easier -- from setting up keybindings, configuring your vimrc file, it's all quite simple compared to what you can do, and often do, in setting up Emacs.

But to be honest they are much closer to each other than either is to a more conventional/modern IDE. They are spiritual siblings for sure.

Re:How Did Vim Become So Popular? by dima55 on Wednesday July 01, 2020 @04:52AM (#23699360)
M-x ansi-term
Re:How Did Vim Become So Popular? by Kaze404 on Wednesday July 01, 2020 @02:18AM (#23698330)
Wait until you find out about Doom, which I consider to be all the good of Spacemacs without the crust.
Re:How Did Vim Become So Popular? by cwxm on Wednesday July 01, 2020 @09:37AM (#23701148)
Have you taken a look at Doom Emacs? I liked Spacemacs, but I found Doom more performant, as well as not abstracting too much, which allows you to slowly learn Emacs as you go.
Re:How Did Vim Become So Popular? by b5n on Tuesday June 30, 2020 @08:34PM (#23696442)
Probably in the minority - I have an extensive custom .emacs.d, but I've kept most of the default emacs bindings. Not only do I find them ergonomic (use the side of your palm for ctrl!), they're also the same bindings you'll find in most terminals. Additionally, emacs does so much more than editing, and having consistent bindings across tasks is really convenient (I'm super lazy :).
Re:How Did Vim Become So Popular? by fivre on Tuesday June 30, 2020 @08:49PM (#23696551)
just

``` set -o vi ```

problem solved! no more emacs pollution!

Re:How Did Vim Become So Popular? by ed25519FUUU on Tuesday June 30, 2020 @07:38PM (#23696104)
Alas, the emacs install base is fraction of vi/vim.
Re:How Did Vim Become So Popular? by the_jeremy on Tuesday June 30, 2020 @07:58PM (#23696226)
I am also surprised by this. What are you basing it on? For arbitrarily comparable online communities, it looks like emacs.stackexchange.com is twice as active as vi.stackexchange.com
Re:How Did Vim Become So Popular? by unoti on Tuesday June 30, 2020 @08:06PM (#23696290)
> ...the emacs install base is fraction of vi/vim.

> What are you basing it on? ... it looks like emacs.stackexchange.com is twice as active as vi.stackexchange.com

A couple of things about this. For myself and many others, the reason I started vi in the first place is it's been installed by default on many kinds of machines. On SCO Unix and AIX from my youth, for example, this was the editor you used on a vanilla install of a machine to get things going. So this is part of why the install base is larger.

Another part of why the emacs community is more active is that Vi is just an editor, while emacs is more of a programming language and I daresay nearly an operating system in its own right. Because of the amazing power and flexibility of emacs there's a lot more stuff to discuss for Emacs than Vi.

Re:How Did Vim Become So Popular? by maxlybbert on Tuesday June 30, 2020 @09:48PM (#23696855)
When I was teaching myself to program, I had a night job in a warehouse. It so happened that the inventory software was on a UNIX server, and we accessed it through a terminal emulator from our windows computer. I discovered one day that I could exit the inventory software and end up with a shell prompt, and that the server had Perl available.

My computer books convinced me that emacs was the better editor, but it wasn’t installed on the server. vi was. So I learned vi and Perl on my lunch breaks.

Re:How Did Vim Become So Popular? by dkns on Wednesday July 01, 2020 @04:41AM (#23699288)
Stack Overflow survey (https://insights.stackoverflow.com/survey/2019#development-e...) has Vim at ~25% while Emacs is at 4.5%.
Re:How Did Vim Become So Popular? by sqrt17 on Wednesday July 01, 2020 @09:53AM (#23701310)
it also has notepad++ at 30.5% - I've seen one or two people who would use notepad++ when nothing else is available, but I don't think many people have it as their primary IDE.

Also, if you sum up all the JetBrains products (which you can get as IntelliJ Ultimate if you shell out the money), you land in the vicinity of 63% (not vim-related but a neat fact)

Re:How Did Vim Become So Popular? by zorked on Wednesday July 01, 2020 @04:01AM (#23699016)
Emacs is more complex, and Emacs users do more in Emacs than just edit text. (think org-mode, debugger frontends, mail readers, etc.)
Re:How Did Vim Become So Popular? by hellofunk on Wednesday July 01, 2020 @05:45AM (#23699682)
Well vi or vim is nearly always installed by default everywhere, but emacs rare is so.
Re:How Did Vim Become So Popular? by rplst8 on Tuesday June 30, 2020 @10:13PM (#23696994)
Vi users RTFM.
Re:How Did Vim Become So Popular? by harrygeez on Tuesday June 30, 2020 @11:33PM (#23697494)
I love emacs, but I taught myself to use vi because I know when I ssh into a remote server there will have a vi.
Re:How Did Vim Become So Popular? by davidw on Wednesday July 01, 2020 @12:55AM (#23697866)
Emacs has an edit-over-ssh mode that's pretty useful.
Re:How Did Vim Become So Popular? by CodeGlitch on Wednesday July 01, 2020 @05:37AM (#23699645)
Yes Tramp mode.
Re:How Did Vim Become So Popular? by dijit on Wednesday July 01, 2020 @05:42AM (#23699673)
You can do that in vim via scp like this:

vim scp://user@myserver[:port]//path/to/file.txt

Re:How Did Vim Become So Popular? by chupasaurus on Wednesday July 01, 2020 @12:18AM (#23697694)
Even if it's a Cisco router and there are no text files other than a note.txt 'Here be dragons'
Re:How Did Vim Become So Popular? by cyberbanjo on Tuesday June 30, 2020 @07:47PM (#23696156)
I've always assumed the opposite with how people say emacs is a nice OS and poor editor... What does Vim over emacs?
Re:How Did Vim Become So Popular? by jrumbut on Tuesday June 30, 2020 @08:02PM (#23696251)
It's not a comment on quality or usefulness, and only indirectly its resource consumption (vi/vim consumes less than emacs in its default configuration), it's really about standards.

vi and the ex editor language are part of the POSIX standard and were around early in the history of BSD. See the history here: https://en.m.wikipedia.org/wiki/Vi

For a well worn joke on the subject, "Ed is the standard!": https://www.gnu.org/fun/jokes/ed-msg.en.html

Re:How Did Vim Become So Popular? by harrygeez on Tuesday June 30, 2020 @11:45PM (#23697549)
I love Emacs and have been using it for years but whenever I want to make a really quick edit, i.e. writing a git commit I almost always reach for vi because by the time Emacs loaded I would've been done committing with vi, at least with a slower machine.

I know some people run Emacs in daemon mode, but it's not always convenient to do that

This and when I ssh into any machine, I know there will be a vi at the very least

Re:How Did Vim Become So Popular? by Kaze404 on Wednesday July 01, 2020 @02:20AM (#23698350)
> This and when I ssh into any machine, I know there will be a vi at the very least

You could use emacs for that. Editing over ssh using TRAMP works perfectly in every case I've used it.

Re:How Did Vim Become So Popular? by sqrt17 on Wednesday July 01, 2020 @10:11AM (#23701496)
1) vim is easier on your hands if you're on a high-latency connection (i.e. usable in a terminal) and/or get tired of chording (i.e. having to press Ctrl along with random keys).

2) I've found vim's plugin systems (Pathogen, Vundle, vim-plug) vastly more intuitive than Emacs' version with package-install and activating one of several repositories (Milk, ELPA, MELPA, whatever) - you install the same plugin regardless of whether you're using Vundle or vim-plug

3) vim and its packages are vastly easier to configure - this is subjective and may be much improved in Doom Emacs/Spacemacs, but in general vim packages have a bunch of global variables that you can set to a number or a string whereas most emacs packages need you to define elisp functions and/or nontrivial data structures, with no sane defaults to fall back on if you want things just to work

Re:How Did Vim Become So Popular? by alwillis on Wednesday July 01, 2020 @04:58AM (#23699394)
It’s composability is Vim’s killer feature.

This post is what got me started on Vim: https://stackoverflow.com/questions/1218390/what-is-your-mos...

Re:How Did Vim Become So Popular? by cat199 on Tuesday June 30, 2020 @08:21PM (#23696382)
this is huge flamewar territory, but this is a bit 'off' question wise - alot of the current state of things is due to historical precedent - some details:

- (original) vi was on most unices from the mid-80s onwards out of the box

- (gnu/lucid) emacs was an additional install (not getting into other emacs flavors - original teco emacs was fairly small i believe).

- original vi just had basic editing and at some point a hardcoded lisp mode, no addons vs gnu emacs which was a programmable editing environment running within a lisp interpreter - remeber in the early days, people built whole custom hardware to be able to run lisp with sufficient complexity (see also: lisp machines, twenex, etc), so using lisp for your editor was in some sense the definition of 'overkill', depending on ones view of what an editor should do

- Also, from late-80s->90s era if you wanted a GUI for your text editor you probably used emacs, and real vi never had a gui option - put another way emacs was the only one of the two linked to gui libraries.

- vim vs vi: most obvious difference (IMHO) feature wise is that vim adds vimscript, which is an interpreted programming language, so now editing modes are extensible, etc (as was the case in emacs before). detail: vim codebase is not based on vi codebase.

since vi was just about everywhere and emacs was a (fairly large) package, you had more general vi knowledge vs emacs 'in the culture' since even an emacs user might need to know vi but not usually the other way around, and so vi (later vim, as linux distros switched their 'default vi' to 'vim') gained more install base by default. Then, people hearing about emacs likely hear the 'vi vs emacs' arguments and never try it since there are now many more choices, they've learned vi, they prefer an IDE, etc (in the old days there was much less choice, main 2 were vi and emacs, and emacs was probably somewhere on your managed LAN somewhere if you wanted to give it a shot)

most of the 'vi vs emacs' arguments are rooted in the real-vi vs fsf-emacs era and are basically obsolete in a modern vim era, since everyone is using gui library vim with vimscript, which basically means the same thing in terms of 'bloat' (both editors contain engines to display text in cli or gui mode and embed a language interpreter). Basically what was once valid internet lore kept getting past down, and the 'minimalism' of vim was confused with being 'minimal' in terms of what people meant in the original vi-vs-emacs discussions. Emacs does contain 'non editor' functions e.g. networking, etc, so the core is probably a bit bigger than the core of vim, but when people are still using these comparisons and talking about 'emacs bloat' while their preferred editor is some electron based thing, we've lost a bit of the point/message..

Re:How Did Vim Become So Popular? by octorian on Tuesday June 30, 2020 @10:09PM (#23696968)
> vim vs vi: most obvious difference (IMHO) feature wise is that vim adds vimscript IMHO, the most obvious difference is that in vim you can kinda just press "i" and pretend its a normal text editor. You know, the kind anyone coming from another OS would already be familiar with. Try doing this in regular vi, and you'll be cursing and pulling your hair out.

Today, I don't put much stock into anyone expressing an opinion in the "vi vs emacs" wars, because 90% of the people claiming a preference for vi seem to actually be vim users. Using vim is a much more pleasant experience than using good old classic vi.