Tip 19Sending Commands to a Terminal Buffer
images/neovim-only.png

With Terminal mode, you can interact directly with a process running inside a terminal buffer. It’s also possible to interact with such a process by remote control, by calling the jobsend() function. The beauty of this is that you can use Vim script to automate certain interactions with a program. In this tip, you’ll create a simple :Restart command that you can use to restart a web server.

Preparation

The source code that accompanies this book includes a webapp directory. Switch to that directory and install the dependencies using npm:

=> $ cd code/webapp
=> $ npm install

Now open a terminal ...

Get Modern Vim now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.