cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.09k stars 77 forks source link

neovim: support relative number row target from TERMINAL mode #2373

Open fidgetingbits opened 1 month ago

fidgetingbits commented 1 month ago

This is mostly for consideration, and filing so I don't forget. ATM I prefer to use relative rows in the terminal because they are faster to say and don't accumulate large values (like figuring out to say row 39 from 29339 for instance), etc.

It seems like it would probably be possible for cursorless in neovim to inspect the incoming command to check for a row reference. It could then query neovim to see if the relative number setting is true, and if so, figure out the row the cursor is on and then compute the absolute row number and patch the value in the command so cursorless gets what it expects?

This of course breaks down if you aren't in TERMINAL mode, because you don't know if the relative reference is up or down, but my most common use case historically for this is just pulling stuff down into the command line while I'm in TERMINAL mode. So it could be something only that triggers when in TERMINAL mode I think.

That said, some other things I'm going to experiment with to solve this problem:

Maybe one of these will be sufficient that I don't think it's needed.

saidelike commented 1 month ago

I like the idea of the custom color for the last two digits