This may be better explained with an avy-goto-line example:
;; l
;; k
;; j
;; h
;; [point]
;; a
;; s
;; d
;; f
;; g
asdfghjkl are taken from avy-keys. For the first character of overlay keys, avy-keys is split into two halves and one half is for positions after the point and the other is for positions before the point. The second, third, ... characters can be used freely.
In this way, users can form the muscular memory that: a is for the 1st occurrence forward, s is for the 2nd forward, ... h is for the 1st backward, j for the 2nd backward, ...
This probably requires the function (defun avy--regex-candidates (regex &optional beg end pred group) returning two lists for both directions. When avy-all-windows is on, non-selected windows can use keys freely after keys are allocated to the selected window.
This may be better explained with an
avy-goto-line
example:asdfghjkl
are taken fromavy-keys
. For the first character of overlay keys,avy-keys
is split into two halves and one half is for positions after the point and the other is for positions before the point. The second, third, ... characters can be used freely.In this way, users can form the muscular memory that:
a
is for the 1st occurrence forward,s
is for the 2nd forward, ...h
is for the 1st backward,j
for the 2nd backward, ...avy-goto-word-1
example:This probably requires the function
(defun avy--regex-candidates (regex &optional beg end pred group)
returning two lists for both directions. Whenavy-all-windows
is on, non-selected windows can use keys freely after keys are allocated to the selected window.