I used :term to open a new integrated split terminal window. The problem is, using :! <cmd> opens a new buffer which takes the entire screen, runs the shell command, then waits for me to press any key.

Is there any way I can send a command directly to the terminal without having to switch focus to it?


1 Answer 1


:! runs the command in a (usually non-interactive) shell. See chapter 21 of the user manual and :h :! for more information.

This is different to :term which runs an interactive terminal in a vim window. This is a relative new feature which vim needs to have been compiled with, the details of which can be found at :h terminal. If you want to type in the terminal window without switching to it then term_sendkeys() may be useful.

  • I was hoping it would be slightly more approachable. I settled to use neoterm instead.
    – daedsidog
    Commented Jan 17, 2021 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.