In Vim I enter the command :w | make
. My Makefile looks like this:
all:
g++ -o main main.cpp
./main
main.cpp looks like this:
#include <iostream>
using namespace std;
int main(){
cout << "Hello world!";
}
Vim output says:
"main.cpp" 6L, 88C written
:!make 2>&1| tee /tmp/ve16mwu/0
g++ -o main maincpp
./main
(1 of 3): g++ -o main main.cpp
Press ENTER or type command to continue_
Now after I quit Vim and run the executable: $ ./main
then the output shows up fine in the terminal.
If I put add a newline \n
to the line like this: "Hello world!\n"
then it shows in Vim's output just fine.
Apparently, in Vim, the output won't show your last line of text if it doesn't have \n
on the end. Is there a workaround for this?