Foreword
I use UltiSnips and have the following definitions in my .vimrc
file
let g:UltiSnipsExpandTrigger="<F8>"
let g:UltiSnipsJumpForwardTrigger="<F8>"
let g:UltiSnipsJumpBackwardTrigger="<S-F8>"
The problem
The third definition doesn't work; the strange behavior I witness is that ⇧+F8 switches the case of the letter under the cursor and that after it and move to the next char just as I had hit 2~ in normal mode.
Troubleshooting
Mindful of another strange keyboard behavior I experienced in the bash with fzf, I decided to investigate which escape sequence is sent when I press (shifted) function keys, by issuing them in the terminal prepended by ⇧+V.
What I "discovered" is that ⇧+F8 sends ^[[32~
, which is the same escape sequence sent by Esc[32~, which indeed does the following:
- Esc exits UltiSnips' select mode, thus returning to normal mode
- [3 do nothing since the latter "kills" the former, which doesn't expect a digit after it
- 2~ switch the case of under-cursor and immediately-after-cursor letters and moves to next character
which is what I see happening everytime.
Furthermore, I've checked that function keys from F1 to F4 send ^[[11~ ^[[12~ ^[[13~ ^[[14~
whereas combinations from ⇧+F1 to ⇧+F4 send ^[[23~ ^[[24~ ^[[25~ ^[[26~
; based on these escape sequences I'd expect all these keys to misbehave (in the same way too, except for the count), but they don't!
Of the aforementioned 8 combinations, only ⇧+F3 switches the case of the following 5 letters (as the ^[[5~
escape sequence implies), and the others do nothing (they don't even exit the select mode!).
Info
I use URxvt, $TERM
is rxvt-unicode-256color
and Vim version is 8.1.
Related question(s) and pages
The first time I had this problem was long ago and I searched for an answer already; since then I've forgotted I had found a related (actually exactly the same) question but it was and is still unanswered (maybe this is way I've forgotten it).
Here is a related wikipage.
Here is a related issue on GitHub.
:set <s-f8>=^[[32~
? to type this, type:set <s-f8>=
then press ctrl-v shift-f8. this should make<s-f8>
work properly:set <s-f8>=^[[32~
does exactly what is already done. But it's clearly not the case, since your answer works!