Is there a way to make vim run the "make" command in another terminal window?

DLCom

I mainly use vim as an editor for C/C++ programming. Unfortunately, I'm not quite satisfied with the way my build process works. I know that it's possible to type in (or map to a key) :make to run the make process. I dislike the way this command works, though, as it runs the build process in the same terminal window without proper highlighting. I therefore usually run the make command in another window on my second monitor so that I have both proper highlighting and can look at the build errors the compiler shows me in one window while scrolling through the source code in my main vim window. This is also quite tedious because it requires me to change focus to another window, then type in the make command.

Now, my question is as follows: Is it possible to make vim run the make command in this other window without having to change focus? This way, I could just map the "build in other window" command to some key in vim and could achieve all of this with a single key press.

My system is Manjaro Linux with i3 as DWM.

(I was unsure wether to post this on stackoverflow or here, please forgive me if this is the wrong forum.)

user1717828

With named pipes:

  1. Open your source code with Vim in one terminal.
  2. Open a second terminal where you want the make output and create a new pipe with mkfifo mypipe.
  3. In the second terminal, run watch --color -n 0.3 'cat mypipe' to always be reading the named pipe.
  4. In the first terminal, run :!script -q -c "make" mypipe > /dev/null in Vim after saving changes to your source code.

We have to use script to trick the program to keeping the colored output. Make sure your version of watch supports color.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is there a way to make a file that would run a terminal command when you click it?

From Dev

How make Vim fill Terminal window

From Dev

Run command on another(new) terminal window

From Dev

how to make an application to run from a command in terminal

From Dev

Make a full terminal window application like Vim/Mutt/Cmus

From Dev

OS X command to make current terminal window full screen

From Dev

How do I make a vim command run automatically with .vimrc?

From Dev

Is there a way to make putty automatically "close window on exit" from the command line?

From Dev

Unable to run the `make` command

From Dev

How to make the Terminal make a noise on command completion?

From Dev

Simplest way to make a command run after system reboot

From Dev

Vim make a custom macro or command

From Dev

Make Vim use the terminal colors again

From Dev

Execute command as if in another open terminal window

From Dev

How do I make my jar file open a terminal window to run other class?

From Dev

Run vim command when preview window is open

From Dev

Run vim command when preview window is open

From Dev

Make links open new window in specified terminal

From Dev

Make the runserver command run with code

From Dev

Make the runserver command run with code

From Dev

Make NERDtree not be the default window when VIM starts?

From Dev

How can I make the "python" command in terminal, run python3 instead of python2?

From Dev

How to make sbt run another consecutive command regardless of previous command's result?

From Dev

another way to make "if statement" short

From Dev

Open XFCE Terminal Window and Run command in same Window

From Dev

Open XFCE Terminal Window and Run command in same Window

From Dev

How to make a .sh script automatically run in the terminal?

From Dev

How to make terminal recognize command "gvim" or "mvim"?

From Dev

How to make local .command Terminal script?

Related Related

  1. 1

    Is there a way to make a file that would run a terminal command when you click it?

  2. 2

    How make Vim fill Terminal window

  3. 3

    Run command on another(new) terminal window

  4. 4

    how to make an application to run from a command in terminal

  5. 5

    Make a full terminal window application like Vim/Mutt/Cmus

  6. 6

    OS X command to make current terminal window full screen

  7. 7

    How do I make a vim command run automatically with .vimrc?

  8. 8

    Is there a way to make putty automatically "close window on exit" from the command line?

  9. 9

    Unable to run the `make` command

  10. 10

    How to make the Terminal make a noise on command completion?

  11. 11

    Simplest way to make a command run after system reboot

  12. 12

    Vim make a custom macro or command

  13. 13

    Make Vim use the terminal colors again

  14. 14

    Execute command as if in another open terminal window

  15. 15

    How do I make my jar file open a terminal window to run other class?

  16. 16

    Run vim command when preview window is open

  17. 17

    Run vim command when preview window is open

  18. 18

    Make links open new window in specified terminal

  19. 19

    Make the runserver command run with code

  20. 20

    Make the runserver command run with code

  21. 21

    Make NERDtree not be the default window when VIM starts?

  22. 22

    How can I make the "python" command in terminal, run python3 instead of python2?

  23. 23

    How to make sbt run another consecutive command regardless of previous command's result?

  24. 24

    another way to make "if statement" short

  25. 25

    Open XFCE Terminal Window and Run command in same Window

  26. 26

    Open XFCE Terminal Window and Run command in same Window

  27. 27

    How to make a .sh script automatically run in the terminal?

  28. 28

    How to make terminal recognize command "gvim" or "mvim"?

  29. 29

    How to make local .command Terminal script?

HotTag

Archive