Maximize current split in vim

Sometimes, working on a project in Vim, I have multiple splits open. However I frequently catch myself not using them. So I maximize the main split with the following simple command:

Ctrl-w _

To return to equal splits just fire the following command:

Ctrl-w =

Above is applied to a horizontal split (:sp); I am not sure if there a way to minimize vertically splited windows.

Update 29 november 2012: So I was playing around with shortcuts and found out that

Ctrl-w +

makes the split bigger by one line. By using numbers between Ctrl-w and +, you can make the split bigger by n lines, eg:

Ctrl-w 20+

It will result in a split being maximized by 10 lines.

Host key verification failed

Last week I spend a lot of time installing and re-installing remote Ubuntu servers. Every time was trying to connect with SSH to the server it asked me whether I trusted the server. When you type `yes` (trust the server), your local machine saves the fingerprint of that server. So the next time you don’t have to type `yes` again.

The problem is: after installing a new server the fingerprint changes. When the next time you try to access the server via SSH it fails. Because your local machine does not trust the identity anymore.

To fix it you could run the following command from within your Terminal session:

ssh-keygen -R server.address.com

Replace server.address.com with the address of the server you working with.

Enabling line numbers in Vim

Working on a legacy code I found myself browsing through dependencies. Functions exist of 600 lines of code and it’s difficult to find the right function again. Therefore I enabled the line numbers on the left side of Vim buffer screen.

To enable these numbers put the following in your ~/.vimrc:

:set number

You could also execute this command from within Vim. This enables numbers only for the current session.