Skip to content

Commit 20635e2

Browse files
committed
Fix the <F3> problem on my terminal.
[Problem] For reasons I couldn't find out, when I was inside an Unite buffer (most notorious the buffer explorer one) and I press the <F3> key, a new line containing only the character 'R' was inserted on my document. It turns out that the <F3> key is internally mapped to a combination of keys for vt100 terminals: <ESC>OR This caused, first the Unite buffer to close with the <ESC> key, then a new line was inserted above my current one with the key 'O' and after that the letter 'R' was inserted. [Solution] This is not a solution to the problem itself but it also prevent it from happening. I simple map, only inside an Unite buffer, the sequence of keys that <F3> (<ESC>OR) sends to the same "toggle" command that <F3> originally was supposed to send.
1 parent eea9850 commit 20635e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vimrc

+6-2
Original file line numberDiff line numberDiff line change
@@ -1227,13 +1227,17 @@ nnoremap [unite]g :<C-u>exec "Unite -buffer-name=Grep grep:.::" . expand("<cwo
12271227
nnoremap [unite]G :<C-u>exec "Unite -buffer-name=Grep grep:.::" . expand("<cWORD>")<cr>
12281228
12291229
" Global shortcuts
1230-
nmap <F3> :<C-u>silent Unite -buffer-name=Open\ Buffers -no-start-insert buffer<cr>
1230+
nnoremap <silent> <F3> :<C-u>silent Unite -toggle -buffer-name=Open\ Buffers -no-start-insert buffer<cr>
12311231
12321232

12331233
" Custom mappings for the unite buffer
12341234
autocmd FileType unite call s:unite_settings()
12351235
function! s:unite_settings()
1236-
" nmap <buffer> <F3> <Plug>(unite_all_exit)
1236+
" My terminal keeps giving me trouble with my <F3> key and Unite. For some reason inside an
1237+
" Unite buffer, the <F3> key sends the original terminal vt100 ^[OR combination.
1238+
" So, to prevent <F3> from adding a new line with the letter "R" on it I simply remat the key
1239+
" combination to the original mapping only inside an Unite buffer.
1240+
nnoremap <buffer> <silent> <ESC>OR :<C-u>silent Unite -toggle -buffer-name=Open\ Buffers -no-start-insert buffer<cr>
12371241
" Play nice with supertab
12381242
let b:SuperTabDisabled=1
12391243
endfunction

0 commit comments

Comments
 (0)