Reputation:
watching a screencast (can't link it since you need to have a peepcode pro subscription) I've seen a developer indenting his source code (a ruby file) graphically using the visual mode inside vim. He did the following steps: press "v" selecting lines and then pressing something else I didn't get (because there is no representation of what's being pressed on the keyboard), then he got the whole source perfectly indented, without the need to write something on the command line.
Is there a plugin you know to do it that way from visual mode?
Upvotes: 1
Views: 405
Reputation: 330
This plugin does exactly what you want: https://github.com/Chiel92/vim-autoformat.
Upvotes: 1
Reputation: 760
You can press = in visual mode to automatically indent your code.
Or you can use > and < in visual mode to change the indentation level of the selected code.
Upvotes: 1