[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No automatic tabs in Emacs?
From: |
Glenn Morris |
Subject: |
Re: No automatic tabs in Emacs? |
Date: |
Wed, 01 Dec 2010 21:08:58 -0800 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Sueroski wrote:
> And I wanna add something to main. I push Enter and write my code. In
> Emacs I get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
>
> And I wanna get by default without pressing TAB, get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
It sounds like you want the command `newline-and-indent', which is bound
to ctrl-j. You can make the enter key do this for you by adding
something like the following to ~/.emacs:
(add-hook 'c-mode-hook (lambda () (local-set-key "\r" 'newline-and-indent)))
- Re: No automatic tabs in Emacs?, (continued)
- Re: No automatic tabs in Emacs?, Richard Riley, 2010/12/09
- Re: No automatic tabs in Emacs?, Elena, 2010/12/08
- Re: No automatic tabs in Emacs?, Richard Riley, 2010/12/09
- Re: No automatic tabs in Emacs?, rustom, 2010/12/08
- Re: No automatic tabs in Emacs?, Stefan Monnier, 2010/12/08
- Re: No automatic tabs in Emacs?, Stefan Monnier, 2010/12/08
- Re: No automatic tabs in Emacs?, Richard Riley, 2010/12/09
Re: No automatic tabs in Emacs?, Elena, 2010/12/08
Re: No automatic tabs in Emacs?, José A . Romero L ., 2010/12/08
Re: No automatic tabs in Emacs?, despen, 2010/12/08
Re: No automatic tabs in Emacs?,
Glenn Morris <=
Re: No automatic tabs in Emacs?, Raffaele Ricciardi, 2010/12/09