Top > emacs

.emacs

C言語のindent設定

  • 21.4.1 で動作する設定をやっと見つけた。他ver で動くかは知らない。

http://d.hatena.ne.jp/gomi-box/20071022/1193036225

;; 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)

MacOSX


Reload   Diff   Front page List of pages Search Recent changes Backup Referer   Help   RSS of recent changes
Last-modified: Tue, 06 Jun 2017 17:13:20 JST (869d)