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:
To return to equal splits just fire the following command:
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
makes the split bigger by one line. By using numbers between Ctrl-w and +, you can make the split bigger by n lines, eg:
It will result in a split being maximized by 10 lines.
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.
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
You could also execute this command from within Vim. This enables numbers only for the current session.