Cannot type right curly brace in VIM

keyboardvi

For some reason, I cannot type right curly braces (}) in VIM. On my German keyboard, the shortcuts are <ALT-8> and <ALT-9> for left and right braces, respectively. These work in all applications, except for VIM, which does not recognize <ALT-9>.

I use VIM 8 in iTerm2 on macOS 13.3. There are no plugins installed in VIM. None of the different :*map commands lists anything related to <ALT-9>.

How do I get my right curly brace back into VIM?

Best Answer

While checking the questions from @arcdale's comment, I found that <ALT-9> does not produce a } on the commandline, too. The cause of this was simply that I had mapped the navigation shortcut to switch panes in iTerm to <ALT-Number>. Hence, binding switching panes to another combo solved the problem.

Howvever, this does not explain why there was a problem with <ALT-9>, while all the other combinations, <ALT-5> to <ALT-8>, worked as expected.