My putty session keeps on hanging when I'm in the middle of editing a file in vim. This has happened three times this morning. Hopefully it's nothing, just a glitch in the matrix somewhere, but I fear it means disk/memory problems on my server. What should I try to debug this? Has happened in insert mode each time, and the cursor won't respond to any keyboard or mouse input.

I've changed nothing on my server recently, and not done any updates. Everything was working fine yesterday (and indeed has for a long time).

Centos 6, by the way.

Doesn't happen until I get into vim, go into insert mode, and make a couple of tiny changes. ONLY appears to happen on one specific file. And no, not a system file or anything, just a php file in my site.



Try using vi instead on the same file. This would be an easy way to determine if it's an issue with the program, file or something else.

  • vi appears to work fine. I tried setting vim to do some logging, but it doesn't show anything useful - in fact the log dies in the middle of an innocuous line: Searching for "syntax/sql.vim" in "/root/.vim,/usr/share/vim/vimfiles,/usr/shar (it should go on to say e/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/root/.vim/after". So something's killing it bad enough that the log dies mid line... (and since sql.vim is searched/loaded for other files that I can edit fine, I don't feel the problem lies with that) – Codemonkey May 4 '16 at 11:07
  • Are you working on a large file, or scrolling a lot of text? – ewwhite May 4 '16 at 11:08
  • Not at all, 720 lines, and the edit I'm trying to make is just a few lines from the bottom of the file. I can navigate around the file absolutely fine, but as soon as I make that edit (just adding a couple of carriage returns), it dies. I copied the file to a new location with a new name, and get the same problem with that file! – Codemonkey May 4 '16 at 11:14
  • Are you connected over SSH? – ewwhite May 4 '16 at 11:16
  • Yep, and always have been. Never had a problem like this before. Now that I've made some changes in vi, it seems that vim is perfectly happy with the file again. Still crashes on the duplicate that I made though. – Codemonkey May 4 '16 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.