vim – Resizing your vim buffer

To resize your buffer up and down type the following:

To resize your buffer left and right, type the following:

You could make a mapping to do these without pressing the ctrl-w key combo first.
Something like this for the vertical stuff:

You have to put that in your .vimrc file.

vim – How to quickly comment out entire sections of code

Go to the first line and type the following:

^ to go to the beginning line. (probably want the top too)
Ctrl + Alt + V (to enter block highlight mode)
#j (where # is the number of lines to be commented out) Or just move the cursor manually.
I (capital i)
//
Press the esc key.
They should all be commented out now, with c++ style comments.

vim – Remove trailing whitespace

Last blog post, I mentioned you could clean up and reformat a file by using :retab.
This doesn’t remove unnecessary trailing whitespace though. To remove trailing whitespace, use the following:

vim – Quickly convert all tabs to spaces

Make sure, in your .gvimrc file, that the following are set to your liking:

Then type the following within vim:

vim – A few more vim tips

retrieves a yanked/deleted entry before the last yanked/deleted entry

Ex: yank/delete something, then yank/delete something else. Then type “0p or “1p

Count the number of words in the file of <word>