In Aptana Studio when I have to format code I choose a block of code and then press Ctrl + Shift + F.
What is the equivalent of this in Vim?
I.e., say we got the below lines of code:
function() {
var test = "Hello, World!";
var test2 = "Hello, World! Again";
}
The final output I want to see is well formatted code like below:
function(){
var test = "Hello, World!";
var test2 = "Hello, World! Again";
}
If Vim knows the language you are using, you can use the =
key to auto-indent a section of code.
Within the block type =a}
, or to auto-indent the entire file by typing gg=G
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With