Search code examples
vimiterm2

Vim arrow keys not working after accidental iTerm reset


I am using vim (8.0.705) in iTerm2 (build 3.1.5) in MacOSX.

When I accidentally hit cmd-R in the iTerm window (meant to reload a browser window), the terminal gets reset.

From this point the arrow keys in vim are not usable, other commands keep working. What is the reason and how can I re-enable the arrow keys?


Solution

  • Answer 1: :!clear

    Answer 2: Hit Ctrl+A - Ctrl+D to detach screen from your terminal, then run screen -D -R to reattach. This should make your arrow keys work again.

    Answer 3: If you're not in screen, but just in Vim, then you can Ctrl+Z and type fg for the same effect.

    Source: https://superuser.com/questions/800088/why-does-cmd-r-mess-up-vim-on-the-mac-what-is-it-actually-trying-to-do