Difference between revisions of "C-mode"

From WikEmacs
Jump to navigation Jump to search
(Created page with "'''c-mode''' is the default major mode for editing C source files ({{File|.c}} and {{File|.h}} files). It uses {{ModeLink|cc-mode}}. <!-----DONT REMOVE ANYTHING FROM ...")
 
(moved all markup to CC-mode and added redirection)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''c-mode''' is the default [[major mode]] for editing [[C]] source files
+
#REDIRECT [[CC-mode]]
({{File|.c}} and {{File|.h}} files). It uses {{ModeLink|cc-mode}}.
 
 
 
<!-----DONT REMOVE ANYTHING FROM THIS TEMPLATE ------------------------------>
 
<!-----FEW MONTHS, YEARS FROM WE CAN DELETE STUFF. NOT NOW ------------------>
 
<!-----YOU DON"T WANT WIKEMACS TO BE ANOTHER EMACSWIKI RIGHT ------------------>
 
<!-----PLEASE BE PATIENT AND CO-OPERATE FOR GREATER GOOD ------------------>
 
 
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= Basic setup =
 
 
 
c-mode is bundled with Emacs by default. No additional setup is required.
 
 
 
= Helpful keybindings =
 
 
 
; {{Keys|C-M-a}}
 
: Go to the beginning of the current function. If you are between 2 functions, go the start of the previous one.
 
 
 
; {{Keys|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 =
 
<!-- Customization common to all platforms goes here -->
 
 
 
== Change default indenting style ==
 
<source lang="lisp">
 
; set k&r style
 
(setq c-set-style "k&r")
 
; indent with 4 spaces
 
(setq c-basic-offset 4)
 
</source>
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= [[GNU/Linux]] =
 
<!-- Customization/Notes specific to GNU/Linux goes here -->
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= [[OS X]] =
 
<!-- Customization/Notes specific to OS X goes here -->
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= [[Windows]] =
 
<!-- Customization/Notes specific to Windows goes here -->
 
 
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= [[Emacs-24]] =
 
<!-- Customization/Notes specific to Emacs-24 -->
 
<!-- Recent revision should come first. This way important information stays at top  -->
 
 
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= [[Emacs-23]] =
 
<!-- Customization/Notes specific to Emacs-22 -->
 
 
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= Recommended Reading =
 
<!-- Only internal links. DO NOT insert EXTERNAL LINKS -->
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= Project Pages =
 
* [http://cc-mode.sourceforge.net/ cc-mode]
 
 
 
<!------------------------------------------------------------------------->
 
 
 
= Tutorial Pages =
 
<!-- ;[http://wiki.bazaar.canonical.com/EmacsTips Emacs as commit message editor]  -->
 
<!-- :Tips for setting up Emacs as Bazaar commit editor. -->
 
 
 
<!------------------------------------------------------------------------->
 
<!-- Add categories based on user-level (beginner etc), user-role (programming, emacs contributor etc), platform (windows, linux etc) or work flow (text editing, document authoring etc)  -->
 
 
 
[[Category:Programming]]
 

Latest revision as of 11:27, 20 April 2012

Redirect to: