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.
This commit is contained in:
Tom Willemsen 2011-04-26 09:30:24 +02:00
parent abca74c7fd
commit 9d53d9b19c

View file

@ -1,3 +1,9 @@
(add-hook 'c-mode-hook (add-hook 'c-mode-hook
(lambda () (lambda ()
(local-set-key [f11] 'c-toggle-header-source))) (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)))