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

Re: is there better way to define a customer Command like F[oobar]

Expand Messages
  • Paul Isambert
    ... You can use an incomplete command name if there is no ambiguity with another command; for instance, if Foobar is your only command beginning with F, then
    Message 1 of 4 , Apr 9, 2013
    • 0 Attachment
      Kent <kent.yuan@...> a écrit:
      > many vim build in commands have abbreviation, e.g.
      >
      > :d[elete]
      >
      > user can type :d :de :del :dele ...delete
      >
      > Is there a better way to define a customer command (:command! Foobar)
      > like it too?
      >
      > e.g.
      >
      > F[oobar]
      >
      > what I can think of is, defining 6 commands, calling same function
      >
      > F
      > Fo
      > Foo
      > ....
      >
      > Foobar

      You can use an incomplete command name if there is no ambiguity with
      another command; for instance, if Foobar is your only command
      beginning with F, then F, Fo, Foo, etc. are all ok. However, if you
      have Funk too, then you must at least use Fo or Fu, and so on and so
      forth.

      Defining 6 commands or more will work for the most recently defined
      command, in case of ambiguity, all the other being be deleted (with
      Foobar and Funk, F will only work for one or the other).

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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Kent
      thanks Tim, thanks Paul my test yesterday failed because there was another plugin defined an ambiguous command.... :( ... -- -- You received this message from
      Message 2 of 4 , Apr 9, 2013
      • 0 Attachment
        thanks Tim, thanks Paul

        my test yesterday failed because there was another plugin defined an
        ambiguous command.... :(





        On Tue, Apr 9, 2013 at 9:22 AM, Paul Isambert <zappathustra@...> wrote:
        > Kent <kent.yuan@...> a écrit:
        >> many vim build in commands have abbreviation, e.g.
        >>
        >> :d[elete]
        >>
        >> user can type :d :de :del :dele ...delete
        >>
        >> Is there a better way to define a customer command (:command! Foobar)
        >> like it too?
        >>
        >> e.g.
        >>
        >> F[oobar]
        >>
        >> what I can think of is, defining 6 commands, calling same function
        >>
        >> F
        >> Fo
        >> Foo
        >> ....
        >>
        >> Foobar
        >
        > You can use an incomplete command name if there is no ambiguity with
        > another command; for instance, if Foobar is your only command
        > beginning with F, then F, Fo, Foo, etc. are all ok. However, if you
        > have Funk too, then you must at least use Fo or Fu, and so on and so
        > forth.
        >
        > Defining 6 commands or more will work for the most recently defined
        > command, in case of ambiguity, all the other being be deleted (with
        > Foobar and Funk, F will only work for one or the other).
        >
        > Best,
        > 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
        >
        > ---
        > You received this message because you are subscribed to the Google Groups "vim_use" group.
        > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        > For more options, visit https://groups.google.com/groups/opt_out.
        >
        >

        --
        --
        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 because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.