Hacker News new | ask | show | jobs
by klibertp 4569 days ago
Well, I switched to Emacs from Vim exactly because of ELisp. Or rather because of Vimscript: I thought that Lisp or whatever, even Forth would be better than Vimscript :)

After 3 or so years of using Vim heavily I started hit the limit of what can be done with defaults, simple options adjustions and even plugins. I honestly tried to use Vimscript, but I couldn't bring myself to do this for real. I knew some Scheme then, so I wasn't afraid of Lisps. I switched and I immediately started implementing things I wished I had implemented months earlier in Vim. My Vim config was ~700 loc and it had only a few custom commands defined in it after 3 years. As I mentioned in another comment my emacs config is ~4k loc now and defines a multitude of advices, hooks and plain commands after half a year. It grows almost every day and what's most important is that coding to Emacs APIs in ELisp gives me much more pleasure than coding in Vimscript.

Lastly, modality - somehow I'm not missing it. It's not that I've seen the light and now think that modal editors are an abomination, but I came to appreciate modeless-by-default model of editing. Emacs ofers many ways to enter modal mode, so when I felt that modal interface would be better for something I just coded it so it's modal.

In short - if you're a happy Vim user who doesn't feel the need to write your own Vimscript (or you're happy with Vimscript!) then I see no reason to switch (maybe org-mode or something, but that's a very specific case). But if you thought at some point that you'd like to code up something in your editor but didn't because it was too much of a PITA then give Emacs a try.

3 comments

Have you tried the evil mode or whatever vim emulator suits your fancy?

Is your config out there in the wild?

> Have you tried the evil mode

I did. It's nice - it actually emulates Vim instead of Vi, which makes a huge difference. With proper plugins you get even things like surround and increment/decrement number at point. I stopped using it temporarily because it didn't work well on my Windows machine and when I moved to *nix-only Emacs I forgot to enable it back. It's great for reducing the shock of switching though :)

> Is your config out there in the wild?

It somewhat is, although it's not the greatest thing in terms of organization or portability. I'm telling myself that I will move to el-get and stop having all the plugins in this repository and so on, but I didn't do this yet. My own code is here: https://github.com/piotrklibert/dotemacs_reloaded/tree/maste...

> I stopped using it temporarily because it didn't work well on my Windows machine

Just to set the record, I use evil-mode on Windows and haven't had any problems. I also use it on Mac/Linux and haven't noticed inconsistencies.

Well. I'd never taken a close look at Vimscript before. Ye gods.

But didn't I hear something about Python being usable as a Vim extension language? I'm not terribly fond of Python for aesthetic reasons, but it's at least as powerful as any of the modern scripting languages, and it has features (like docstrings and list comprehensions) which I'd really like to see more widely adopted. Have I misunderstood the state of things? Can a Vim user not actually say "F this Vimscript nonsense, I'm switchin' to Python!" and get as much power over the editor as Vimscript would've offered?

Ruby is also usable, as are a few other languages. Unfortunately you need to compile Vim with support for a given language if I recall correctly. VimScript is the only extension language available to all versions of Vim, so that's a consideration if you intend to share your creations.

That said, it's possible that a large percentage of people use a Vim binary with Python/Ruby/etc. support. I have no idea what the usage statistics are.

The impression I had was that Python had become a de facto standard Vim extension language, but evidently that's very much not the case. Definitely a drawback; it's nice in the short term, perhaps, to be able to choose your favorite among various scripting languages, and use that to extend your editor, but in the long term it seems likely to result in a lot of fragmentation.
I'm curious if there is an efficient way to transition from VIm to Emacs. I've wanted to for a while now but dread the lost productivity from making the transition.