(require 'cc-mode)
(require 'find-file)
;;; Obj-C
(add-to-list 'auto-mode-alist '("\\.mm$" . objc-mode))
;;; C
(add-hook 'c-mode-common-hook
'(lambda ()
(c-toggle-auto-hungry-state 1)
(setq tab-width 4)
(setq c-basic-offset 4)
(setq indent-tabs-mode nil)
(local-set-key [(return)] 'newline-and-indent)
(local-set-key (quote [C-s-up]) 'ff-find-other-file)
(local-set-key (quote [C-s-down]) 'ff-find-other-file)
(set (make-local-variable 'cc-other-file-alist)
'(("\\.m\\'" (".h"))
("\\.mm\\'" (".h"))
("\\.h\\'" (".m" ".mm" ".c" ".cpp" ".cc"))
("\\.c\\'" (".h"))
("\\.cpp\\'" (".h"))
("\\.cc\\'" (".h"))
))))
沒有留言:
張貼留言