I use two monitors in my development workflow, one is a fullscreen vim session for editing and the other is a fullscreen terminal where I run make && ./test to show results. Fairly often I find myself opening a bunch of other windows in the background (browers, more shells etc). I don’t like this for a few reasons:
- I don’t like having to remember how many times I have to hit tab before I get my make window.
- There’s no strong visual feedback in Ubuntu for which window is currently in focus. I could probably do something about that but that’s a separate problem.
- To be honest I’m lazy, and
:w alt-tab up-arrow enter alt-tabis far too many keystrokes.
I think a good solution might be to have a vim command that runs make && ./test in the other window, but I can’t think of how to do this. I could write a server/client script that waits from some notification from vim then runs the command but it really seems like there should be a simpler solution. Any thoughts?
Thanks to Jim’s comment for getting me started. This is what I’m doing now:
On the first monitor:
tmux new-session -s dev(creates a new tmux session named dev)On the second monitor:
tmux new -t dev(connects to that new session)On the second monitor:
Ctrl-b + c(creates a new window)I forked vimux and wrote functions to send commands to another window. So now in vim I can use
:call VimuxRunCommandWin("make && ./test").And I think that’s probably enough procrastination for one day…