Emacs personal configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

25 行
780B

  1. ;https://www.emacswiki.org/emacs/IndentingC
  2. ;;(require-package 'guess-offset)
  3. ;; (setq c-default-style "linux"
  4. ;; c-basic-offset 4
  5. ;; tab-width 4
  6. ;; indent-tabs-mode t)
  7. ;; http://www.linuxfromscratch.org/alfs/view/hacker/part2/hacker/coding-style.html
  8. (defun linux-c-mode ()
  9. "C mode with adjusted defaults for use with the Linux kernel."
  10. (interactive)
  11. (c-mode)
  12. (c-set-style "K&R")
  13. (setq c-basic-offset 8
  14. indent-tabs-mode t))
  15. (setq auto-mode-alist
  16. (cons '("\\.[ch]$" . linux-c-mode)
  17. auto-mode-alist))
  18. ;;http://www.delorie.com/gnu/docs/emacs/cc-mode_6.html
  19. ;;http://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Minor-Modes
  20. ; C-c C-a: (add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))
  21. (provide 'init-c)