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

I wish I had known this earlier; please put it in the docs!

Expand Messages
  • Manuel Ortega
    Dear Bram, While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the attributes to the command :command can be abbreviated. Namely: instance:
    Message 1 of 5 , Aug 19, 2013
      Dear Bram,

      While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the
      "attributes" to the command ":command" can be abbreviated.  Namely:
      instance:

         -n[args]
         -com[plete]
         -ra[nge]
         -cou[nt]
         -re[gister]
         -ban[g]

      I didn't ever know this before.  No wonder!  As far as I can tell, there
      is nothing at all in the docs that says this can be done.  It's not in
      ":h :command" after scrolling down.  It's not in usr_40.txt.  Even
      ":helpg" comes up empty when fed "-n=", "-ra=", etc.

      This is VERY useful info and I could really have used it years ago.
      Please add it to the docs.  It should be included in the relevant
      subheadings of ":h :command", such as ":h command-nargs" and so forth.

      One shouldn't have to be poking through a super-complicated syntax file
      to discover things like this :)

      -Manny

      --
      --
      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.
    • Manuel Ortega
      ... In fact, not only was none of this in the docs, but I couldn t find ANY *usages* of it ANYWHERE in the entire runtime directory, except for 4 occurrences
      Message 2 of 5 , Aug 19, 2013
        On Mon, Aug 19, 2013 at 3:53 PM, Manuel Ortega <mannyvimdev@...> wrote:
        Dear Bram,

        While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the
        "attributes" to the command ":command" can be abbreviated.  Namely:
        instance:

           -n[args]
           -com[plete]
           -ra[nge]
           -cou[nt]
           -re[gister]
           -ban[g]

        I didn't ever know this before.  No wonder!  As far as I can tell, there
        is nothing at all in the docs that says this can be done.  It's not in
        ":h :command" after scrolling down.  It's not in usr_40.txt.  Even
        ":helpg" comes up empty when fed "-n=", "-ra=", etc.

        This is VERY useful info and I could really have used it years ago.
        Please add it to the docs.  It should be included in the relevant
        subheadings of ":h :command", such as ":h command-nargs" and so forth.

        One shouldn't have to be poking through a super-complicated syntax file
        to discover things like this :)

        In fact, not only was none of this in the docs, but I couldn't find ANY *usages* of it ANYWHERE in the entire runtime directory, except for 4 occurrences of "-na=" (which isn't even as short as it could be) in the vimball plugin.

        So I conclude I'm not the only one who didn't know about it :)

        -Manny 

        --
        --
        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.
      • Gary Johnson
        ... Your point about the lack of documentation is well taken. However, I would not conclude that absence of use is evidence of absence of knowledge. The only
        Message 3 of 5 , Aug 19, 2013
          On 2013-08-19, Manuel Ortega wrote:
          > On Mon, Aug 19, 2013 at 3:53 PM, Manuel Ortega <mannyvimdev@...> wrote:
          >
          > Dear Bram,
          >
          > While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the
          > "attributes" to the command ":command" can be abbreviated.  Namely:
          > instance:
          >
          >    -n[args]
          >    -com[plete]
          >    -ra[nge]
          >    -cou[nt]
          >    -re[gister]
          >    -ban[g]
          >
          > I didn't ever know this before.  No wonder!  As far as I can tell, there
          > is nothing at all in the docs that says this can be done.  It's not in
          > ":h :command" after scrolling down.  It's not in usr_40.txt.  Even
          > ":helpg" comes up empty when fed "-n=", "-ra=", etc.
          >
          > This is VERY useful info and I could really have used it years ago.
          > Please add it to the docs.  It should be included in the relevant
          > subheadings of ":h :command", such as ":h command-nargs" and so forth.
          >
          > One shouldn't have to be poking through a super-complicated syntax file
          > to discover things like this :)
          >
          >
          > In fact, not only was none of this in the docs, but I couldn't find ANY
          > *usages* of it ANYWHERE in the entire runtime directory, except for 4
          > occurrences of "-na=" (which isn't even as short as it could be) in the vimball
          > plugin.
          >
          > So I conclude I'm not the only one who didn't know about it :)

          Your point about the lack of documentation is well taken. However,
          I would not conclude that absence of use is evidence of absence of
          knowledge.

          The only time those arguments are used is when defining a command,
          which is almost always done in one's .vimrc or in a plugin and
          hardly ever done from the command line, so there is little advantage
          to the shorter form. Further, the shorter form are significantly
          less intelligible.

          Whenever I put a Vim command in my .vimrc or in a plugin, I almost
          always use the long form of all commands simply because I think it
          is easier to understand. If I looked at a command definition that
          contained "-ban" for example, I would wonder what the heck that
          meant, whereas I would immediately know what "-bang" meant. When
          I'm defining a command, the difference in time or space between
          typing the long form and the short form is insignificant.

          Regards,
          Gary

          --
          --
          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.
        • Dimitar DIMITROV
          ... Dimitar -- -- 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
          Message 4 of 5 , Aug 19, 2013
            >> On Mon, Aug 19, 2013 at 3:53 PM, Manuel Ortega <mannyvimdev@...> wrote:
            >>
            >>    Dear Bram,
            >>
            >>    While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the
            >>    "attributes" to the command ":command" can be abbreviated.  Namely:
            >>    instance:
            >>
            >>       -n[args]
            >>       -com[plete]
            >>       -ra[nge]
            >>       -cou[nt]
            >>       -re[gister]
            >>       -ban[g]
            >>
            >>    I didn't ever know this before. 
            No wonder!  As far as I can tell, there
            >>    is nothing at all in the docs that says this can be done.  It's not in
            >>    ":h :command" after scrolling down.  It's not in usr_40.txt.  Even
            >>    ":helpg" comes up empty when fed "-n=", "-ra=", etc.
            >>
            >>    This is VERY useful info and I could really have used it years ago.
            >>    Please add it to the docs.  It should be included in the relevant
            >>    subheadings of ":h :command", such as ":h command-nargs" and so forth.
            >>
            >>    One shouldn't have to be poking through a super-complicated syntax file
            >>    to discover things like this :)
            >>
            >>
            >> In fact, not only was none of this in the docs, but I couldn't find ANY
            >> *usages* of it
            ANYWHERE in the entire runtime directory, except for 4
            >> occurrences of "-na=" (which isn't even as short as it could be) in the vimball
            >> plugin.
            >>
            >> So I conclude I'm not the only one who didn't know about it :)
            >
            >Your point about the lack of documentation is well taken.  However,
            >I would not conclude that absence of use is evidence of absence of
            >knowledge.
            >
            >The only time those arguments are used is when defining a command,
            >which is almost always done in one's .vimrc or in a plugin and
            >hardly ever done from the command line, so there is little advantage
            >to the shorter form.  Further, the shorter form are significantly
            >less intelligible.
            >
            >Whenever I put a Vim command in my .vimrc or in a plugin, I almost
            >always use the long form of all commands simply because I think it
            >is easier to understand.  If I
            looked at a command definition that
            >contained "-ban" for example, I would wonder what the heck that
            >meant, whereas I would immediately know what "-bang" meant.  When
            >I'm defining a command, the difference in time or space between
            >typing the long form and the short form is insignificant.

            Agreed. Just wanted to mention a few very usefull :help related shortcuts not very well known:

            :h i^x^n Vs :help i_CTRL-X_CTRL-N
            :h^x^n works as well (no spaces needed, ^x can be entered as caret+x or <c-v> followed by <c-x>)
            :h::

            >Regards,
            >Gary

            Dimitar

            --
            --
            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
            ... That these abbreviations work is an accident. I rather not document them. I could fix the code to make sure the full name is used, but that might break
            Message 5 of 5 , Aug 22, 2013
              Manuel Ortega wrote:

              > While perusing $VIMRUNTIME/syntax/vim.vim, I noticed that many of the
              > "attributes" to the command ":command" can be abbreviated. Namely:
              > instance:
              >
              > -n[args]
              > -com[plete]
              > -ra[nge]
              > -cou[nt]
              > -re[gister]
              > -ban[g]
              >
              > I didn't ever know this before. No wonder! As far as I can tell, there
              > is nothing at all in the docs that says this can be done. It's not in
              > ":h :command" after scrolling down. It's not in usr_40.txt. Even
              > ":helpg" comes up empty when fed "-n=", "-ra=", etc.
              >
              > This is VERY useful info and I could really have used it years ago.
              > Please add it to the docs. It should be included in the relevant
              > subheadings of ":h :command", such as ":h command-nargs" and so forth.
              >
              > One shouldn't have to be poking through a super-complicated syntax file
              > to discover things like this :)

              That these abbreviations work is an accident. I rather not document
              them. I could fix the code to make sure the full name is used, but that
              might break some existing scripts.

              I think leaving this undocumented is the best solution. The problem is
              that it's now tricky to add another argument, changing the order of the
              compares will change the abbreviations. If a new argument is added we
              can check the full word for that.

              --
              hundred-and-one symptoms of being an internet addict:
              101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

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