0

Is there a way that a open up a window or buffer, where i can run my bash commands? I thought on something like you know it from VS Code(1). The code windows on the top and a small command prompt on the bottom of the view, where i can run for example my rails or node server?

VS Code

For more clearity I want an editor on the top and a command prompt on the bottom of the window, where I can switch using commands. On the terminal should run a long running part.

3
  • You could use tmux and put vim in one window.
    – nalyd88
    Feb 13, 2019 at 15:13
  • That's exactly what I would like to avoid. Some times I need some registers and <C-w> commands to jump through terminal and editor.
    – ChrKahl
    Feb 13, 2019 at 15:17
  • 4
    :terminal command added in version 8.1 vim.org/vim-8.1-released.php Feb 13, 2019 at 15:25

2 Answers 2

3

You need Vim 8.1, then you can use the following command:

:below terminal ++rows=10

Normally a terminal is opened above the current window, but with below it is opened at the bottom. And in this case, the terminal should have a height of 10 rows.

See :help :terminal for additional ++-options.

1

For older Vim versions, there is Conque Shell, a no-longer-supported plugin which nevertheless has served me well in the past, and for now, continues to do so. It's still provided by e.g. vim-addons, which makes it really easy to add to your setup.

You can start a bash (or any other command, really...) using the current window as terminal:

:ConqueTerm bash

Personally I have the following two corresponding lines in my ~/.vimrc:

let g:ConqueTerm_CWInsert = 1      " Allow <C-w> to switch buffer without leaving insert mode
let g:ConqueTerm_InsertOnEnter = 1 " Automatically enter insert mode when switching to Conque buffer

Your Answer

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

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