O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Window Commands

The following table lists common commands for controlling windows in vim. See also the split , vsplit , and resize commands in Chapter 2. For brevity, control characters are marked in the following list by ^.

Command

Action

:new

Open a new window.

:new file

Open file in a new window.

:sp file

Split the current window.

:svfile

Same as :sp, but make new window read-only.

:snfile

Edit next file in new window.

:clo

Close current window.

:hid

Hide current window, unless it is the only visible window.

:on

Make current window the only visible one.

:res n

Resize window to n lines.

:wa

Write all changed buffers to file.

:qa

Close all buffers and exit.

^W s

Same as :sp.

^W n

Same as :new.

^W ^

Open new window with alternate (previously edited) file.

^W c

Same as :clo.

^W o

Same as :only.

^W j, ^W k

Move cursor to next/previous window.

^W p

Move cursor to previous window.

^W h, ^W l

Move cursor to window on left/right.

^W t, ^W b

Move cursor to window on top/bottom of screen.

^W K, ^W B

Move current window to top/bottom of screen.

^W H, ^W L

Move current window to far left/right of screen.

^W r, ^W R

Rotate windows down/up.

^W +, ^W -

Increase/decrease current window size.

^W =

Make all windows same height.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required