Strange Symphonies The whole is greater than the sum of its parts

Related tags

6Feb/090

Conveniently Resizing mvim to Fullscreen and Halfscreen

While doing development on my MacBook, thanks to its widescreen I like to keep two terminals open side by side, or two mvim (thats vim for Mac OS X), or some combination of the two. Whatever it is, its two windows side by side.

Rather than continually manually resizing the window myself, which can be a chore I have created a two simple functions to do it for me.

Plug this into your ~/.gvimrc [image16x16:file]:
[block:file]
function Fullscreen()
set columns=187
endfunction
command! Fullscreen :call Fullscreen()

function Halfscreen()
set columns=87
endfunction
command! Halfscreen :call Halfscreen()
[/block]

Now with mvim all fired, up just enter :Fullscreen or :Halfscreen, and BAM! Don't forget to use tab completion so you don't have to type the whole command!

Defaulting to Halfscreen on Open

When I open up mvim, I want it to be Halfscreen by default.

Lucky for me, it is as simple as putting this in to my ~/.gvimrc [image16x16:file]:
[block:file]set columns=87[/block]

[block:important]This is all on the default resolution of 1280x800[/block]