How can I make vim send command for gnu screen session
I'm trying to figure out how to script vim to send a message to the "gnu screen" window. that is, I have a screen session open and in one window I have a vim session and in the other a schema interpreter. When I save the vim session, I would like it to restart the interpreter in another window load in the new environment. I can figure out everything except how to have a "save" in vim, send a shell command to another "screen window", causing the script to terminate and restart. if I could figure out how to send commands, I could kill the process and then start a new one - I just need to make sure it starts in the right "window".
source to share
Have vim a shell shell command and use screen -X
to output commands to the screen. Some permutation :at <other-window> stuff <restart-command>
. See the Configuration section man screen
for additional commands.
For example, if I was at window 1 screen using vim and I had an irb session on window 0, to restart the irb session, I would do
:!screen -X at 0 stuff exit^Mirb^M
( ^M
entered via CTRL-V Enter).
source to share
If you just want the schema interpreter to run every few seconds, you can simply run watch /path/to/scheme/interpreter /path/to/scheme/file
in a second screen window. Adjusting the time intervals at which commands are executed watch
can be configured using command line parameters. The page watch
contains detailed information.
source to share