Rey
Rey

Reputation: 3767

I want Vim to be able to save and close similarly to Photoshop in regards to buffers?

This is my issue with Vim: you have it open for a couple of days. You're ready to close vim. You don't necessarily want to save all files... you want to skip any files which don't have modified changes, and you want to be left (or be asked) what you want to do with the remaining buffers with unmodified changes…

For anyone that has used Photoshop, this is very familiar… you use it for a week, and when you close Photoshop, it is really trying to close the application, and skips all files which haven't been touched, let's you chose what you want to do with the remaining files, and then closes itself.

It seems like every time I close Vim, I have to go through this circus of doing :qa, then running into a file, doing :bd!, then doing :qa again, run into a file I want, :w, and it's just a huge pain. There has to be a better way of doing this.

If it isn't already obvious… I have :set hidden in my .vimrc.

Upvotes: 2

Views: 186

Answers (3)

Rey
Rey

Reputation: 3767

I was able to find the plugin BufOnly, and then with the help of someone else on StackOverflow, I got an answer that satisfies me:

https://stackoverflow.com/a/14690570/240287

Upvotes: 0

Ingo Karkat
Ingo Karkat

Reputation: 172698

How about

:confirm qa

It asks you for each modified file whether to save or abandon it (or all remaining). This is the same behavior that GVIM exhibits when you close it via the X in the window title.

Upvotes: 1

Kent
Kent

Reputation: 195219

does :xa! solve your problem ?

:xa[ll]!    Write all changed buffers, even the ones that are readonly,
        and exit Vim.  If there are buffers without a file name or
        which cannot be written for another reason, Vim will not quit.

Upvotes: 0

Related Questions