Saturday, April 08, 2006

C++ mode in emacs

;; C++
(require 'cc-mode)
(c-set-offset 'inline-open 0)
(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)
(c-set-style "stroustrup")

The last line is used to make better "for {}", it looks wired without this one (with indent)

Several keys:
M-; --add comments to current line
C-x h --select all
C-M-\ --reorganize the selected format and comments


No comments:

Post a Comment