Update runtime files

This commit is contained in:
Bram Moolenaar
2021-05-16 12:39:47 +02:00
parent 50157ef1c2
commit 3ec3217f04
19 changed files with 243 additions and 74 deletions

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.2. Last change: 2021 Feb 16
*pattern.txt* For Vim version 8.2. Last change: 2021 May 02
VIM REFERENCE MANUAL by Bram Moolenaar
@ -19,6 +19,7 @@ explanations are in chapter 27 |usr_27.txt|.
8. Composing characters |patterns-composing|
9. Compare with Perl patterns |perl-patterns|
10. Highlighting matches |match-highlight|
11. Fuzzy matching |fuzzy-match|
==============================================================================
1. Search commands *search-commands*
@ -1431,5 +1432,38 @@ Finally, these constructs are unique to Perl:
are suggested to use ":match" for manual matching and
":2match" for another plugin.
==============================================================================
11. Fuzzy matching *fuzzy-match*
Fuzzy matching refers to matching strings using a non-exact search string.
Fuzzy matching will match a string, if all the characters in the search string
are present anywhere in the string in the same order. Case is ignored. In a
matched string, other characters can be present between two consecutive
characters in the search string. If the search string has multiple words, then
each word is matched separately. So the words in the search string can be
present in any order in a string.
Fuzzy matching assigns a score for each matched string based on the following
criteria:
- The number of sequentially matching characters.
- The number of characters (distance) between two consecutive matching
characters.
- Matches at the beginning of a word
- Matches after a camel case character or a path separator or a hyphen.
- The number of unmatched characters in a string.
The matching string with the highest score is returned first.
For example, when you search for the "get pat" string using fuzzy matching, it
will match the strings "GetPattern", "PatternGet", "getPattern", "patGetter",
"getSomePattern", "MatchpatternGet" etc.
The functions |matchfuzzy()| and |matchfuzzypos()| can be used to fuzzy search
a string in a List of strings. The matchfuzzy() function returns a List of
matching strings. The matchfuzzypos() functions returns the List of matches,
the matching positions and the fuzzy match scores.
The "f" flag of `:vimgrep` enables fuzzy matching.
vim:tw=78:ts=8:noet:ft=help:norl: