[-vim_use, +vim_dev]

Christian Brabandt wrote:

> > Benjamin Fritz wrote:
> > 
> > > I recently started using Google Drive more extensively at work, and was
> > > happy to be able to edit some text files at home, hoping to see them at
> > > work later.
> > > 
> > > But when my work computer synced, it actually got a new copy of the file
> > > for every time I saved in Vim, probably due to 'backupcopy' creating a new
> > > file and renaming it rather than overwriting the old file:
> > > https://productforums.google.com/d/msg/drive/Yjmkd4nbhw4/WOhRazY3gc8J
> > > 
> > > I THOUGHT I could set 'backupcopy' in a BufRead/BufNewFile autocmd based 
> > > on
> > > the location of the file I'm editing; but actually it looks like it's a
> > > global option. I want to get the benefits of "auto"/"no" documented in
> > > :help 'backupcopy' but I want to make sure my Google Drive docs get
> > > overwritten instead of copied to work around Google being careless with
> > > sync. Is there an easy way to do this? Maybe using BufEnter or 
> > > BufWritePre?
> > > Will I risk bad side effects if I do that?
> > 
> > The 'backupcopy' option should be global-local.  Perhaps someone can
> > make a patch for that?
> 
> I think, the attached patch does it.

Thanks, I'll check it out.

-- 
Fingers not found - Pound head on keyboard to continue.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui