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:
parent
abca74c7fd
commit
9d53d9b19c
1 changed files with 7 additions and 1 deletions
|
@ -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)))
|
||||||
|
|
Loading…
Reference in a new issue