Live data from Hacker News

Vim - Putting arrows to use

codingfearlessly.com

31–40 of 42 posts

Re: Vim - Putting arrows to use

#31

I don't remember where I found it but the best remapping I ever did was to map the sequence 'kj' to esc. kj is rarely used in a word, and when it is it isn't a big deal. inoremap kj

That's useful indeed - I have both kj and jk mapped to Esc in my vimrc. https://github.com/mmozuras/vimfiles/blob/master/vimrc#L75

Interesting, I always did jj, but kj or jk feels speedier. Thanks for the tip!

Re: Vim - Putting arrows to use

#32
I'm a rather advanced Vim user (10 years, vimrc with custom vimscript, use many shortcuts for movement), but I find it unproductive to NOT use arrows in insert mode. Example: inserting 'x' two characters before current position.

With arrows: x

Without arrows: hixlli

It also much depends on a keyboard design, the laptop-like often have arrows under ENTER and using them doesn't require hand movement.

Re: Vim - Putting arrows to use

#33
post #18

I believe many VIM users overestimate the importance of using h,j,k,l in comparison to numeric modifiers. Holding down j to scroll down the page is no more "right" than holding down the down arrow, in my opinion. The following made me considerably faster: * Relative Line numbering (For Vim 7.3). G/gg stop being convenient for frequent line movement once your file goes beyond 100 lines. Doing math in your head to figu…

I have been playing with the relative numbering all afternoon. I love having all my lines indexed, but it's hard to hit any number above 5 or 6 with my right hand because it's about to hit j or k. I wish it could be indexed with a combination of numbers between 1 and 5 only, but I guess that would mess with the j and k functionality.

Any ideas?

Also note: I am not a touch typist.

Re: Vim - Putting arrows to use

#34
post #33
post #18

I believe many VIM users overestimate the importance of using h,j,k,l in comparison to numeric modifiers. Holding down j to scroll down the page is no more "right" than holding down the down arrow, in my opinion. The following made me considerably faster: * Relative Line numbering (For Vim 7.3). G/gg stop being convenient for frequent line movement once your file goes beyond 100 lines. Doing math in your head to figu…

I have been playing with the relative numbering all afternoon. I love having all my lines indexed, but it's hard to hit any number above 5 or 6 with my right hand because it's about to hit j or k. I wish it could be indexed with a combination of numbers between 1 and 5 only, but I guess that would mess with the j and k functionality. Any ideas? Also note: I am not a touch typist.

I don't use anything beyond 5(with the exception of 0 because that's fairly easy for me to hit). 6 and 7 are the hardest to hit. 17k for me just becomes 15kkk, for example. If you ever find yourself needing to go 50+ up or down, you should be using one of H, L, or M to take out a good chunk of that.

Re: Vim - Putting arrows to use

#35
post #34
post #33

Earlier quoted context omitted.

I have been playing with the relative numbering all afternoon. I love having all my lines indexed, but it's hard to hit any number above 5 or 6 with my right hand because it's about to hit j or k. I wish it could be indexed with a combination of numbers between 1 and 5 only, but I guess that would mess with the j and k functionality. Any ideas? Also note: I am not a touch typist.

I don't use anything beyond 5(with the exception of 0 because that's fairly easy for me to hit). 6 and 7 are the hardest to hit. 17k for me just becomes 15kkk, for example. If you ever find yourself needing to go 50+ up or down, you should be using one of H, L, or M to take out a good chunk of that.

Yeah that's what I was thinking. Thanks!

Re: Vim - Putting arrows to use

#36
A very small corner case here, but on certain keyboard layouts, hjkl is actually harder to use than the arrow keys. To be more specific, I use an alphagrip keyboard most of the time where left,right,up,down are all under the left thumb and a trackball is under the right thumb. The way I interact with vim is thus very different from most folks, I imagine.

Re: Vim - Putting arrows to use

#37
post #23

Earlier quoted context omitted.

Even better, just learn to use EasyMotion, it's one of the most efficient ways of navigating around a file: https://github.com/Lokaltog/vim-easymotion

I've tried it and didn't like it at all. The main problem is how it replaces the letter I'm searching with another unrelated one, making all the matches practically unreadable. To me, at least. set incsearch and /foo ?bar are more than enough for my needs.

EasyMotion is really only good for getting to something you are staring right at on the screen.... I want to go THERE.. not meant as a general search or anything like that... and doesn't help get off the screen, for sure.

Re: Vim - Putting arrows to use

#38
post #4

I use arrow keys for movement all the time. Not always, but I found no value in forcing myself otherwise.

Interesting. How long have you been using Vim?

Around 2 years I think.

Often switching mode to move around is just more effort than moving my hand a little, at least on the laptops I've used lately.

Re: Vim - Putting arrows to use

#39
post #23

Earlier quoted context omitted.

Even better, just learn to use EasyMotion, it's one of the most efficient ways of navigating around a file: https://github.com/Lokaltog/vim-easymotion

I've tried it and didn't like it at all. The main problem is how it replaces the letter I'm searching with another unrelated one, making all the matches practically unreadable. To me, at least. set incsearch and /foo ?bar are more than enough for my needs.

Basically what dedward said before me.

EasyMotion is not for searching, it's for moving the cursor deliberately to a place onscreen where you need to make an edit.

Re: Vim - Putting arrows to use

#40
post #39

Earlier quoted context omitted.

I've tried it and didn't like it at all. The main problem is how it replaces the letter I'm searching with another unrelated one, making all the matches practically unreadable. To me, at least. set incsearch and /foo ?bar are more than enough for my needs.

Basically what dedward said before me. EasyMotion is not for searching, it's for moving the cursor deliberately to a place onscreen where you need to make an edit.

Yes, I know.

Searching is how I move to where I want.

It's a lot less confusing to me than EasyMotion's logic, it's consistent whether the word I want to jump to is visible or not and it's a native feature.

Well, I was curious when it was released so I've used it for a couple of weeks and found it horrible and confusing. Obviously many people like it so let's say it's a matter of taste.

Post reply on HN