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

146 m4xshen 56 5/18/2025, 12:08:52 PM github.com ↗

Comments (56)

BrouteMinou · 4h ago
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.

WhyNotHugo · 1h ago
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-consecutive lines, I might use things like 31x, go to the next instance (maybe continuing a search with n), and press period.

Honestly though, if you're moving forward 31 characters, there's often an easier approach, like 4w (move forward three Words). Again, at first I had to consciously think about which combination to use. Over time it becomes second nature.

I still use jjjj sometimes. It's imperfect, but at least it's the human that's the limiting factor, and not the software.

suprjami · 42m ago
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

skydhash · 4h ago
I think it's more about getting used to f-F,t-T,A,I, and <semicolon> which can be quicker especially with code. You can also add easymotion or similar plugins for the powered version of those.
WhyNotHugo · 1h ago
TIL! `f` looks really useful, thanks.
mystifyingpoi · 4h ago
That's the point of this plugin - holding "wwwwwwww..." is a bad habit, because it's very likely there is an objectively better way of getting there. Not necessarily "142l" but "/<piece of word><ENTER>" or "f,;;".
jackhalford · 1h ago
`set relativenumber` to see where you’re jumping
konart · 2h ago
>No way I am starting to count how many characters there are

You don't have to. There are many ways to do a jump without counting. Some of the require plugins like flash.nvim, some do require pressing `;` multiple times

qazxcvbnm · 6h ago
A somewhat more “complete” solution that doesn’t give you hints (thus doesn’t rely on the plugin support for all of vim’s vast functionalities), but conditions your instincts to get better: increase the latency of my whole terminal (c.f. https://unix.stackexchange.com/questions/778196/how-to-add-d...) (also see the comment) by running my terminal session on a ssh session into my own machine through a ProxyCommand of the command delay.
mercer · 3h ago
see I just run emacs to get the same effect
blahgeek · 6h ago
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
kiaofz · 4h ago
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.
3abiton · 48m ago
Did you get better in maths?
rybosome · 5h ago
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 want to go up/down a few rows.

I have no proof of this, but I’d guess that the creator of this pattern didn’t feel the same way.

WhyNotHugo · 38m ago
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.

skydhash · 5h ago
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.

umbra07 · 49m ago
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
christophilus · 5h ago
Why’d you switch to emacs, and do you use evil mode?
skydhash · 5h ago
Vim is a fine editor, but emacs has better tooling. I got in touch with Emacs while learning Common Lisp, and I got hooked by the extensive capabilities and customization available. Vim is fine for extension, but you have to build most of them yourself.

I tried evil mode, but it clashes with other keybinding in some places and I got unhappy with it. There's a philosophy conflict there. With vim, you're expected to have a command for an action and then bind it to a key. Your editing workflow is to compose those keys.

But with emacs, you're more expected to have a view and then a set of actions for that view. The power of emacs comes with how easy it is to integrate all those views together. For a programming workflow, you have the file explorer, the symbol explorer, the search result (single file and all files), the version control, the docs, the compilation|build window, the shell, the project tasks,... all together in the same place and linked to each other. With vim, you have to compose all those with a multiplexer and other tools (with conflicting bindings) to get there. Vim is still better for editing, but Emacs is better for workflows.

eviks · 2h ago
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.

rybosome · 57m ago
Thanks for letting me know, I wasn’t aware that was possible!
eviks · 2h ago
You don't need to use the upper row, bind numbers to right thumb modifier + numpad-like uio jkl m,.

Or instead of 15j use another jump to command that accepts those letters as numbers

Or have some jump type of command that displays a-z labels 1 per row in the middle and you can jump without numbers and without shifting focus to the gutter

But yes, the most basic motion will still be more "intuitive"

rgoulter · 5h ago
It's nice to have good tools that are practical for navigating around the text.

For jumping around what's on screen, I think 'easymotion' ("jump anywhere on screen by pressing two characters") & variations are best in terms of how quickly they let you navigate for how easy it is to use.

mathstuf · 4h ago
Also gives me time to plan what I'm going to do once I get there. Or I spot a bug/relevant code snippet along the way.
ryanmcbride · 6h ago
I've pretty much always struggled with this too. I have a numpad that I can touchtype easily but if I'm taking my hands off homerow I may as well use a mouse at that point.
fwip · 5h ago
Huh, I don't find the number row very difficult to touch type. But then again, I do have long fingers.
WhyNotHugo · 1h ago
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.

suprjami · 44m ago
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.

marcyb5st · 6h ago
I use it and helped me greatly! Thanks a lot for putting this together.

There are few minor things I don't agree as bad habits. For instance, Home/End should be allowed at least when you are in edit mode as they armonize with almost any other text input (not just editors, but also the text inputs/areas on websites).

m4xshen · 6h ago
Thank you! Home/End are actually allowed in Hardtime default config. I'm guessing that you are using AstroNvim since its community default config disables them: https://github.com/AstroNvim/astrocommunity/blob/main/lua/as...
marcyb5st · 5h ago
Correct! Thanks for pointing that out. I never investigated and just rolled with it :)
perrygeo · 6h ago
Despite using vim and neovim for over 20 years, I'm still apparently a caveman when it comes to navigating. I both love and hate that this plugin calls me out for it. The "Hardtime Report" is a great feature, really shows just how pervasive my bad habits are. This could either help me improve - or force me to uninstall it in anger.
unshavedyak · 7h ago
This looks awesome! Wonder if something like this could be turned into a generalized optimization engine of sorts? Ie if the problem could be generalized for a set of available movement commands relative to used commands, you could apply it to any underlying platform.

Which is to say, i'd love to see this in Helix. I also toy with custom editors, and observability of available commands is high priority for me, a generalized solution here would be an elegant solve for that. It would also adapt to new features nicely.

avinassh · 5h ago
This looks great! Is it compatible with lazyvim's installations? Because I could not get it working and I suspect it is conflicting with some other plugin
m4xshen · 4h ago
Yeah it is compatible. You can open an issue with more detail if it is still not working.
n8cpdx · 3h ago
This is really cool, I would love something like this for the VS Code vim emulation. I’m constantly trying to improve my usage but bad habits are hard to break, especially when even the bad habits feel so productive compared to not having vim.
lylejantzi3rd · 6h ago
This is awesome. This might be the thing that gets me to stop being a dinosaur and switch to neovim.
darkwater · 6h ago
I'm totally going to install it, thank you very much for developing it!
lherron · 3h ago
Repo name checks out.

Looks awesome, will not try!

SuperManifolds · 5h ago
Been using this plugin for a while, really helped me kick a lot of bad habits. I enjoy how it lets you add custom rules. I really struggled to make myself use I and A, and kept doing ^i $i, so I told it to yell at me when I do that until I learned
nickandbro · 7h ago
Love it! working on similar tool tips for my project:

https://vimgolf.ai

EDIT: thanks all for the feedback! Sorry there are not more levels, but if you check back in a week am adding a level editor!

foob · 6h ago
I signed up to give it a try, but when I click "Go to Levels" it takes me to https://vimgolf.ai/levels and I get a 404 error.
horsellama · 5h ago
same

but clicking on the hamburger menu it shows a link to “Motions”, which seems to be the first level/demo of the game

nickandbro · 5h ago
Sorry, yeah I am adding more levels, and will fix that! Thanks for testing!
shlomo_z · 7h ago
This looks cool. Is it free?
nickandbro · 7h ago
Thanks, it is, right now! And will have a generous free tier once finished. The only big reason I am making a priced option is for users who want AI tips to be able to have that option. Right now, I do that by having reasoning models like o3 solve the levels and then provide tips or verifying a level can be solved with certain motions.
linnnus · 6h ago
I'm always hesitant about signing up for services. would be great if there was a demo that didn't require creating an account!
JLO64 · 6h ago
I wouldn’t mind signing up without a demo if there was more information about what this is exactly.
nickandbro · 6h ago
Great feedback! Will role out a update with that information
nickandbro · 6h ago
Point taken! Right now I am exploring a way where users can test the service on the landing page, without signing up.
yegle · 6h ago
I'm a bit disappointed that this can only be used with NeoVim yet it claims to help you master Vim.

Sorry not meant to be a criticism. Maybe this is the last push for me to switch to using NeoVim.

ilvez · 5h ago
I waited as well long time, but after switching my tooling and usage has improved a lot since lot of progressive community around modern tools that NVim supports. So I encourage to take a look.

I still keep vim configuration around but I've never felt the need for going back.

mystifyingpoi · 3h ago
I'm making my (probably) 4th attempt in migrating from regular Vim to NeoVim, and while it's better now, the learning curve is still steep as hell. Going the kickstart.nvim route this time and boy, half of the stuff there is pure magic. Honestly feels like reading Nix incantations. Dynamic nature of Lua makes it even harder. Thankfully ChatGPT is pretty good in generating configs.
drabbiticus · 5h ago
Not a criticism, just noting that it says it helps master Vim motions, not Vim
thdhhghgbhy · 7h ago
Great work.
alabhyajindal · 7h ago
Very cool!