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

Feature: improvement in cinoptions

Expand Messages
  • Felipe Contreras
    Hi everybody, The issue is simple, having ts=4 and cino=(0 I get this. my_test_funcion_line(const char *my_first_arg, const char *my_second_arg); Which is 2
    Message 1 of 20 , Dec 26, 2004
    • 0 Attachment
      Hi everybody,

      The issue is simple, having ts=4 and cino=(0 I get this.

      my_test_funcion_line(const char *my_first_arg,
      const char *my_second_arg);

      Which is 2 tabs of indentation, and the unclosed parenthesis line have
      5 more tabs and 1 space in order to align it to the parenthesis.

      It would be good to have something like this instead.

      my_test_funcion_line(const char *my_first_arg,
      const char *my_second_arg);

      Which is 2 tabs of indentation, and the unclosed parenthesis line have
      21 spaces in order to align.

      That way it doesn't matter the tab size it will always look good.

      I've looked at the code and it doesn't seem to be an easy thing to do,
      but I'm sure it is a good formatting option.

      What do you think?

      --
      Felipe Contreras
    • Bram Moolenaar
      ... Sorry, Vim only supports a tabstop of 8 properly. You can change the setting, but don t expect everything to work well. Eight is the standard value for
      Message 2 of 20 , Dec 27, 2004
      • 0 Attachment
        Felipe Contreras wrote:

        > The issue is simple, having ts=4 and cino=(0 I get this.
        >
        > my_test_funcion_line(const char *my_first_arg,
        > const char *my_second_arg);
        >
        > Which is 2 tabs of indentation, and the unclosed parenthesis line have
        > 5 more tabs and 1 space in order to align it to the parenthesis.
        >
        > It would be good to have something like this instead.
        >
        > my_test_funcion_line(const char *my_first_arg,
        > const char *my_second_arg);
        >
        > Which is 2 tabs of indentation, and the unclosed parenthesis line have
        > 21 spaces in order to align.
        >
        > That way it doesn't matter the tab size it will always look good.
        >
        > I've looked at the code and it doesn't seem to be an easy thing to do,
        > but I'm sure it is a good formatting option.
        >
        > What do you think?

        Sorry, Vim only supports a tabstop of 8 properly. You can change the
        setting, but don't expect everything to work well. Eight is the
        standard value for tabs, any other value will cause trouble sooner or
        later.

        You can use 'softtabstop' instead. Or set 'expandtab' and use spaces
        only.

        --
        hundred-and-one symptoms of being an internet addict:
        135. You cut classes or miss work so you can stay home and browse the web.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
      • Felipe Contreras
        ... I thought Vim was the God s gift for text editing. Never before I heard Vim only supports , and much less a specific tabstop. Considering Vim the best
        Message 3 of 20 , Dec 27, 2004
        • 0 Attachment
          On Mon, 27 Dec 2004 17:14:16 +0100, Bram Moolenaar <Bram@...> wrote:
          >

          > Sorry, Vim only supports a tabstop of 8 properly. You can change the
          > setting, but don't expect everything to work well. Eight is the
          > standard value for tabs, any other value will cause trouble sooner or
          > later.
          >
          > You can use 'softtabstop' instead. Or set 'expandtab' and use spaces
          > only.

          I thought Vim was the God's gift for text editing. Never before I
          heard "Vim only supports", and much less a specific tabstop.

          Considering Vim the best text editor, and the insane amount of coding
          styles, I would say that is a good feature Vim migth add. Hard, yes,
          but at least someone should write it on the TODO list or something, at
          the end or whatever, but keep it in mind.

          Tanks for this amazingly great application.

          --
          Felipe Contreras
        • James Widman
          Hi Felipe, I m confused; with a ~/.vimrc that consists only of: set nocompatible set ts=4 set cindent set cino=(0 ...it seems that I get the desired indenting
          Message 4 of 20 , Dec 27, 2004
          • 0 Attachment
            Hi Felipe,

            I'm confused; with a ~/.vimrc that consists only of:
            set nocompatible
            set ts=4
            set cindent
            set cino=(0

            ...it seems that I get the desired indenting behavior. I'm using
            version 6.1 on Mac OS 10.3.7.

            On 2004/12/27, at 17:02, Felipe Contreras wrote:
            > I thought Vim was the God's gift for text editing.

            No, it's the Bram's gift for text editing. And with all due respect to
            Bram, I think there's a significant difference. (:

            James
          • Bill McCarthy
            ... Indeed - we know with far greater certainty that there IS a Bram ;-) -- Best regards, Bill
            Message 5 of 20 , Dec 27, 2004
            • 0 Attachment
              On Mon 27-Dec-04 11:59am -0600, James Widman wrote:

              > On 2004/12/27, at 17:02, Felipe Contreras wrote:

              >> I thought Vim was the God's gift for text editing.

              > No, it's the Bram's gift for text editing. And with all due respect to
              > Bram, I think there's a significant difference. (:

              Indeed - we know with far greater certainty that there
              IS a Bram ;-)

              --
              Best regards,
              Bill
            • Felipe Contreras
              ... You mean 2 tabs and 21 spaces? -- Felipe Contreras
              Message 6 of 20 , Dec 27, 2004
              • 0 Attachment
                On Mon, 27 Dec 2004 17:59:56 +0000, James Widman <james@...> wrote:
                > Hi Felipe,
                >
                > I'm confused; with a ~/.vimrc that consists only of:
                > set nocompatible
                > set ts=4
                > set cindent
                > set cino=(0
                >
                > ...it seems that I get the desired indenting behavior. I'm using
                > version 6.1 on Mac OS 10.3.7.

                You mean 2 tabs and 21 spaces?

                --
                Felipe Contreras
              • Keith Roberts
                ... Heh, heh, heh. Don t flip your wig, Felipe. There are lots of ways of dealing with this issue ... you just have to get to know them and choose between
                Message 7 of 20 , Dec 27, 2004
                • 0 Attachment
                  >-----Original Message-----
                  >From: Felipe Contreras [mailto:felipe.contreras@...]
                  >Sent: Monday, December 27, 2004 9:03 AM
                  >To: Bram Moolenaar
                  >Cc: Vim Developers
                  >Subject: Re: Feature: improvement in cinoptions
                  >
                  >On Mon, 27 Dec 2004 17:14:16 +0100, Bram Moolenaar
                  ><Bram@...> wrote:
                  >>
                  >
                  >> Sorry, Vim only supports a tabstop of 8 properly. You can
                  >change the
                  >> setting, but don't expect everything to work well. Eight is the
                  >> standard value for tabs, any other value will cause trouble
                  >sooner or
                  >> later.
                  >>
                  >> You can use 'softtabstop' instead. Or set 'expandtab' and
                  >use spaces
                  >> only.
                  >
                  >I thought Vim was the God's gift for text editing. Never
                  >before I heard "Vim only supports", and much less a specific tabstop.
                  >
                  >Considering Vim the best text editor, and the insane amount of
                  >coding styles, I would say that is a good feature Vim migth
                  >add. Hard, yes, but at least someone should write it on the
                  >TODO list or something, at the end or whatever, but keep it in mind.
                  >
                  >Tanks for this amazingly great application.
                  >
                  >--
                  >Felipe Contreras

                  Heh, heh, heh. Don't flip your wig, Felipe. There are lots of ways of
                  dealing with this issue ... you just have to get to know them and choose
                  between them.

                  The basic problem is that, unless you have a dept-wide or project-wide
                  standard to follow re tabbing, you really can't use leading tabs
                  effectively. IMHO, ts=8 is disgusting, but there's lots of stuff out
                  there that won't work right with a different setting, which has nothing
                  at all to do with vim per se.

                  The best way to handle this IMO is to :set expandtab and set everything
                  else the way *you* like it, and let everyone else set things the way
                  *they* like it. You need a few mappings to convert from one "tab
                  setting" to another (not really a tab setting at all, since all the
                  leading tabs are removed; the maps just adjust indentation from one
                  'sts' to a different one).

                  Here are my settings:

                  expandtab
                  smarttab
                  smartindent
                  autoindent
                  nocindent
                  tabstop=3
                  softtabstop=3
                  shiftwidth=3
                  textwidth=0
                  formatoptions=cq2

                  You might have to play with the 'smart' settings. My language is
                  FORTRAN-like, so I don't use cindent. Bram will tell you you should
                  never change 'ts' to be other than 8, but I have found the secret to
                  success here is to always have ts=sts=sw. That way *all* commands give
                  you the same degree of indent/undent. There is no way I know of to have
                  a different initial indent from subsequent ones (ie, 8 spaces from the
                  left margin and 3 spaces for all others).

                  If your language doesn't support \t in strings, then you should code
                  embedded tabs by catenating a variable set to ^I:

                  TB = char(9)
                  STRING = "Some stuff":TB:"some more stuff"

                  Or a function to return 'n' tabs:

                  FUNCTION TAB(nbr)
                  IF NOT(nbr) OR NOT(NUMERIC(nbr)) THEN RETURN('')
                  str = ''
                  FOR I = 1 TO nbr
                  str = str:char(9)
                  NEXT I
                  RETURN(str)
                  END
                  STRING = "Some stuff":TAB(3):"some more stuff"

                  Otherwise you might end up converting whitespace in strings as well,
                  which you almost certainly don't want to do. Here are the maps I use to
                  switch between tab settings:

                  map ,t- :setl et\|:retab<cr>
                  map ,t2 :setl noet ts=2 sts=2 sw=2\|:retab!<cr>
                  map ,t3 :setl noet ts=3 sts=3 sw=3\|:retab!<cr>
                  map ,t4 :setl noet ts=4 sts=4 sw=4\|:retab!<cr>

                  Have fun!

                  BTW, if you don't like my approach, check the archives; there have been
                  numerous discussions on this topic.

                  -Keith
                • James Widman
                  ... I mean that when I type in your example, the type-specifier lines up with the type-specifier from the previous line. Assuming the m in my_test_function
                  Message 8 of 20 , Dec 27, 2004
                  • 0 Attachment
                    On 2004/12/27, at 18:30, Felipe Contreras wrote:

                    > On Mon, 27 Dec 2004 17:59:56 +0000, James Widman <james@...>
                    > wrote:
                    >> Hi Felipe,
                    >>
                    >> I'm confused; with a ~/.vimrc that consists only of:
                    >> set nocompatible
                    >> set ts=4
                    >> set cindent
                    >> set cino=(0
                    >>
                    >> ...it seems that I get the desired indenting behavior. I'm using
                    >> version 6.1 on Mac OS 10.3.7.
                    >
                    > You mean 2 tabs and 21 spaces?

                    I mean that when I type in your example, the type-specifier lines up
                    with the type-specifier from the previous line. Assuming the 'm' in
                    my_test_function is in the first column, that means 5 tabs and one
                    space. I don't know how you got 2 and 21.

                    James
                  • Felipe Contreras
                    ... Yeah, I know it lines up, but the problem is that if you change the tabstop it will get weird. I don t get 2 tabs and 21 lines, that s exactly what I want,
                    Message 9 of 20 , Dec 27, 2004
                    • 0 Attachment
                      On Mon, 27 Dec 2004 20:19:05 +0000, James Widman <james@...> wrote:
                      >
                      > I mean that when I type in your example, the type-specifier lines up
                      > with the type-specifier from the previous line. Assuming the 'm' in
                      > my_test_function is in the first column, that means 5 tabs and one
                      > space. I don't know how you got 2 and 21.

                      Yeah, I know it lines up, but the problem is that if you change the
                      tabstop it will get weird.

                      I don't get 2 tabs and 21 lines, that's exactly what I want, as oposed
                      to 5 tabs and 1 line.

                      --
                      Felipe Contreras
                    • Mathias Michaelis
                      Hi * ... This is also my opinion. My favorite style of using tabs is: 1. I insert at the beginning of each line exactly as many tabs as is required by the
                      Message 10 of 20 , Dec 27, 2004
                      • 0 Attachment
                        Hi *

                        > It would be good to have something like this instead.
                        >
                        > my_test_funcion_line(const char *my_first_arg,
                        > const char *my_second_arg);
                        >
                        > Which is 2 tabs of indentation, and the unclosed parenthesis line
                        > have 21 spaces in order to align.
                        >
                        This is also my opinion. My favorite style of using tabs is:

                        1. I insert at the beginning of each line exactly as many tabs as is
                        required by the level of intentation

                        2. I don't use tabs at any other place

                        Independend of the fact that vim may or may not work properly with
                        certain nonstandard settings I can imagine a boolean option to turn
                        on or off this simple behaviour that results of the above simple two
                        rules. I my opinion it would be nice to know this to have in a TODO
                        list.

                        Best regards
                        Mathias
                      • Robert Webb
                        I think a lot of people have misunderstood what Felipe was asking (myself included at first)... ... Felipe is not complaining about something not lining up,
                        Message 11 of 20 , Dec 27, 2004
                        • 0 Attachment
                          I think a lot of people have misunderstood what Felipe was asking
                          (myself included at first)...

                          Felipe Contreras wrote:

                          > The issue is simple, having ts=4 and cino=(0 I get this.
                          >
                          > my_test_funcion_line(const char *my_first_arg,
                          > const char *my_second_arg);
                          >
                          > Which is 2 tabs of indentation, and the unclosed parenthesis line have
                          > 5 more tabs and 1 space in order to align it to the parenthesis.
                          >
                          > It would be good to have something like this instead.
                          >
                          > my_test_funcion_line(const char *my_first_arg,
                          > const char *my_second_arg);
                          >
                          > Which is 2 tabs of indentation, and the unclosed parenthesis line have
                          > 21 spaces in order to align.
                          >
                          > That way it doesn't matter the tab size it will always look good.

                          Felipe is not complaining about something not lining up, but
                          suggesting that there are two different types of indentation.
                          The first is the indentation from one level of code to another (eg
                          after "if" or inside {}s). It's purpose is to change the level of
                          indentation, ie *not* to line things up. The second type of
                          indentation is used when you *do* want to line things up (eg the
                          example Felipe gives, where a continuing line is aligned with an
                          opening "(").

                          He suggests that the first type use tabs, and the second type use
                          spaces. This means that the tabstop can be changed to another value,
                          and everything should still line up. That is, the indentation between
                          nested levels of code will increase/decrease, but continuing lines
                          will still line up with the opening "(" because their additional
                          indentation was only made using spaces.

                          It's not a bad idea. Personally I would probably prefer as many tabs
                          as possible though, as I never change the tabstop setting. It would
                          have to be an option if anything. And if you used ts=8 and sw=4,
                          things would never line up properly again if you changed the ts
                          anyway.

                          Bram replied:

                          > Sorry, Vim only supports a tabstop of 8 properly. You can change
                          > the setting, but don't expect everything to work well. Eight is the
                          > standard value for tabs, any other value will cause trouble sooner
                          > or later.

                          Huh? I always use ts=4, which is more standard than ts=8 on Windows
                          (ts=4 is the default in Visual Studio), and have never had a problem.
                          Everything works exactly as it should. Doesn't seem to me like the
                          value 8 is any better supported than any other value.

                          > You can use 'softtabstop' instead. Or set 'expandtab' and use
                          > spaces only.

                          You can also change from one tabstop setting to another using :retab

                          Rob.

                          --

                          Robert Webb <RobertW@...>,
                          Want to make polyhedra?
                          <http://www.software3d.com/Stella.html>
                        • James Widman
                          ... Hmm.... [[ begin imaginary .vimrc ]] ... ...so something like this is desired? James
                          Message 12 of 20 , Dec 27, 2004
                          • 0 Attachment
                            On 2004/12/28, at 2:25, Robert Webb wrote:
                            > Felipe is not complaining about something not lining up, but
                            > suggesting that there are two different types of indentation.

                            Hmm....

                            " [[ begin imaginary .vimrc ]]
                            :autocmd SynRegionEnter cParen set et
                            :autocmd SynRegionLeave cParen set noet

                            ...so something like this is desired?

                            James
                          • Gary Johnson
                            ... 8 is the standard value on Unix. Those Unix utilities that assume a value at all assume a value of 8. Gary -- Gary Johnson | Agilent
                            Message 13 of 20 , Dec 28, 2004
                            • 0 Attachment
                              On 2004-12-28, Robert Webb <RobertW@...> wrote:

                              > Bram replied:
                              >
                              > > Sorry, Vim only supports a tabstop of 8 properly. You can change
                              > > the setting, but don't expect everything to work well. Eight is the
                              > > standard value for tabs, any other value will cause trouble sooner
                              > > or later.
                              >
                              > Huh? I always use ts=4, which is more standard than ts=8 on Windows
                              > (ts=4 is the default in Visual Studio), and have never had a problem.
                              > Everything works exactly as it should. Doesn't seem to me like the
                              > value 8 is any better supported than any other value.

                              8 is the standard value on Unix. Those Unix utilities that assume a
                              value at all assume a value of 8.

                              Gary

                              --
                              Gary Johnson | Agilent Technologies
                              garyjohn@... | Wireless Division
                              | Spokane, Washington, USA
                            • Bram Moolenaar
                              ... I have had lots of problems with Visual Studio assuming a tabstop of 4. Mostly when editing files with Vim that others edited with Visual Studio. Have to
                              Message 14 of 20 , Dec 28, 2004
                              • 0 Attachment
                                Robert Webb wrote:

                                > Bram replied:
                                >
                                > > Sorry, Vim only supports a tabstop of 8 properly. You can change
                                > > the setting, but don't expect everything to work well. Eight is the
                                > > standard value for tabs, any other value will cause trouble sooner
                                > > or later.
                                >
                                > Huh? I always use ts=4, which is more standard than ts=8 on Windows
                                > (ts=4 is the default in Visual Studio), and have never had a problem.
                                > Everything works exactly as it should. Doesn't seem to me like the
                                > value 8 is any better supported than any other value.

                                I have had lots of problems with Visual Studio assuming a tabstop of 4.
                                Mostly when editing files with Vim that others edited with Visual
                                Studio. Have to guess the tabstop setting and manually adjust it.

                                Actually, you can change the setting in Visual Studio, and some people
                                set it to 2 or 3. Problem is that only 8 is a real standard, everything
                                else is a user preference. Or a MicroSoft preference (which some people
                                mistake for a standard).

                                > > You can use 'softtabstop' instead. Or set 'expandtab' and use
                                > > spaces only.
                                >
                                > You can also change from one tabstop setting to another using :retab

                                Doesn't solve the problem that the text looks different in other
                                programs.

                                --
                                hundred-and-one symptoms of being an internet addict:
                                142. You dream about creating the world's greatest web site.

                                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                                \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
                              • Felipe Contreras
                                ... I agree 8 is the standard. But talking about coding styles everyone has it s own standard so if something can be said about tabstop is that the standard
                                Message 15 of 20 , Dec 28, 2004
                                • 0 Attachment
                                  On Tue, 28 Dec 2004 12:37:21 +0100, Bram Moolenaar <Bram@...> wrote:
                                  >
                                  > Robert Webb wrote:
                                  >
                                  > > Huh? I always use ts=4, which is more standard than ts=8 on Windows
                                  > > (ts=4 is the default in Visual Studio), and have never had a problem.
                                  > > Everything works exactly as it should. Doesn't seem to me like the
                                  > > value 8 is any better supported than any other value.
                                  >
                                  > I have had lots of problems with Visual Studio assuming a tabstop of 4.
                                  > Mostly when editing files with Vim that others edited with Visual
                                  > Studio. Have to guess the tabstop setting and manually adjust it.
                                  >
                                  > Actually, you can change the setting in Visual Studio, and some people
                                  > set it to 2 or 3. Problem is that only 8 is a real standard, everything
                                  > else is a user preference. Or a MicroSoft preference (which some people
                                  > mistake for a standard).

                                  I agree 8 is the standard. But talking about coding styles everyone
                                  has it's own "standard" so if something can be said about tabstop is
                                  that the standard is 8, but people use a lot of different settings,
                                  hence my feature request.

                                  In fact it has one advantage over "only spaces": it will look good at
                                  the prefered tabstop of the viewer user.

                                  --
                                  Felipe Contreras
                                • Bram Moolenaar
                                  ... You can have different coding styles and still keep tabstop at 8. Don t mixup the tabstop setting with the indent increments ( shiftwidth in Vim). ...
                                  Message 16 of 20 , Dec 28, 2004
                                  • 0 Attachment
                                    Felipe Contreras wrote:

                                    > I agree 8 is the standard. But talking about coding styles everyone
                                    > has it's own "standard" so if something can be said about tabstop is
                                    > that the standard is 8, but people use a lot of different settings,
                                    > hence my feature request.

                                    You can have different coding styles and still keep tabstop at 8.
                                    Don't mixup the tabstop setting with the indent increments ('shiftwidth'
                                    in Vim).

                                    > In fact it has one advantage over "only spaces": it will look good at
                                    > the prefered tabstop of the viewer user.

                                    That only works when the writer is very careful about how tabs are used.
                                    Thus using spaces for indent where needed. Otherwise comments and
                                    continuation lines won't align properly. Not many people are that
                                    careful, thus in general you can't change the tabstop without getting a
                                    few wrong indents.

                                    --
                                    We are the Borg of GNU GPL. We will assimilate your source code.
                                    Resistance is futile.

                                    /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                    /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                    \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                                    \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
                                  • Antoine J. Mechelynck
                                    ... (Sorry if this is a stale thread or if this issue has already been answered. I m only starting to catch up with all the mail accumulated since my disk
                                    Message 17 of 20 , Jan 5, 2005
                                    • 0 Attachment
                                      Gary Johnson wrote:
                                      > On 2004-12-28, Robert Webb <RobertW@...> wrote:
                                      >
                                      >
                                      >>Bram replied:
                                      >>
                                      >>
                                      >>>Sorry, Vim only supports a tabstop of 8 properly. You can change
                                      >>>the setting, but don't expect everything to work well. Eight is the
                                      >>>standard value for tabs, any other value will cause trouble sooner
                                      >>>or later.
                                      >>
                                      >>Huh? I always use ts=4, which is more standard than ts=8 on Windows
                                      >>(ts=4 is the default in Visual Studio), and have never had a problem.
                                      >>Everything works exactly as it should. Doesn't seem to me like the
                                      >>value 8 is any better supported than any other value.
                                      >
                                      >
                                      > 8 is the standard value on Unix. Those Unix utilities that assume a
                                      > value at all assume a value of 8.
                                      >
                                      > Gary
                                      >
                                      (Sorry if this is a stale thread or if this issue has already been
                                      answered. I'm only starting to catch up with all the mail accumulated
                                      since my disk crashed about a fortnight ago.)

                                      8 also used to be the DOS standard. Before Windows even existed,
                                      practically all DOS programs that knew about tabs aligned them to a
                                      multiple of 8 spaces. IIRC, even "cooked" console output would (under
                                      DOS) convert a 0x09 byte to as many spaces as needed to have the last
                                      one of them fall on a multiple-of-8 column.

                                      Best regards,
                                      Tony.
                                    • Robert Webb
                                      A bunch of people replied to me... ... [The Huh? section below was mine...] ... I know tab=8 is standard in lots of places, but this has nothing to do with
                                      Message 18 of 20 , Jan 5, 2005
                                      • 0 Attachment
                                        A bunch of people replied to me...

                                        > >>>Sorry, Vim only supports a tabstop of 8 properly. You can change
                                        > >>>the setting, but don't expect everything to work well. Eight is
                                        > >>>the standard value for tabs, any other value will cause trouble
                                        > >>>sooner or later.

                                        [The "Huh?" section below was mine...]

                                        > >>Huh? I always use ts=4, which is more standard than ts=8 on
                                        > >>Windows (ts=4 is the default in Visual Studio), and have never had
                                        > >>a problem. Everything works exactly as it should. Doesn't seem
                                        > >>to me like the value 8 is any better supported than any other
                                        > >>value.
                                        > >
                                        > > 8 is the standard value on Unix. Those Unix utilities that assume
                                        > > a value at all assume a value of 8.
                                        > >
                                        > (Sorry if this is a stale thread or if this issue has already been
                                        > answered. I'm only starting to catch up with all the mail
                                        > accumulated since my disk crashed about a fortnight ago.)
                                        >
                                        > 8 also used to be the DOS standard. Before Windows even existed,
                                        > practically all DOS programs that knew about tabs aligned them to a
                                        > multiple of 8 spaces. IIRC, even "cooked" console output would
                                        > (under DOS) convert a 0x09 byte to as many spaces as needed to have
                                        > the last one of them fall on a multiple-of-8 column.

                                        I know tab=8 is standard in lots of places, but this has nothing to do
                                        with what I was saying. I was saying that vim supports any size tab
                                        perfectly well. Sure if you use external filters something might go
                                        haywire, but that's not vim's fault. Within vim, as far as I can
                                        tell, any size tab is fully supported. But Bram himself said it
                                        wasn't supported properly. I'm just wondering what that means.

                                        Yes, 8 is standard mostly, but I'm so glad VC++ uses 4, as I just find
                                        it a much nicer level of indent. I know about sw=4, but it's just not
                                        quite the same. I use ts=4 all the time, and have never noticed a
                                        single problem.

                                        Rob.

                                        --

                                        Robert Webb <RobertW@...>,
                                        Want to make polyhedra?
                                        <http://www.software3d.com/Stella.html>
                                      • Keith Roberts
                                        ... Whether vim (or any other software) only handles tabstops of 8 properly is not an issue if you take the hard tabs out of the equation. It is easy
                                        Message 19 of 20 , Jan 6, 2005
                                        • 0 Attachment
                                          >-----Original Message-----
                                          >From: Antoine J. Mechelynck [mailto:antoine.mechelynck@...]
                                          >Sent: Wednesday, January 05, 2005 9:28 PM
                                          >To: Gary Johnson
                                          >Cc: Vimdev
                                          >Subject: Re: Feature: improvement in cinoptions
                                          >
                                          >Gary Johnson wrote:
                                          >> On 2004-12-28, Robert Webb <RobertW@...> wrote:
                                          >>
                                          >>
                                          >>>Bram replied:
                                          >>>
                                          >>>
                                          >>>>Sorry, Vim only supports a tabstop of 8 properly. You can
                                          >change the
                                          >>>>setting, but don't expect everything to work well. Eight is the
                                          >>>>standard value for tabs, any other value will cause trouble
                                          >sooner or
                                          >>>>later.
                                          >>>
                                          >>>Huh? I always use ts=4, which is more standard than ts=8 on Windows
                                          >>>(ts=4 is the default in Visual Studio), and have never had a problem.
                                          >>>Everything works exactly as it should. Doesn't seem to me like the
                                          >>>value 8 is any better supported than any other value.
                                          >>
                                          >>
                                          >> 8 is the standard value on Unix. Those Unix utilities that assume a
                                          >> value at all assume a value of 8.
                                          >>
                                          >> Gary
                                          >>
                                          >(Sorry if this is a stale thread or if this issue has already
                                          >been answered. I'm only starting to catch up with all the mail
                                          >accumulated since my disk crashed about a fortnight ago.)
                                          >
                                          >8 also used to be the DOS standard. Before Windows even
                                          >existed, practically all DOS programs that knew about tabs
                                          >aligned them to a multiple of 8 spaces. IIRC, even "cooked"
                                          >console output would (under
                                          >DOS) convert a 0x09 byte to as many spaces as needed to have
                                          >the last one of them fall on a multiple-of-8 column.
                                          >
                                          >Best regards,
                                          >Tony.

                                          Whether vim (or any other software) 'only handles tabstops of 8
                                          properly' is not an issue if you take the "hard" tabs out of the
                                          equation. It is easy enough to change to your own tabbing preferences
                                          w/o disturbing the rest of creation. I use the following maps to make
                                          life easier:

                                          " Tabstop settings (use the one for the current setting,
                                          " then the one for the setting you desire, then ,t- to
                                          " change tabs to spaces)
                                          map ,t2 :setl noet ts=2 sts=2 sw=2\|:retab!<cr>
                                          map ,t3 :setl noet ts=3 sts=3 sw=3\|:retab!<cr>
                                          map ,t4 :setl noet ts=4 sts=4 sw=4\|:retab!<cr>
                                          " Undo tabbing (convert to spaces so everyone sees it the same)
                                          map ,t- :setl et\|:retab<cr>

                                          The secret is to make sure that ts=sts=sw so that all commands which
                                          either indent or "shift" text operate the same.

                                          -Keith
                                        • Antoine J. Mechelynck
                                          ... I was not contradicting you; rather, I was reacting to the latest post above mine, saying 8 was standard on Unix as if to mean Dos/Windows had a
                                          Message 20 of 20 , Jan 7, 2005
                                          • 0 Attachment
                                            Robert Webb wrote:
                                            > A bunch of people replied to me...
                                            >
                                            >
                                            >>>>>Sorry, Vim only supports a tabstop of 8 properly. You can change
                                            >>>>>the setting, but don't expect everything to work well. Eight is
                                            >>>>>the standard value for tabs, any other value will cause trouble
                                            >>>>>sooner or later.
                                            >
                                            >
                                            > [The "Huh?" section below was mine...]
                                            >
                                            >
                                            >>>>Huh? I always use ts=4, which is more standard than ts=8 on
                                            >>>>Windows (ts=4 is the default in Visual Studio), and have never had
                                            >>>>a problem. Everything works exactly as it should. Doesn't seem
                                            >>>>to me like the value 8 is any better supported than any other
                                            >>>>value.
                                            >>>
                                            >>>8 is the standard value on Unix. Those Unix utilities that assume
                                            >>>a value at all assume a value of 8.
                                            >>>
                                            >>
                                            >>(Sorry if this is a stale thread or if this issue has already been
                                            >>answered. I'm only starting to catch up with all the mail
                                            >>accumulated since my disk crashed about a fortnight ago.)
                                            >>
                                            >>8 also used to be the DOS standard. Before Windows even existed,
                                            >>practically all DOS programs that knew about tabs aligned them to a
                                            >>multiple of 8 spaces. IIRC, even "cooked" console output would
                                            >>(under DOS) convert a 0x09 byte to as many spaces as needed to have
                                            >>the last one of them fall on a multiple-of-8 column.
                                            >
                                            >
                                            > I know tab=8 is standard in lots of places, but this has nothing to do
                                            > with what I was saying. I was saying that vim supports any size tab
                                            > perfectly well. Sure if you use external filters something might go
                                            > haywire, but that's not vim's fault. Within vim, as far as I can
                                            > tell, any size tab is fully supported. But Bram himself said it
                                            > wasn't supported properly. I'm just wondering what that means.
                                            >
                                            > Yes, 8 is standard mostly, but I'm so glad VC++ uses 4, as I just find
                                            > it a much nicer level of indent. I know about sw=4, but it's just not
                                            > quite the same. I use ts=4 all the time, and have never noticed a
                                            > single problem.
                                            >
                                            > Rob.
                                            >
                                            > --
                                            >
                                            > Robert Webb <RobertW@...>,
                                            > Want to make polyhedra?
                                            > <http://www.software3d.com/Stella.html>
                                            >
                                            >
                                            >

                                            I was not contradicting you; rather, I was reacting to the latest post
                                            above mine, saying 8 was standard "on Unix" as if to mean Dos/Windows
                                            had a different standard or no standard. I'm not convinced that 4 is
                                            more standard than 8 on Windows but anyway I was talking about Dos as it
                                            existed before Windows came into the picture.

                                            For my own use, I use varying levels of indent depending on context and
                                            filetype. For instance in HTML lists and tables with heavy indent
                                            nesting I often use 2; but in such cases I use spaces instead of tabs so
                                            I can keep my hard tabs at 8. I've also read on this list that in Python
                                            (where tabs have a semantic value) the interpreter always assumes 8.

                                            I'm not telling you what to use: if it works for you, great. Live and
                                            let live is my motto.

                                            Best regards,
                                            Tony.
                                          Your message has been successfully submitted and would be delivered to recipients shortly.