36 lines
1.1 KiB
ReStructuredText
36 lines
1.1 KiB
ReStructuredText
Marks
|
|
=================
|
|
|
|
|
|
kitty has the ability to mark text on the screen based on regular expressions.
|
|
This can be useful to highlight words or phrases when browsing output from long
|
|
running programs or similar. Lets start with a few examples:
|
|
|
|
Suppose we want to be able to highlight the word ERROR in the current window.
|
|
Add the following to :file:`kitty.conf`::
|
|
|
|
map f1 toggle_marker text 1 ERROR
|
|
|
|
Now when you press :kbd:`F1` all instances of the word :code:`ERROR` will be
|
|
highlighted. To turn off the highlighting, press :kbd:`F1` again.
|
|
If you want to make it case-insensitive, use::
|
|
|
|
map f1 toggle_marker itext 1 ERROR
|
|
|
|
To make it match only complete words, use::
|
|
|
|
map f1 toggle_marker regex 1 \bERROR\b
|
|
|
|
Suppose you want to highlight both :code:`ERROR` and :code:`WARNING`, case
|
|
insensitively::
|
|
|
|
map f1 toggle_marker iregex 1 \bERROR\b 2 \bWARNING\b
|
|
|
|
kitty supports up to 3 mark groups (the numbers in the commands above). You
|
|
can control the colors used for these groups in :file:`kitty.conf` with::
|
|
|
|
mark1_foreground red
|
|
mark1_background gray
|
|
mark2_foreground green
|
|
...
|