Emacs personal configuration
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

24 lines
742B

  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. (setq auto-mode-alist
  15. (cons '("\\.[ch]$" . linux-c-mode)
  16. auto-mode-alist))
  17. ;;http://www.delorie.com/gnu/docs/emacs/cc-mode_6.html
  18. ;;http://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Minor-Modes
  19. (add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))
  20. (provide 'init-c)