Live data from Hacker News

Vim Anti-Patterns

sanctum.geek.nz

81–90 of 249 posts

Re: Vim Anti-Patterns

#81
post #74

I never got into the habit of using { and }. I just use H M L (high/medium/low) to get approximately in the right part of the screen, then go line-by-line. You can also do 5H or 10L to get "5 lines from the top" or "10 lines from the bottom". I make pretty good use of vim features, but I like to mix some sloppiness with the precision. I don't often count things before typing commands, because that breaks the second-n…

Sounds like you've got something mapped to a key sequence that starts with O. You can look through :map and try and find it -- not sure if there's an easier way.

So this prompted me to Google for it (Googling for one-letter vim commands works better than I thought!), and this looks like the issue:

http://stackoverflow.com/questions/2158516/delay-before-o-op...

Re: Vim Anti-Patterns

#82
post #50

I started off using Emacs a lot (like tons and tons of Emacs with tons and tons of custom modes, functions, and craziness - network pong anybody?). For almost a summer, my xinitrc at the school labs literally opeed up a full screen Emacs; it was my window manager too. The simplicity of vim (and pretty colors) drew me in. Plus as I learned more sed/ed, I understood vi more. That, and a slow connection from off campus…

evil-mode vim keys in emacs.

I don't want vi modality. I find it more annoying than emacs yoga-esque bindings. I want more sane emacs bindings.

Re: Vim Anti-Patterns

#84

I never got into the habit of using { and }. I just use H M L (high/medium/low) to get approximately in the right part of the screen, then go line-by-line. You can also do 5H or 10L to get "5 lines from the top" or "10 lines from the bottom". I make pretty good use of vim features, but I like to mix some sloppiness with the precision. I don't often count things before typing commands, because that breaks the second-n…

I share some of your sentiments. I find that I so frequently want to go the first and last non-whitespace characters in a line that I remapped H to go to first non-whitespace character and L to go to the last. I think of these as "linewise-h" and "linewise-l", which almost fits with vim's other conventions. Then I substitute ctrl-d and ctrl-u to go up or down by half-screens.

I'll also note that although I do also frequently use () and {}, I very much like the plugin sneak, which adds an f-type motion. Usually f{char} goes to the first following instance of {char} on the line. Sneak adds in s{char}{char}, which goes to the first instance of {char}{char} (not restricted to the line), and is ;-repeatable just like f-type motions. What this means is that my default navigation is often, look where I want to go, find two letters, sneak to that combination, and then ;;; until I get to the right one.

On your also: My O doesn't stall at all. Have you tried performing the same action on an empty vimrc? You might start vim with `vim -u NONE`, enter some text, and try out O. Or maybe `:map O` or `:nmap O` will inform you that you have some operator-pending map beginning with O.

Re: Vim Anti-Patterns

#85
Moving to the far left-corner of the keyboard to reach Escape has been a major annoyance for me. On the other hand, the Caps Lock key on my keyboard is almost useless. I never use that key. Is there a way to map Caps Lock to Escape in Vim?

Re: Vim Anti-Patterns

#86

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.

Yeah, it's just nice to have the layout in hardware. And programming your own keyboard can be fun.

Re: Vim Anti-Patterns

#88
post #30

Earlier quoted context omitted.

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

I've somehow gotten in the habit of using ^C for Escape. Guess it feels natural from using it in Bash to restart typing my command or to kill a program.

That's not equivalent...

Re: Vim Anti-Patterns

#89
post #32

So I have used ST3 for years now, and I realise that I'm slowly moving toward Vim. I started using Vim shortcuts in Chrome, and now I use Vintageous in ST3. Vintageous is good, but it is incomplete. It can't even do the first examples on this article (ctrl+f / ctrl+b) correctly. Thinking I should just bite the bullet. Would mean I could work on a server using Mosh + Tmux as well, which should be rather nice. What wou…

For 1: ctrl-n

[ed: a little more context and detail: http://usevim.com/2012/07/06/vim101-completion/ ]

Re: Vim Anti-Patterns

#90

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…

> shift+ctrl+left arrow x 2 + delete

Maybe I haven't understand well exactly what you wanted to delete, but if I have, then you might reconsider your emacs-fu, because there is much easier way to do that: Meta+.

Post reply on HN