Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a bad habit of leaving a vim session running in one of many, many consoles I have open. Then at some later point, I'll want to edit that file and get the familiar complaint about it being edited somewhere else and have to tab through many consoles to find it. Is there some clever way to have vim exit automatically if there are no changes to the open files and it's been inactive for x minutes? I'm on linux and would be willing to use a different terminal program to get something like this working.

share|improve this question

1 Answer 1

The most productive solution would be to not have multiple instances of vim running in seperate consoles, but to familiarize yourself with the various possibilities of having multiple files open in a single vim session. I've shirked that issue for a long time myself, but once I got the hang of it, I found it to be a distinctive boost to my productivity (and terminal efficiency, too).

Check :help windows, :help tabs, and :help split.

Edit: More to the point of your original request of closing a vim session after inactivity: An external tool would still have to signal vim to properly save / close the file, so changes get saved / the .swp file removed. So, if there indeed is such a solution, it should probably come in the form of a vim plugin. But I know of no such plugin, and couldn't find one ad-hoc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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