Commit Graph

344 Commits

Author SHA1 Message Date
Junegunn Choi d83eb2800a Add change-nth action
Example:
  # Start with --nth 1, then 2, then 3, then back to the default, 1
  echo 'foo foobar foobarbaz' | fzf --bind 'space:change-nth(2|3|)' --nth 1 -q foo

Close #4172
Close #3109
2025-01-13 00:13:31 +09:00
Junegunn Choi 5460517bd2 Treat a single-character delimiter as a plain string delimiter
even if it's a regular expression meta-character

Close #4170
2025-01-12 10:23:43 +09:00
Junegunn Choi 4fdc07927f Refactor --preview-border=line 2025-01-11 19:34:26 +09:00
Junegunn Choi 43eafdf4b7 Fix preview scrollbar with '--preview-window bottom,border-line' 2025-01-11 00:53:07 +09:00
Junegunn Choi fa3f706e71 Refactor option parser 2025-01-07 19:16:41 +09:00
Junegunn Choi a30181e240 Update man page sections 2025-01-07 00:20:36 +09:00
Junegunn Choi 88d768bf6b Restructure --help output 2025-01-06 23:34:14 +09:00
Junegunn Choi 5ae60e2e80 Add style presets: --style=[default|minimal|full]
Close #4160
2025-01-06 02:10:44 +09:00
Junegunn Choi 0e0b868342 Add preview border style 'line'
It draws a single line between the preview window and the rest of the
interface. i.e. automatically choose between 'left', 'right', 'top', and
'bottom' depending on the position of the preview window.
2025-01-06 00:44:59 +09:00
Junegunn Choi a5beb08ed7 Border around the header section
Close #4159
2025-01-05 23:02:52 +09:00
Junegunn Choi 8a71e091a8 Fix '--tmux border-native' 2025-01-04 18:47:00 +09:00
Andreas Auernhammer 120cd7f25a Add border-native option to --tmux flag (#4157)
This commit adds the `border-native` resulting in the following:

```
--tmux[=[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]]
```

By default, when not specified, the `-B` flag is passed to the
`tmux popup-window` command such that no border is drawn around
the tmux popup window.

When the `border-native` option is present, the `-B` flag is omitted
and the popup window is drawn using the border style configured in
the tmux config file.

Fixes #4156

Signed-off-by: Andreas Auernhammer <github@aead.dev>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-01-04 18:30:32 +09:00
Junegunn Choi c2e1861747 Update --help output 2025-01-02 23:54:59 +09:00
Junegunn Choi ee3916be17 Border around the input section (prompt + info)
Close #4154
2025-01-02 16:25:00 +09:00
Junegunn Choi fd513f8af8 Add missing --list-border=* parser
Patch suggested by @bitraid
2024-12-31 19:39:46 +09:00
Junegunn Choi 9a2b7f559c Add --list-border for additional border around the list section
Close #4148
2024-12-31 17:05:14 +09:00
Junegunn Choi ca5e633399 Add toggle-hscroll 2024-12-19 21:05:26 +09:00
Junegunn Choi e60a9a628b Add toggle-multi-line action 2024-12-19 21:05:26 +09:00
Junegunn Choi da9179335c Respect the properties of the currently active preview window options 2024-12-12 13:53:08 +09:00
msabathier bee80a730f Allow walking multiple root directories (#4109)
Co-authored-by: Martin Sabathier <martin.sabathier.ext@corys.fr>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2024-11-25 19:25:30 +09:00
jaydee-coder d4d9b99879 Allow specifying '{n}' as the OFFSET in the preview-window flag (#4079)
* fzf: Allow '{n}' to be used as the OFFSET in the preview-window flag

* man: Document using '{n}' as the OFFSET in the preview-window flag
2024-11-04 22:27:59 +09:00
Junegunn Choi 1a32220ca9 Add --gap option to put empty lines between items 2024-10-01 19:15:17 +09:00
Junegunn Choi 2191a44e36 Redraw/hide scroll offset when 'info' property is changed 2024-09-12 22:04:19 +09:00
Junegunn Choi 952276dc2d Add 'noinfo' option to hide scroll offset information in preview window
fzf --preview 'seq 1000' --preview-window noinfo

Close #2525
2024-09-12 18:31:14 +09:00
Junegunn Choi e0924d27b8 Change default --ellipsis to '··' 2024-08-27 19:41:39 +09:00
Junegunn Choi e215e2daf3 Allow comments in $FZF_DEFAULT_OPTS and $FZF_DEFAULT_OPTS_FILE
Close #3961
2024-08-13 18:51:02 +09:00
Junegunn Choi 587df594b8 Fix incompatibility of adaptive height and 'start:reload'
This command would cause a deadlock and make fzf crash:

  fzf --bind 'start:reload:ls' --height ~100%

Because,

1. 'start' event is handled by Terminal
2. When 'reload' is bound to 'start', fzf avoids starting the initial reader
3. Terminal waits for the initial input to find the right height when
   adaptive height is used
4. Because the initial reader is not started, Terminal never gets the
   initial list
5. No chance to trigger 'start:reload', hence deadlock

This commit fixes the above problem by extracting the reload command
bound to 'start' event and starting the initial reader with that command
instead of letting Terminal start it.

This commit also makes the environment variables available to
$FZF_DEFAULT_COMMAND.

  FZF_DEFAULT_COMMAND='echo $FZF_QUERY' fzf --query foo

Fix #3944
2024-07-27 11:30:25 +09:00
Junegunn Choi 8f4c23f1c4 Remove --walker-path-sep
Related: #3859 #3907 #3909
2024-07-05 20:15:03 +09:00
Junegunn Choi bf515a3d32 Add --walker-path-sep=CHAR to use a different path separator
This is needed when you run a Windows binary on WSL or zsh on Windows
where forward slashes are expected.

  export FZF_DEFAULT_OPTS='--walker-path-sep /'

Close #3859
2024-06-29 17:13:31 +09:00
Junegunn Choi 0420ed4f2a Empty --marker-multi-line if --marker is empty 2024-06-25 20:49:42 +09:00
Junegunn Choi 70bf8bc35d Add --wrap option and 'toggle-wrap' action (#3887)
* `--wrap`
* `--wrap-sign`
* `toggle-wrap`

Close #3619
Close #2236
Close #577
Close #461
2024-06-25 17:08:47 +09:00
Junegunn Choi 5b52833785 Do not start the initial reader if 'reload*' is bound to 'start' 2024-06-24 17:05:53 +09:00
Junegunn Choi c3cc378d89 Allow empty pointer and marker
Close #3879
2024-06-20 01:45:06 +09:00
Junegunn Choi 540632bb9e Add --info-command for customizing the input text
Close #3866
2024-06-20 00:53:18 +09:00
Junegunn Choi e2401aca68 Add 'offset-middle' action 2024-06-17 18:34:10 +09:00
Junegunn Choi 93bbb3032d Add --tail=NUM to limit the number of items to keep in memory 2024-06-04 17:50:46 +09:00
Junegunn Choi e2f93e5a2d --tmux vs. --height: Last one wins 2024-06-01 22:11:15 +09:00
Junegunn Choi 555b0d235b Ignore --height option if it's not supported on the platform
This is to make shell integration work out of the box on Git bash.

  eval "$(fzf --bash)"
  vim <CTRL-T>
    # would print '--height option is currently not supported on this platform'
2024-06-01 14:35:45 +09:00
Junegunn Choi 7aa88aa115 Fix error message on invalid --tmux option
fzf --tmux foobar
  # not a valid integer: foobar
  # ->
  # invalid tmux option: foobar (expected: [center|top|bottom|left|right][,SIZE[%]][,SIZE[%]])
2024-05-31 16:57:35 +09:00
Junegunn Choi 12630b124d Make --tmux argument optional 2024-05-29 02:16:18 +09:00
Junegunn Choi 782de139c8 [vim] Native --tmux fix for Neovim 2024-05-28 19:27:31 +09:00
Junegunn Choi 2f51eb2b41 Different marker for the first and last line of multi-line entries
Can be configured via `--marker-multi-line`
2024-05-27 01:35:05 +09:00
Junegunn Choi 0ccbd79e10 Fix --help output: marker default
Co-authored-by: LangLangBart <92653266+LangLangBart@users.noreply.github.com>
2024-05-26 09:24:30 +09:00
Junegunn Choi 89375005b5 Fix option validation order 2024-05-25 16:23:13 +09:00
Junegunn Choi 7e9a0fcdbd Change default --scroll-off to 3 2024-05-24 19:25:50 +09:00
Junegunn Choi da500a358f Use bold bar as the default marker 2024-05-24 00:31:20 +09:00
Junegunn Choi a90426b7ca Add print(...) action 2024-05-22 22:18:24 +09:00
Junegunn Choi 0cadf70072 Update the summary 2024-05-21 01:57:22 +09:00
Junegunn Choi 076b3d0a9a Embed man page in the binary and show it on 'fzf --man' 2024-05-21 01:06:10 +09:00
Junegunn Choi 7b0c9e04d3 Change default marker 2024-05-20 18:51:52 +09:00