Tuesday, April 24, 2012

Re: Indenting/formating

On Tuesday, April 24, 2012 5:58:48 AM UTC-5, Gautier DI FOLCO wrote:
> Hi,
>
> I recently look for re-(format|indent)ing my code and after many queries on google or in :help I didn&#39;t find <span lang="en"><span>a satisfactory solution.
> On websites I found a solution with AStyle or indent and in :help I have to make a very big function.
>
> Basically I want to follow de Allman Style (<a href="http://en.wikipedia.org/wiki/Indent_style#Allman_style" target="_blank">http://en.wikipedia.org/wiki/<WBR>Indent_style#Allman_style</a>), </span></span><span lang="en"><span>maybe</span> <span>then</span> <span>I would</span> <span>align</span> <span>commas dots,  or</span> <span>even</span> <span>comments</span><span>,</span> <span>but it&#39;s still</span> <span>basic.
>
> I don&#39;t want an external tool because I work on many computers with many constraints.
>

If I assume correctly that you're writing code in C, just turn on filetype-specific indenting, or turn on 'cindent'. If you want to tweak the automatic indenting, update the 'cinoptions' setting.

See the following for a basic introduction for Vim's indentation features:

http://vim.wikia.com/wiki/Indenting_source_code

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment