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

Wrong comment character after newline

Expand Messages
  • Marco
    Hi, I use ConTeXt with the asciimode setting. That means the comment character is %%, instead of %. I set commentstring to %% %s. However, when I start a new
    Message 1 of 6 , Jan 10, 2013
      Hi,

      I use ConTeXt with the \asciimode setting. That means the comment
      character is %%, instead of %. I set commentstring to %% %s.
      However, when I start a new line in a comment, only one percent sign
      is inserted, instead of two followed by a space:

      %% Foo<CR>
      %
      ^ (cursor)

      I'd like to have it like this:

      %% Foo<CR>
      %%
      ^ (cursor)

      What option is responsible for the string that is inserted after a
      newline is started in a comment? It does not seem to be related to
      commentstring.

      Marco
    • Christian Brabandt
      ... The commentstring option is only used for folding. I think, you need to tweak the comments option. regards, Christian -- You received this message from
      Message 2 of 6 , Jan 10, 2013
        On Thu, January 10, 2013 13:04, Marco wrote:
        > Hi,
        >
        > I use ConTeXt with the \asciimode setting. That means the comment
        > character is %%, instead of %. I set commentstring to %% %s.
        > However, when I start a new line in a comment, only one percent sign
        > is inserted, instead of two followed by a space:
        >
        > %% Foo<CR>
        > %
        > ^ (cursor)
        >
        > I'd like to have it like this:
        >
        > %% Foo<CR>
        > %%
        > ^ (cursor)
        >
        > What option is responsible for the string that is inserted after a
        > newline is started in a comment? It does not seem to be related to
        > commentstring.

        The commentstring option is only used for folding. I think,
        you need to tweak the 'comments' option.

        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
      • Marco
        ... Tim Popes commentary plugin uses the commentstring as well. ... That s it, thanks. Marco
        Message 3 of 6 , Jan 10, 2013
          On 2013–01–10 Christian Brabandt wrote:

          > The commentstring option is only used for folding.

          Tim Popes commentary plugin uses the commentstring as well.

          > I think, you need to tweak the 'comments' option.

          That's it, thanks.

          Marco
        • Christian Brabandt
          ... Yeah, it is probably used in a couple of more plugins. I use it myself in the NrrwRgn plugin. What I meant was in the core functionality of Vim, it is only
          Message 4 of 6 , Jan 10, 2013
            On Thu, January 10, 2013 15:56, Marco wrote:
            > On 2013–01–10 Christian Brabandt wrote:
            >
            >> The commentstring option is only used for folding.
            >
            > Tim Popes commentary plugin uses the commentstring as well.

            Yeah, it is probably used in a couple of more plugins. I use
            it myself in the NrrwRgn plugin. What I meant was in the core
            functionality of Vim, it is only used for folding (as stated
            by the help).

            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
          • Benji Fisher
            ... (sent from Gmail web interface: apologies if it is not plain text) The default ftplugin for TeX (all flavors) sets comments to sO:% -,mO:% ,exO:%%,:% .
            Message 5 of 6 , Jan 10, 2013
              On Thu, Jan 10, 2013 at 10:29 AM, Christian Brabandt <cblists@...> wrote:
              On Thu, January 10, 2013 15:56, Marco wrote:
              > On 2013–01–10 Christian Brabandt wrote:
              >
              >> The commentstring option is only used for folding.
              >
              > Tim Popes commentary plugin uses the commentstring as well.

              Yeah, it is probably used in a couple of more plugins. I use
              it myself in the NrrwRgn plugin. What I meant was in the core
              functionality of Vim, it is only used for folding (as stated
              by the help).

              regards,
              Christian

              (sent from Gmail web interface:  apologies if it is not plain text)

              The default ftplugin for TeX (all flavors) sets 'comments' to 'sO:% -,mO:%  ,exO:%%,:%'.  This is good if you like this sort of comment block:

              % -
              %  This is a comment
              %  block
              %  in TeX
              %%

              If you do not use such blocks, and you just want to use '%%" as your comment marker, then

              :set comments=:%%

              should do it.  See also

              :help 'comments'
              :help format-comments
              :help fo-table

              -- 
              HTH
              Benji Fisher

              --
              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
            • Marco
              ... For context the default was comments=b:%D,b:%C,b:%M,:% and I changed it to comments=b:%D,b:%C,b:%M,:%% which is working as I expect it to. ... Very
              Message 6 of 6 , Jan 10, 2013
                On 2013–01–10 Benji Fisher wrote:

                > The default ftplugin for TeX (all flavors) sets 'comments' to 'sO:% -,mO:%
                > ,exO:%%,:%'. This is good if you like this sort of comment block:

                For context the default was

                comments=b:%D,b:%C,b:%M,:%

                and I changed it to

                comments=b:%D,b:%C,b:%M,:%%

                which is working as I expect it to.

                > :help format-comments

                Very helpful, indeed. I didn't know that comments could be
                fine-tuned with such granularity.

                Marco
              Your message has been successfully submitted and would be delivered to recipients shortly.