Search¶
Since: Version 20200607-144723-74889cd4
The functionality described in this section requires version 20200607-144723-74889cd4 of wezterm, or a more recent version.
This action will trigger the search overlay for the current tab. It accepts a
typed pattern string as its parameter, allowing for Regex,
CaseSensitiveString, CaseInSensitiveString and CaseSmartString as pattern
matching types.
For Regex matching, the supported regular expression syntax is described here.
Since: Nightly Builds Only
The functionality described in this section requires a nightly build of wezterm. You can obtain a nightly build by following the instructions from the Download section.
CaseSmartString was added, to make the search case-insensitive until the search term
includes any uppercase character, which triggers the search to become case-sensitive.
local act = wezterm.action
config.keys = {
-- search for things that look like git hashes
{
key = 'H',
mods = 'SHIFT|CTRL',
action = act.Search {
Regex = '[a-f0-9]{6,}',
},
},
-- search for the lowercase string "hash" matching the case exactly
{
key = 'H',
mods = 'SHIFT|CTRL',
action = act.Search { CaseSensitiveString = 'hash' },
},
-- search for the string "hash" matching regardless of case
{
key = 'H',
mods = 'SHIFT|CTRL',
action = act.Search { CaseInSensitiveString = 'hash' },
},
-- search for the string "hash" matching regardless of case, until the search string is edited
-- with an uppercase and the matching becomes case sensitive.
{
key = 'H',
mods = 'SHIFT|CTRL',
action = act.Search { CaseSmartString = 'hash' },
},
}
Learn more about the search overlay
Since: Version 20220624-141144-bd1b7c5d
The functionality described in this section requires version 20220624-141144-bd1b7c5d of wezterm, or a more recent version.
You may now use wezterm.action.Search("CurrentSelectionOrEmptyString") to have the search take the currently selected text as the item to search.
The selection text is adjusted to be a single line.