CLI Split Windows in Vim

I use split windows, both horizontally and vertically, in Vim all the time. I’ve always wanted to be able to split the window and then start a command line shell within that window but up until now that has just been a dream.

My friend sent me a link to conque this morning which I’m so taken with that it’s prompted me to drop coding and write a blog post.

Conque lets me do exactly what I’ve wanted, create shells within Vim. In insert mode you interact with the shell as expected. In normal mode you can scroll back through your history, yank text into buffers, paste and manipulate text. Best thing ever.

Two files open on the left, three shells on the right; iPython, MySQL, and Django's web server - all with syntax highlighting.


How do you switch between windows?
-- ispiked, 13 Aug 2010
How do you switch between windows?

The regular keys to switch windows in Vim: Ctrl+W and then a direction (so, to switch to the window to the right, do Ctrl+W and then L).

I also have some handy shortcuts set up like CTRL+J to go down a window and maximize it. You can see those shortcuts in my .vimrc

Edit: I added a shortcut for Ctrl+W and S to open a new shell. You can see that here
-- Wil Clouser, 13 Aug 2010
This is great! I'm a long-term VIM user now and I have always searched (not very actively, though) using Vim and a terminal in a single instance.

-- Kenny Meyer, 14 Aug 2010

Post a comment

Feel free to email me with any comments, and I'll be happy to post them on the articles. This is a static site so it's not automatic.