sometimes my file just freezes in my vi |vim, what happened?

Solution 1:

Ctrl-S is probably the culprit; it stops your screen output in most terminals. As Michael mentioned, you can restore your screen to normal by entering Ctrl-Q.

Theoretically, setting stty -ixon should prevent Ctrl-S from freezing your screen, but it's not working on my local Solaris 10 login.

Solution 2:

Do you happen to use it inside GNU Screen? (As pra points out, this is apparently true even outside screen) It's pretty common to accidentally hit Ctrl+S (xoff), which disables screen painting until you hit Ctrl+Q (xon)

Solution 3:

If Ctrl+S isn't your problem (as in pra's answer) this may help you.

If you've tried to install a bunch of custom plugins using Vundle, sometimes things go awry. You can try to remove these packages manually and see if it helps. Find out where the plugins have been written to - in my case they were all inside the .vim/bundle directory because I used git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim to install Vundle. So once inside the .vim directory you can wipe the entire bundle folder to remove all plugins, and start again, by executing rm -rf bundle.

Hope it helps!