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

RE: Vim :: How To Disable Swap File for FileType

Expand Messages
  • EdwardBeckett
    I change _vimrc to filetype text as a test I.E. set ft=text and the swap file was still being created . However, I disabled my plugins and the autocmd worked
    Message 1 of 4 , Feb 9, 2013

      I change _vimrc to filetype text  as a test I.E. set ft=text and the swap file was still being created … However, I disabled my plugins and the autocmd worked … I’m of the impression there’s a conflict with subsequent filetype settings …

       

      As such I decided on an alternative :: Saving the swaps into a dedicated directory …

       

      IE. set dir=$HOME/_vimswap//,%TEMP%//,/%TMP%//,.

       

      That will work for me …

       

      Thanks Benjamin

       

       

      From: Benjamin Fritz [via VIM] [mailto:[hidden email]]
      Sent: Saturday, February 09, 2013 10:24 PM
      To: EdwardBeckett
      Subject: Re: Vim :: How To Disable Swap File for FileType

       

      On Saturday, February 9, 2013 3:52:52 PM UTC-6, [hidden email] wrote:

      >
      > autocmd FileType text set noswapfile // fails ...
      >

      This should work, the :help for 'swapfile' says:

              When 'swapfile' is reset, the swap file for the current buffer is
              immediately deleted.  When 'swapfile' is set, and 'updatecount' is
              non-zero, a swap file is immediately created.

      Why do you think it's not working?

      Maybe your "text" filetype isn't being detected? I didn't think there was such a filetype by default. What is the value of your filetype option in the file you're worried about?

      --
      --
      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 click here.
      NAML



      View this message in context: RE: Vim :: How To Disable Swap File for FileType
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      --
      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
      ... Please bottom-post. ... This should tell you what the current filetype is and in which script it was set. Vim by default includes this to detect the text
      Message 2 of 4 , Feb 11, 2013
        On Saturday, February 9, 2013 9:43:13 PM UTC-6, edw...@... wrote:
        > I change _vimrc to filetype text  as a test I.E. set ft=text and the swap file was still being created … However, I disabled my plugins and the autocmd worked … I’m of the impression there’s a conflict with subsequent filetype settings …
        >  
        > As such I decided on an alternative :: Saving the swaps into a dedicated directory …
        >  
        > IE. set dir=$HOME/_vimswap//,%TEMP%//,/%TMP%//,.
        >  
        > That will work for me …
        >  
        > Thanks Benjamin
        >  

        Please bottom-post.

        If you suspect further filetype settings are interfering, it's easy enough to figure out where it's being set:

        :verbose set filetype?

        This should tell you what the current filetype is and in which script it was set.

        Vim by default includes this to detect the "text" filetype:

        au BufNewFile,BufRead *.txt,*.text setf text

        What file extension is your text file? Do you have any filetype detection rules to make Vim detect it as such?

        --
        --
        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.