Live data from Hacker News

Emacs and Vim

martinklepsch.org

151–160 of 277 posts

Re: Emacs and Vim

#151
post #40
post #9

Earlier quoted context omitted.

Usually the strong defenders of emacs tell you that you must use c-n c-p c-b c-f to move because those are better and you will adapt in a short time. Then the strongest defenders of emacs tell you that you must use whatever you want because the purpose of emacs is that the editor must adapt to you and not the opposite.

It's the vim defenders who will claim that the home key navigation is a must. Emacs advocates don't much care from what I've seen. Some of them will be roused to suggest that you learn to use searching better.

There's like 70 different commands that can move the cursor in Vim. And that's before you add any plugins or mappings.

Re: Emacs and Vim

#152
post #82
post #55

Earlier quoted context omitted.

What key do you press in Vim more often than any other? Esc! Not on the home row (although I'm sure you'll say you remap it to tab).

Remap to tab? Insanity! I remap it to Caps Lock of course.

Where the Tab key is now is where the Escape key was on the system Bill Joy developed Vi.

Re: Emacs and Vim

#153
post #71

Earlier quoted context omitted.

Then how do you move multiple lines at a time (4, 16, 64, 256)? To move 16 lines down, I press C-u C-u C-n (of course, the control key stays down the whole time). You either have to press C-u C-u then move your forearm to the arrow key and press down, or press the arrow key 16 times. (Each C-u is a power of 4. You can specify any number by typing it after the C-u, for example C-u 100 C-n to move down 100 lines.)

I cannot recall the last time I wanted to move 16 lines - that would imply I stopped to count the lines. What I invariably want to do is "move down one paragraph" (C-down) or "move to that spot I can see on the screen" (1-6 lines, tap up/down; 6-30 lines, hold the down key for about a second until I'm within a line or two, then tap up/down a couple times; >30 lines and use pgup/pgdown to get closer). For anything fur…

> I cannot recall the last time I wanted to move 16 lines - that would imply I stopped to count the lines

I'm sure something like this is possible in Emacs, but in vim I have it set up so that my current line shows the absolute line number and other lines show the relative line number.

If I'm eyeing a particular line that I want to jump to, I just read off its relative line number and hit j or k, according to whether it's down or up from where I'm at -- I'm there. Because I use relative line numbers, the number is never more than two digits.

For more precise navigation (jumping to a particular spot on a particular line), I use a plugin called EasyMotion, which basically lets me jump to any text object on the screen with a few key strokes.

Re: Emacs and Vim

#154
post #89

The last time I tried Emacs+Evil I found that when pressing Ctrl+[ there was a slight delay when moving back into command mode. I was constantly tripping up when typing furiously. This alone was enough to move me back to Vim. Everything else about Emacs was awesome. I would love to go back if I could get over this one problem..

You can fix that by setting this:

(setq evil-esc-delay 0)

Re: Emacs and Vim

#155
post #122
post #17

Emacs+Evil is the next Vim. And yes, CtrlP is probably the thing you'll miss most. But all the other things I got from switching from Vim to Emacs+Evil easily outweigh the missing CtrlP. Vim was great, until I wanted to customize it heavily. It is simply not made to facilitate things like: child processes, SSH, understanding my code, a visual interface for Git.

> understanding my code Both Vim and Emacs have a horrible time trying to syntax highlight Perl, but I find Vim's flaws to be more tolerable. Emacs isn't some sort of panacea.

I have written a good amount of perl in both Vim and Emacs and can't recall noticing bad syntax highlighting in either. Do you have an example?

Re: Emacs and Vim

#156
post #55
post #8

Earlier quoted context omitted.

But that means your fingers have leave home row! :(

What key do you press in Vim more often than any other? Esc! Not on the home row (although I'm sure you'll say you remap it to tab).

Esc? Not quite. C-c mostly. It differs sometimes from Esc, but rarely enough for me not to care.

Re: Emacs and Vim

#157

Vim's home-row commands are great... Unless you use a non-QWERTY keyboard layout. A lot of developers forget that there exist other methods of input, and mnemonic-based shortcuts are one of those things that make a lot more sense than attempting to optimise for a tiny reduction in finger-movement (which ought to be the domain of the input-device anyway).

Vim works with colemak quite well with only a few rotated keybindings to get back home row navigation.

Re: Emacs and Vim

#158
> I completely do not understand how anyone can use Emacs’ default keybindings.

I completely do not understand how switching modes is a good idea in an editor. It just doesn't fit in my brain somehow. I start typing and randomly end up pasting and cutting. I want to paste and cut it randomly types my commands in insert mode.

Emacs cords are pretty intuitive to me. I don't know many: just moving, saving, creating 2 windows, search & replace, cutting and pasting. There are hundreds more, but you can get away with a few basic ones.

Save needing to rebind the Ctrl key to CapsLock, emacs key-bindings are optimized to not have to move the hands to the mouse or arrow keys, which I appreciate. Vim's are as well, but again I don't like modes, so there is that.

Re: Emacs and Vim

#159
post #120

Wanna have fun with emacs? Try to integrate evil mode nicely in different plugins. Especially if you use totally different key bindings in vi (non qwerty layout for example). It was very painful experience for me. Yes, vim is far from ideal, yes neo-vim is looking like to be next iteration in vim evolution, yes no parallel tasks execution is pain. But at the same time there is vimproc. For clojure integration there i…

Not to mention that the Evil Mode editing messes up the Emacs repl. At least for clojure.

Works fine with SLIME; I use evil/emacs/slime for my daily lisp dev.

Re: Emacs and Vim

#160
post #115
post #65

I really wanted to use Org-mode, but my vim muscle memory and lack of knowledge of keybindings to do useful things like copy/paste and move around with more than just arrow keys were preventing me from being productive. Finally got Evil installed and haven't looked back! Evil and Org-mode work great together.

They do work fine together, but unless you remap the Org-mode control key combinations then none of your Org-mode specific stuff will feel very vim-like. I think one good little project would be to remap all the Org functions to vim-like key sequences. The info in this newslist thread is a small start on that: http://thread.gmane.org/gmane.emacs.orgmode/52815

There are a nice set of org-mode bindings for evil-mode in the prelude-evil.el module that helps quite a bit:

https://github.com/bbatsov/prelude/blob/master/modules/prelu...

Post reply on HN