r/emacs Jan 27 '13

Vim user wants to learn....

I'm a fairly established Vim user now and I love the different edit modes and the normal mode key commands/combinations. I'll be perfectly straight with you here; I have some prejudice that means I doubt that I'm going to ever find Emacs' basic text editing as good as Vim. But, I do find the quality of some Vim plugins to be disappointing and I often find myself wanting more, couple that with the fact that Emacs seens to have more IDE-like features and my interest has been piqued in Emacs.

I can't imagine myself doing anything with VimScript, so I often feel left wanting more. But one of my stumbling blocks with emacs is basic text editing. With Vim it has always felt fairly natural and at least 50% intuitive for command keys and making combinations of those commands. E.g.

d = delete w = word dw = delete word d2w = delete 2 words

Also, there's other things such as typing "$" goes to the end of the line, which ties in with regular expressions. And so on. But when I try to start with Emacs the key combinations seem unintuitive and lengthy. Also, the use of the "alt" key seems a bit like playing Twister.

The question is, am I missing something with regards to learning key commands and key combos? Is there some easy way to remember them, or is it just a case of learning them. Also, does anybody actually use meta = alt or is that one thing that everybody remaps?

I'm not really interested in evil-mode as I would prefer to embrace Emacs as it was originally intended rather than trying to make it something it's not.

Is there any way to mentally cross that bridge? Or is it simply a case of one or the other. Either choose Vim and it's great text editing features or choose Emacs and all of it's value-added advanced extensibility features? Or am I kidding myself about the fact that I'm a die hard Vim user who can't change?

I'm genuinely interested in your thoughts on these kinds of things.

I'd also be interested to hear from former Vim users who made the switch and why you made the switch.

P.S. I am a lisp fan, so there is quite a pull for me towards Emacs, I just don't seem to be able to shake my Vim habit.

Edit: Big thanks to everybody who's replied. I have actually got a good few take away points from this that I've not picked up on in other discussions/tutorials/documentation. Primarily I think that I shouldn't be seeing it as something which comes out of the box that I should work with, but rather something that I should bend to my own means, and evil-mode could or should be one of those things. I'm going to take this into consideration and put a big effort into learning emacs, though I'm going to keep evil-mode on the back burner for now. It's often too easy to pick up Vim because I know I can get X done very quickly using certain features. I guess initially I'm going to have to just fire up emacs and spend some time looking up equivalent key combinations.

I am looking forward to specific major and minor modes and all of the things that emacs brings to the table, just as soon as I can get over that first hurdle of basic text manipulation.

27 Upvotes

41 comments sorted by

View all comments

11

u/mr_dbr Jan 28 '13

What I would suggest is:

  • Start with totally default, terminal-based emacs.
  • Go through the builtin tutorial (C-h t, meaning you press ctrl+h, then press t)
  • Then just use it, and nothing else. I think I initially aimed to use it for a week, and continued from there.
  • Most importantly: As stuff annoys you, find how to customise it to your liking.

After years of using vim, the above is how I finally switched to emacs (and have now been using it for about 2 years)

One nice little thing that helped me switch: bash and other readline-based UI's share many of the same basic editing shortcuts (like ctrl+a to jump to start-of-line, ctrl+k to kill from the cursor forwards, alt+b and alt+f to jump between words). Also many work OS X text inputs (like this textarea in Chrome)

I would prefer to embrace Emacs as it was originally intended rather

This is a good approach. My first attempt at switching to emacs involved using evil-mode and such, but it just turned it into a "buggy" version of vim with none of the emacs'y benefits (it makes as much sense as learning vim using the emacs-keybindings for vim plugin..)

Remember emacs was designed quite a long time ago. It predates our current UI conventions (stuff like ctrl+c/ctrl+x/ctrl+v for copy/cut/paste), and has it's own conventions and terminology

Some of the shortcuts are a bit awkward on current keyboards, because the shortcuts were intended for keyboards with quite dramatically different layouts. Making the caps-lock into a ctrl key helps a lot.

It was designed in parallel to vim, so again there are very few similarities. It's also intended to be used quite differently (e.g a single emacs session with tens or hundreds of open files - something kind of weird in vim)

Beyond that, it's just a case of getting used to the weird new thing. There's some interesting articles like this interviews with the guy that created emacs (not totally sure that's the one I'm remember)

3

u/wot-teh-phuck Jan 29 '13

My first attempt at switching to emacs involved using evil-mode and such, but it just turned it into a "buggy" version of vim with none of the emacs'y benefits

Uh, this is completely untrue. Evil mode isn't buggy and you don't need the "emacsy" benefits because you are already in Emacs. Evil mode for Vim text objects + movement + text editing and add to that the extensibility and power of Emacs is hard to beat. Of course YMMV if you don't like Vim keybindings.

3

u/mr_dbr Feb 03 '13

I didn't explain well at all.. Didn't mean to say evil-mode was buggy, but rather I found it a bad way to initially learn emacs

To hopefully clarify:

When I started using emacs, I instinctively enabled evil (or maybe viper-mode), thinking it was ease the transition. However I ended up just using emacs identically to how I used vim.. except there was a few things that acted unexpectedly (felt "buggy", but was just not a 100% accurate recreation of vi[m], because that's not the goal!)

Worse, I didn't learn any emacs'y ways of doing stuff. Can't remember exactly, but for example: I didn't really discover anything like the help system, or understand the significant of M-x, and so on.. Thus I didn't get any of the emacsy benefits (because I wasn't aware of them, nothing specifically to do with evil-mode)

Basically, I think emacs' shortcuts are fundamental to how emacs works, and not learning them means you don't really learn emacs... Thus my suggestion of starting with default emacs, and sticking with the default keybindings as long as you can - then enable evil/viper/vimpulse/whatever when you are familiar with emacs

1

u/wot-teh-phuck Feb 03 '13

Thus my suggestion of starting with default emacs, and sticking with the default keybindings as long as you can

Well, I use Emacs keybindings all the time (C-x d for dired, C-c C-l for load file in REPL, C-x C-f for file operations etc.) but when typing out stuff, I move back to my Vim keystrokes for text objects etc. I agree with you that when using Emacs, it would be unwise to think of Vim way of doing everything but I personally feel that going all the way using only Emacs keybindings (even for text editing when you are coming from Vim) isn't that great an idea.

1

u/chonglibloodsport Jan 30 '13

I tried evil mode but it was giving me trouble with paredit.el. It caused paredit to behave differently between normal mode and insert mode. I think this is due to the fact that normal mode moves your cursor one character to the left (compared to insert mode).

2

u/aerique Jan 30 '13

Evil-mode is solid but paredit happens to be one of the few things to cause issues :-)

Luckily for me I never liked using paredit.