Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

unix

Sometimes when I edit my file using vi or vim, my file just freezes. Even if I type Ctrl+C or Ctrl+D, it still freezes there. I kill -9 <pid> from another terminal, the pid is killed, but the file still freezes there.

I guess I must have typed some combination of key which I do not know. Does anybody have an idea?

like image 577
user399517 Avatar asked Aug 05 '10 22:08

user399517


People also ask

How do you unfreeze in vi editor?

How to Unfreeze Vi Editor or Unix Terminal? You can unfreeze or resume the terminal using Ctrl+Q.

How do I force quit vi?

If you've made mistakes along the way in your editing and want to back out (abandon) all non-saved changes, enter Command mode by pressing Esc and type :q! This command quits without saving any changes and exits vi.

How do I start vi file?

To Start vi To use vi on a file, type in vi filename. If the file named filename exists, then the first page (or screen) of the file will be displayed; if the file does not exist, then an empty file and screen are created into which you may enter text.

How do I save and exit Vim?

TL;DR – How to Exit Vim If you didn't make any changes, type :q and press Enter / return. If you made some changes and would like to keep them, type :wq and press Enter / return.


1 Answers

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.

like image 184
pra Avatar answered Sep 21 '22 05:09

pra