I have been using iTerm2 and vim for a while. I have experienced some issues when I needed to use key combinations such as CTRL-F10 and SHIFT-F10 inside a vim session running inside iTerm2. It is straight forward to define key bindings such as <C-F10>
and <S-F10>
for the GUI version of MacVim. No problems there.
However, it proved to be difficult to get the same key combinations in the terminal version of MacVim. I have solved this by using iTerm2's Send Escape Sequence
functionality. Once I have defined CTRL-F10 as [21;5~
and SHIFT-F10 as [21;2~
in my iTerm2 profile, those were now working inside the terminal MacVim without any issues.
Recently, I have hit a new wall, when I decided to add tmux to the equation. I have noticed that those escape sequences are no longer working for a terminal MacVim running inside a tmux pane. That is my problem.
I have been focusing on the Send Hex Code
option, which seems to be working. I tested it with some known hex codes such as 0x04
which is Ctrl-d
and it works. The problem is that I could not find the hex codes for CTRL-F10 and SHIFT-F10.
So the solution is either make tmux receive my escape codes coming from iTerm2 or find the hex codes for the keys that I need to be working inside tmux.