legacy-dotfiles/emacs.d/20-c-mode.el
Tom Willemsen 9d53d9b19c EMACS: c-mode keys
* Mapped <Return> to c-indent-new-comment-line followed by a
    c-indent-line-or-region.

  * Mapped <C-return> to newline, since c-indent-new-comment-line
    inserts a \ at the end of #define statements and #include
    statements which makes the compiler think the line continues on
    the next.
2011-04-26 09:30:24 +02:00

9 lines
381 B
EmacsLisp

(add-hook 'c-mode-hook
(lambda ()
(local-set-key [f11] 'c-toggle-header-source)
(local-set-key "\C-m"
(lambda ()
(interactive)
(c-indent-new-comment-line)
(c-indent-line-or-region)))
(local-set-key [C-return] 'newline)))