Re: pressing saves the editing file without the possibility to undo
On 26/05/09 19:03, Matt Wozniski wrote:
> 'hidden' is definitely an option that I would recommend that everyone
> set in his vimrc.
I wouldn't. I don't like having hidden, maybe unsaved, files, that
aren't displayed in a window. Personally I set 'autowriteall', and it
makes my editing more pleasant, but I wouldn't recommend that to
everyone either: what this option does is save the file rather than hide
it or |abandon| it. The alternative, with none of 'hidden', 'autowrite'
or 'autowriteall', is the default behaviour: if you try to "abandon" a
window which contains a modified file, and your ex-command doesn't end
in an exclamation mark, Vim will protest and refuse to close the window.
You can then decide whether to save the file (e.g. by using :wq or :x
rather than :q, or :w|e foobar rather than :e foobar), or not (:q! or
:e! foobar), before closing the window or reusing it for a different file.
What I would certainly _not_ recommend is forcing the help window to
close all other windows, as the OP found that his after-plugin did: that
would defeat the |+windows| feature of Vim: imagine a Vim version where
you can open split-windows with no problem _but_ they all disappear if
you use the help? The mere notion makes me shudder.
Rather, I use the following to have the help window (if any) positiopned
more or less "predictably" (i.e. always at the bottom, unless of course
I later open a new split-window under it):
" open help window at bottom unless :help typed in full
if version < 700
cnoreabbrev h bot h
cnoreabbrev <expr> h
\ ((getcmdtype() == ':' && getcmdpos() <= 2)? 'bot h' : 'h')
map <F1> :bot help<CR>
It is illegal to drive more than two thousand sheep down Hollywood
Boulevard at one time.
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php