bufstop icon indicating copy to clipboard operation
bufstop copied to clipboard

Problem with arrow keys, spuriously enters insert mode & modifies another buffer

Open poetaman opened this issue 3 years ago • 2 comments

Pressing arrow keys takes me out of the Bufstop window, and even worse it starts insert mode and inserts one of: A/B/C/D for respective: <Up><Down><Left><Right>. I have never encountered this with any other buffer/mode combination in my terminal. I like the rest of the UI.

poetaman avatar Jan 28 '21 12:01 poetaman

The issue happens because the plugin remaps the <Esc> key, which is also used as a control character by terminals. For example, <down> is being sent as <Esc>OB (this depends on the terminal). Because <Esc> is remapped, Vim no longer recognizes the sequence and only executes OB, which basically means open another line and write B.

I am trying to find a solution, but in the meantime you can use the configuration option g:BufstopDismissKey. Add this to your vimrc:

let g:BufstopDismissKey = "<Esc><Esc>"

This resolves the arrow keys issue but now you need to double press Esc to close the Bufstop window. You can also use another key or combination:

let g:BufstopDismissKey = "<Tab>"

mihaifm avatar Jan 28 '21 18:01 mihaifm

@mihaifm Thanks, for now I am using the <Tab> key!

poetaman avatar Jan 29 '21 08:01 poetaman