How do I make Emacs auto-indent my C code? -


I'm just starting to feel a sense for emacs, but I'm frustrated with the tendency to suppress it The return key I know that I will do this by pressing C-J, but I can not go into that habit. I just can not do it every time I have to hit, and every time I hate it again.

I went into the option and found the C mode hook and C + + mode hook - and they defined two keymapping (10 and 13), and I remembered that 0A and 0C CR / LF because I had a lot of use in the assembly) - I thought that since " (lambda zero (defined-key lip-mode-map [13] (quote newline) -and- indent)) "and the second is the same but instead of (Nutry News) , I end up in Aundh Ind Put and thought it would work.

But it's not: I set it up and saved, tried no avail, tried it. Resumed emacs, there is still no success. How do I indentify my code? It is very crazy that emacs require a degree to configure it just for your basic needs.

In addition, as a side question: How do I copy and paste the clipboard? Killing / yanking is easy and everyone but I hate to edit-> Every time I want to paste someone else, I copy.

- Edit -

Okay, I have mine. The following lines and work Amsis does:

 (add-hook 'c-mode-common-hook (lambda () (local-set-key (Kebeedi "RET") newline-end 

Take a look at this

As suggested here, set the set code in your .emacs

  (local set-key (KBD "RET") (Set-Set-Newline -indent) Newline-and-indent) (Ad-hook 'C-mode' set-new Line-indent)  

You can customize the default style of variables Go to Customize Options-> Emacs-> Custom Options in your emacs, then type c-default-style and Set your choice, by doing so, you do not have to hit the tab. Type from the beginning of the line and as you "", it will automatically be indented.

Hope That it helps


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -