Unsaved buffer warning when switching files/buffers

VimText Editor

Vim Problem Overview


I am using FuzzyFinder with Vim to open files and switch between buffers. It works like a charm except when the current file I am working on has some changes. Vim wouldn't let me switch the buffer till I save it:

"E37: No write since last change (add ! to override)".

Is there a way of suppressing this warning unless I am quitting the editor? All I want to do it switch to a different buffer for referencing some code and switch back.

Vim Solutions


Solution 1 - Vim

I think you can use :set hidden.

Solution 2 - Vim

Use the :set hidden option and Vim will hide the buffer until you come back to it.

You can also use :set confirm to deal with the unsaved buffer warning more conveniently.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondeepakgView Question on Stackoverflow
Solution 1 - VimJamesView Answer on Stackoverflow
Solution 2 - Vimtoo much phpView Answer on Stackoverflow