Hints

kitty has a hints mode to select and act on arbitrary text snippets currently visible on the screen. For example, you can press ctrl+shift+e to choose any URL visible on the screen and then open it using your system browser.

URL hints mode

URL hints mode

Similarly, you can press ctrl+shift+p>f to select anything that looks like a path or filename and then insert it into the terminal, very useful for picking files from the output of a git or ls command and adding them to the command line for the next command.

The hints kitten is very powerful to see more detailed help on its various options and modes of operation, see below. You can use these options to create mappings in kitty.conf to select various different text snippets. See ctrl+shift+p>f for examples.

Command Line Interface

kitty +kitten hints [options]

Select text from the screen using the keyboard. Defaults to searching for URLs.

Options

--program <PROGRAM>

What program to use to open matched text. Defaults to the default open program for the operating system. Use a value of - to paste the match into the terminal window instead. A value of @ will copy the match to the clipboard. A value of default will run the default open program. Can be specified multiple times to run multiple programs.

--type <TYPE>

The type of text to search for. Default: url Choices: hash, line, path, regex, url, word

--regex <REGEX>

The regular expression to use when kitty +kitten hints --type=regex. The regular expression is in python syntax. If you specify a group in the regular expression only the group will be matched. This allow you to match text ignoring a prefix/suffix, as needed. The default expression matches lines. To match text over multiple lines you should prefix the regular expression with (?ms), which turns on MULTILINE and DOTALL modes for the regex engine. Default: (?m)^\s*(.+)\s*$

--url-prefixes <URL_PREFIXES>

Comma separated list of recognized URL prefixes. Default: file,ftp,http,https

--word-characters <WORD_CHARACTERS>

Characters to consider as part of a word. In addition, all characters marked as alphanumeric in the unicode database will be considered as word characters. Defaults to the select_by_word_characters setting from kitty.conf.

--minimum-match-length <MINIMUM_MATCH_LENGTH>

The minimum number of characters to consider a match. Default: 3

--multiple

Select multiple matches and perform the action on all of them together at the end. In this mode, press Esc to finish selecting.

--multiple-joiner <MULTIPLE_JOINER>

String to use to join multiple selections when copying to the clipboard or inserting into the terminal. The special strings: “space”, “newline”, “empty”, “json” and “auto” are interpreted as a space character, a newline an empty joiner, a JSON serialized list and an automatic choice, based on the type of text being selected. In addition, integers are interpreted as zero-based indices into the list of selections. You can use 0 for the first selection and -1 for the last. Default: auto

--add-trailing-space <ADD_TRAILING_SPACE>

Add trailing space after matched text. Defaults to auto, which adds the space when used together with –multiple. Default: auto Choices: always, auto, never

--hints-offset <HINTS_OFFSET>

The offset (from zero) at which to start hint numbering. Note that only numbers greater than or equal to zero are respected. Default: 1

--alphabet <ALPHABET>

The list of characters to use for hints. The default is to use numbers and lowercase English alphabets. Specify your preference as a string of characters. Note that unless you specify the hints offset as zero the first match will be highlighted with the second character you specify.