Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use Ctrl+w s to split a window in Vim. However it is not working in my case. I opened a file using vim filename. Then I pressed Ctrl+w s. But as soon as I press just Ctrl+w it clears the viewport and I could see my shell display before vim opened the file. I mean the view port is replaced by the content just before the file was opened. However, I am still editing the file with Vim.


share|improve this question

migrated from Oct 1 '11 at 19:06

This question came from our site for professional and enthusiast programmers.

What shell and what terminal are you using? – Anson Oct 1 '11 at 18:50
I am using gnome-terminal and bash shell. About the Ctrl+w thing triggering thing, I found out that I had a shortcut with Ctrl+w in my terminal's keyboard preferences. I have disabled it though. However, Ctrl+ws is still not splitting the window horizontally. – rajan sthapit Oct 2 '11 at 6:40

Control-W must be being eaten by your terminal. Check settings and remove. If it still doesn't fix, then try this in Vim (in insert mode) or at your shell: hit Control-V and then Control-W. does it insert a ^W ?

If it doesn't work in your shell either, something about the terminal is still eating it. If it works in the shell but not Vim, then report back.

In the meanwhile, you can split by doing :split in Vim.

share|improve this answer

I kept trying to press them all at once, and it didn't work, after playing with it for half an hour I released the control-w and then pressed S, it worked that way (though, your problem might be something completely different)

share|improve this answer
The asker's problem is almost certainly something different, because he is actually having a problem when pressing the key combo. – Kazark Nov 9 '12 at 2:34

I just had this problem on Ubuntu as well, all the shortcuts using Ctrl + something worked except for Ctrl+ws and Ctrl+wq. It turns out that the shell is swallowing the second part of the command, which is Ctrl+s / Ctrl+q.

I've found that this solution fixed my problem:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .