Can I redirect output of a program to gvim?

前端 未结 4 1938
耶瑟儿~
耶瑟儿~ 2020-12-24 05:12

I want to redirect the output of some Windows program directly to gvim basically for searching the output. Say for example the result of findstr cmd. Is it possible to do th

相关标签:
4条回答
  • 2020-12-24 05:50

    You can read it from vim with

    :r !dir (for example)
    
    0 讨论(0)
  • 2020-12-24 05:54

    AFAIK, there is no gvim on Mac OS.

    If you are using MacVim on mac, this is what I do:

    dir | /Applications/MacVim.app/Contents/MacOS/Vim -
    

    When Vim starts in the terminal, then type

    <esc>:gui
    

    That should start the MacVim (gui version of vim)

    0 讨论(0)
  • 2020-12-24 06:00

    If you're already in Vim you can use the r command to read like this:

    :r !<cmd>
    

    E.g.

    :r !dir
    
    0 讨论(0)
  • 2020-12-24 06:03

    sure:

    dir | gvim -
    

    the - option tells vim to open stdin

    This works for Windows and Linux versions.

    0 讨论(0)
提交回复
热议问题