Chloe
Chloe

Reputation: 47

Execute C on a split screen in vim

When I execute a C program in vim using :!./%<, I would like to be able to see my code (on the left side of a split screen), as well as the stdout results from the execution of the program (on the right side of the split screen). At the moment, the output of the program execution is blocking the view of my code until I hit ENTER, but then I can no longer see the program output.

How do I execute a C program in vim so that I can see both of its code and its execution results together on a split screen ?? I tried piping the output using :!./%<|vert copen, but failed. I am using Linux.

Any help will be much appreciated.

Upvotes: 1

Views: 273

Answers (1)

mikedu95
mikedu95

Reputation: 1736

Install vimshell then type :VimShellInteractive to transform a vim window (a split for example) into an instance of a shell where you can still use vim commands.

Upvotes: 2

Related Questions