I’m using split panes in tmux – one being vim, the other being a shell. Sometimes, around once a day, vim freezes. I can move between panes, perform any tmux commands, just vim doesn’t react to anything. This happens only with tmux. My only solution for now is to kill that pane and create a new one.
You might have hit Ctrl+S, which turns off flow control in terminals and stops the terminal from accepting input. It is reenabled by pressing Ctrl+Q.
For me, this turned out to be a gpm problem. Run:
sudo service gym restart
See here for the related bug.
My story involved following
alias doodle='(f=$(mktemp); vim $f; echo $f)' # alias to quick edit a new file with whatever name
Now that I use this alias
diff -u $(doodle) $(doodle) vim said
Vim: Warning: Output is not to a terminal.
After that the terminal froze. Usual keys wouldn't help, e.g. Ctrl+Q, Ctrl-C, etc.
Pressing ZQ helped. It would exit the vim that you stuck in, but whos UI you can't see.
vim needs some flag (not figured out yet which) to show itself on screen when being executed from bach mode.
I hope it helps someone.