Hacker News new | ask | show | jobs
by blaenk 3210 days ago
I am genuinely surprised to see this on the front page. The author has done amazing work with Emacs packages, such as general.el [ https://github.com/noctuid/general.el ], his Evil guide [ https://github.com/noctuid/evil-guide], and many others.

I used vim for many years and like everyone else in a similar position, none of the touted "vim emulators" came close at all. They would always only cover a very superficial micro-subset of vim functionality, such as some thin approximation of modes and motions.

Inevitably you would come up against a brick wall by doing something which you would otherwise express in vim without giving it a second thought, due to one's fluency, and it would all come crashing down. Once you reach that point, it's very difficult to just "make do" because it becomes blatantly obvious that what you're using is not vim. In such cases I personally would just revert to the stock editor, because I'd rather use the well made stock editor than a half-hearted attempt at vim emulation that would keep me guessing as to whether or not certain functionality I've come to expect was implemented or not.

I used vim for a long time because I truly felt (and still do) that it was the best "editing language" or "interface," as in, the means by which one communicates their intentions to the editor. However, I always felt like it came short in everything else. Options, their names, and their documentation were terse and cryptic. Vimscript felt inconsistent and left something to be desired for me. Overall I _loved_ vim but I felt most people did so _despite_ many failings. When I would see beautifully crafted Emacs packages such as Magit [ https://magit.vc/ ] and how meticulously they were documented [ https://magit.vc/manual/magit/#Top ], I started to become interested in Emacs. The fact that Emacs has a culture of and encourages everything being self-documented is what pushed me over the edge. Every variable, function, keybind, syntax highlighting face, and _much more_ (truly pretty much everything) is and can be documented. Emacs Lisp may not satiate hardcore lispers, but I've found it to be amazingly powerful. I can interactively expand macros to see what's going on at each step with macrostep. There's a built-in interactive debugger. One can "advise" existing functions to add functionality to them (before, after, around, etc.). I've found that the vast majority of package authors are very receptive and accommodating, and in the absolute worst case where they're intransigent or I recognize that it's an edge case that only applies to me, I can confidently, consistently, and safely modify things myself without having to fork the package. I could go on and on.

Admittedly however, Emacs out of the box left a _lot_ to be desired for me in terms of cosmetics and keybinds. It's important to remember that many of the keybinds for example were devised back in a time before the now-more-conventional keybinds became, well, conventional. I knew not to be deterred by that though. IMO, the way to think of Emacs is as a language or REPL with which each person creates their _own editor_, _if_ they want to. I fully expect that if I were to sit at someone else's Emacs setup, they would have vastly different binds and modifications, and _yet_ I would feel confident knowing that I could count upon some core primitives such as describe-key and so on, again due to Emacs' self-documenting nature.

To call Evil a vim emulator or even a port is to sell it short. It continues to blow my mind how amazing Evil is at _being_ vim. I realize it's blasphemous, but I truly believe that it is a _better vim than vim is_. The ease with which anyone can (and does) define new operators, motions, and text objects is breathtaking coming from vim. Likewise, I worried about losing access to many of the vim packages I used. I quickly found that the self-purported "ports" of the packages (such as evil-surround) were actually _much better_ than their vim equivalents! They could be extended and configured in many more ways than their vim equivalents, and they would _compose_ with many other Emacs constructs out of the box. I continue to be amazed.

Despite how great I believe Emacs is, I wouldn't be using it if it weren't for how amazing Evil is. I have come to depend on both, the vim "editing language" and the Emacs environment, but if it came down to it, I would have to choose vim for its editing language.

But it's 2017 and nowadays we can have both. The war is over.

2 comments

I've used vim, and before that other vim clones, for well over 20 years. I felt the same about emacs' pre-evil vi emulators (like viper). I tried a couple of them, but kept going back to vim until evil came along. With evil, emacs editing is about as close to vim as possible, though it still has its not a perfect vim emulator (it lacks emulation of all of vim's ex commands, for instance, vim's help system, and vim's regexes).

Vim is also just plain better at certain things -- for instance, xptemplate (a plugin for vim) is about a trillion times better than yasnippet (which is embarrassingly primitive by comparison). In my experience, vim is much faster at working with large files. Also, some things that drew me to emacs (such as shell/terminal integration) turned out to be disappointingly ineffective and too convoluted for practical use (for my setup).

That said, I still wound up switching from vim to emacs, and don't regret the decision, because emacs has an elisp ecosystem that's way better than anything I can get in vim, and because all in all emacs can do more things than vim, as it can integrate just about anything (at least in principle). It did take a lot of time and effort to make the switch, though, despite evil. The problem is that for many/most modes, the default keybindings are emacs keybindings, not vim keybindings. So I've had to rebind a ton of keys to make emacs useful (and still have way more keys to rebind if I wanted full functionality). I've heard that Spacemacs makes one need less such rebinding, as it has sane defaults for vim users, but I'm just not ready to make the jump to a wholesale new way of doing things now that I've invested so much time in configuring emacs the way I want (though if I had to start from scratch, I'd give Spacemacs a go).

In the end, I enjoy being fluent with two of the most powerful editors on the planet (though I admit I'd be lost in emacs without evil and all my keybindings). If there's something one editor can't do, or can't do well, I can just use the other. I see a really bright future for both editors, with things like neovim in the vim world and Scheme integration for emacs. Both editors are moving targets and developments in one constantly inspire developments in the other.

The skeleton dsl[0] in emacs is quite nice for snippets, but I've never really used snippets all that much.

[0]: here's my config for generating some useful common-lisp forms: https://github.com/fiddlerwoaroof/dotfiles/blob/master/emacs... and here's where I use it with helm: https://github.com/fiddlerwoaroof/dotfiles/blob/71500d002106...

I have also been a long time vim user, who recently converted to spacemacs(< 1yr). It has good sensible defaults and i can still customize my emacs. I am also using it for email(mu4e) and some todo management(org-mode).

The biggest inconvenience with elisp(imo) is the lack of namespace, especially for an editor. If only it had something like common-lisp packages.