Link hinting for luakit
Link hints allow interacting with web pages without the use of a
follow mode is entered, all clickable elements are
highlighted and labeled with a short number. Typing either an element
number or part of the element text will "follow" that hint, issuing a
mouse click. This is most commonly used to click links without using
the mouse and focus text input boxes. In addition, the
mode offers several variations on this behavior. For example, instead
of clicking, the URI of a followed link can be copied into the clipboard.
Another example would be hinting all images on the page, and opening the
followed image in a new tab.
Customizing hint labels
If you prefer to use letters instead of numbers for hint labels (useful if
you use a non-qwerty keyboard layout), this can be done by replacing the
local select = require "select" select.label_maker = function () local chars = charset("asdfqwerzxcv") return trim(sort(reverse(chars))) end
charset() function generates hints using the specified letters.
For a full explanation of what the
does, see the
select module documentation; the short explanation is
that it makes hints as short as possible, saving you typing.
Note: this requires modifying the
select module because the actual
link hinting interface is implemented in the
select module; the
follow module provides the
ex-follow user interface on top
Hinting with non-latin letters
If you use a keyboard layout with non-latin keys, you may prefer to use non-latin letters to hint. For example, using the Cyrillic alphabet, the above code could be changed to the following:
... local chars = charset("ФЫВАПРОЛДЖЭ") ...
Alternating between left- and right-handed letters
To make link hints easier to type, you may prefer to have them alternate
between letters on the left and right side of your keyboard. This is easy to
do with the
interleave() label composer function.
... local chars = interleave("qwertasdfgzxcvb", "yuiophjklnm") ...
Matching only hint labels, not element text
If you prefer not to match element text, and wish to select hints only by
their label, this can be done by specifying the
-- Match only hint label text follow.pattern_maker = follow.pattern_styles.match_label
Ignoring element text case
To ignore element text case when filtering hints, set the following option:
-- Uncomment if you want to ignore case when matching follow.ignore_case = true
After each follow ignore all keys pressed by the user to prevent the accidental activation of other key bindings.
- 2010–2012 Mason Larobina
- 2010–2011 Fabian Streitel