help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to change the indentation style of emacs


From: suvayu ali
Subject: Re: how to change the indentation style of emacs
Date: Sun, 23 Jan 2011 13:56:29 +0100

On Sat, Jan 22, 2011 at 4:22 PM, Anand Dhanakshirur
<adhanakshirur@yahoo.com> wrote:
> Hi,
> I am using emacs for c and c++ files.
>
> 1. Presently(default), In a C program,
> after "for" loop, the next line(the next line starting with
> "{" is indented(shifted) by 2 spaces.
> I want to change this.
> I want the next line is not shifted by 2 spaces when i press TAB key.(for 
> indentation)
> basically
> Now it is, for (i=0;i<10; i++)
>             {
>             }
>
> I want this to be changed as
>           for (i=0; i<10;i++)
>
> 2 .One more thing want to do.
> after opening for loop of if condition,
> the next line is getting shiftedby 2 spaces.
> I want the next line to be shifted by 4 spaces.
>
> How to do these 2 things?
>

You can choose indentation styles by using `C-c . <RET> STYLE <RET>'
where style can be tab completed. For more details you can look in the
info manual section 26.3.5 (Programs > Program Indent > Custom C
Indent > Customising C Indentation). If nothing suits you, I think you
can even define your own style.

-- 
Suvayu

Open source is the future. It sets us free.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]