mlsamuelson.com

Split windows in Vim

vim -O filename1 filename2 filename3

from command line, open files in vertical windows.

vim -o filename1 filename2 filename3

from command line, open files in horizontal windows.

:split filename.php

inside Vim, open filename.php in a new buffer and split window horizontally. use :vsplit filename.php to split vertically. additionally, you can use the short forms :sp and :vsp.

CTRL+w v

split current window vertically into two windows. do again and you'll get a third window, etc. replace v with s and you'll split horizontally instead.

CTRL+w w

switch windows

CTRL+w j

switch to window below active window. (can use other directional keys - h k and l)

CTRL+w +

increase height of active window.

CTRL+w -

increase height of active window.

CTRL+w <

decrease width of active window.

CTRL+w >

decrease width of active window.

CTRL+w q

quit window. :bd (buffer delete) works too.

:bd

delete buffer (closing current window)

These commands work well in conjunction with Edit Mulitiple Files in Vim.

Find Me Around

User login