summaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-26 01:50:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-26 01:50:08 +0900
commit7220d8233e81291db8bda3d4eb5286ca45f07be0 (patch)
tree0bbb9c4593e50c0a06408982c0b907c30db8661b /CHANGELOG.md
parent0237bf09bf1fe70d94727b040ac39110f56b497f (diff)
downloadfzf-7220d8233e81291db8bda3d4eb5286ca45f07be0.tar.gz
Add 'search' and 'transform-search'
Close #4202
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a808a5b7..ab795978 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,27 @@ CHANGELOG
--bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \
--header-lines-border bottom --no-list-border
```
+- Added `search(...)` and `transform-search(...)` action to trigger an fzf search with an arbitrary query string. This can be used to extend the search syntax of fzf. In the following example, fzf will use the first word of the query to trigger ripgrep search, and use the rest of the query to perform fzf search within the result.
+ ```sh
+ TRANSFORMER='
+ words=($FZF_QUERY)
+
+ # If $FZF_QUERY contains multiple words, drop the first word,
+ # and trigger fzf search with the rest
+ if [[ ${#words[@]} -gt 1 ]]; then
+ echo "search:${FZF_QUERY#* }"
+
+ # Otherwise, if the query does not end with a space,
+ # restart ripgrep and reload the list
+ elif ! [[ $FZF_QUERY =~ \ $ ]]; then
+ echo "reload:rg --column --color=always --smart-case \"${words[0]}\""
+ fi
+ '
+ fzf --ansi --disabled \
+ --with-shell 'bash -c' \
+ --bind "start:transform:$TRANSFORMER" \
+ --bind "change:transform:$TRANSFORMER"
+ ```
- Added `bell` action to ring the terminal bell
```sh
# Press CTRL-Y to copy the current line to the clipboard and ring the bell