Live data from Hacker News

Vim Anti-Patterns

sanctum.geek.nz

51–60 of 249 posts

Re: Vim Anti-Patterns

#51

I was originally a die hard Emacs user, but I started to feel a bit of strain on the whole holding Ctrl+p, Ctrl+n etc. I was trying to find an editor/plugin that can reduce keystrokes or at least the strain. I ran across EVIL for Emacs which is just a Vim emulation and keybindings for Emacs users. Unfortunately I did not like it at first the entire hjkl felt awkward and all those modes - OMG. But after toying around…

I got some basic muscle memory in Vim, then tried for a long time to learn emacs. Now I've found spacemacs, and couldn't be happier (which uses EVIL mode under the hood). If you haven't tried it, you should check it out.

Unfortunately I'm using windows for my main os, and emacs does not work as smoothly on windows as it does on mac/linux. But now you got a beefy framework with all the bells and whistles from spacemacs, I really like to keep my plugins lean and specific to my needs. also now you need to worry about layers being maintained in spacemacs, which can be a good/bad thing.

I have tried it out loved the ease of it, but not the trade off for hangs and crashes.

Re: Vim Anti-Patterns

#52

I have a programmable keyboard, so I just map escape to be right above tab, where tilde usually is.

I have xmodmap. All keyboards are programmable. I do the control-capslock rebind, as is traditional among Emacs users.

I also typically use a Unicomp Model-M style keyboard, complete with springs. But that's an entirely different flame war.

Re: Vim Anti-Patterns

#53
post #9
post #3

> "If you have to move more than a couple of lines, moving one line at a time by holding down j or k is inefficient." This very point is actually why I moved from Vim to Emacs years ago. After mastering Vim, I realized that Vim strongly encourages you to think a little too much about exactly how to get there or do that thing in the fewest keystrokes, and that it's incompatible with muscle memory. Even years later, I…

As an Emacs user I want to plug ace-jump-mode to move around the viewable part of the buffer more efficiently than many of the commands mentioned in the OP's post. 1. look at character you want to go to 2. M-x ace-jump-mode (I have this bound to F9) 3. Hit key for the character you want to go to 4. All instances of them are rewritten in the buffer with a coloured character. 5. Hit the coloured character you are looki…

I have got to try AceJump one of these days...

Re: Vim Anti-Patterns

#54
post #13

Earlier quoted context omitted.

Honest question: How does Emacs help with this particular problem ? I feel like with every editor, it involves repeatedly hitting J, Ctrl+N or down arrow, which is inefficient. Do you have a way to get to a particular line that does not force you to think too much about how to get there ?

> How does Emacs help with this particular problem? What, inefficiency? Inefficiency wasn't the problem. The problem was having to focus too much of my mind on how to use the editor. Muscle memory is invaluable, and Vim just doesn't let my muscle memory take over if I keep having to think about what's the most "efficient" way to move around or change text. Emacs lets my muscle memory take over easily. I just hit C-n…

Normal vim users aren't thinking about the most efficient way to perform an edit, but rather just go with muscle memory. Said vim users also don't write blog articles on how to be more efficient with vim.

Re: Vim Anti-Patterns

#55
post #33

Earlier quoted context omitted.

> feel a bit of strain on the whole holding Ctrl+p others don't seem to like this, but i've found the following global key swaps effective swap ctrl->alt LCtrl::LAlt RCtrl::RAlt swap capslock->alt Capslock::Alt this enables you to hit "ctrl" with your thumb (next to the spacebar), and capslock becomes the new "alt". so no more reaching for that hard to reach LCtrl key with your pinky.

it's a tad bit weird but all the other command power you get from vim is just really comfortable. But I can see that swap working out in vanilla emacs

sure - it's not a vim or emacs-specific re-mapping tbh, because many programs require liberal usage of ctrl.

Re: Vim Anti-Patterns

#56
> So wean yourself off the arrow keys, by the simple expedient of disabling them entirely...

I thought the opposite was proposed by the community - avoid hjkl and I've felt the same way...

Re: Vim Anti-Patterns

#57
post #54

Earlier quoted context omitted.

> How does Emacs help with this particular problem? What, inefficiency? Inefficiency wasn't the problem. The problem was having to focus too much of my mind on how to use the editor. Muscle memory is invaluable, and Vim just doesn't let my muscle memory take over if I keep having to think about what's the most "efficient" way to move around or change text. Emacs lets my muscle memory take over easily. I just hit C-n…

Normal vim users aren't thinking about the most efficient way to perform an edit, but rather just go with muscle memory. Said vim users also don't write blog articles on how to be more efficient with vim.

Well after 5 years of using Vim, the muscle memory for more efficient operations never kicked in. I was either holding "h" and "l" to move around, or I was consciously thinking of the more efficient combined operations like "f.ce.com^[". And that conscious thinking was very distracting from the actual code I was editing.

Re: Vim Anti-Patterns

#58
post #13

Earlier quoted context omitted.

Honest question: How does Emacs help with this particular problem ? I feel like with every editor, it involves repeatedly hitting J, Ctrl+N or down arrow, which is inefficient. Do you have a way to get to a particular line that does not force you to think too much about how to get there ?

Of course we do: You can jump by searching for line contents with C-s, you can do an operation a certain number of times with M- , and do an operation four times with C-u , which chains, so you can do an operation 16 times with C-u C-u . If you want to jump to a specific line number, you can use M-g M-g , or (because C-u also provides numerical arguments) C-u M-g M-g. Finally, many motion commands set the mark, so yo…

> "But you can also just use C-n, etc. and we won't judge you for it."

This is probably the biggest selling point of the Emacs community. They're not going to try to guilt or shame you into using more efficient or more advanced commands. If C-n works for you, use it!

Re: Vim Anti-Patterns

#59
post #22

Earlier quoted context omitted.

I highly recommend not using the Esc key, remap to jk or caps lock that you can reach without moving your hands. It makes a pretty big difference.

Even easier to use the default Ctrl + [ instead of ESC.

Easier than editing a config file, but not easier than hitting jk or kj. Just take the second to map it.
Post reply on HN