|
|
[PHP](defun my-c-mode-common-hook()
(setq tab-width 4 indent-tabs-mode nil)
;;; hungry-delete and auto-newline
(c-toggle-auto-hungry-state 1)
;;按键定义
(define-key c-mode-base-map [(control \`)] 'hs-toggle-hiding)
(define-key c-mode-base-map [(return)] 'newline-and-indent)
(define-key c-mode-base-map [(f7)] 'smart-compile)
(define-key c-mode-base-map [(meta \`)] 'c-indent-command)
;; (define-key c-mode-base-map [(tab)] 'hippie-expand)
(define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
(local-set-key (kbd "{") 'skeleton-c-mode-left-brace)
;;(define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
;; set linux style as the default style. Add by Leon.
(c-set-style "linux")
;;预处理设置
(setq c-macro-shrink-window-flag t)
(setq c-macro-preprocessor "cpp")
(setq c-macro-cppflags " ")
(setq c-macro-prompt-flag t)
(setq hs-minor-mode t)
(setq abbrev-mode t)
)[/PHP]
这是我的c common hook,我在其它地方还加了
[PHP](setq default-tab-width 4)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)[/PHP]这样的语句,可是indent的时候还是空8格,怎样才能搞成4格?
我是cvs的emacs,以前的版本好像是好的,真是奇怪 |
|