Resize FZF window when vim resizes
Checklist
- [x] I have fzf 0.54.0 or later
- [x] I have searched through the existing issues
Output of :echo system(fzf#exec() .. ' --version')
0.65.1 (e5cd7f0a)
OS
- [ ] Linux
- [x] macOS
- [ ] Windows
- [ ] Etc.
Problem / Steps to reproduce
I use vim inside tmux. Often, I want to find uses of some function. When I :Rg, sometimes the results get cut off so much that they're not helpful. I maximize the tmux pane, but the fzf window doesn't resize, so I have to relaunch it and type my search again. This is annoying. See video:
https://github.com/user-attachments/assets/a20a1ad3-f896-49d3-a89c-890eec8188ca
Desired solution: when vim resizes, the fzf panes should redraw and fill the newly available space.
I'm not sure if Vim provides an API to resize a popup window. If it doesn't, we're out of luck.
A better option I think (which I use) is to make fzf start in a tmux popup instead of a vim popup, so it can be larger than the current pane, by setting g:fzf_layout option like this:
if exists('$TMUX')
let g:fzf_layout = { 'tmux': '90%,60%' }
endif
(reference: https://github.com/junegunn/fzf/blob/master/README-VIM.md#starting-fzf-in-a-popup-window)
Oh, thank you! Switching over to using this.