Commit Graph
550 Commits
Author SHA1 Message Date
Junegunn Choi cb6ea5e06f Prefer a relative entry over tilde expansion in s:in_dir
Only :History reports a path as '~/...', but every command went through the
same branch, so an entry under a directory literally named '~' resolved to
the home directory and Show opened the wrong file or nothing. Resolve
against the run directory first and fall back to the home reading.
2026-08-26 22:47:46 +09:00
Junegunn Choi 4ae5a659f8 Fold g:fzf_action keys before the show key check
fzf#wrap turns them into --expect, which fzf matches with the same case
folding as a binding, so g:fzf_action = {'CTRL-O': 'split'} slipped past the
check. The footer advertised Show while --expect closed fzf instead.
2026-08-26 22:46:09 +09:00
Junegunn Choi b83a8e5ddd Show a buffer-local entry in the buffer the run started on
BLines, BTags and a lowercase mark carry a position but no buffer, so they
landed wherever the window had got to. The window can leave that buffer
while fzf is open, including through another run's show key, and BLines then
applied its line number to the wrong buffer, clamped to its length.

The callback carries the buffer alongside the window and returns to it
first, or does nothing if it is gone.
2026-08-26 21:25:33 +09:00
Junegunn Choi 091f9c92f9 Withhold the show key from a key the command binds
Setting show_key to a key a command binds for its own hint, ctrl-alt-x on
Buffers or alt-a on Rg, advertised both in the footer while the command's
binding won by coming later in the options. '_hint' entries now carry the
fzf key names behind the label, which is what the check compares, since a
label like 'A-a/d' cannot be.
2026-08-26 20:52:47 +09:00
Junegunn Choi a246483a09 Add ctrl-o to show the entry without closing fzf
Files, GFiles, GFiles?, Rg/Ag, Buffers, History, Locate, Lines, BLines,
Tags, BTags, Marks and Changes. Writes the entry to an fzf#vim#ipc fifo, so
it needs the asynchronous fzf#run from junegunn/fzf@5cb7bab7
(junegunn/fzf#4897, 0.74.4), which the g:loaded_fzf check detects.

Commands declare '_show' for the entry kind and '_hint' for footer keys, so
the footer and the binding cannot disagree. s:can_show withholds both when
the run would block or the window to open in is not visible.

g:fzf_vim.show_key configures the key, empty to turn it off, comma separated
to bind several ('ctrl-o,double-click'). Named for its 'Show' footer label,
since Enter already occupies 'Open' there. Only the first key is labelled,
and a clash on any of them drops all of them, so the footer cannot list a
key that does nothing. Binding Enter drops its 'Open' hint too, since fzf
accepts on Enter rather than through g:fzf_action.

s:show_entry parses each entry the way that command's sink does and runs
win_execute() in the window fzf started from. That keeps the focus in fzf
and works from a popup, which win_gotoid() cannot leave. It opens with
'keepalt keepjumps hide', so stepping through entries leaves the alternate
file and the jumplist unchanged.

fzf#run is asynchronous, so runs can overlap, and a second run would stop
the first's ipc channel and overwrite the script locals its sink reads back
afterwards. Channels are now keyed by fifo path and per-run state is bound
into the callback instead, which is why Buffers, Colors, Jumps, Maps,
Helptags and complete change here.
2026-08-26 18:21:17 +09:00
Junegunn Choi d2a59a992a Use --footer for key binding hints
- Buffers: CTRL-ALT-X replaces SHIFT-DELETE to unload buffers
- History:, History/, Commits: use --scheme=history
- Bump min fzf version to 0.63.0 for --footer
2026-06-12 09:06:10 +09:00
sachit 356608e2ae Show lua colorschemes in :Colors command (#1619) 2026-06-02 11:09:22 +09:00
Junegunn Choi 7fd26e3609 Experiment: Replace '--info inline' with '--info inline-right' (#1617) 2026-05-31 23:41:34 +09:00
Junegunn Choi c2b97c62b9 Add ALT-ENTER to paste selected items into the buffer
- New fzf#vim#paste inserts selections instead of opening them
  - First item after cursor (space-padded), rest on following lines
  - Leading whitespace stripped only when pasting after text
- Commands opt in via `_paste`; key configurable with g:fzf_vim.paste_key
- Skip the key when buffer is not &modifiable
- Per command, paste:
  - path: Files, GFiles, GFiles?, Buffers, History, Locate
  - line text: Lines, BLines, Marks, Changes
  - matched text: Rg, Ag, Grep
  - tag name: Tags, BTags
  - commit hash: Commits, BCommits
2026-05-31 23:26:55 +09:00
Junegunn Choi e5b53de3d3 [Buffers] Allow selecting the current buffer
But place the initial cursor on the second item so quick switching is
still possible as before.
2026-05-24 10:51:04 +09:00
Junegunn Choi 11d44b1805 Make the appearance of History: and History/ consistent 2026-05-24 10:27:28 +09:00
Junegunn Choi b9b98ac574 Commands: Fix quotation mistake 2026-05-21 20:35:33 +09:00
Junegunn Choi 31e338e314 Buffers: SHIFT-DELETE to unload buffers
Close #75
Close #733
2026-05-21 19:04:45 +09:00
Junegunn Choi 28ed21ef3e Some facelift 2026-05-21 19:00:40 +09:00
Junegunn Choi b9624aa012 Do not display statusline when fzf is running in a floating window
Related: #1615
2026-04-10 21:30:27 +09:00
Junegunn Choi 34a564c81f Update README 2026-02-02 09:42:52 +09:00
Enno ddc14a6a54 Avoid cooked terminal mode (#1604)
as `:help system()` states

		When prepended by |:silent| the terminal will not be set to
		cooked mode.  This is meant to be used for commands that do
		not need the user to type.  It avoids stray characters showing
		up on the screen which require |CTRL-L| to remove. >
			:silent let f = system('ls *.vim')
2025-12-09 08:49:13 +09:00
Junegunn Choi 879db51d09 Update README.md 2025-09-03 09:59:37 +09:00
phanium 3725f364cc Fix cmd hisotry correctly (#1594) 2025-06-20 17:04:48 +09:00
Junegunn Choi 98dcd77a18 Fix dictionary alignments 2025-06-08 10:51:25 +09:00
Scott LaiandJunegunn Choi a2ed9fb885 Add :BMarks command (#1593)
And allow passing arguments of :marks to :Marks command. Close #1158.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-06-08 10:48:17 +09:00
Max Coplan 3ed6ac56d0 feat(preview): teach preview.sh to print directories (#1590) 2025-05-24 19:00:23 +09:00
Mo-tmd 3cb44a8ba5 Add workaround for normal! bug in nvim terminals (#1588)
There's a known issue regarding `normal` usage in neovim. See
https://github.com/neovim/neovim/issues/4895 for more details.

As a temporary workaround, use setpos to set the
bookmark instead.
2025-04-16 07:58:52 +09:00
Junegunn Choi 1fff637559 Use FugitiveWorkTree() to find the git root
Fix #1586
2025-03-21 17:31:10 +09:00
Junegunn Choi 245eaf8e50 Allow specifying command-level fzf options
Close #1583
2025-03-03 19:35:54 +09:00
Simon Désaulniers f06bd1e69b autoload/fzf: don't user fzf#shellescape in favor of shellescape (#1582)
fzf#shellescape should only be used when building commands that fzf will run.
2025-02-22 10:41:20 +09:00
Junegunn Choi 6cda389bde Update README 2025-02-02 23:27:53 +09:00
Junegunn Choi b3a49d7993 Apply --scheme=path where appropriate
See https://github.com/junegunn/fzf/pull/4192
2025-01-30 00:26:53 +09:00
Junegunn Choi 80d1cc2e68 Clean up scroll offset expression 2025-01-30 00:19:58 +09:00
Junegunn Choi 556f45e79a Use --gap option for rendering g:fzf_vim.grep_multi_line = 2+
Requires fzf 0.56.0

https://github.com/junegunn/fzf/releases/tag/v0.56.0
2024-10-29 14:09:47 +09:00
Junegunn Choi ec75ffbfd5 [Ag/Rg] Fix quickfix list when multi-line mode is enabled
Fix #1568
2024-10-01 18:40:44 +09:00
Junegunn Choi c5ce7908ee Require fzf 0.53.0 or above with --tmux
Close https://github.com/junegunn/fzf/issues/3980
2024-08-28 13:44:08 +09:00
Junegunn Choi 04bfa81157 [Colors] Change color scheme on the fly (experimental) 2024-08-24 16:10:24 +09:00
Junegunn Choi 6f28c8c7bb [Tags] Fix preview on Vim 9.1
Fix #1555
2024-08-01 15:20:41 +09:00
Junegunn Choi f7c7b44764 Rename issue template file 2024-07-19 21:54:33 +09:00
Junegunn Choi 0337b09394 Update issue template 2024-07-19 21:49:07 +09:00
Junegunn Choi 8f3846f968 Show how to download the latest binary in ISSUE_TEMPLATE.md 2024-07-19 21:42:56 +09:00
zzmandJunegunn Choi 3e2ed513d4 [Jumps] Support preview window (#1553)
Require fzf 0.54.0 or above

Signed-off-by: zeminzhou <zhouzemin@pingcap.cn>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2024-07-19 21:39:44 +09:00
Junegunn Choi 279e1ec068 [fzf#vim#grep / Ag / Rg / RG] Multi-line display for narrow screens (#1549) 2024-06-07 08:38:27 +09:00
ykhan21 0a80e43f90 Fix environment variable reference (#1546) 2024-05-26 09:21:13 +09:00
Junegunn Choi 47077d0b17 Fix missing quote
Thanks @arekt
2024-05-25 17:02:44 +09:00
ykhan21 42507c3bea Add scoop_git_bash to Windows bash candidates (#1545) 2024-05-25 14:38:13 +09:00
Junegunn Choi 19de6507ff Fix Ag/Rg sink for win32unix (git bash, mintty) 2024-05-23 21:38:15 +09:00
Felix Endres 08dcd814a9 Improve :BCommits Preview (#1525)
Reduce the preview of :BCommits to the relevant part, when used with visual selection.
Only show the part of the diff that belongs to the selection.

That makes it very easy to quickly follow the evolution of a code block.
2024-05-23 12:56:13 +09:00
Junegunn Choi 71b0e0fb94 [Changes] Fix 'List index out of range: 0' error
Ignore change item that points to a non-existent line
2024-05-17 21:48:08 +09:00
Junegunn Choi 3656cbb9ef [preview.sh] Rename $BATNAME to $BATCAT (#1457) 2024-05-14 17:54:37 +09:00
Junegunn Choi 61edb0ca42 [preview.sh] Use $BATNAME if defined
Close #1457
2024-05-14 17:52:23 +09:00
Junegunn Choi a50c2640b9 Fix Commands and Windows on Windows
Use tab character with --tabstop=1 instead of non-breaking space

Fix #1542
2024-05-14 17:39:29 +09:00
Junegunn Choi d91dd754a9 [preview.sh] Fix handling of backslashes in paths on Windows 2024-05-14 09:34:55 +09:00
Junegunn Choi 99093bd103 [RG] Use 'cd .' as the dummy command on Windows 2024-05-08 00:06:01 +09:00