quick_select_patterns

On this page
  1. quick_select_patterns

quick_select_patterns#

Specify additional patterns to match when in quick select mode. This setting is a table listing out a set of regular expressions.

config.quick_select_patterns = {
  -- match things that look like sha1 hashes
  -- (this is actually one of the default patterns)
  '[0-9a-f]{7,40}',
}

If you want to use capture groups in your patterns, you must use non-capturing groups (?:) for them to work as you intend, as the overall list of quick_select_patterns is compiled into a larger alternation regex that itself uses capture groups.

The regex syntax supports backreferences and look around assertions. See Fancy Regex Syntax for the extended syntax, which builds atop the underlying Regex syntax.

This example matches the string "bar", but only when not part of the string "foo:bar":

config.quick_select_patterns = {
  '(?<!foo:)bar',
}
Edit this page