vimflowy icon indicating copy to clipboard operation
vimflowy copied to clipboard

gj, gk for moving across graphical lines

Open paulfchristiano opened this issue 10 years ago • 4 comments

Would be nice if gj and gk (or some other keys) moved up and down a graphical line rather than a bullet. I would probably prefer this as the j, k behavior in most cases, but I'm happy to use gj and gk until there are custom shortcuts.

paulfchristiano avatar Sep 26 '15 19:09 paulfchristiano

Would mouse support solve this for you?

za3k avatar Dec 07 '15 23:12 za3k

No; I just want j and k to behave this way (or to have bindings that can be remapped to them).

There isn't a natural way to avoid long lines without breaking the logical structure of an outline. And once you have long lines, j and k become unwieldy.

paulfchristiano avatar Dec 07 '15 23:12 paulfchristiano

Yeah, not suggesting avoiding long lines, just mentioning you can click a position within a line to edit there. Okay, having a command to move up and down a logical line seems reasonable. Jeff, I'm going to leave this to you, since I feel like it should match vim style.

za3k avatar Dec 07 '15 23:12 za3k

kinda brittle, but maybe:

  • add data attributes with row/column, use to get div corresponding to cursor
  • iterate through $('.cursor').siblings() either backwards/forward through $('.cursor').index(), find all things differing in offset().top and differing minimally in offset().left
  • use data attributes to know where to move cursor

WuTheFWasThat avatar Mar 24 '17 03:03 WuTheFWasThat