Tab completion for the custom command

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tab completion for the custom command

Andy Lego

Hello,

I would like to have a command that accepts tab completion. For
example:
:command -nargs=1 Hello echo "Hello my friend <args>"
If I type now:
:Hello Bill
I will see the response:
Hello my friend Bill
If I type:
:Hello Bob
I will see the response:
Hello my friend Bob

Now I would like to restrict the list of arguments possible for this
command for the tab completion. I would like to be able to type:
:Hello Bi<tab>
and it would expand to:
:Hello Bill

Is that possible?

Thank you.

Andy


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Tab completion for the custom command

Tony Mechelynck

Andy Lego wrote:

> Hello,
>
> I would like to have a command that accepts tab completion. For
> example:
> :command -nargs=1 Hello echo "Hello my friend <args>"
> If I type now:
> :Hello Bill
> I will see the response:
> Hello my friend Bill
> If I type:
> :Hello Bob
> I will see the response:
> Hello my friend Bob
>
> Now I would like to restrict the list of arguments possible for this
> command for the tab completion. I would like to be able to type:
> :Hello Bi<tab>
> and it would expand to:
> :Hello Bill
>
> Is that possible?
>
> Thank you.
>
> Andy

see
        :help :command-completion
        :help :command-completion-custom


Best regards,
Tony.
--
"I have made mistakes but I have never made the mistake of claiming
that I have never made one."
                -- James Gordon Bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Tab completion for the custom command

Andy Lego-2
Hello,

Got it working, thank you...

Andy

On 7/23/07, Tony Mechelynck <[hidden email]> wrote:

Andy Lego wrote:

> Hello,
>
> I would like to have a command that accepts tab completion. For
> example:
> :command -nargs=1 Hello echo "Hello my friend <args>"
> If I type now:
> :Hello Bill
> I will see the response:
> Hello my friend Bill
> If I type:
> :Hello Bob

> I will see the response:
> Hello my friend Bob
>
> Now I would like to restrict the list of arguments possible for this
> command for the tab completion. I would like to be able to type:
> :Hello Bi<tab>
> and it would expand to:
> :Hello Bill
>
> Is that possible?
>
> Thank you.
>
> Andy

see
        :help :command-completion
        :help :command-completion-custom


Best regards,
Tony.
--
"I have made mistakes but I have never made the mistake of claiming
that I have never made one."
                -- James Gordon Bennett






--
http://legoandy.com  -o-  http://capitalmtb.org
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---