summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-24 00:54:53 +0900
committerGitHub <noreply@github.com>2025-01-24 00:54:53 +0900
commit243a76002c93b474cf8401b37670a43803a0a2d2 (patch)
treee0972774a3e45905b140c6d4affe370cbda04991 /README.md
parentc71e4ddee41d3381fb9ec25cc7078bdb25ac4b27 (diff)
downloadfzf-243a76002c93b474cf8401b37670a43803a0a2d2.tar.gz
Option to prioritize file name matches (#4192)
* 'pathname' is a new tiebreak option for prioritizing matches occurring in the file name of the path. * `--scheme=path` will automatically set `--tiebreak=pathname,length`. * fzf will automatically choose `path` scheme when the input is a TTY device, where fzf would start its built-in walker or run `$FZF_DEFAULT_COMMAND` which is usually a command for listing files. Close #4191
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4d235998..5164c4b1 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,7 @@ Table of Contents
* [Custom fuzzy completion](#custom-fuzzy-completion)
* [Vim plugin](#vim-plugin)
* [Advanced topics](#advanced-topics)
+ * [Customizing for different types of input](#customizing-for-different-types-of-input)
* [Performance](#performance)
* [Executing external programs](#executing-external-programs)
* [Turning into a different process](#turning-into-a-different-process)
@@ -718,6 +719,22 @@ See [README-VIM.md](README-VIM.md).
Advanced topics
---------------
+### Customizing for different types of input
+
+Since fzf is a general-purpose text filter, its algorithm was designed to
+"generally" work well with any kind of input. However, admittedly, there is no
+true one-size-fits-all solution, and you may want to tweak the algorithm and
+some of the settings depending on the type of the input. To make this process
+easier, fzf provides a set of "scheme"s for some common input types.
+
+| Scheme | Description |
+| :--- | :--- |
+| `--scheme=default` | Generic scheme designed to work well with any kind of input |
+| `--scheme=path` | Suitable for file paths |
+| `--scheme=history` | Suitable for command history or any input where chronological ordering is important |
+
+(See `fzf --man` for the details)
+
### Performance
fzf is fast. Performance should not be a problem in most use cases. However,
@@ -727,6 +744,8 @@ you might want to be aware of the options that can affect performance.
makes the initial scanning slower. So it's not recommended that you add it
to your `$FZF_DEFAULT_OPTS`.
- `--nth` makes fzf slower because it has to tokenize each line.
+- A plain string `--delimiter` should be preferred over a regular expression
+ delimiter.
- `--with-nth` makes fzf slower as fzf has to tokenize and reassemble each
line.