phpvim

Open Vim From PHP CLI


How do you open up vim from a CLI like svn and git do when you drop -m from commit commands?

I'm getting the follow error: Vim: Warning: Output is not to a terminal

`echo "Please edit this file" > file.name`;
`vim file.name`;

Solution

  • PHP Doesn't automatically pass thru the STDIN/STDOUT streams, you need to do it manually:

    `echo "Please edit this file" > file.name`;
    system("vim file.name > `tty`");
    

    (Note: I don't really understand what I'm talking about, I just know the above works.)