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

shiftround option

Expand Messages
  • cyboman
    I m reading an online book, Learning Vim the hardway, and it talks about the shiftround option. I tried it but it didn t affect anything. The effect was the
    Message 1 of 8 , Nov 17, 2012
    • 0 Attachment
      I'm reading an online book, Learning Vim the hardway, and it talks about the shiftround option. I tried it but it didn't affect anything. The effect was the same as before. I tried reading the help but it wasn't very helpful :) Has anybody used this option before? What is the advantage of it? What am I doing wrong that I don't see its effects?

      Any help is appreciated.

      --
      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
    • Marcin Szamotulski
      ... With noshiftround the on the line x leads to x when the shiftround is on x As you can see it is one column before. Best, Marcin -- You received this
      Message 2 of 8 , Nov 17, 2012
      • 0 Attachment
        On 05:44 Sat 17 Nov , cyboman wrote:
        > I'm reading an online book, Learning Vim the hardway, and it talks about the shiftround option. I tried it but it didn't affect anything. The effect was the same as before. I tried reading the help but it wasn't very helpful :) Has anybody used this option before? What is the advantage of it? What am I doing wrong that I don't see its effects?
        >
        > Any help is appreciated.
        >
        > --
        > 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

        With noshiftround the >> on the line
        x
        leads to
        x
        when the shiftround is on
        x
        As you can see it is one column before.

        Best,
        Marcin

        --
        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
      • rail shafigulin
        I m still no quite clear. So when I set shiftround it moves the code by the length of shiftwidth-1 when I use the or
        Message 3 of 8 , Nov 17, 2012
        • 0 Attachment
          I'm still no quite clear. So when I set shiftround it moves the code by the length of shiftwidth-1 when I use the >> or << ?


          On Sat, Nov 17, 2012 at 11:12 AM, Marcin Szamotulski <mszamot@...> wrote:
          On 05:44 Sat 17 Nov     , cyboman wrote:
          > I'm reading an online book, Learning Vim the hardway, and it talks about the shiftround option. I tried it but it didn't affect anything. The effect was the same as before. I tried reading the help but it wasn't very helpful :) Has anybody used this option before? What is the advantage of it? What am I doing wrong that I don't see its effects?
          >
          > Any help is appreciated.
          >
          > --
          > 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

          With noshiftround the >> on the line
           x
          leads to
               x
          when the shiftround is on
              x
          As you can see it is one column before.

          Best,
              Marcin

          --
          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 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
        • Christian Brabandt
          Hi rail! (please don t top poste) ... No, if it is set, it moves it to the next multiple value of shiftwidth, while when it is not set, it simply moves by
          Message 4 of 8 , Nov 17, 2012
          • 0 Attachment
            Hi rail!
            (please don't top poste)

            On Sa, 17 Nov 2012, rail shafigulin wrote:

            > I'm still no quite clear. So when I set shiftround it moves the code by the
            > length of shiftwidth-1 when I use the >> or << ?

            No, if it is set, it moves it to the next multiple value of shiftwidth,
            while when it is not set, it simply moves by shiftwidth chars.

            Here is an example:
            If your shiftwidth value is 4 and your input starts at cell 3 indenting
            using >> would move the text to cell 5 if shiftround is set, while it
            moves your text to cell 7 when shiftround is not set.

            regards,
            Christian
            --
            Den (inländischen) Ruhm großer Minister, Feldherrn, Fürsten stürzt
            eine einzige Staatsumwälzung oder Eroberung.
            -- Jean Paul

            --
            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
          • rail shafigulin
            ... The next multiple value of shiftwidth confuses me. So if shiftwidth is 8, will the next multiple be 2, 4 or 8? How about shiftwidth of 7, will the next
            Message 5 of 8 , Nov 17, 2012
            • 0 Attachment


              On Sat, Nov 17, 2012 at 4:16 PM, Christian Brabandt <cblists@...> wrote:
              Hi rail!
              (please don't top poste)

              On Sa, 17 Nov 2012, rail shafigulin wrote:

              > I'm still no quite clear. So when I set shiftround it moves the code by the
              > length of shiftwidth-1 when I use the >> or << ?

              No, if it is set, it moves it to the next multiple value of shiftwidth,
              while when it is not set, it simply moves by shiftwidth chars.

              Here is an example:
              If your shiftwidth value is 4 and your input starts at cell 3 indenting
              using >> would move the text to cell 5 if shiftround is set, while it
              moves your text to cell 7 when shiftround is not set.

              regards,
              Christian
              --
              Den (inländischen) Ruhm großer Minister, Feldherrn, Fürsten stürzt
              eine einzige Staatsumwälzung oder Eroberung.
                              -- Jean Paul

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

              The "next multiple value of shiftwidth" confuses me. So if shiftwidth is 8, will the next multiple be 2, 4 or 8? How about shiftwidth of 7, will the next multiple be 7 ?

              Any help is appreciated.

              --
              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
            • Marcin Szamotulski
              ... Indeed, if you set shift width to 7 and the first non blank character is at column 9 then will move it to the column 14 when shiftround is set and
              Message 6 of 8 , Nov 17, 2012
              • 0 Attachment
                On 17:42 Sat 17 Nov , rail shafigulin wrote:
                > On Sat, Nov 17, 2012 at 4:16 PM, Christian Brabandt <cblists@...>wrote:
                >
                > > Hi rail!
                > > (please don't top poste)
                > >
                > > On Sa, 17 Nov 2012, rail shafigulin wrote:
                > >
                > > > I'm still no quite clear. So when I set shiftround it moves the code by
                > > the
                > > > length of shiftwidth-1 when I use the >> or << ?
                > >
                > > No, if it is set, it moves it to the next multiple value of shiftwidth,
                > > while when it is not set, it simply moves by shiftwidth chars.
                > >
                > > Here is an example:
                > > If your shiftwidth value is 4 and your input starts at cell 3 indenting
                > > using >> would move the text to cell 5 if shiftround is set, while it
                > > moves your text to cell 7 when shiftround is not set.
                > >
                > > regards,
                > > Christian
                > > --
                > > Den (inländischen) Ruhm großer Minister, Feldherrn, Fürsten stürzt
                > > eine einzige Staatsumwälzung oder Eroberung.
                > > -- Jean Paul
                > >
                > > --
                > > 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
                > >
                >
                > The "next multiple value of shiftwidth" confuses me. So if shiftwidth is 8,
                > will the next multiple be 2, 4 or 8? How about shiftwidth of 7, will the
                > next multiple be 7 ?
                >
                > Any help is appreciated.
                >
                > --
                > 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

                Indeed, if you set shift width to 7 and the first non blank character
                is at column 9 then '>>' will move it to the column 14 when 'shiftround'
                is set and to column 9+7=16 when it is not set. The operator << will
                move it to the column 7 when 'shiftround' is set and 9-7=2 when it is
                not set.

                Best,
                Marcin

                --
                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
              • John Beckett
                ... The way to think of it is this: If you have :set noshiftround , after adjusting an indent you may find that the indents are NOT aligned at the standard
                Message 7 of 8 , Nov 17, 2012
                • 0 Attachment
                  rail shafigulin wrote:
                  > I'm still no quite clear. So when I set shiftround it moves
                  > the code by the length of shiftwidth-1 when I use the >> or << ?

                  The way to think of it is this:

                  If you have ":set noshiftround", after adjusting an indent you
                  may find that the indents are NOT aligned at the "standard"
                  positions. The standard positions are those you would get
                  after indenting text that originally had no indent.

                  If you have ":set shiftround", after adjusting an indent, the
                  indent will be aligned at a standard position (the indent is
                  rounded to a multiple of the 'shiftwidth' option).

                  John

                  --
                  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
                • rail shafigulin
                  ... Thanks, John. I think I m getting it now. Marcin thanks for the help too. -- You received this message from the vim_use maillist. Do not top-post! Type
                  Message 8 of 8 , Nov 17, 2012
                  • 0 Attachment


                    On Sat, Nov 17, 2012 at 6:30 PM, John Beckett <johnb.beckett@...> wrote:
                    rail shafigulin wrote:
                    > I'm still no quite clear. So when I set shiftround it moves
                    > the code by the length of shiftwidth-1 when I use the >> or << ?

                    The way to think of it is this:

                    If you have ":set noshiftround", after adjusting an indent you
                    may find that the indents are NOT aligned at the "standard"
                    positions. The standard positions are those you would get
                    after indenting text that originally had no indent.

                    If you have ":set shiftround", after adjusting an indent, the
                    indent will be aligned at a standard position (the indent is
                    rounded to a multiple of the 'shiftwidth' option).

                    John

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

                    Thanks, John. I think I'm getting it now. Marcin thanks for the help too.

                    --
                    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
                  Your message has been successfully submitted and would be delivered to recipients shortly.