Oni: Wired behavior when use fzf

Created on 29 Dec 2017  路  5Comments  路  Source: onivim/oni

When use fzf.vim, it should exist the window when I use Esc, which works within terminal neovim, but not oni. The window does not closed.

Most helpful comment

@meijieru, seems the default init.vim config that ships with oni includes the following line tnoremap <Esc> <C-\><C-n> which should allow the esc key to act like esc in other buffers, the issue here I think is that this means it overwrites the fzf specific binding for closing the buffer (which is actually a terminal buffer, which fzf switched to a while ago).

An alternative solution if you want the default config (although if you have your own init.vim you might not want or need it is) explicilty map esc for fzf heres what i use

if exists('g:gui_oni')
  au FileType fzf tnoremap <nowait><buffer> <esc> <c-g> "Close FZF in neovim with esc
endif

I believe this is what fzf uses under the hood.

All 5 comments

This does not happen if I disable the default config.

@meijieru, seems the default init.vim config that ships with oni includes the following line tnoremap <Esc> <C-\><C-n> which should allow the esc key to act like esc in other buffers, the issue here I think is that this means it overwrites the fzf specific binding for closing the buffer (which is actually a terminal buffer, which fzf switched to a while ago).

An alternative solution if you want the default config (although if you have your own init.vim you might not want or need it is) explicilty map esc for fzf heres what i use

if exists('g:gui_oni')
  au FileType fzf tnoremap <nowait><buffer> <esc> <c-g> "Close FZF in neovim with esc
endif

I believe this is what fzf uses under the hood.

@Akin909 Thanks, I disable the default config, and enable some features I like. It works well now.

Good call @Akin909 ! I wonder if we should just scrap our tnoremap <Esc> binding? I know it caused some problems for others, too. Would be in line with the minimization effort in #973 , too.

@bryphe I think its well intentioned and would be quite helpful for new users of vim but almost certainly going to cause unpredictable mapping conflicts for experienced vim users. That being said I've seen that mapping dozens of times trawling around other vim users configs I think its a fairly standard thing for neovim users to map, plus vim users are more likely to turn off the default config.

The fzf issue will definitely come up again with the mapping in place so its a toss up I think, in this case I personally am in favour of leaving it as new user's would really benefit. I spent ages trying to figure how to get out of :term when I switched to neovim and absolutely gave up with vim's new term for a similar reason.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bryphe picture bryphe  路  29Comments

bryphe picture bryphe  路  19Comments

badosu picture badosu  路  19Comments

rococode picture rococode  路  20Comments

rektrex picture rektrex  路  18Comments