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

strange behavior: ":w" only writes new buffers to disk, not open them.

Expand Messages
  • leo
    Hello all, I have changed my .vimrc quite a bit recently. I do not know exactly when, but when a create new buffer, for instance :w test.txt , vim only
    Message 1 of 9 , Aug 20, 2013
    • 0 Attachment
      Hello all,

      I have changed my .vimrc quite a bit recently. I do not know exactly when, but when a create new buffer, for instance ":w test.txt", vim only writes/creates the file test, but it no longer opens it by default. Is there any option that controls that? I'm using macvim

      Thanks in advance

      --
      --
      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.
    • Tim Chase
      ... I m not quite sure I understand what you mean by no longer opens it by default . Based on my reading, there are two possible meanings that occur to me:
      Message 2 of 9 , Aug 20, 2013
      • 0 Attachment
        On 2013-08-20 18:16, leo wrote:
        > when a create new buffer, for instance ":w test.txt", vim
        > only writes/creates the file test, but it no longer opens
        > it by default. Is there any option that controls that?

        I'm not quite sure I understand what you mean by "no longer opens it
        by default". Based on my reading, there are two possible meanings
        that occur to me:

        1) when creating a new buffer (":new") and then writing it (":w
        test.txt"), it writes the file but doesn't change the buffer-name to
        associate it with the file on disk. If this is the case, this is
        clearly a regression. I'd test to see if you can duplicate it with
        after you've started vim with "vim -u NONE" to eliminate any
        possibility of vimrc files interfering.

        2) when creating a new buffer against an existing file (":e
        existing.txt") and then writing a new file (":w test.txt"), it
        doesn't change the file-name (i.e., subsequent writes write to
        "existing.txt"), this is the expected behavior. To write to a new
        file and change to that one instead, you want to use ":saveas
        test.txt" instead of ":w test.txt"


        It would help to know:
        - which one of the above you're talking about,
        - which version of Vim you're running ("7.2.314")
        - any plugins or particularly germane settings you might have in your
        vimrc

        -tim



        --
        --
        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.
      • Leonardo Barbosa
        Thanks Tim, a) I m talking about the first one. b) ... VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 27 2011 19:46:24) MacOS X (unix) version c) vim -u
        Message 3 of 9 , Aug 20, 2013
        • 0 Attachment
          Thanks Tim,

          a) I'm talking about the first one.
          b)
          :version
          VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 27 2011 19:46:24)
          MacOS X (unix) version
          c) "vim -u NONE" makes vim works as expected.

          what do you think?

          Leo


          On Tue, Aug 20, 2013 at 10:34 PM, Tim Chase <vim@...> wrote:
          > On 2013-08-20 18:16, leo wrote:
          >> when a create new buffer, for instance ":w test.txt", vim
          >> only writes/creates the file test, but it no longer opens
          >> it by default. Is there any option that controls that?
          >
          > I'm not quite sure I understand what you mean by "no longer opens it
          > by default". Based on my reading, there are two possible meanings
          > that occur to me:
          >
          > 1) when creating a new buffer (":new") and then writing it (":w
          > test.txt"), it writes the file but doesn't change the buffer-name to
          > associate it with the file on disk. If this is the case, this is
          > clearly a regression. I'd test to see if you can duplicate it with
          > after you've started vim with "vim -u NONE" to eliminate any
          > possibility of vimrc files interfering.
          >
          > 2) when creating a new buffer against an existing file (":e
          > existing.txt") and then writing a new file (":w test.txt"), it
          > doesn't change the file-name (i.e., subsequent writes write to
          > "existing.txt"), this is the expected behavior. To write to a new
          > file and change to that one instead, you want to use ":saveas
          > test.txt" instead of ":w test.txt"
          >
          >
          > It would help to know:
          > - which one of the above you're talking about,
          > - which version of Vim you're running ("7.2.314")
          > - any plugins or particularly germane settings you might have in your
          > vimrc
          >
          > -tim
          >
          >
          >

          --
          --
          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.
        • Tim Chase
          ... then I d start binary-searching your vimrc by putting finish halfway through. If it still works, move it to 75% of the way through; otherwise, move it to
          Message 4 of 9 , Aug 20, 2013
          • 0 Attachment
            On 2013-08-20 23:02, Leonardo Barbosa wrote:
            > c) "vim -u NONE" makes vim works as expected.

            then I'd start binary-searching your vimrc by putting

            finish

            halfway through. If it still works, move it to 75% of the way
            through; otherwise, move it to 25% of the way through. By cutting
            your vimrc in half each time, you should be able to determine the
            problematic line.

            Alternatively, you could try including posting your vimrc here to get
            other eyes on what might be causing the problem.

            -tim


            --
            --
            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.
          • Leonardo Barbosa
            Thanks again! The problems seems to be the combination of these two lines let &showbreak = ↳ if you can t see this character, it s a return arrow set
            Message 5 of 9 , Aug 21, 2013
            • 0 Attachment
              Thanks again! The problems seems to be the combination of these two lines
              let &showbreak = '↳ ' " if you can't see this character, it's a return arrow
              set cpo=n

              Indeed, i have set those, recently.

              Leo


              On Tue, Aug 20, 2013 at 11:21 PM, Tim Chase <vim@...> wrote:
              > On 2013-08-20 23:02, Leonardo Barbosa wrote:
              >> c) "vim -u NONE" makes vim works as expected.
              >
              > then I'd start binary-searching your vimrc by putting
              >
              > finish
              >
              > halfway through. If it still works, move it to 75% of the way
              > through; otherwise, move it to 25% of the way through. By cutting
              > your vimrc in half each time, you should be able to determine the
              > problematic line.
              >
              > Alternatively, you could try including posting your vimrc here to get
              > other eyes on what might be causing the problem.
              >
              > -tim
              >
              >

              --
              --
              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.
            • Christian Brabandt
              ... This is you error. You probably want to add the n flag to the cpo settings and not have cpo only contain the n . The difference is, in the former,
              Message 6 of 9 , Aug 21, 2013
              • 0 Attachment
                On Wed, August 21, 2013 11:26, Leonardo Barbosa wrote:
                > set cpo=n

                This is you error. You probably want to add the 'n' flag
                to the 'cpo' settings and not have 'cpo' only contain the 'n'.

                The difference is, in the former, the default flag 'F' will still
                be available, which is responsible for setting the filename of
                the current buffer to the one supplied by the :w command.
                If it isn't there (e.g. by setting cpo=n), Vim won't set the buffername
                and this is what you are currently experiencing.

                See also the help:
                :h cpo-F

                regards,
                Christian

                --
                --
                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.
              • Tim Chase
                ... Christian nailed the issue (including digging up which option, F , was the culprit that got wiped out), however he omitted the most important detail: how
                Message 7 of 9 , Aug 21, 2013
                • 0 Attachment
                  On 2013-08-21 12:06, Christian Brabandt wrote:
                  > On Wed, August 21, 2013 11:26, Leonardo Barbosa wrote:
                  > > set cpo=n
                  >
                  > This is you error. You probably want to add the 'n' flag
                  > to the 'cpo' settings and not have 'cpo' only contain the 'n'.
                  >
                  > The difference is, in the former, the default flag 'F' will still
                  > be available, which is responsible for setting the filename of
                  > the current buffer to the one supplied by the :w command.
                  > If it isn't there (e.g. by setting cpo=n), Vim won't set the
                  > buffername and this is what you are currently experiencing.
                  >
                  > See also the help:
                  > :h cpo-F


                  Christian nailed the issue (including digging up which option, 'F',
                  was the culprit that got wiped out), however he omitted the most
                  important detail: how to fix it. If you got caught by this, it might
                  have been helpful to include the remedy, to change

                  set cpo=n

                  to

                  set cpo+=n

                  as mentioned at

                  :help :set+=

                  -tim



                  --
                  --
                  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
                  ... In other words, you probably want this: set cpo+=n NOT this: set cpo=n -- -- You received this message from the vim_use maillist. Do not top-post! Type
                  Message 8 of 9 , Aug 21, 2013
                  • 0 Attachment
                    On Wednesday, August 21, 2013 5:06:50 AM UTC-5, Christian Brabandt wrote:
                    > On Wed, August 21, 2013 11:26, Leonardo Barbosa wrote:
                    >
                    > > set cpo=n
                    >
                    >
                    >
                    > This is you error. You probably want to add the 'n' flag
                    >
                    > to the 'cpo' settings and not have 'cpo' only contain the 'n'.
                    >
                    >

                    In other words, you probably want this:

                    set cpo+=n

                    NOT this:

                    set cpo=n

                    --
                    --
                    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.
                  • Leonardo Barbosa
                    Cool. Fixed! Thank you all ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying
                    Message 9 of 9 , Aug 21, 2013
                    • 0 Attachment
                      Cool. Fixed! Thank you all



                      On Wed, Aug 21, 2013 at 11:20 AM, Ben Fritz <fritzophrenic@...> wrote:
                      > On Wednesday, August 21, 2013 5:06:50 AM UTC-5, Christian Brabandt wrote:
                      >> On Wed, August 21, 2013 11:26, Leonardo Barbosa wrote:
                      >>
                      >> > set cpo=n
                      >>
                      >>
                      >>
                      >> This is you error. You probably want to add the 'n' flag
                      >>
                      >> to the 'cpo' settings and not have 'cpo' only contain the 'n'.
                      >>
                      >>
                      >
                      > In other words, you probably want this:
                      >
                      > set cpo+=n
                      >
                      > NOT this:
                      >
                      > set cpo=n
                      >
                      > --
                      > --
                      > 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 a topic in the Google Groups "vim_use" group.
                      > To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/YPcNy12ubaU/unsubscribe.
                      > To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@....
                      > For more options, visit https://groups.google.com/groups/opt_out.

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