Live data from Hacker News

Show HN: Hardtime.nvim – break bad habits and master Vim motions

github.com

61–70 of 89 posts

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#61

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

Agree. vim-sneak is the answer to this, you can reach anywhere with maximum 3 key presses. It's very intuitive and easy to pick up. If I had to pick only one Vim plugin it would be sneak. https://github.com/justinmk/vim-sneak

That seems reasonable, I will definitely test that out.

Thank you.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#62

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

I always use f-F, t-T to move within lines, have found that to be the quickest.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#63

I’ve been using vim for 10+ years. However I honestly don’t see the downside of repeating h or j to move up/down (with the key repeat delay adjusted to a small value). It’s more intuitive than using say 15j, which involves recognizing some number in the screen and then look at the keyboard to type because the upper number row cannot be easily touch typed

There are countless more convenient keys that you can use to navigate up and down without counting. Basic ones are /, *, n, N, H, M, L, {, }, %, ctrl-]. ]c, [c when you're in a diff buffer or have a Git plugin that offers this key. ]d, [d, [q, ]q, ]l, [l if you use Neovim.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#64

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

Relative line numbers can help with j and k.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#65
The way I like to explain vim to people new to it is; start from "the inside out" on a QWERTY keyboard and assume most people are right-handed.

By that, I mean the hjkl navigation keys are the first kind of navigation people want to do and are conveniently easily typed with the right hand in a traditional "home-row" position.

Next, very common editing commands are associated with home-row keys associated with the left hand; asd, with finding a character on the current line associated with f (and F for finding backward).

After those, other lesser used, but still very useful, commands are associated with the rows above and below the "home-row".

Finally, repeating any of these is bound to prefixed numbers, which are of course two rows above the "home-row" on a QWERTY keyboard.

Modifiers such as Shift, Ctrl, and others are approximately the same distance as the numeric row, unless one binds CapsLock to be Ctrl on most modern keyboards (note that Sun's keyboard got it right and had Ctrl in the position most keyboards now have CapsLock).

Interestingly enough, learning vim can often times follow the above distances from hjkl with great result.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#66

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

There was a guide that mentioned "scrabble tile" movement. `fj` is quicker than `fe` because J is way less common than E.

Once you get "near", then zeroing in on your target (eg: `fj`, `Fa` for "adjacent") can be the fastest/most accurate way to get to where you want to go.

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#67

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

At first I had to count characters. Over time, it becomes intuitive. In the same way that if someone holds up three fingers you don't count "one, two, three", you immediately perceive that they are holding up three fingers. For numbers under 10, I usually hit the right amount. For numbers around 30, I might be off by one to five, but move on from then. When I want to remove similar prefixes from multiple non-consecut…

A big help for me is H/M/L - mnemonic high/middle/low.

Moves to the top/bottom/middle of the viewport, and the. I'll jjjj/kkkk away! (or probably just search, mostly).

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#68
post #37

I’ve been using vim for 10+ years. However I honestly don’t see the downside of repeating h or j to move up/down (with the key repeat delay adjusted to a small value). It’s more intuitive than using say 15j, which involves recognizing some number in the screen and then look at the keyboard to type because the upper number row cannot be easily touch typed

I was the exact same until I started using relative line numbers. Then I can just look at a line and see that it's N lines down and jump there immediately. With j or k repeat I'll often over shoot and then have to go back which is kind of annoying.

How is this easier than jumping straight to the line with absolute numbers?

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#69

I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement. No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"... I am totally going to spam some 2w 3w llll until I reach the desired position.

llllllllllllllllllllllllllllllllllllllllllllllllllll

Re: Show HN: Hardtime.nvim – break bad habits and master Vim motions

#70
post #68
post #37

Earlier quoted context omitted.

I was the exact same until I started using relative line numbers. Then I can just look at a line and see that it's N lines down and jump there immediately. With j or k repeat I'll often over shoot and then have to go back which is kind of annoying.

How is this easier than jumping straight to the line with absolute numbers?

15j is easier than 4879gg. It’s a little bit quicker on big files—not a huge difference.
Post reply on HN