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

Re: now swap file when loading file below a certain directory?

Expand Messages
  • David Barnett
    ... I wanted the same thing, only in my case it was when using a very slow filesystem and it s very clear that the above autocmd only makes vim destroy the
    Message 1 of 6 , Aug 3, 2013
      On Friday, September 16, 2011 9:42:51 AM UTC-7, meino....@... wrote:
      > Gary Johnson <gary…@...> [11-09-16 17:26]:
      > > On 2011-09-16, mcc wrote:
      > > > can I instruct vim not to create a swap file, when the original
      > > > file is below a certain directory???
      I wanted the same thing, only in my case it was when using a very slow filesystem and it's very clear that the above autocmd only makes vim destroy the swapfile again after creating it.

      I'd be very interested to see a way to prevent the swapfile from being created in the first place for certain paths. It seems like it's almost possible to disable swap by default and selectively enable it with some jiggering of autocmds, 'swapfile', and 'updatecount', but it's complicated by the fact that 'swapfile' is local-only and there doesn't seem to be any autocmd executed _after_ the buffer is initialized but _before_ the swapfile is created.

      David

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ben Fritz
      ... BufRead might work. But why do you want it before the swapfile is created? Setting swapfile will create it then and there if it s needed. -- -- You
      Message 2 of 6 , Aug 3, 2013
        On Saturday, August 3, 2013 4:30:40 PM UTC-5, David Barnett wrote:
        > On Friday, September 16, 2011 9:42:51 AM UTC-7, meino....@... wrote:
        >
        > > Gary Johnson <gary…@...> [11-09-16 17:26]:
        >
        > > > On 2011-09-16, mcc wrote:
        >
        > > > > can I instruct vim not to create a swap file, when the original
        >
        > > > > file is below a certain directory???
        >
        > I wanted the same thing, only in my case it was when using a very slow filesystem and it's very clear that the above autocmd only makes vim destroy the swapfile again after creating it.
        >
        >
        >
        > I'd be very interested to see a way to prevent the swapfile from being created in the first place for certain paths. It seems like it's almost possible to disable swap by default and selectively enable it with some jiggering of autocmds, 'swapfile', and 'updatecount', but it's complicated by the fact that 'swapfile' is local-only and there doesn't seem to be any autocmd executed _after_ the buffer is initialized but _before_ the swapfile is created.
        >

        BufRead might work. But why do you want it before the swapfile is created? Setting 'swapfile' will create it then and there if it's needed.

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Lech Lorens
        ... Why don t you just put the swap files on a faster filesystem? This can be done by setting dir appropriately. This has the advantage of not littering the
        Message 3 of 6 , Aug 4, 2013
          On Saturday, August 3, 2013 11:30:40 PM UTC+2, David Barnett wrote:
          > On Friday, September 16, 2011 9:42:51 AM UTC-7, meino....@... wrote:
          >
          > > Gary Johnson <gary…@...> [11-09-16 17:26]:
          >
          > > > On 2011-09-16, mcc wrote:
          >
          > > > > can I instruct vim not to create a swap file, when the original
          >
          > > > > file is below a certain directory???
          >
          > I wanted the same thing, only in my case it was when using a very slow filesystem and it's very clear that the above autocmd only makes vim destroy the swapfile again after creating it.
          >
          >
          >
          > I'd be very interested to see a way to prevent the swapfile from being created in the first place for certain paths. It seems like it's almost possible to disable swap by default and selectively enable it with some jiggering of autocmds, 'swapfile', and 'updatecount', but it's complicated by the fact that 'swapfile' is local-only and there doesn't seem to be any autocmd executed _after_ the buffer is initialized but _before_ the swapfile is created.
          >
          >
          >
          > David

          Why don't you just put the swap files on a faster filesystem? This can be done by setting 'dir' appropriately. This has the advantage of not littering the directories with the edited files.

          HTH,
          Lech

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.