Friday, February 16, 2007

Split it exactly into two "equal" halves???

Alright, you know to use the vim :sp command, and noticed that halves are supposed to be equal.

But, did you know that you can resize the splits within vim very easily?

As a start, if you are editing one file and want to open another, but not give it more than 10 lines, you would type

:10 sp file2

What if, now you are in the file2 split and want to increase its size a tad? Type
Ctrl-w +
If you now want to split the windows equally, you can typle Ctrl-w =
If you want to increase the size by 15 lines, you would type Ctrl-w 15+

Substitute the "+" for "-" if you want to decrease the size of the split you are viewing.

No comments: