Live data from Hacker News

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

github.com

51–60 of 89 posts

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

#52
post #46

Earlier quoted context omitted.

Agreed. I wonder if this is somewhat revealing of the mental processes of the creators. To me, if my cursor is a few lines away from another line, the easiest way for me to get there is by either using h/j a few times, or looking at the absolute line number and doing that with gg. Relative jumps are only useful to me in macros. Calculating a relative jump myself would 100% pull me out of the flow state where I just w…

Why would you ever calculate relative jump yourself instead of having relative line numbers in the gutter? And yes, for a few lines it's fine, the plugin has this number configurable.

Thanks for letting me know, I wasn’t aware that was possible!

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

#53
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.

[deleted]

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

#54

Earlier quoted context omitted.

Agreed. I wonder if this is somewhat revealing of the mental processes of the creators. To me, if my cursor is a few lines away from another line, the easiest way for me to get there is by either using h/j a few times, or looking at the absolute line number and doing that with gg. Relative jumps are only useful to me in macros. Calculating a relative jump myself would 100% pull me out of the flow state where I just w…

The best tip I got, was to rely more on search instead of other kind of movement. Especially when doing a bunch of editing. Things like easymotion/sneak/avy works best when reading/reviewing. While I loved multi cursor with sublime. After I moved to Vim, I’ve never needed it. It’s either search~repeat or a macro. Now I’m using emacs, and it’s mostly occur-mode and macro. Grep edit is nice for bigger refactoring.

I really, really like flash/easymotion/etc because I effectively also use the same jump motions all the time in my browser (with vimium/tridactyl). So I have double the muscle memory, and I context-switch less between my browser and neovim, compared to if I was primarily using relative line jumps in neovim

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

#55
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.

Did you get better in maths?

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

#56

When I started using Vim many years ago, I mapped the arrow keys to no-op. This made the biggest difference, more than anything else. It forced me to use hjkl and never the arrow keys. Everything else is a bonus that comes by itself later.

That's a good start, but then you develop the same anti-pattern like typing jjjjj to go down 5 lines instead of 5j

That's what hardtime solves.

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

#57

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

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

#58

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

Agreed. I wonder if this is somewhat revealing of the mental processes of the creators. To me, if my cursor is a few lines away from another line, the easiest way for me to get there is by either using h/j a few times, or looking at the absolute line number and doing that with gg. Relative jumps are only useful to me in macros. Calculating a relative jump myself would 100% pull me out of the flow state where I just w…

Getting used to thinking about multi-line motions via 5j helped me train to visualise lines that way.

Over time, I started using things like 13dd or 7yy with more ease.

Of course, `set relativenumber` is always recommended.

> Calculating a relative jump myself would 100% pull me out of the flow state where I just want to go up/down a few rows.

Yeah, you can't be a purist about it. If you're hard-focused and jjjjj is the first thing that comes to mind, then that's fine. When you're doing lighter work is when you have the spare mental capacity to train and improve on your workflow.

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

#59

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.

Do you even `%` to navigate to matching ()[]{}? Often useful to jump straight to function end from signature, lispy paran-nests, and so on.

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

#60
This was the neovim plugin that really caused me to stick with it. I've been using this plugin for over a year, after the (short) initial period of frustration with the delays I was able to start really flying with vim motions. Now I can't imagine going back to a regular text editor.
Post reply on HN