m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.35k stars 27 forks source link

Suggest alternative when blocking repeated keys #75

Closed Android789515 closed 7 months ago

Android789515 commented 7 months ago

I'm new to Vim and it's annoying to just see "You pressed the k key too soon" without an alternative to scrolling down with k.

m4xshen commented 7 months ago

For jumping to line within the screen, use relative jump eg: 5k, 12j. To achieve this you need to set the option relativenumber to true first, and then your screen will look like this:

5 the line you want to go
4
3
2
1
0 the line your cursor at
1
2
3

In this case you just look at the line you want to go and then use the number of that line as prefix, so that would be 5k.

As for jumping to line outside the screen, use <C-U> and <C-D> to scroll half of the screen, or <C-B> and <C-F> to scroll a screen.

These two way of vertical moving is much more efficient than the continuous k and j.