Commit Graph
98 Commits
Author SHA1 Message Date
Junegunn Choi 8a0068127a Add g:fzf_vim.options for fzf options shared by all commands (#1624)
- Key hint footer had no off switch. $FZF_DEFAULT_OPTS could not give one,
  since fzf reads it before the options fzf.vim passes
- Merged ahead of the per-call and command-level options, so both still
  take precedence
- '--no-footer' there hides the hints. Documented as fzf-vim-key-hints,
  the footer had no name to look up
- Help TOC also gained Paste key and Show key, missing since those
  sections were added

Close #1623
2026-09-07 11:39:02 +09:00
Junegunn Choi 88104829b1 Add ctrl-o to show the entry without closing fzf (#1621)
Files, GFiles, GFiles?, Rg/Ag, Buffers, History, Locate, Lines, BLines,
Tags, BTags, Marks, Changes, Commits and BCommits. 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, when the window to open in is not visible, or when
g:fzf_action, the paste key or the command itself already claims the key.

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. BLines, BTags and a lowercase mark carry a
position but no buffer, so the callback carries the buffer the run started
on as well as the window.

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-09-06 10:26:02 +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
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
Junegunn Choi 245eaf8e50 Allow specifying command-level fzf options
Close #1583
2025-03-03 19:35:54 +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
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 503bb6fe9c [Tags] Require readtags from universal-ctags
Close #1540
2024-04-25 20:03:30 +09:00
Junegunn Choi d1016dbd7c [fzf#vim#buffers] Allow users to pass a custom list of buffer numbers
Introducing a global configuration variable may seem easier but this
method is more flexible in that it allows you to define multiple
variations of the command without having to repeatedly setting and
unsetting the variable.

  function! MyBuffers()
    return filter(range(1, bufnr('$')), 'buflisted(v:val) && getbufvar(v:val, "&filetype") != "qf"')
  endfunction

  command! -bar -bang Buffers call fzf#vim#buffers(MyBuffers(), fzf#vim#with_preview({'placeholder': '{1}'}), <bang>0)

Close #831
Close #393
2023-10-14 23:57:35 +09:00
Ivan KovnatskyandJunegunn Choi f3b82091a6 Fix formatting around BLines (#1510)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-10-06 09:11:13 +09:00
Balki 678ee1a549 Replace unicode figure space (U+2007) with regular space (#1507) 2023-09-17 23:52:34 +09:00
Junegunn Choi 937f430ce3 Add :Changes command
Close #1478
Close #1479
2023-09-14 22:45:00 +09:00
jiz4oh 587f55bf50 Use fzf#shellescape instead (#1503) 2023-09-07 11:31:15 +09:00
Junegunn Choi 1be10b0e50 Update README 2023-09-06 00:48:04 +09:00
Junegunn Choi 832a090870 Add option to use location list instead of quickfix list
Close #432
Close #448
Close #846
Close #1095
Close #1500
2023-09-06 00:46:24 +09:00
Nikita Kouevda 5ab282c2f4 doc: Remove broken link to .vimrc (#1499) 2023-09-03 18:20:37 +09:00
Kevin UsheyandJunegunn Choi 5d87ac1fe8 Add :Jumps (#710)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-06-04 16:21:37 +09:00
Junegunn Choi f5ba993af3 Require the latest fzf
It has a crucial fix for fzf#vim#grep2
2023-06-04 15:50:44 +09:00
Junegunn Choi fd812b5710 [fzf#vim#grep[2]] Deprecate has_column argument
The boolean value tells the function if the output of the command
contains column numbers, but we can just see the selected lines if they
contain column numbers.

The argument is now removed from the documentation, and will be silently
ignored for backward compatibility.

Close #1480
2023-06-04 15:49:16 +09:00
Junegunn Choi 87b60bb133 Add :RG command and fzf#vim#grep2 function 2023-06-04 15:27:45 +09:00
Junegunn Choi dc71692255 Update documentation and comments 2023-01-27 10:42:13 +09:00
psyngwandJunegunn Choi bdf48c282a Fix: Windows preview window logic, including git diff preview (#1452)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-01-16 13:41:07 +09:00
Junegunn Choi 9c37e6801b Update RG example 2023-01-08 17:55:48 +09:00
Junegunn Choi 333635e25e Update g:fzf_preview_window example 2022-09-22 17:30:03 +09:00
Junegunn Choi 161da95640 [[B]Commits] Allow tracking changes in the line range
Thanks to @anhpt379

Close #898
Close #1288
2021-05-24 19:38:51 +09:00
Junegunn Choi 708c26aceb Update README 2020-12-14 00:18:01 +09:00
Junegunn Choi 4c9af003e6 Fix typo 2020-12-14 00:14:45 +09:00
Junegunn Choi 54b3817db2 [[B]Commits] Use delta if available 2020-12-14 00:12:22 +09:00
Junegunn Choi 97ec188e07 [GF?] Use delta to format git diff if available
Close #1202
2020-12-12 02:22:21 +09:00
Junegunn Choi ddc377c0d3 Update doc: 0.23.0 or above required 2020-10-22 17:11:09 +09:00
Junegunn Choi 44057cce0e Update g:fzf_preview_window to be a list with optional toggle keys
- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix #1010
2020-10-22 17:02:48 +09:00
Junegunn Choi 4145f53f3d Use native preview scroll of fzf 0.22.0
This allows you to scroll upwards

Fix #1053
Fix #751
Fix #749
2020-08-13 00:14:41 +09:00
Junegunn Choi 7bc8eccf57 Dependencies 2020-07-27 20:47:38 +09:00
Junegunn Choi 3925db8307 Update vim help file 2020-05-06 00:54:32 +09:00
Alexandre PerrinandAlexandre Perrin 25bed070d8 Use -- before the search pattern for Ag, Rg, etc. (#1012)
Before this patch, a search pattern starting with a dash like
`:Rg -bang` would fail (or exhibit the wrong behaviour) because it would
be treated as a option. However, this case is very common when searching
for ->member in a project in C, C++, PHP, etc.

Co-authored-by: Alexandre Perrin <alex@atipik.ch>
2020-05-06 00:53:11 +09:00
Junegunn Choi 2c07630341 Better completion example 2020-05-03 17:36:28 +09:00
Junegunn Choi 5b6f282d97 Update documentation: fuzzy completion functions 2020-05-03 17:24:11 +09:00
Junegunn Choi d4d36b412b Update installation instruction 2020-03-17 14:29:57 +09:00
Junegunn Choi 7ccecee77d Clarification: Files command runs $FZF_DEFAULT_COMMAND
Files is equivalent to running fzf without input pipe; fzf reads the
output of $FZF_DEFAULT_COMMAND

Related: #966
2020-03-17 12:07:37 +09:00
Junegunn Choi 15ed47f561 Add option to globally enable or disable preview window 2020-03-15 16:16:04 +09:00
Junegunn Choi 467c327788 Recommend running ./install --bin on update 2020-02-05 10:37:52 +09:00
Junegunn Choi ee08c8f949 Clarification on 'do' option of Plug statement 2020-02-04 18:28:55 +09:00
Junegunn Choi dc7796a6e2 Simplify the installation instruction 2020-02-04 18:23:53 +09:00
tockn 8a6894d6a5 Fix typo (#914) 2020-01-10 11:51:02 +09:00
Nils ANDRÉ-CHANG 8b778dc642 Remove useless line in autocmd (#924) 2020-01-10 11:48:06 +09:00
Junegunn Choi f71f4808d9 Update examples 2019-12-18 10:08:03 +09:00
Junegunn Choi 6eda9fd38a Revamp README 2019-11-24 19:33:58 +09:00
Junegunn Choi 91ed5f4b39 Fix invalid layout example 2019-06-08 23:29:43 +09:00
Michael Gaffney ac4e7bfb36 Allow 'fzf-vim.txt' to be listed in the LOCAL ADDITIONS section of help.txt (#805)
The first field on the first line of a help file should be a link to the
help file name. (See :h help-writing)
2019-04-29 13:33:16 +09:00
Junegunn Choi b31512e2a2 Fix incorrect fzf_layout example (#769) 2019-02-22 10:54:51 +09:00