开发者

Emacs customization

I'm new to the whole Emacs thing, and one of the things that gets me is that out-of-the-box Emacs doesn't keep you within blocks when programming. I program in mostly Python and开发者_JAVA技巧 C++ and hitting enter sends the cursor back to column 1 on a new line rather than keeping you in the block you're working in. I managed to find this:

(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))

Which binds the enter key to newline-and-indent in Python mode, but how do I extend this to cover C/C++ mode too?


The following is from my init.el for xemacs, it might or might not work for emacs:

(add-hook 'c-mode-common-hook
      '(lambda () 
         (define-key c-mode-base-map (kbd "RET") 'newline-and-indent)))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜