Template:NewPage

From WikEmacs
Revision as of 11:10, 31 March 2012 by Aaptel (talk | contribs)
Jump to navigation Jump to search

c-mode is the default major mode for editing C source files (.c and .h files). It uses cc-mode.



Basic setup

c-mode is bundled with Emacs by default. No additional setup is required.

Helpful keybindings

[C-M-a]
Go to the beginning of the current function. If you are between 2 functions, go the start of the previous one.
[C-M-e]
Go to the end of the current function. If you are between 2 functions, go to the end of the next one.

Common Customization

Change default indenting style

; set k&r style
(setq c-set-style "k&r")
; indent with 4 spaces
(setq c-basic-offset 4)


GNU/Linux

OS X

Windows

Emacs-24

Emacs-23

Recommended Reading

Project Pages


Tutorial Pages