hop.nvim icon indicating copy to clipboard operation
hop.nvim copied to clipboard

Add option to preserve cursor column when changing lines

Open BlueDrink9 opened this issue 4 years ago • 2 comments
trafficstars

EasyMotion has a setup to replace hjkl. This includes a setting that means when you jump to another line, the current column your cursor is in is used for the jump, if possible. It would be great to have this feature in hop.

(As an aside, if you can suggest a pattern that I can use with HintPattern that matches the behavior for the above linked h and l, I'd appreciate the help. EasyMotion seems to be much more flexible with what counts as a word boundary than hop, which makes it much more useful.)

BlueDrink9 avatar Jul 19 '21 04:07 BlueDrink9

Hey that’s a funny mode! That’s definitely doable! I’d rather merge #123 first so that implementing those modes get trivial.

hadronized avatar Jul 19 '21 10:07 hadronized

Just for the context, preserving the column is easily implementable with an option opts.preserve_column by overriding the jump target’s column with the one at the cursor before the jump.

I think it’s sane to authorize this whatever the command (even cross-windows). If anyone wants to try a patch, I’d be happy to review it. Otherwise I should have time to implement that in the incoming days.

hadronized avatar Jan 19 '22 15:01 hadronized