Sometimes it happens that Vim freezes / gets stuck / doesn’t react and you might wonder what is going on.
Recently, I figured out that this happens for me when I accidentally pressed
Ctrl + S.
It turns out that this is an old legacy features back from the slow days of computing where ressources were really scarce and you sometimes wanted to freeze the output of one program to help with your ressources.
It is not even a Vim feature, but rather a feature of your terminal.
Try this in a bash:
for ((i=1;i<=100;i++)); do echo $i; sleep 1; done and then press
Ctrl + S - the program hangs.
Now here comes the good part: you can easily resume again - both in Vim and the bash - by pressing
Ctrl + Q.
Even better: Add this snippet
stty -ixon # Don't hang on Ctrl+S in terminals to your
.bashrc file to disable the function altogether.
comments powered by Disqus