Ctrl+W s not splitting windows in Vim

7,153

Solution 1

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.

Solution 2

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:
7,153

Related videos on Youtube

rajan sthapit
Author by

rajan sthapit

Updated on September 18, 2022

Comments

  • rajan sthapit
    rajan sthapit over 1 year

    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.

    Suggestions?

    • Admin
      Admin over 12 years
      What shell and what terminal are you using?
  • Chris
    Chris about 3 years
    I ran into this problem using :term. I'd forgotten I was in a vim context, and opened vim from within the vim-hosted terminal. Eventually (after 1 or more nestings over the day), I was no longer able to CTRL-W through the windows.