diff runtime/doc/pattern.txt @ 24636:840665e74421

Update runtime files Commit: https://github.com/vim/vim/commit/3ec3217f0491e9ba8aa8ea02f7e454cd19a287ef Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 16 12:39:47 2021 +0200 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 May 2021 12:45:04 +0200
parents ef454a7f485d
children fd37be6dc258
line wrap: on
line diff
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -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 @@ 7. Ignoring case in a pattern	|/ignoreca
 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 @@ 10. Highlighting matches				*match-highl
 		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: