avy icon indicating copy to clipboard operation
avy copied to clipboard

avy-goto-char-2 display overlays after first character like Neovim's leap

Open aaronjensen opened this issue 1 year ago • 0 comments

Rather than attempt to explain it myself I'll just include a snippet of Leap.vim's readme:

Leap allows you to jump to any positions in the visible editor area by entering a 2-character search pattern, and then potentially a "label" character to pick your target from multiple matches, similar to Sneak. The novel idea in Leap is its "clairvoyant" ability: you get a live preview of the target labels - by mapping possible futures, Leap can show you which key(s) you will need to press before you actually need to do that.

  • Initiate the search in the forward (s) or backward (S) direction, or in the other windows (gs).
  • Start typing a 2-character pattern ({c1}{c2}).
  • After typing the first character, you see "labels" appearing next to some of the {c1}{?} pairs. You cannot use the labels yet.
  • Enter {c2}. If the pair was not labeled, then voilà, you're already there. No need to be bothered by remaining labels, just continue editing.
  • Else: select a label....

https://github.com/ggandor/leap.nvim#how-to-use-it-tldr

The basic idea is that for avy-goto-char-2, after the first character it would start to show labels. This gives your brain time to register that so you can get ready to type that character after the 2nd without having to rely purely on reaction time.

aaronjensen avatar Jan 05 '23 10:01 aaronjensen