Vim - How can I stop :bn and :bp from saying "No write since last change"?
I'm using vim quite extensively for editing code segments.
Two of the most common commands I use are :bn (next buffer) and :bp (previous buffer).
However, using :bn, navigating away from a file I'm editing, shows the message "No write since last change (add ! to override)", and only :bn! or :w and then :bn works.
I know there's a way to stop this from happening - probably something in the .vimrc file...
Does anyone know what I can do?
Either of those will eliminate the problem.
I used this way (autowrite) for a few months,
but it wasn't perfect for me - because when working with code (especially scripting languages such as python), saving open buffers in mid-work is dangerous (for example, if I have a cron that runs my code, and I'm in the middle of editing it, I might get syntax errors, name errors, etc.).
Now I've found a far better option, for me:
:set hidden (Saves all open buffers in the background, instead of closing them and re-opening on demand)
in conjunction with (the default, on my machine at-least):
:set confirm (Demands confirmation before closing unsaved buffers)
Credit must be given to all the commentators here.
Hope this helps others... :)
|All times are GMT -5. The time now is 04:49 AM.|