junegunn / fzf.vim

fzf :heart: vim
MIT License
9.59k stars 581 forks source link

Suspend nvim leads to getting stuck in fzf split #600

Open Artem-Schander opened 6 years ago

Artem-Schander commented 6 years ago

I'm often using the ctrl+z combo to suspend vim, but while a fzf split is open this action does not work as expected. The fzf split toggles the result list and behaves like a simple text input. Also it wont let me out. I have to quit the terminal / tmux session.

bildschirmfoto 2018-03-16 um 18 47 21
mulholo commented 5 years ago

Any progress on this?

wren commented 5 years ago

So, after a bit of research, this seems to be a quirk with Terminal mode in NeoVim (https://github.com/neovim/neovim/issues/4895). In that ticket, they mention that <c-\><c-n> gets you out of terminal mode.

I tested a bit, and found that would get me back to normal mode, but the terminal window would stay open and unresponsive. But it turns out that terminal mode can have it's own mappings. So long story short, putting this alias in my vimrc works for me to get out of terminal mode even if I've accidentally ctrl+z fzf and get stuck in the window:

tnoremap <Esc> <C-\><C-n>:q!<CR>

After that, I can suspend an fzf window, and still get back to normal by just pressing esc.

brettbuddin commented 4 years ago

I'm having the same problem in Vim 8.2. <c-\> allows me to kill the fzf process to get out of the situation.