.emacs-zerock 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. (custom-set-variables
  2. ;; custom-set-variables was added by Custom.
  3. ;; If you edit it by hand, you could mess it up, so be careful.
  4. ;; Your init file should contain only one such instance.
  5. ;; If there is more than one, they won't work right.
  6. '(ansi-color-faces-vector
  7. [default default default italic underline success warning error])
  8. '(ansi-color-names-vector
  9. ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
  10. '(custom-enabled-themes (quote (deeper-blue)))
  11. '(inhibit-startup-screen t)
  12. '(mouse-wheel-progressive-speed nil))
  13. (custom-set-faces
  14. ;; custom-set-faces was added by Custom.
  15. ;; If you edit it by hand, you could mess it up, so be careful.
  16. ;; Your init file should contain only one such instance.
  17. ;; If there is more than one, they won't work right.
  18. )
  19. (defun disable-all-themes ()
  20. "disable all active themes"
  21. (dolist (theme custom-enabled-themes)
  22. (disable-theme theme)))
  23. ;; disable color theme if in console
  24. (if (not window-system)
  25. (disable-all-themes))
  26. ;; disable backup
  27. (setq backup-inhibited t)
  28. (setq make-backup-files nil)
  29. (setq auto-save-default nil) ; disable autosave
  30. ;; fill mode
  31. (add-hook 'text-mode-hook 'turn-on-auto-fill)
  32. (setq-default fill-column 79)
  33. ;; disable space-to-tab for indentations
  34. (setq-default indent-tabs-mode nil)
  35. ;; except for C
  36. (defun c-lineup-arglist-tabs-only (ignored)
  37. "Line up argument lists by tabs, not spaces"
  38. (let* ((anchor (c-langelem-pos c-syntactic-element))
  39. (column (c-langelem-2nd-pos c-syntactic-element))
  40. (offset (- (1+ column) anchor))
  41. (steps (floor offset c-basic-offset)))
  42. (* (max steps 1)
  43. c-basic-offset)))
  44. (add-hook 'c-mode-common-hook
  45. (lambda ()
  46. ;; Add kernel style
  47. (c-add-style
  48. "linux-tabs-only"
  49. '("linux" (c-offsets-alist
  50. (arglist-cont-nonempty
  51. c-lineup-gcc-asm-reg
  52. c-lineup-arglist-tabs-only))))))
  53. (add-hook 'c-mode-hook
  54. (lambda ()
  55. (setq indent-tabs-mode t)
  56. (setq show-trailing-whitespace t)
  57. (c-set-style "linux-tabs-only")))
  58. (add-hook 'c++-mode-common-hook
  59. (lambda ()
  60. ;; Add kernel style
  61. (c-add-style
  62. "linux-tabs-only"
  63. '("linux" (c-offsets-alist
  64. (arglist-cont-nonempty
  65. c-lineup-gcc-asm-reg
  66. c-lineup-arglist-tabs-only))))))
  67. (add-hook 'c++-mode-hook
  68. (lambda ()
  69. (setq indent-tabs-mode t)
  70. (setq show-trailing-whitespace t)
  71. (c-set-style "linux-tabs-only")))
  72. (defalias 'list-buffers 'ibuffer) ; because ibuffers
  73. (setq inhibit-splash-screen t) ; skip splash
  74. (line-number-mode 1) ; line number at bottom
  75. ;;(global-linum-mode 1) ; line numbers on side
  76. (column-number-mode 1) ; column number at bottom
  77. ;; typical cut/copy/paste functions
  78. (cua-mode)
  79. (setq x-select-enable-clipboard t)
  80. (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
  81. (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
  82. (require 'term)
  83. (define-key term-raw-map (kbd "C-'") 'term-line-mode)
  84. (define-key term-mode-map (kbd "C-'") 'term-char-mode)
  85. (define-key term-raw-map (kbd "C-y") 'term-paste)
  86. ;; add directory for workstation-specific code
  87. (add-to-list 'load-path "~/.emacs.d/lisp/")
  88. ;; show clock at bottom
  89. (display-time-mode 1)
  90. ;; show battery at bottom
  91. (display-battery-mode 1)
  92. ;; custom modes for file extensions
  93. (add-to-list 'auto-mode-alist '("\\.ino\\'" . c++-mode))
  94. (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))