* C言語のindent設定 (21.4.1 で動作した。他ver は知らない) [#we17460a]

** http://d.hatena.ne.jp/gomi-box/20071022/1193036225 [#ee1cc484]

 ;; c-mode-hock(C言語のインデントの設定)
 (defun my-c-mode-hook ()
   (c-set-style "stroustrup")
   (setq indent-tabs-mode nil)
   (setq c-basic-offset 4)
   (c-toggle-auto-state -1)
   (define-key c-mode-base-map "\C-m" 'newline-and-indent))
(add-hook 'c-mode-hook 'my-c-mode-hook)

 ;; c++-mode-hock(C++のインデントの設定)
 (defun my-c++-mode-hook ()
   (c-set-style "stroustrup")
   (setq indent-tabs-mode nil)
   (setq c-basic-offset 4)
   (c-toggle-auto-state -1)
   (define-key c-mode-base-map "\C-m" 'newline-and-indent))
 (add-hook 'c++-mode-hook 'my-c++-mode-hook)

Reload   Diff   Front page List of pages Search Recent changes Backup Referer   Help   RSS of recent changes