Re: [vim] prettify

Martin Trautmann <t-use@xxxxxxx> wrote:
Hi all,

does vim include any prettify functions? The syntax highlighting does
know the key words. The bracket operation does know about begin and end
of levels.

Thus a prettify would be very nice which would fix a broken indention, a
mix of tabs and spaces etc.

Broken indentation can be fixed with the = command. See

:help =
:help 30.3

A mix of tabs and spaces can be changed to all spaces with

:set expandtab

If instead you execute these:

:set noexpandtab

vim will replace sequences of tabs and/or spaces at the start of lines with
the fewest tabs and spaces that will result in the same indentation.

:help expandtab
:help retab

However, vim has no built-in way to prettify code by moving elements
(e.g., braces) from one line to another.

Gary Johnson