Christian Brabandt wrote:

> On Mon, May 24, 2010 10:06 pm, Bram Moolenaar wrote:
> > I also changed it to put the undofile with the edited file.  That should
> > work, as writing a file usually means the undofile can be written there
> > as well.  It's possible to change this with the 'undodir' option.
> 
> Is this a good idea? Generally I wouldn't mind if I am the only one who
> edits certain files. But what about project directories, that are
> accessed by several people? .<names>.un~ files would accumulate (and
> since I usually have to work on Windows, they will even be visible for
> everybody). This might be a problem for production servers, on which
> only certain files are allowed to be. Well, I guess I have to set
> 'undodir'. (Will it be possible to set 'undodir' only for certain files
> via e.g. autocommands?)

This completely depends on what you are doing.  When a file has been
edited by someone else, using Vim, you can undo his changes.  That can
be very useful.  On the other hand, the undo file will reveal anything
you undid, perhaps things you never wanted others to see.

We probably need to add an example for a BufWritePre autocommand that
only sets 'undofile' for files under your home directory.  Perhaps this
works:

        set noundofile
        au BufWritePre $HOME/* setlocal undofile

Untested!

Another solution would be to always have 'undofile' set and change
'undodir' depending on the file name.

> > Note that despite the checks it might still be possible that the undo
> > information is corruped and changes your text in unexpected ways.  Be
> > careful.
> 
> Yes I have noted that.
> 
> BTW: If the undolevels setting is negative, you won't need to write a
> undo-file, right?

Yes, when there is no undo info the file should not be written.  But an
old file should still be deleted, as it will no longer be valid.

> And secondly using the provided binary, I could not
> successfully read in an undo file. I always get this error message:
> "File contents changed, cannot use undo info"

Hmm, I wonder why.  I hope someone can debug this.

> Oh and for some reason, my vim was killed several times, when I tried
> the vim73 beta. Unfortunately, I am on Windows and did not get any error
> message so I don't know how to debug this. The first time I noticed, was
> when I tried to write a large Textfile. Don't know, if this was related
> to the undo-file settings, which was turned on.

It's the first time I use this compiler.  Not sure if that is related.

> > You can try the self-installing executable:
> >   ftp://ftp.vim.org/pub/vim/unstable/gvim73a.exe
> 
> This should be:
> ftp://ftp.vim.org/pub/vim/unstable/pc/gvim73a.exe

Right.

-- 
I AM THANKFUL...
...for the clothes that fit a little too snug because it
means I have more than enough to eat.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui