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
:retab

If instead you execute these:

:set noexpandtab
:retab

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.
See

: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
.



Relevant Pages

  • Re: [OT] CVS diff: hard vs. soft tabs
    ... | originally saved to disk with hard tabs for indenting. ... or could i do this in vim? ... and also familiarize yourself with the "retab" command. ... use shiftwidth and softtabstop to control indentation levels. ...
    (Debian-User)
  • Re: Python + vim + spaces vs tab
    ... Does anyone knows a way to configure vim so it automatically select to ... correct expandtab value depending on the current buffer 'way of doing'? ... I need to edit different files, some are using spaces, others tabs. ... I can't make vim automatically comply with the current buffer coding ...
    (comp.lang.python)
  • Re: Ruby Tool Survey
    ... manage multiple tabs than multiple windows in Vim. ... remember which session is which. ...
    (comp.lang.ruby)
  • Re: Default editor
    ... Glad the latest vim takes no Tabs. ... Now I have to figure what was downloaded with vim that was common to gedit. ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)
  • Re: Default editor
    ... Hash: SHA1 ... Glad the latest vim takes no Tabs. ... Now I have to figure what was downloaded with vim that was common to gedit. ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)