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

split window keyword lookup (shell)

Expand Messages
  • Jason Morehouse
    Hello, I ve been using keywordprg to access the php manual online via elinks. I was wondering though if there is a way to map a key to open the command in a
    Message 1 of 3 , Oct 2, 2005
    • 0 Attachment
      Hello, I've been using keywordprg to access the php manual online via
      elinks. I was wondering though if there is a way to map a key to open
      the command in a slit window?

      Something like this (doesn't work!)
      nmap <C-M> :new | :!elinks
      "http://www.php.net/"<C-R>=expand("<cword>")<CR><CR>

      Any ideas?
      Thanks,
      -Jason
    • Mikolaj Machowski
      ... Where are you using Vim? Console or X environment? In console you are almost lost - use screen program. To execute in separate window Vim had to have shell
      Message 2 of 3 , Oct 2, 2005
      • 0 Attachment
        Dnia niedziela, 2 października 2005 21:54, Jason Morehouse napisał:
        > Hello, I've been using keywordprg to access the php manual online via
        > elinks. I was wondering though if there is a way to map a key to open
        > the command in a slit window?
        >
        > Something like this (doesn't work!)
        > nmap <C-M> :new | :!elinks
        > "http://www.php.net/"<C-R>=expand("<cword>")<CR><CR>

        Where are you using Vim? Console or X environment?

        In console you are almost lost - use screen program. To execute in
        separate window Vim had to have shell emulation in window. Not
        officially supported. There is vimshell patch:

        http://www.wana.at/vimshell/


        In X environment best solution could be (untested):

        :call system("xterm -e elinks
        'http://www.php.net/'".<c-r>=expand("<cword>")."' &")

        m.
      • Gary Johnson
        ... You can t run the command in a vim window as you can in a shell window, but you can dump the output of a command into a vim window. Part of the problem
        Message 3 of 3 , Oct 3, 2005
        • 0 Attachment
          On 2005-10-02, Jason Morehouse <jm@...> wrote:
          > Hello, I've been using keywordprg to access the php manual online via
          > elinks. I was wondering though if there is a way to map a key to open
          > the command in a slit window?
          >
          > Something like this (doesn't work!)
          > nmap <C-M> :new | :!elinks
          > "http://www.php.net/"<C-R>=expand("<cword>")<CR><CR>

          You can't "run" the command in a vim window as you can in a shell
          window, but you can dump the output of a command into a vim window.

          Part of the problem with your mapping is that <cword> is not
          expanded until after the new window has been opened and at that
          point there is no longer a word under the cursor.

          Try this. I have tested it using 'echo' in place of 'elinks', so I
          know the mapping works as I expect it to, but I don't know enough
          about the behavior of 'elinks' to know whether it will do what you
          want as is.


          nmap <C-M> :exe 'new <bar> r!elinks "http://www.php.net/"'.expand("<cword>")<CR>

          HTH,
          Gary

          --
          Gary Johnson | Agilent Technologies
          garyjohn@... | Wireless Division
          | Spokane, Washington, USA
        Your message has been successfully submitted and would be delivered to recipients shortly.