pynxfq
Last Updated: February 25, 2016
·
430
· anthonysutardja

Fixing indentations in vim

vim

To fix indentations in your code:

gg=G

  • gg moves the cursor to the beginning of the document
  • = is the indent command
  • G is the modifying motion that = can take.

Cheers.

2 Responses
Add your response

1984

Great stuff. I often use = in visual mode to indent only specific methods/blocks in my code. For example to indent the next 5 lines v5j=.

over 1 year ago ·
2099

@janahrens This is the same:
=5j</code>

over 1 year ago ·