问个emacs键绑定问题
发表于 : 2009-10-26 21:09
我想在输入;时自动换行请问如何写?如下只是换行没有插入分号,请教。
(local-set-key "\;" 'align-newline-and-indent)
(local-set-key "\;" 'align-newline-and-indent)
代码: 全选
(defun my-c-mode-hook()
(interactive)
;设置C程序的对齐风格
(c-set-style "stroustrup")
;auto模式,当你键入{时,会自动根据你设置的对齐风格对齐
;hungry模式,当按Backspace时会删除最多的空格
(c-toggle-auto-hungry-state)
;自动回车
(c-toggle-auto-newline t)
;TAB键的宽度设置为4
(setq-default c-basic-offset 4)
;在菜单中加入当前Buffer的函数索引
(imenu-add-menubar-index)
;在状态条上显示当前光标在哪个函数体内部
(which-function-mode))