Live data from Hacker News

Vim Anti-Patterns

sanctum.geek.nz

61–70 of 249 posts

Re: Vim Anti-Patterns

#61

Not trying to start a flame war here, but I in recent few years I am seeing Vim being more popular, and I feel it adoption in terms of younger developers (those who weren't programming when original Vi was around) grows. (Ok, please forget about GUI editors, they have their audience, and I am not comparing any of those facts to them) I used Vim for 3 years, and found philosophy and implementation of modal editing ama…

I tried EVIL mode, and it is amazing, but something just felt wrong using it inside Emacs. I wasn't using either Emacs or Vim

I use emacs with evil, my approach for this is to use vim keybindings for everything related to text editing and emacs keybindings for everything else.(With just some minor exceptions).

Unless you want to go the whole full exotic keyboards route and/or go crazy with remaps, emacs keys are just too painful.

Re: Vim Anti-Patterns

#63
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…

Personally I think some people just go too far with that kind of /efficient movement/ thinking. There's nothing wrong with pressing j or k a few times, and I agree it's a waste of brain energy to think hard about how to get wherever. (I also think hjkl vs arrow keys is overrated, though I've learned to use hjkl)

The only commands I use to move vertically in vim are j, k, /, ?, ctrl-d, ctrl-u. And sometimes I just get the mouse and click.

Re: Vim Anti-Patterns

#64

Not trying to start a flame war here, but I in recent few years I am seeing Vim being more popular, and I feel it adoption in terms of younger developers (those who weren't programming when original Vi was around) grows. (Ok, please forget about GUI editors, they have their audience, and I am not comparing any of those facts to them) I used Vim for 3 years, and found philosophy and implementation of modal editing ama…

I tried EVIL mode, and it is amazing, but something just felt wrong using it inside Emacs. I wasn't using either Emacs or Vim I use emacs with evil, my approach for this is to use vim keybindings for everything related to text editing and emacs keybindings for everything else.(With just some minor exceptions). Unless you want to go the whole full exotic keyboards route and/or go crazy with remaps, emacs keys are just…

actually they aren't. At least for me. I mean, C-p I won't be pressing with one hand, I use both. I have pretty long slim fingers. I am touch typist too, so yeah sometimes my pink is used a little bit more than I would like, but I didn't feel pain or discomfort. Vim is far far better in that term.

Re: Vim Anti-Patterns

#66
post #24

> don’t forget you can yank, delete or change forward or backward to a search result. Did not know this! (although I've been on vim for ~a month) That's a great trick. Much easier than trying to count words.

I agree it is very nice, although you should know one caveat:

deleting/yanking with / and ? will do whole lines, so it may go past the match.

deleting/yanking with t, T, f, and F will go up to just the char you want, but it won't search onto the next line.

I wish there was a way to get a char-by-char multiline search, so I could e.g. cut/yank a whole sentence (something like d/.). But I haven't found it. I wonder if anyone else knows of a way?

Re: Vim Anti-Patterns

#67
post #34

> It’s always useful to jump back to where you were, as well, which is easily enough done with two backticks, or gi to go to the last place you inserted text. I And here I was undoing and redoing the entire time.

Ha, I do the same - you always learn something new in vim.

For me the biggest boost in Vim was configuring the shell (i.e. readline via .inputrc) to use my vim key bindings, so I can use it without arrow keys. Not because of efficiency, but more for wrists comfort.

Furthermore I am in the camp of mapping ESC to 'jj'. My index finger has more power and using the pinky (e.g. via CAPS or ESC) is too exhausting for me.

Re: Vim Anti-Patterns

#69
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…

What prevents you from using vim inefficiently in the same manner?

Re: Vim Anti-Patterns

#70

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 find myself to use the numeric movements rather rarely in vim, instead going for visual mode more naturally. Especially if n > 3. I don't need to count and have a visual confirmation on the active region.

And in emacs, working with the selection does similar things for me (esp. once you add some functions/modules like expand-selection to it).

For movement, it's mostly search forwards/backwards, in both vim and emacs. Raskin was definitely along the right track with his leap keys (and someday I'm going to remap some dedicated keys to C-s/C-r/\//?).

Post reply on HN