hop.nvim
hop.nvim copied to clipboard
Feature: HopLine whilst maintaining current cursor position
Currently, Hop provides line movement (HopLineStart
, etc.) by having the hint destination be either the start or the beginning of the destination line.
Request
I would like to be able to have commands such as HopLineCurrentPosition
, HopLineCurrentPositionAC
, etc. wherein the destinations hinted are vertically aligned with the current cursor position.
For example, where x
is a character, p
is the current cursor position, and any other character a hint destination, having an initial state as follows:
xxxxxx
xxxxpxxx
xxxxxxx
The command HopLineCurrentPosition
would result in:
xxxxax
xxxxpxxx
xxxxbxx
And then pressing a
would move the cursor to the associated hint destination:
xxxxpx
xxxxxxxx
xxxxxxx
Considerations
If a destination line is shorter than the current cursor position, the hint should be the end of the line like so:
xxxa
xxxxxxp
xxxxb
xxxxxxcxx
Yep, that looks like a valid jump target generator and should be rather simple to implement.