Loading ...
Sorry, an error occurred while loading the content.

Re: Backup - always

Expand Messages
  • Yakov Lerner
    ... Try using the autocommand: au BufWrite *.abc,*.def :exe :w! /my/other/dir/ .expand( %:t ) (untested). Alternatively, you can try the savevers plugin:
    Message 1 of 3 , Apr 29, 2007
    • 0 Attachment
      On 4/30/07, Fredrik Gustafsson <iveqy@...> wrote:
      > Hi,
      > I'm looking for a way to always backup certain filetypes. The backup and
      > writebackup options only works if the file exist. I need a backup even
      > if I create a new file (i.e. the new file should be saved at two
      > locations).
      >
      > how do I do that?

      Try using the autocommand:
      au BufWrite *.abc,*.def :exe ":w! /my/other/dir/".expand("%:t")
      (untested).

      Alternatively, you can try the 'savevers' plugin:
      http://www.vim.org/scripts/script.php

      Yakov
    Your message has been successfully submitted and would be delivered to recipients shortly.