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

How to disable swapfile when editing a directory?

Expand Messages
  • anhnmncb
    As title, and I don t think it s very useful when editing a directory. -- Regards, anhnmncb gpg key: 44A31344
    Message 1 of 16 , Nov 23, 2008
      As title, and I don't think it's very useful when editing a directory.
      --
      Regards,

      anhnmncb
      gpg key: 44A31344

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... When editing a directory, the netrw plugin uses :setlocal noswapfile , so you don t need to do anything, the swapfile is already disabled on that
      Message 2 of 16 , Nov 23, 2008
        On 24/11/08 04:52, anhnmncb wrote:
        > As title, and I don't think it's very useful when editing a directory.

        When editing a directory, the netrw plugin uses ":setlocal noswapfile",
        so you don't need to do anything, the swapfile is already disabled on
        that directory.

        See, however, ":help g:netrw_use_noswf", which tells you how to _enable_
        swapfiles for directory buffers.


        Best regards,
        Tony.
        --
        You cannot propel yourself forward by patting yourself on the back.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • anhnmncb
        ... Why I still find that vim produces a _.swp file in dir that editing? ... -- Regards, anhnmncb gpg key: 44A31344
        Message 3 of 16 , Nov 23, 2008
          Tony Mechelynck <antoine.mechelynck@...> writes:

          > On 24/11/08 04:52, anhnmncb wrote:
          >> As title, and I don't think it's very useful when editing a directory.
          >
          > When editing a directory, the netrw plugin uses ":setlocal noswapfile",
          > so you don't need to do anything, the swapfile is already disabled on
          > that directory.

          Why I still find that vim produces a _.swp file in dir that editing?
          >
          > See, however, ":help g:netrw_use_noswf", which tells you how to _enable_
          > swapfiles for directory buffers.
          >
          >
          > Best regards,
          > Tony.

          --
          Regards,

          anhnmncb
          gpg key: 44A31344

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... I don t -- while editing my home directory, ls -l ~/.sw* does list four files, but the most recent of them dates from more than a month ago. You might
          Message 4 of 16 , Nov 24, 2008
            On 24/11/08 08:44, anhnmncb wrote:
            > Tony Mechelynck<antoine.mechelynck@...> writes:
            >
            >> On 24/11/08 04:52, anhnmncb wrote:
            >>> As title, and I don't think it's very useful when editing a directory.
            >> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
            >> so you don't need to do anything, the swapfile is already disabled on
            >> that directory.
            >
            > Why I still find that vim produces a _.swp file in dir that editing?

            I don't -- while editing my home directory, "ls -l ~/.sw*" does list
            four files, but the most recent of them dates from more than a month ago.

            You might create a swapfile (with no filename in its name) when you edit
            a [No Name] file; then that swapfile will remain if Vim crashes or gets
            killed.

            >> See, however, ":help g:netrw_use_noswf", which tells you how to _enable_
            >> swapfiles for directory buffers.
            >>
            >>
            >> Best regards,
            >> Tony.
            >
            --
            Procrastinators do it tomorrow.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • anhnmncb
            ... Here generates _.swo and _.swp, I m sure the dir hasn t these files before I edit it. btw. my gvim version is official 7.2 for windows. -- Regards,
            Message 5 of 16 , Nov 24, 2008
              Tony Mechelynck <antoine.mechelynck@...> writes:

              > On 24/11/08 08:44, anhnmncb wrote:
              >> Tony Mechelynck<antoine.mechelynck@...> writes:
              >>
              >>> On 24/11/08 04:52, anhnmncb wrote:
              >>>> As title, and I don't think it's very useful when editing a directory.
              >>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
              >>> so you don't need to do anything, the swapfile is already disabled on
              >>> that directory.
              >>
              >> Why I still find that vim produces a _.swp file in dir that editing?
              >
              > I don't -- while editing my home directory, "ls -l ~/.sw*" does list
              > four files, but the most recent of them dates from more than a month ago.
              >
              > You might create a swapfile (with no filename in its name) when you edit
              > a [No Name] file; then that swapfile will remain if Vim crashes or gets
              > killed.

              Here generates _.swo and _.swp, I'm sure the dir hasn't these files
              before I edit it.

              btw. my gvim version is official 7.2 for windows.

              --
              Regards,

              anhnmncb
              gpg key: 44A31344

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Tony Mechelynck
              ... Mine is 7.2.049 for Linux (compiled from official sources, official patches 1-49, and one unofficial patch which is about floating point functions), Huge
              Message 6 of 16 , Nov 24, 2008
                On 24/11/08 10:57, anhnmncb wrote:
                > Tony Mechelynck<antoine.mechelynck@...> writes:
                >
                >> On 24/11/08 08:44, anhnmncb wrote:
                >>> Tony Mechelynck<antoine.mechelynck@...> writes:
                >>>
                >>>> On 24/11/08 04:52, anhnmncb wrote:
                >>>>> As title, and I don't think it's very useful when editing a directory.
                >>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                >>>> so you don't need to do anything, the swapfile is already disabled on
                >>>> that directory.
                >>> Why I still find that vim produces a _.swp file in dir that editing?
                >> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                >> four files, but the most recent of them dates from more than a month ago.
                >>
                >> You might create a swapfile (with no filename in its name) when you edit
                >> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                >> killed.
                >
                > Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                > before I edit it.
                >
                > btw. my gvim version is official 7.2 for windows.
                >

                Mine is 7.2.049 for Linux (compiled from official sources, official
                patches 1-49, and one unofficial patch which is about floating point
                functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                but not MzScheme, etc. etc. etc.

                I suppose that the fact that mine generates .swp, .swo, etc., rather
                than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                on Linux and you're on Windows.

                Are you sure you aren't currently editing a [No Name] buffer (possibly
                as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                help you. Look for buffers with a (active) or h (hidden) left of their name.


                Best regards,
                Tony.
                --
                You know you have a small apartment when Rice Krispies echo.
                -- S. Rickly Christian

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Ben Schmidt
                ... You can find out what those swap files are by navigating to that directory in cmd and doing vim -r to get a list (not all that helpful) or vim -r _.swp
                Message 7 of 16 , Nov 24, 2008
                  Tony Mechelynck wrote:
                  > On 24/11/08 10:57, anhnmncb wrote:
                  >> Tony Mechelynck<antoine.mechelynck@...> writes:
                  >>
                  >>> On 24/11/08 08:44, anhnmncb wrote:
                  >>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                  >>>>
                  >>>>> On 24/11/08 04:52, anhnmncb wrote:
                  >>>>>> As title, and I don't think it's very useful when editing a directory.
                  >>>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                  >>>>> so you don't need to do anything, the swapfile is already disabled on
                  >>>>> that directory.
                  >>>> Why I still find that vim produces a _.swp file in dir that editing?
                  >>> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                  >>> four files, but the most recent of them dates from more than a month ago.
                  >>>
                  >>> You might create a swapfile (with no filename in its name) when you edit
                  >>> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                  >>> killed.
                  >> Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                  >> before I edit it.
                  >>
                  >> btw. my gvim version is official 7.2 for windows.
                  >>
                  >
                  > Mine is 7.2.049 for Linux (compiled from official sources, official
                  > patches 1-49, and one unofficial patch which is about floating point
                  > functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                  > but not MzScheme, etc. etc. etc.
                  >
                  > I suppose that the fact that mine generates .swp, .swo, etc., rather
                  > than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                  > on Linux and you're on Windows.
                  >
                  > Are you sure you aren't currently editing a [No Name] buffer (possibly
                  > as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                  > help you. Look for buffers with a (active) or h (hidden) left of their name.

                  You can find out what those swap files are by navigating to that
                  directory in cmd and doing

                  vim -r

                  to get a list (not all that helpful) or

                  vim -r _.swp

                  which will try to 'recover' the specific file, showing you what's in it.
                  If indeed it is a directory listing, something must be different or
                  broken with netrw or Vim on windows. If it's something else, well,
                  you'll find out what it is and can decide for yourself what to do.

                  An alternative to going via cmd is to navigate in Vim to the directory,
                  via :cd and then do

                  :recover _.swp

                  Ben.




                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Tony Mechelynck
                  ... well, at least it will tell you the name of the buffer to which this swapfile applies. ... Best regards, Tony. -- Whatever became of eternal truth?
                  Message 8 of 16 , Nov 24, 2008
                    On 24/11/08 13:37, Ben Schmidt wrote:
                    > Tony Mechelynck wrote:
                    >> On 24/11/08 10:57, anhnmncb wrote:
                    >>> Tony Mechelynck<antoine.mechelynck@...> writes:
                    >>>
                    >>>> On 24/11/08 08:44, anhnmncb wrote:
                    >>>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                    >>>>>
                    >>>>>> On 24/11/08 04:52, anhnmncb wrote:
                    >>>>>>> As title, and I don't think it's very useful when editing a directory.
                    >>>>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                    >>>>>> so you don't need to do anything, the swapfile is already disabled on
                    >>>>>> that directory.
                    >>>>> Why I still find that vim produces a _.swp file in dir that editing?
                    >>>> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                    >>>> four files, but the most recent of them dates from more than a month ago.
                    >>>>
                    >>>> You might create a swapfile (with no filename in its name) when you edit
                    >>>> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                    >>>> killed.
                    >>> Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                    >>> before I edit it.
                    >>>
                    >>> btw. my gvim version is official 7.2 for windows.
                    >>>
                    >> Mine is 7.2.049 for Linux (compiled from official sources, official
                    >> patches 1-49, and one unofficial patch which is about floating point
                    >> functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                    >> but not MzScheme, etc. etc. etc.
                    >>
                    >> I suppose that the fact that mine generates .swp, .swo, etc., rather
                    >> than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                    >> on Linux and you're on Windows.
                    >>
                    >> Are you sure you aren't currently editing a [No Name] buffer (possibly
                    >> as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                    >> help you. Look for buffers with a (active) or h (hidden) left of their name.
                    >
                    > You can find out what those swap files are by navigating to that
                    > directory in cmd and doing
                    >
                    > vim -r
                    >
                    > to get a list (not all that helpful) or

                    well, at least it will tell you the name of the buffer to which this
                    swapfile applies.

                    >
                    > vim -r _.swp
                    >
                    > which will try to 'recover' the specific file, showing you what's in it.
                    > If indeed it is a directory listing, something must be different or
                    > broken with netrw or Vim on windows. If it's something else, well,
                    > you'll find out what it is and can decide for yourself what to do.
                    >
                    > An alternative to going via cmd is to navigate in Vim to the directory,
                    > via :cd and then do
                    >
                    > :recover _.swp
                    >
                    > Ben.

                    Best regards,
                    Tony.
                    --
                    Whatever became of eternal truth?

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • anhnmncb
                    ... 1. ... Prompt: E306: Cannot open _.swp 2. ... Prompt: E95: Buffer with this name already exists. btw. I have hidden setting, does it mean that in this
                    Message 9 of 16 , Nov 24, 2008
                      Ben Schmidt <mail_ben_schmidt@...> writes:

                      > Tony Mechelynck wrote:
                      >> On 24/11/08 10:57, anhnmncb wrote:
                      >>> Tony Mechelynck<antoine.mechelynck@...> writes:
                      >>>
                      >>>> On 24/11/08 08:44, anhnmncb wrote:
                      >>>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                      >>>>>
                      >>>>>> On 24/11/08 04:52, anhnmncb wrote:
                      >>>>>>> As title, and I don't think it's very useful when editing a directory.
                      >>>>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                      >>>>>> so you don't need to do anything, the swapfile is already disabled on
                      >>>>>> that directory.
                      >>>>> Why I still find that vim produces a _.swp file in dir that editing?
                      >>>> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                      >>>> four files, but the most recent of them dates from more than a month ago.
                      >>>>
                      >>>> You might create a swapfile (with no filename in its name) when you edit
                      >>>> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                      >>>> killed.
                      >>> Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                      >>> before I edit it.
                      >>>
                      >>> btw. my gvim version is official 7.2 for windows.
                      >>>
                      >>
                      >> Mine is 7.2.049 for Linux (compiled from official sources, official
                      >> patches 1-49, and one unofficial patch which is about floating point
                      >> functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                      >> but not MzScheme, etc. etc. etc.
                      >>
                      >> I suppose that the fact that mine generates .swp, .swo, etc., rather
                      >> than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                      >> on Linux and you're on Windows.
                      >>
                      >> Are you sure you aren't currently editing a [No Name] buffer (possibly
                      >> as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                      >> help you. Look for buffers with a (active) or h (hidden) left of their name.
                      >
                      > You can find out what those swap files are by navigating to that
                      > directory in cmd and doing
                      >
                      > vim -r
                      >
                      > to get a list (not all that helpful) or
                      >
                      > vim -r _.swp
                      >
                      > which will try to 'recover' the specific file, showing you what's in it.
                      > If indeed it is a directory listing, something must be different or
                      > broken with netrw or Vim on windows. If it's something else, well,
                      > you'll find out what it is and can decide for yourself what to do.
                      >
                      > An alternative to going via cmd is to navigate in Vim to the directory,
                      > via :cd and then do
                      >
                      > :recover _.swp

                      1.

                      :cd ~/doc/

                      :recover _.swp

                      Prompt: E306: Cannot open _.swp

                      2.

                      :e ~/doc/

                      :recover _.swap

                      Prompt: E95: Buffer with this name already exists.

                      btw. I have hidden setting, does it mean that in this condition, swap
                      will always generated regardless editing file or dir?

                      >
                      > Ben.
                      >
                      >
                      >
                      >
                      > >
                      >
                      >

                      --
                      Regards,

                      anhnmncb
                      gpg key: 44A31344

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • John Beckett
                      ... No. When you next see this situation, please do what Tony asked: Use :ls! to list all buffers. It is extremely likely that you have a hidden no name
                      Message 10 of 16 , Nov 24, 2008
                        anhnmncb wrote:
                        > btw. I have hidden setting, does it mean that in this
                        > condition, swap will always generated regardless editing file or dir?

                        No. When you next see this situation, please do what Tony asked: Use :ls! to list
                        all buffers. It is extremely likely that you have a hidden "no name" buffer,
                        possibly left over as part of some startup issue.

                        John


                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • anhnmncb
                        ... I share my .vimrc. and .vim(vimfile) both on windows and freebsd, I see the different behavior(I will refer to vim on freebsd, gvim on windows): On
                        Message 11 of 16 , Nov 24, 2008
                          "John Beckett" <johnb.beckett@...> writes:

                          > anhnmncb wrote:
                          >> btw. I have hidden setting, does it mean that in this
                          >> condition, swap will always generated regardless editing file or dir?
                          >
                          > No. When you next see this situation, please do what Tony asked: Use :ls! to list
                          > all buffers. It is extremely likely that you have a hidden "no name" buffer,
                          > possibly left over as part of some startup issue.
                          >
                          > John
                          >
                          >
                          > >
                          >
                          >
                          I share my .vimrc. and .vim(vimfile) both on windows and freebsd, I see
                          the different behavior(I will refer to vim on freebsd, gvim on windows):

                          On freebsd:
                          $ vim
                          :e ~/.vimrc
                          :e ~/doc/
                          :ls!
                          1 #h "~/.vimrc" line 19
                          2u%a- "/media/wind/portable/home/doc" line 9

                          On windows:
                          gvim
                          :e ~/.vimrc
                          :e ~/doc/
                          :ls!
                          1 #h "/portable/apps/vim/.vimrc" line 272
                          2 h "" line 1
                          3u%a- "[Scratch]" line 9

                          Why?
                          --
                          Regards,

                          anhnmncb
                          gpg key: 44A31344

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_use" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • John Beckett
                          ... Don t know. I guess doc is a directory and you might omit the trailing slash, but that s not likely to achieve much. Try :scriptnames on both systems and
                          Message 12 of 16 , Nov 24, 2008
                            anhnmncb wrote:
                            > On windows:
                            > gvim
                            > :e ~/.vimrc
                            > :e ~/doc/
                            > :ls!
                            > 1 #h "/portable/apps/vim/.vimrc" line 272
                            > 2 h "" line 1
                            > 3u%a- "[Scratch]" line 9

                            Don't know. I guess doc is a directory and you might omit the trailing slash, but
                            that's not likely to achieve much.

                            Try ':scriptnames' on both systems and compare what scripts have actually run.

                            John


                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_use" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          • Tony Mechelynck
                            ... It means that if you have an open buffer it will get hidden in preference to being |abandon|ed. In the case of a [No Name] buffer, hidden or not, it will
                            Message 13 of 16 , Nov 24, 2008
                              On 25/11/08 00:25, anhnmncb wrote:
                              > Ben Schmidt<mail_ben_schmidt@...> writes:
                              >
                              >> Tony Mechelynck wrote:
                              >>> On 24/11/08 10:57, anhnmncb wrote:
                              >>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                              >>>>
                              >>>>> On 24/11/08 08:44, anhnmncb wrote:
                              >>>>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                              >>>>>>
                              >>>>>>> On 24/11/08 04:52, anhnmncb wrote:
                              >>>>>>>> As title, and I don't think it's very useful when editing a directory.
                              >>>>>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                              >>>>>>> so you don't need to do anything, the swapfile is already disabled on
                              >>>>>>> that directory.
                              >>>>>> Why I still find that vim produces a _.swp file in dir that editing?
                              >>>>> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                              >>>>> four files, but the most recent of them dates from more than a month ago.
                              >>>>>
                              >>>>> You might create a swapfile (with no filename in its name) when you edit
                              >>>>> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                              >>>>> killed.
                              >>>> Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                              >>>> before I edit it.
                              >>>>
                              >>>> btw. my gvim version is official 7.2 for windows.
                              >>>>
                              >>> Mine is 7.2.049 for Linux (compiled from official sources, official
                              >>> patches 1-49, and one unofficial patch which is about floating point
                              >>> functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                              >>> but not MzScheme, etc. etc. etc.
                              >>>
                              >>> I suppose that the fact that mine generates .swp, .swo, etc., rather
                              >>> than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                              >>> on Linux and you're on Windows.
                              >>>
                              >>> Are you sure you aren't currently editing a [No Name] buffer (possibly
                              >>> as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                              >>> help you. Look for buffers with a (active) or h (hidden) left of their name.
                              >> You can find out what those swap files are by navigating to that
                              >> directory in cmd and doing
                              >>
                              >> vim -r
                              >>
                              >> to get a list (not all that helpful) or
                              >>
                              >> vim -r _.swp
                              >>
                              >> which will try to 'recover' the specific file, showing you what's in it.
                              >> If indeed it is a directory listing, something must be different or
                              >> broken with netrw or Vim on windows. If it's something else, well,
                              >> you'll find out what it is and can decide for yourself what to do.
                              >>
                              >> An alternative to going via cmd is to navigate in Vim to the directory,
                              >> via :cd and then do
                              >>
                              >> :recover _.swp
                              >
                              > 1.
                              >
                              > :cd ~/doc/
                              >
                              > :recover _.swp
                              >
                              > Prompt: E306: Cannot open _.swp
                              >
                              > 2.
                              >
                              > :e ~/doc/
                              >
                              > :recover _.swap
                              >
                              > Prompt: E95: Buffer with this name already exists.
                              >
                              > btw. I have hidden setting, does it mean that in this condition, swap
                              > will always generated regardless editing file or dir?
                              >
                              >> Ben.
                              >>
                              >>
                              >>
                              >>
                              >>
                              >

                              It means that if you have an open buffer it will get hidden in
                              preference to being |abandon|ed. In the case of a [No Name] buffer,
                              hidden or not, it will get a _.swp (or _.swo _.swn etc.) swapfile.

                              I use 'autowriteall' but not 'hidden'. This means that (with the
                              ex-commands I use) a buffer won't become hidden without my say-so.
                              Instead of |abandon|ing a buffer, Vim will save it to disk (then unload
                              the buffer and delete its swapfile), and in the case of a 'modified' [No
                              Name] buffer I'll get a message telling me to use an exclamation mark if
                              I want to abandon changes.


                              Best regards,
                              Tony.
                              --
                              OUTCONERR
                              Twas FORTRAN as the doloop goes
                              Did logzerneg the ifthen block
                              All kludgy were the function flows
                              And subroutines adhoc.

                              Beware the runtime-bug my friend
                              squrooneg, the false goto
                              Beware the infiniteloop
                              And shun the inprectoo.

                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_use" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • anhnmncb
                              ... I have checked that both the scriptnames are same after I do the same operators(i.e. gvim | :e ~/.vimrc | :e ~/doc/). Also note that I have ln -s vimfile
                              Message 14 of 16 , Nov 25, 2008
                                "John Beckett" <johnb.beckett@...> writes:

                                > anhnmncb wrote:
                                >> On windows:
                                >> gvim
                                >> :e ~/.vimrc
                                >> :e ~/doc/
                                >> :ls!
                                >> 1 #h "/portable/apps/vim/.vimrc" line 272
                                >> 2 h "" line 1
                                >> 3u%a- "[Scratch]" line 9
                                >
                                > Don't know. I guess doc is a directory and you might omit the trailing slash, but
                                > that's not likely to achieve much.
                                >
                                > Try ':scriptnames' on both systems and compare what scripts have actually run.

                                I have checked that both the scriptnames are same after I do the same
                                operators(i.e. gvim | :e ~/.vimrc | :e ~/doc/).

                                Also note that I have ln -s vimfile .vimrc .gvimrc of windows to .vim
                                .vimrc .gvimrc of freebsd, so the dir name is different.

                                --- FreeBSD----
                                1: /usr/home/anhnmncb/.vimrc
                                2: /media/wind/portable/apps/vim/vimfiles/ywfiles/yw_scripts.vim
                                3: /usr/local/share/vim/vim72/syntax/syntax.vim
                                4: /usr/local/share/vim/vim72/syntax/synload.vim
                                5: /usr/local/share/vim/vim72/syntax/syncolor.vim
                                6: /usr/local/share/vim/vim72/filetype.vim
                                7: /usr/local/share/vim/vim72/menu.vim
                                8: /usr/local/share/vim/vim72/autoload/paste.vim
                                9: /usr/local/share/vim/vim72/ftplugin.vim
                                10: /usr/local/share/vim/vim72/indent.vim
                                11: /media/wind/portable/apps/vim/vimfiles/plugin/calendar.vim
                                12: /usr/local/share/vim/vim72/plugin/getscriptPlugin.vim
                                13: /usr/local/share/vim/vim72/plugin/gzip.vim
                                14: /usr/local/share/vim/vim72/plugin/matchparen.vim
                                15: /usr/local/share/vim/vim72/plugin/netrwPlugin.vim
                                16: /usr/local/share/vim/vim72/plugin/rrhelper.vim
                                17: /usr/local/share/vim/vim72/plugin/spellfile.vim
                                18: /usr/local/share/vim/vim72/plugin/tarPlugin.vim
                                19: /usr/local/share/vim/vim72/plugin/tohtml.vim
                                20: /usr/local/share/vim/vim72/plugin/vimballPlugin.vim
                                21: /usr/local/share/vim/vim72/plugin/zipPlugin.vim
                                22: /media/wind/portable/apps/vim/vimfiles/after/plugin/netrwFileHandlers.vim
                                23: /usr/local/share/vim/vim72/autoload/netrwFileHandlers.vim
                                24: /usr/home/anhnmncb/.gvimrc
                                25: /usr/local/share/vim/vim72/scripts.vim
                                26: /usr/local/share/vim/vim72/syntax/vim.vim
                                27: /usr/local/share/vim/vim72/syntax/perl.vim
                                28: /usr/local/share/vim/vim72/syntax/python.vim
                                29: /usr/local/share/vim/vim72/ftplugin/vim.vim
                                30: /usr/local/share/vim/vim72/indent/vim.vim
                                31: /usr/local/share/vim/vim72/autoload/netrw.vim
                                32: /usr/local/share/vim/vim72/syntax/netrw.vim

                                ---- windows 2000----
                                1: D:/portable/apps/vim/.vimrc
                                2: D:/portable/apps/vim/vimfiles/ywfiles/yw_scripts.vim
                                3: D:/portable/apps/vim/vim72/syntax/syntax.vim
                                4: D:/portable/apps/vim/vim72/syntax/synload.vim
                                5: D:/portable/apps/vim/vim72/syntax/syncolor.vim
                                6: D:/portable/apps/vim/vim72/filetype.vim
                                7: D:/portable/apps/vim/vim72/menu.vim
                                8: D:/portable/apps/vim/vim72/lang/menu_en_gb.latin1.vim
                                9: D:/portable/apps/vim/vim72/lang/menu_en_gb.utf-8.vim
                                10: D:/portable/apps/vim/vim72/autoload/paste.vim
                                11: D:/portable/apps/vim/vim72/ftplugin.vim
                                12: D:/portable/apps/vim/vim72/indent.vim
                                13: D:/portable/apps/vim/vimfiles/plugin/calendar.vim
                                14: D:/portable/apps/vim/vim72/plugin/getscriptPlugin.vim
                                15: D:/portable/apps/vim/vim72/plugin/gzip.vim
                                16: D:/portable/apps/vim/vim72/plugin/matchparen.vim
                                17: D:/portable/apps/vim/vim72/plugin/netrwPlugin.vim
                                18: D:/portable/apps/vim/vim72/plugin/rrhelper.vim
                                19: D:/portable/apps/vim/vim72/plugin/spellfile.vim
                                20: D:/portable/apps/vim/vim72/plugin/tarPlugin.vim
                                21: D:/portable/apps/vim/vim72/plugin/tohtml.vim
                                22: D:/portable/apps/vim/vim72/plugin/vimballPlugin.vim
                                23: D:/portable/apps/vim/vim72/plugin/zipPlugin.vim
                                24: D:/portable/apps/vim/vimfiles/after/plugin/netrwFileHandlers.vim
                                25: D:/portable/apps/vim/vim72/autoload/netrwFileHandlers.vim
                                26: D:/portable/apps/vim/.gvimrc
                                27: D:/portable/apps/vim/vim72/scripts.vim
                                28: D:/portable/apps/vim/vim72/syntax/vim.vim
                                29: D:/portable/apps/vim/vim72/ftplugin/vim.vim
                                30: D:/portable/apps/vim/vim72/indent/vim.vim
                                31: D:/portable/apps/vim/vim72/autoload/netrw.vim
                                32: D:/portable/apps/vim/vim72/syntax/netrw.vim


                                >
                                > John
                                >
                                >
                                > >
                                >

                                --
                                Regards,

                                anhnmncb
                                gpg key: 44A31344

                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_use" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • anhnmncb
                                ... Both freebsd and windows share the same settings, so I don t think hidden is relative to my problem. ... -- Regards, anhnmncb gpg key: 44A31344
                                Message 15 of 16 , Nov 25, 2008
                                  Tony Mechelynck <antoine.mechelynck@...> writes:

                                  > On 25/11/08 00:25, anhnmncb wrote:
                                  >> Ben Schmidt<mail_ben_schmidt@...> writes:
                                  >>
                                  >>> Tony Mechelynck wrote:
                                  >>>> On 24/11/08 10:57, anhnmncb wrote:
                                  >>>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                                  >>>>>
                                  >>>>>> On 24/11/08 08:44, anhnmncb wrote:
                                  >>>>>>> Tony Mechelynck<antoine.mechelynck@...> writes:
                                  >>>>>>>
                                  >>>>>>>> On 24/11/08 04:52, anhnmncb wrote:
                                  >>>>>>>>> As title, and I don't think it's very useful when editing a directory.
                                  >>>>>>>> When editing a directory, the netrw plugin uses ":setlocal noswapfile",
                                  >>>>>>>> so you don't need to do anything, the swapfile is already disabled on
                                  >>>>>>>> that directory.
                                  >>>>>>> Why I still find that vim produces a _.swp file in dir that editing?
                                  >>>>>> I don't -- while editing my home directory, "ls -l ~/.sw*" does list
                                  >>>>>> four files, but the most recent of them dates from more than a month ago.
                                  >>>>>>
                                  >>>>>> You might create a swapfile (with no filename in its name) when you edit
                                  >>>>>> a [No Name] file; then that swapfile will remain if Vim crashes or gets
                                  >>>>>> killed.
                                  >>>>> Here generates _.swo and _.swp, I'm sure the dir hasn't these files
                                  >>>>> before I edit it.
                                  >>>>>
                                  >>>>> btw. my gvim version is official 7.2 for windows.
                                  >>>>>
                                  >>>> Mine is 7.2.049 for Linux (compiled from official sources, official
                                  >>>> patches 1-49, and one unofficial patch which is about floating point
                                  >>>> functions), Huge version with GTK2/Gnome GUI, Perl, Python, Ruby and TCL
                                  >>>> but not MzScheme, etc. etc. etc.
                                  >>>>
                                  >>>> I suppose that the fact that mine generates .swp, .swo, etc., rather
                                  >>>> than _.swp, _.swo, etc. for [No Name] files is due to the fact that I'm
                                  >>>> on Linux and you're on Windows.
                                  >>>>
                                  >>>> Are you sure you aren't currently editing a [No Name] buffer (possibly
                                  >>>> as a hidden buffer, if you have 'hidden' set)? The ":ls!" command might
                                  >>>> help you. Look for buffers with a (active) or h (hidden) left of their name.
                                  >>> You can find out what those swap files are by navigating to that
                                  >>> directory in cmd and doing
                                  >>>
                                  >>> vim -r
                                  >>>
                                  >>> to get a list (not all that helpful) or
                                  >>>
                                  >>> vim -r _.swp
                                  >>>
                                  >>> which will try to 'recover' the specific file, showing you what's in it.
                                  >>> If indeed it is a directory listing, something must be different or
                                  >>> broken with netrw or Vim on windows. If it's something else, well,
                                  >>> you'll find out what it is and can decide for yourself what to do.
                                  >>>
                                  >>> An alternative to going via cmd is to navigate in Vim to the directory,
                                  >>> via :cd and then do
                                  >>>
                                  >>> :recover _.swp
                                  >>
                                  >> 1.
                                  >>
                                  >> :cd ~/doc/
                                  >>
                                  >> :recover _.swp
                                  >>
                                  >> Prompt: E306: Cannot open _.swp
                                  >>
                                  >> 2.
                                  >>
                                  >> :e ~/doc/
                                  >>
                                  >> :recover _.swap
                                  >>
                                  >> Prompt: E95: Buffer with this name already exists.
                                  >>
                                  >> btw. I have hidden setting, does it mean that in this condition, swap
                                  >> will always generated regardless editing file or dir?
                                  >>
                                  >>> Ben.
                                  >>>
                                  >>>
                                  >>>
                                  >>>
                                  >>>
                                  >>
                                  >
                                  > It means that if you have an open buffer it will get hidden in
                                  > preference to being |abandon|ed. In the case of a [No Name] buffer,
                                  > hidden or not, it will get a _.swp (or _.swo _.swn etc.) swapfile.
                                  >
                                  > I use 'autowriteall' but not 'hidden'. This means that (with the
                                  > ex-commands I use) a buffer won't become hidden without my say-so.
                                  > Instead of |abandon|ing a buffer, Vim will save it to disk (then unload
                                  > the buffer and delete its swapfile), and in the case of a 'modified' [No
                                  > Name] buffer I'll get a message telling me to use an exclamation mark if
                                  > I want to abandon changes.

                                  Both freebsd and windows share the same settings, so I don't think
                                  hidden is relative to my problem.

                                  >
                                  >
                                  > Best regards,
                                  > Tony.

                                  --
                                  Regards,

                                  anhnmncb
                                  gpg key: 44A31344

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_use" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                • anhnmncb
                                  ... Amm, forgot to say, if I :e ~/doc without trailing slash, then dir will have a .doc.swp too when on freebsd, so the proper way is not to omit it. ... --
                                  Message 16 of 16 , Nov 25, 2008
                                    "John Beckett" <johnb.beckett@...> writes:

                                    > anhnmncb wrote:
                                    >> On windows:
                                    >> gvim
                                    >> :e ~/.vimrc
                                    >> :e ~/doc/
                                    >> :ls!
                                    >> 1 #h "/portable/apps/vim/.vimrc" line 272
                                    >> 2 h "" line 1
                                    >> 3u%a- "[Scratch]" line 9
                                    >
                                    > Don't know. I guess doc is a directory and you might omit the trailing slash, but
                                    > that's not likely to achieve much.

                                    Amm, forgot to say, if I :e ~/doc without trailing slash, then dir will
                                    have a .doc.swp too when on freebsd, so the proper way is not to omit it.

                                    >
                                    > Try ':scriptnames' on both systems and compare what scripts have actually run.
                                    >
                                    > John
                                    >
                                    >
                                    > >
                                    >

                                    --
                                    Regards,

                                    anhnmncb
                                    gpg key: 44A31344

                                    --~--~---------~--~----~------------~-------~--~----~
                                    You received this message from the "vim_use" maillist.
                                    For more information, visit http://www.vim.org/maillist.php
                                    -~----------~----~----~----~------~----~------~--~---
                                  Your message has been successfully submitted and would be delivered to recipients shortly.