-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Tools: Emacs
Alexandre Gautier edited this page Oct 12, 2016
·
6 revisions
By default, emacs
will use spaces to indent your C code.
Of course, you don't want that.
To tell emacs to use tabs
instead, you just need to put the following lines in the file ~/.emacs
(If it doesn't exist, just create it):
(setq c-default-style "k&r"
c-basic-offset 8
tab-width 8
indent-tabs-mode t)
If you want to highlight lines exceeding 80 characters and trailing whitespace, you can add this to your ~/.emacs
:
(require 'whitespace)
(setq whitespace-style '(face empty lines-tail trailing))
(global-whitespace-mode t)
0.1 - Betty-style usage
0.2 - Betty-doc usage
0.3 - References
1.1 - Indentation
1.2 - Breaking long lines and strings
1.3 - Placing Braces
1.4 - Placing Spaces
1.5 - Naming
1.6 - Functions
1.7 - Commenting
1.8 - Macros and Enums
1.9 - Header files
2.1 - Functions
2.2 - Data structures
3.1 - Emacs
3.2 - Vim
3.3 - Atom