There are times when I'm working on a temporary buffer, and I want to do something like a `gf' (go to file), but Vim insists that the buffer is modified and refuses to abandon the file. You can get around this by telling Vim the file isn't modified.
:set hidden
This effectively makes Vim treat the file like it's already saved. Please avoid using this for any production files as it can make Vim think that the file on disk is different than it actually is.
Subscribe to:
Post Comments (Atom)
5 comments:
Or you could "set hidden" in your vimrc to allow vim to hide modified buffers.
Thus the reason I started this blog... to learn from the community ;-).
you could also use a scratch buffer... there are a bunch of plugins on vim.org to handle them but all you really need to do is set these options: http://vim.pastey.net/107112
Easy enough to make your own :Scratch command
I think you should update the post with the 'set hidden' method. It is much preferred and in fact recommendeded as a default for all users by the #vim IRC channel.
Updated based on reader feedback. Thanks guys.
Post a Comment