Hi,
Is there a way to force FZF to open a tmux split in Neovim? I have mapped exit from terminal to <esc><esc> plus Neovim changes the size of buffes every time which is pretty annoying.
So I think I'd rather have it in Tmux as it was in Vim, but I can't seem to find a way to do it. Thanks.
I have mapped exit from terminal to
You could do a buffer-local :tnoremap mapping for fzf, I think, which maps a single <esc> to quit fzf.
@junegunn It might be a good idea to setf fzf in the Neovim terminal buffer so that users can do customization (or is there some equivalent event already?).
Neovim changes the size of buffes every time
It changes them permanently, or only while fzf is showing?
Thanks @justinmk , any details on how to do the local terminal mapping? I would need some help here.
Each time FZF opens it shifts horizontal splits up. so after a while if I have quickfix and whatnot my work buffer shrinks up to a single line, then I do 'Ctrl-W-o` and start over.
@firedev If the setf fzf suggestion is accepted the configuration would look like this:
au FileType fzf tnoremap <buffer> <esc> [command to quit fzf/terminal]
if I have quickfix and whatnot my work buffer shrinks up to a single line,
You're right, I never noticed that because I usually don't have more than 1 horizontal split (and I am not fastidious about windows staying the same size, I slap them around as needed). Looks like this is another case for providing an API to save the window layout.
@justinmk Thanks, however it looks like there is no FileType fzf. It opens a new terminal window and filetype is empty for it.
For some reason, neovim pane becomes blank while I'm running :call system('echo hello | fzf-tmux'), and :!fzf doesn't work on neovim. :!fzf-tmux might work, but it doesn't work nicely on ordinary vim. So terminal is the only sane option.
setf fzf sounds nice. Currently fzf.vim project sets statusline on TermOpen. See: https://github.com/junegunn/fzf.vim/blob/master/plugin/fzf.vim#L104
@junegunn system() cannot run interactive commands in Neovim.
@justinmk Yeah, but fzf-tmux opens a new pane and all the interactivity will happen there.
Sorry guys, I can't seem to make it work. I mean any commands I add are just being typed into FZF prompt. I press <esc> then it waits a second and types whatever is after <esc> straight to FZF.
@firedev I verified that this works:
:au FileType fzf tnoremap <nowait><buffer> <esc> <c-g>
<nowait> will ignore all other <esc>-prefixed mappings while you are in "fzf mode"<c-g> is one of way exiting fzf, another way would be <c-c> and maybe others.Thank you! Feels great so far.
Most helpful comment
@firedev I verified that this works:
<nowait>will ignore all other<esc>-prefixed mappings while you are in "fzf mode"<c-g>is one of way exiting fzf, another way would be<c-c>and maybe others.