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

[patch] sets PEP8 indenting suggestions as default in python files

Expand Messages
  • Lorenzo Bercelli
    This patch sets tabs as equal to 4 spaces in python files, as strongly suggested by the PEP8 ( http://www.python.org/dev/peps/pep-0008/#indentation ) . T his
    Message 1 of 11 , Sep 17 2:30 PM
    • 0 Attachment
      This patch sets tabs as equal to 4 spaces in python files, as
      strongly
      suggested by the PEP8
      (
      http://www.python.org/dev/peps/pep-0008/#indentation
      )
      .
       T
      his are probably some of the most often found options in .vimrc files, it's also the first thing suggested in all those 'create a python development environment with vim' tutorials, I think it would be easier to just make it default for python files
      .

          Lorenzo Bercelli

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Lorenzo Bercelli
      Oh God sorry I forgot to attach the patch, here it is. Lorenzo ... -- -- You received this message from the vim_dev maillist. Do not top-post! Type your
      Message 2 of 11 , Sep 17 2:36 PM
      • 0 Attachment
        Oh God sorry I forgot to attach the patch, here it is.

         
           Lorenzo


        On Tue, Sep 17, 2013 at 9:30 PM, Lorenzo Bercelli <lo@...> wrote:
        This patch sets tabs as equal to 4 spaces in python files, as
        strongly
        suggested by the PEP8
        (
        http://www.python.org/dev/peps/pep-0008/#indentation
        )
        .
         T
        his are probably some of the most often found options in .vimrc files, it's also the first thing suggested in all those 'create a python development environment with vim' tutorials, I think it would be easier to just make it default for python files
        .

            Lorenzo Bercelli

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        ... You probably want :setlocal instead of :set in the filetype plugin. regards, Christian -- -- You received this message from the vim_dev maillist. Do not
        Message 3 of 11 , Sep 17 11:01 PM
        • 0 Attachment
          On Tue, September 17, 2013 23:36, Lorenzo Bercelli wrote:
          > Oh God sorry I forgot to attach the patch, here it is.

          You probably want :setlocal instead of :set in the filetype plugin.

          regards,
          Christian

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Lorenzo Bercelli
          Right, right, silly me. Here it is dutifully updated Lorenzo Bercelli -- -- You received this message from the vim_dev maillist. Do not top-post! Type your
          Message 4 of 11 , Sep 18 5:48 AM
          • 0 Attachment

            Right, right, silly me. Here it is dutifully updated

            Lorenzo Bercelli

            --
            --
            You received this message from the "vim_dev" 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_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Bram Moolenaar
            ... Your text suggests to set tabstop to 4, but the patch makes clear that you only set softtabstop and shiftwidth to 4. That is OK. Tabstop should be at its
            Message 5 of 11 , Sep 18 1:02 PM
            • 0 Attachment
              Lorenzo Bercelli wrote:

              > This patch sets tabs as equal to 4 spaces in python files, as
              > strongly
              > suggested by the PEP8
              > (
              > http://www.python.org/dev/peps/pep-0008/#indentation
              > )
              > .
              >
              > T
              > his are probably some of the most often found options in .vimrc files,
              > it's also the first thing suggested in all those 'create a python
              > development environment with vim' tutorials, I think it would be easier to
              > just make it default for python files
              > .

              Your text suggests to set tabstop to 4, but the patch makes clear that
              you only set softtabstop and shiftwidth to 4. That is OK. Tabstop
              should be at its default of 8 to avoid trouble.

              --
              hundred-and-one symptoms of being an internet addict:
              226. You sit down at the computer right after dinner and your spouse
              says "See you in the morning."

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              --
              You received this message from the "vim_dev" 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_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Lorenzo Bercelli
              Yes, I didn t explicitly set tabstop=8 because it s already default, should I ? Lorenzo ... -- -- You received this message from the vim_dev maillist. Do not
              Message 6 of 11 , Sep 18 3:12 PM
              • 0 Attachment
                Yes, I didn't explicitly set tabstop=8 because it's already default, should I ?

                 
                   Lorenzo


                On Wed, Sep 18, 2013 at 8:02 PM, Bram Moolenaar <Bram@...> wrote:

                Lorenzo Bercelli wrote:

                > This patch sets tabs as equal to 4 spaces in python files, as
                > strongly
                > suggested by the PEP8
                >  (
                > http://www.python.org/dev/peps/pep-0008/#indentation
                > )
                > .
                >
                >  T
                > his are probably some of the most often found options in .vimrc files,
                > it's also the first thing suggested in all those 'create a python
                > development environment with vim' tutorials, I think it would be easier to
                > just make it default for python files
                > .

                Your text suggests to set tabstop to 4, but the patch makes clear that
                you only set softtabstop and shiftwidth to 4.  That is OK.  Tabstop
                should be at its default of 8 to avoid trouble.

                --
                hundred-and-one symptoms of being an internet addict:
                226. You sit down at the computer right after dinner and your spouse
                     says "See you in the morning."

                 /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
                ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\  an exciting new programming language -- http://www.Zimbu.org        ///
                 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


                --
                --
                You received this message from the "vim_dev" 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_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Marius Gedminas
                ... That may be a good idea. Python interprets ASCII TAB as being 8 spaces wide, for the purposes of indentation:
                Message 7 of 11 , Sep 20 3:22 AM
                • 0 Attachment
                  On Wed, Sep 18, 2013 at 10:12:17PM +0000, Lorenzo Bercelli wrote:
                  > Yes, I didn't explicitly set tabstop=8 because it's already default, should
                  > I ?

                  That may be a good idea. Python interprets ASCII TAB as being 8 spaces
                  wide, for the purposes of indentation:
                  http://docs.python.org/2/reference/lexical_analysis.html#indentation

                  Marius Gedminas
                  --
                  The difference between Microsoft and 'Jurassic Park':
                  In one, a mad businessman makes a lot of money with beasts that should be
                  extinct.
                  The other is a film.
                • Nikolay Pavlov
                  ... should ... I do not think so. Using mixed tabs/spaces is highly discouraged even by vim syntax highlighting; and it is even a syntax error in python 3. If
                  Message 8 of 11 , Sep 20 10:28 AM
                  • 0 Attachment


                    On Sep 20, 2013 2:22 PM, "Marius Gedminas" <marius@...> wrote:
                    >
                    > On Wed, Sep 18, 2013 at 10:12:17PM +0000, Lorenzo Bercelli wrote:
                    > > Yes, I didn't explicitly set tabstop=8 because it's already default, should
                    > > I ?
                    >
                    > That may be a good idea.  Python interprets ASCII TAB as being 8 spaces
                    > wide, for the purposes of indentation:
                    > http://docs.python.org/2/reference/lexical_analysis.html#indentation

                    I do not think so. Using mixed tabs/spaces is highly discouraged even by vim syntax highlighting; and it is even a syntax error in python 3. If tabs are not mixed with spaces it does not matter how wide they are.

                    > Marius Gedminas
                    > --
                    > The difference between Microsoft and 'Jurassic Park':
                    > In one, a mad businessman makes a lot of money with beasts that should be
                    > extinct.
                    > The other is a film.

                    --
                    --
                    You received this message from the "vim_dev" 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_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Lorenzo Bercelli
                    The maintainer hasn t answered this email either. I m sending you the patch again, assuming you approved it the last time. Lorenzo ... -- -- You received this
                    Message 9 of 11 , Sep 24 10:28 AM
                    • 0 Attachment
                      The maintainer hasn't answered this email either. I'm sending you the patch again, assuming you approved it the last time.

                       
                         Lorenzo


                      On Wed, Sep 18, 2013 at 8:02 PM, Bram Moolenaar <Bram@...> wrote:

                      Lorenzo Bercelli wrote:

                      > This patch sets tabs as equal to 4 spaces in python files, as
                      > strongly
                      > suggested by the PEP8
                      >  (
                      > http://www.python.org/dev/peps/pep-0008/#indentation
                      > )
                      > .
                      >
                      >  T
                      > his are probably some of the most often found options in .vimrc files,
                      > it's also the first thing suggested in all those 'create a python
                      > development environment with vim' tutorials, I think it would be easier to
                      > just make it default for python files
                      > .

                      Your text suggests to set tabstop to 4, but the patch makes clear that
                      you only set softtabstop and shiftwidth to 4.  That is OK.  Tabstop
                      should be at its default of 8 to avoid trouble.

                      --
                      hundred-and-one symptoms of being an internet addict:
                      226. You sit down at the computer right after dinner and your spouse
                           says "See you in the morning."

                       /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
                      ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                      \\\  an exciting new programming language -- http://www.Zimbu.org        ///
                       \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


                      --
                      --
                      You received this message from the "vim_dev" 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_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • Bram Moolenaar
                      ... OK. Let s make it one line: As suggested by PEP8. setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 I ll also include the patch for keywordprg. --
                      Message 10 of 11 , Sep 25 4:53 AM
                      • 0 Attachment
                        Lorenzo Bercelli wrote:

                        > The maintainer hasn't answered this email either. I'm sending you the
                        > patch again, assuming you approved it the last time.

                        OK. Let's make it one line:

                        " As suggested by PEP8.
                        setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8

                        I'll also include the patch for keywordprg.


                        --
                        This sentence is not sure that it exists, but if it does, it will
                        certainly consider the possibility that other sentences exist.

                        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                        \\\ an exciting new programming language -- http://www.Zimbu.org ///
                        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                        --
                        --
                        You received this message from the "vim_dev" 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_dev" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • Lorenzo Bercelli
                        Thanks. Made it one line. Lorenzo ... -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are
                        Message 11 of 11 , Sep 25 10:28 AM
                        • 0 Attachment
                          Thanks. Made it one line.

                           
                             Lorenzo


                          On Wed, Sep 25, 2013 at 11:53 AM, Bram Moolenaar <Bram@...> wrote:

                          Lorenzo Bercelli wrote:

                          > The maintainer hasn't answered this email either. I'm sending you the
                          > patch again, assuming you approved it the last time.

                          OK.  Let's make it one line:

                          " As suggested by PEP8.
                          setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8

                          I'll also include the patch for keywordprg.


                          --
                          This sentence is not sure that it exists, but if it does, it will
                          certainly consider the possibility that other sentences exist.

                           /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
                          ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                          \\\  an exciting new programming language -- http://www.Zimbu.org        ///
                           \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

                          --
                          --
                          You received this message from the "vim_dev" 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_dev" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+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.