How can I redirect output from stdout into vim?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error:



Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Vim: Finished.


What can I do?










share|improve this question























  • askubuntu.com/questions/510890/…
    – bertieb
    1 hour ago










  • Possible duplicate of Read from stdin to new, named, file in vim
    – bertieb
    1 hour ago














up vote
2
down vote

favorite












I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error:



Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Vim: Finished.


What can I do?










share|improve this question























  • askubuntu.com/questions/510890/…
    – bertieb
    1 hour ago










  • Possible duplicate of Read from stdin to new, named, file in vim
    – bertieb
    1 hour ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error:



Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Vim: Finished.


What can I do?










share|improve this question















I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error:



Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Vim: Finished.


What can I do?







vim pipe stdout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 22 mins ago









rrauenza

1233




1233










asked 5 hours ago









Human

286




286











  • askubuntu.com/questions/510890/…
    – bertieb
    1 hour ago










  • Possible duplicate of Read from stdin to new, named, file in vim
    – bertieb
    1 hour ago
















  • askubuntu.com/questions/510890/…
    – bertieb
    1 hour ago










  • Possible duplicate of Read from stdin to new, named, file in vim
    – bertieb
    1 hour ago















askubuntu.com/questions/510890/…
– bertieb
1 hour ago




askubuntu.com/questions/510890/…
– bertieb
1 hour ago












Possible duplicate of Read from stdin to new, named, file in vim
– bertieb
1 hour ago




Possible duplicate of Read from stdin to new, named, file in vim
– bertieb
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
3
down vote













You're missing the - filename argument that instructs Vim to fill the buffer from stdin; cp. :help --



echo $PATH | vim -


Alternatively, you can use your shell's process substitution to create a temporary file descriptor and have Vim edit that "virtual" file.



vim <(echo $PATH)





share|improve this answer




















  • If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
    – John Kugelman
    34 mins ago

















up vote
2
down vote













How can I redirect output from stout into vim?



Your question has been answered on AskUbuntu.



The simplest solution is to add - to your command:



echo $PATH | vim -



You can use process substitution (this also works with
applications that can't read from STDIN):



vim <(ls -la)


Or use vim's function to read from STDIN:



ls -la | vim -



Source How do I redirect command output to vim in bash?, answer by Chaos






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "3"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1369538%2fhow-can-i-redirect-output-from-stdout-into-vim%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    You're missing the - filename argument that instructs Vim to fill the buffer from stdin; cp. :help --



    echo $PATH | vim -


    Alternatively, you can use your shell's process substitution to create a temporary file descriptor and have Vim edit that "virtual" file.



    vim <(echo $PATH)





    share|improve this answer




















    • If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
      – John Kugelman
      34 mins ago














    up vote
    3
    down vote













    You're missing the - filename argument that instructs Vim to fill the buffer from stdin; cp. :help --



    echo $PATH | vim -


    Alternatively, you can use your shell's process substitution to create a temporary file descriptor and have Vim edit that "virtual" file.



    vim <(echo $PATH)





    share|improve this answer




















    • If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
      – John Kugelman
      34 mins ago












    up vote
    3
    down vote










    up vote
    3
    down vote









    You're missing the - filename argument that instructs Vim to fill the buffer from stdin; cp. :help --



    echo $PATH | vim -


    Alternatively, you can use your shell's process substitution to create a temporary file descriptor and have Vim edit that "virtual" file.



    vim <(echo $PATH)





    share|improve this answer












    You're missing the - filename argument that instructs Vim to fill the buffer from stdin; cp. :help --



    echo $PATH | vim -


    Alternatively, you can use your shell's process substitution to create a temporary file descriptor and have Vim edit that "virtual" file.



    vim <(echo $PATH)






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 5 hours ago









    Ingo Karkat

    17.1k22142




    17.1k22142











    • If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
      – John Kugelman
      34 mins ago
















    • If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
      – John Kugelman
      34 mins ago















    If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
    – John Kugelman
    34 mins ago




    If you're using Vim as a pager in place of less/more, try | vim -R - to disable the "Save changes?" prompt when you quit.
    – John Kugelman
    34 mins ago












    up vote
    2
    down vote













    How can I redirect output from stout into vim?



    Your question has been answered on AskUbuntu.



    The simplest solution is to add - to your command:



    echo $PATH | vim -



    You can use process substitution (this also works with
    applications that can't read from STDIN):



    vim <(ls -la)


    Or use vim's function to read from STDIN:



    ls -la | vim -



    Source How do I redirect command output to vim in bash?, answer by Chaos






    share|improve this answer
























      up vote
      2
      down vote













      How can I redirect output from stout into vim?



      Your question has been answered on AskUbuntu.



      The simplest solution is to add - to your command:



      echo $PATH | vim -



      You can use process substitution (this also works with
      applications that can't read from STDIN):



      vim <(ls -la)


      Or use vim's function to read from STDIN:



      ls -la | vim -



      Source How do I redirect command output to vim in bash?, answer by Chaos






      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        How can I redirect output from stout into vim?



        Your question has been answered on AskUbuntu.



        The simplest solution is to add - to your command:



        echo $PATH | vim -



        You can use process substitution (this also works with
        applications that can't read from STDIN):



        vim <(ls -la)


        Or use vim's function to read from STDIN:



        ls -la | vim -



        Source How do I redirect command output to vim in bash?, answer by Chaos






        share|improve this answer












        How can I redirect output from stout into vim?



        Your question has been answered on AskUbuntu.



        The simplest solution is to add - to your command:



        echo $PATH | vim -



        You can use process substitution (this also works with
        applications that can't read from STDIN):



        vim <(ls -la)


        Or use vim's function to read from STDIN:



        ls -la | vim -



        Source How do I redirect command output to vim in bash?, answer by Chaos







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 5 hours ago









        DavidPostill♦

        101k25214249




        101k25214249



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1369538%2fhow-can-i-redirect-output-from-stdout-into-vim%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            Installing NextGIS Connect into QGIS 3?

            One-line joke