When pressing Ctrl-R or Ctrl-T in the Neovim :terminal I have to press two keys (doesn't seem to matter which) before fzf appears. For Ctrl-R it shows `__fzf_history__` in the terminal, while for Ctrl-T the current line is cleared and nothing is shown. Running __fzf_history__ and fzf-file-widget manually has the same behavior. Everything works fine outside Neovim.
I have tried to demonstrate the issue in the following recording: https://asciinema.org/a/9iaer5356x9sct6gyj533lsom
I'm using FZF commit 8ac37d59278209a7aec536f319c26109ef6704eb.
Hi, thanks for the report. It's a known issue of Neovim terminal. See https://github.com/neovim/neovim/issues/4151
Until the issue is fixed (or fzf finds another way to find cursor position), you'll have to disable --height option in Neovim terminal.
[ -n "$NVIM_LISTEN_ADDRESS" ] && export FZF_DEFAULT_OPTS='--no-height'
I'll leave this issue open so that the other Neovim users can see.
/cc @justinmk
@junegunn where should this command be place:
[ -n "$NVIM_LISTEN_ADDRESS" ] && export FZF_DEFAULT_OPTS='--no-height'
within init.vim, or bashrc? Thanks!
That is for bashrc, but come to think of it, it would be simpler to put it in init.vim because terminal buffers are created inside Neovim and will inherit the value.
" Append --no-height
let $FZF_DEFAULT_OPTS .= ' --no-height'
EDIT: Not recommended, see below.
@junegunn: I would like to have this setting entirely in my vimrc, but I run into the issue that whenever I :term, my zshrc runs again and overrides $FZF_DEFAULT_OPTS. Does this work for you?
Ah, yeah it worked for me because I don't set FZF_DEFAULT_OPTS in my .zshrc. You'll have to touch your shell configuration file if that's not the case.
This should be fixed on Neovim HEAD https://github.com/neovim/neovim/issues/4151 .
Cool, thanks for the update.
Most helpful comment
Hi, thanks for the report. It's a known issue of Neovim terminal. See https://github.com/neovim/neovim/issues/4151
Until the issue is fixed (or fzf finds another way to find cursor position), you'll have to disable
--heightoption in Neovim terminal.I'll leave this issue open so that the other Neovim users can see.
/cc @justinmk