1827781 Members
2572 Online
109969 Solutions
New Discussion

vim screw-up

 
Tom Dawson
Regular Advisor

vim screw-up

Hi,

Yesterday, I was editing away in vim, and I inadvertently hit some keystrokes that are causing me a headache. Now, whenever I enter ":w" to save changes, I get prompted with the following:

WARNING: The file has been changed since reading it!!!
Do you really want to write to it (y/n)? y
Hit ENTER or type command to continue

The file being edited is write-enabled.

I think I may have been trying to do a search for "set", and inadvertently entered a set sequence that is causing the problem. But I'm clueless as to what it may be.

If I enter ":set" now, this is what the options are set to:

--- Options ---
backspace=2 helplang=en ruler viminfo='20,"50
cscopetag history=50 ttyfast t_Sb=^[[4%dm
cscopeverbose hlsearch ttymouse=xterm t_Sf=^[[3%dm
cscopeprg=/usr/bin/cscope
fileencoding=utf-8
fileencodings=utf-8,latin1
formatoptions=tcql

Does anyone have a clue as to what is causing me to get prompted everytime I try to save changes in a file?

TIA,
Tom
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: vim screw-up

You may have a copy of the file, usually .filename.swp sitting out there. Try deleteing the .swp files whre you are working.

Is it possible someone else is trying to edit the file?

Perhaps copy the vim settings back in from another machine where it functions correctly.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tom Dawson
Regular Advisor

Re: vim screw-up

Steven,

Thanks!

There are no *.swp files. No one else is editing the file(s).

I have another Linux machine at home. I'll get the "set options" from it tonight and try to load them tomorrow.

Thanks,
Tom
Tom Dawson
Regular Advisor

Re: vim screw-up

Well duh...

I implemented the Windoze fix. I rebooted and everything is back to normal.
Tom Dawson
Regular Advisor

Re: vim screw-up

As mentioned above, the reboot seems to have rectified the problem.