User Tools

Site Tools


This is an old revision of the document!


Show trailing whitespace

Show trailing whitespace as red blocks:

 '(show-trailing-whitespace t))

Use Allman/BSD style

Make curly braces placement as described by Allman from the BSD project:

(setq c-default-style "bsd" c-basic-offset 4)

Use SmartTabs

Use "SmartTabs", ie. tabs for indentation and spaces for alignment.

Create the folder ~/.emacs.d/lisp and download smart-tabs-mode.el and cl-lib into it.

Add the following lines to the .emacs file:

(add-to-list 'load-path "~/.emacs.d/lisp/")
(load-file "~/.emacs.d/lisp/cl-lib-0.5.el")
(load-file "~/.emacs.d/lisp/smart-tabs-mode.el")
(autoload 'smart-tabs-mode "Intelligently indent with tabs, align with spaces!")
(autoload 'smart-tabs-mode-enable "smart-tabs-mode")
(autoload 'smart-tabs-advice "smart-tabs-mode")
(autoload 'smart-tabs-insinuate "smart-tabs-mode")
(smart-tabs-insinuate 'c 'c++ 'java 'javascript 'cperl 'ruby 'nxml)

Switch between cc/h files

Switch between the header and implementation using Alt-o.

Download SwitchFile.el to the ~/emacs.d/lisp folder.

(require 'switch-file)
(global-set-key (kbd "M-o") 'switch-cc-to-h)
emacs/emacs.1442076944.txt.gz · Last modified: 2015/09/12 18:55 by deva