hit any key to close this window

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

hit any key to close this window

Samuel Ferencik

Hi all,

I use a tool (the IVT terminal) that has its own RC file with specific
syntax. When I edit this ivt.rc file (in vim), I want the K command to
take me to the help for the keyword.

The help is available in a single HTML page (ivt.htm), with the
keywords being used as position names (e.g. the help for the CONNECT
command is at ivt.htm#CONNECT).

I am on Windows, so I created a batch file that starts firefox and
opens the desired address (e.g. ivt.htm#CONNECT). The 'keywordprg'
option points to this batch file, so vim passes the keyword as the
only parameter to the batch file.

So far, so good. However, jumping to the help like this leaves the
"Hit any key to close this window" prompt open. So when I am done
looking at the help (in firefox) I first have to locate the command
prompt window, hit Enter, and only after that can I return to vim to
continue editing.

How can I get rid of the "hit any key" prompt?
Would perhaps a different mechanism (alternative to the batch file) solve this?

Since there is no "silent" K command, perhaps I am doing something
that was not expected...

I will appreciate any advice.

Sam

--~--~---------~--~----~------------~-------~--~----~
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: hit any key to close this window

Tom Link-3


> Since there is no "silent" K command, perhaps I am doing something
> that was not expected...

I'm not sure if I understand you correctly but :h K says:

> K Run a program to lookup the keyword under the
> cursor.  The name of the program is given with the
> 'keywordprg' (kp) option (default is "man").  The
> keyword is formed of letters, numbers and the
> characters in 'iskeyword'.  The keyword under or
> right of the cursor is used.  The same can be done
> with the command >
> :!{program} {keyword}

I assume that :silent !{program} {keyword} would do. In a map,
keyword
could be replaced with <c-r><c-w>.

noremap K :silent !{program} <c-r><c-w><cr>

or so (untested).


--~--~---------~--~----~------------~-------~--~----~
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: hit any key to close this window

Jürgen Krämer-4
In reply to this post by Samuel Ferencik


Hi,

Samuel Ferencik wrote:

>
> I use a tool (the IVT terminal) that has its own RC file with specific
> syntax. When I edit this ivt.rc file (in vim), I want the K command to
> take me to the help for the keyword.
>
> The help is available in a single HTML page (ivt.htm), with the
> keywords being used as position names (e.g. the help for the CONNECT
> command is at ivt.htm#CONNECT).
>
> I am on Windows, so I created a batch file that starts firefox and
> opens the desired address (e.g. ivt.htm#CONNECT). The 'keywordprg'
> option points to this batch file, so vim passes the keyword as the
> only parameter to the batch file.
>
> So far, so good. However, jumping to the help like this leaves the
> "Hit any key to close this window" prompt open. So when I am done
> looking at the help (in firefox) I first have to locate the command
> prompt window, hit Enter, and only after that can I return to vim to
> continue editing.
>
> How can I get rid of the "hit any key" prompt?
> Would perhaps a different mechanism (alternative to the batch file) solve this?

I would use something like this

  nnoremap K :silent ! start c:\\path\\to\\yourbatch.bat <c-r><c-w><cr>

Note the space between the exclamation mark and start which seems to be
necessary.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
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: hit any key to close this window

Samuel Ferencik

Hi thomas, Jurgen,

thank you both, that does it. I just did not know the trick with <c-
r><c-w> and shuddered at the thought of having to detect the bounds of
the word under cursor - so I concluded the "!{program} {keyword}"
alternative was not for me...

Thanks again to both of you.

Sam

On Oct 9, 11:00 am, Jürgen Krämer <[hidden email]> wrote:

> Hi,
>
>
>
> Samuel Ferencik wrote:
>
> > I use a tool (the IVT terminal) that has its own RC file with specific
> > syntax. When I edit this ivt.rc file (in vim), I want the K command to
> > take me to the help for the keyword.
>
> > The help is available in a single HTML page (ivt.htm), with the
> > keywords being used as position names (e.g. the help for the CONNECT
> > command is at ivt.htm#CONNECT).
>
> > I am on Windows, so I created a batch file that starts firefox and
> > opens the desired address (e.g. ivt.htm#CONNECT). The 'keywordprg'
> > option points to this batch file, so vim passes the keyword as the
> > only parameter to the batch file.
>
> > So far, so good. However, jumping to the help like this leaves the
> > "Hit any key to close this window" prompt open. So when I am done
> > looking at the help (in firefox) I first have to locate the command
> > prompt window, hit Enter, and only after that can I return to vim to
> > continue editing.
>
> > How can I get rid of the "hit any key" prompt?
> > Would perhaps a different mechanism (alternative to the batch file) solve this?
>
> I would use something like this
>
>   nnoremap K :silent ! start c:\\path\\to\\yourbatch.bat <c-r><c-w><cr>
>
> Note the space between the exclamation mark and start which seems to be
> necessary.
>
> Regards,
> Jürgen
>
> --
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us.     (Calvin)


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