My .vimrc
contains junegunn's implementation of Most Recently Used FZF search:
nmap <Leader><Leader> :FZFMru<CR>
command! FZFMru call fzf#run({
\ 'source': v:oldfiles,
\ 'sink': 'e',
\ 'options': '-m -x +s',
\ 'down': '40%'})
Recently, while this FZF window is open, I find the up and down keys behave strangely. In normal mode I hit <Leader><Leader>
, and the FZF windows opens. Hitting <Up>
, <Down>
, <Left>
or <Right>
switches me into insert mode and types respectively A, B, C or D (upper case). Looking at :map
I don't see that these keys are mapped to anything, in any mode.
What is going on?
Update: it seems like this is connected to the fzf.vim
plugin's using terminal mode - in the floating terminal the arrow keys are mapped to these sequences:
up - "\027[A"
down - "\027[B"
left - "\027[D"
right - "\027[C"
(ie vi-compatible mode, even though within my main Vim session I use set nocompatible
and this isn't an issue.) There is a GitHub discussion here. However, it's very hard to figure out under which conditions this occurs.