Search code examples
vimvi

Is it possible to split a window in Vim/Vi with a terminal?


Is there a way to split a window inside Vi/Vim so that one window will be a terminal?

P.S. Solutions like installing new text editors and such will not help me.


Solution

  • There's no way to do this without a plugin. Here are a couple of ways to get similar functionality.

    • Use tmux, or another terminal window manager. In response to your P.s., tmux is not another text editor. It just allows you to split your terminal screen, so you would still be using vim for your text editing.
    • You can also run terminal commands and view the output from inside vim. Just run a command, but preface it with an exclamation point. For example, if you run :!ls from within vim, you will see a list of the files in your current directory. Any other commands such as :!pwd or :!git add * will also work. If you want to read the output of a command into your current vim buffer you can use the read command. For example, if you run :read !ls vim will enter a list of the files in your current directory into your current buffer at the cursor position.