.emacs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. ;; link to notes file:
  2. ;; ~/config_files/emacs/initial_notes.org
  3. ;;{{{ Set up package and use-package
  4. (require 'package)
  5. (add-to-list 'package-archives
  6. '("melpa" . "https://melpa.org/packages/") t)
  7. (package-initialize)
  8. ;; Bootstrap 'use-package'
  9. (eval-after-load 'gnutls
  10. '(add-to-list 'gnutls-trustfiles "/etc/ssl/cert.pem"))
  11. (unless (package-installed-p 'use-package)
  12. (package-refresh-contents)
  13. (package-install 'use-package))
  14. (eval-when-compile
  15. (require 'use-package))
  16. (require 'bind-key)
  17. (setq use-package-always-ensure t)
  18. ;; enable time tracking in org-mode
  19. (setq org-clock-persist 'history)
  20. (org-clock-persistence-insinuate)
  21. (use-package ivy :demand
  22. :config
  23. (setq ivy-use-virtual-buffers t
  24. ivy-count-format "%d/%d "))
  25. (ivy-mode 1)
  26. ;; (desktop-save-mode 1)
  27. ;; this will ensure that packages are always installed if not present
  28. (require 'use-package)
  29. (setq use-package-always-ensure t)
  30. (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
  31. (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
  32. (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
  33. ;; make escape key escape commands anywhere
  34. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  35. (use-package projectile
  36. :init
  37. (projectile-mode +1)
  38. :bind (:map projectile-mode-map
  39. ("s-p" . projectile-command-map)
  40. ("C-c p" . projectile-command-map)))
  41. (use-package markdown-mode
  42. :commands (markdown-mode gfm-mode)
  43. :mode (("README\\.md\\'" . gfm-mode)
  44. ("\\.md\\'" . markdown-mode)
  45. ("\\.markdown\\'" . markdown-mode))
  46. :init (setq markdown-command "multimarkdown"))
  47. ;; set fill column / text width to 80
  48. (setq-default fill-column 80)
  49. ;; Enable auto-fill minor mode in all text modes
  50. (add-hook 'text-mode-hook 'turn-on-auto-fill)
  51. ;; Enable auto-fill-function
  52. (setq-default auto-fill-function 'do-auto-fill)
  53. ;; diplay line and column numbers
  54. (column-number-mode)
  55. (global-display-line-numbers-mode t)
  56. ;; disable column numbers for term and org modes
  57. (dolist (mode '(org-mode-hook
  58. term-mode-hook
  59. eshell-mode-hook))
  60. (add-hook mode (lambda () (display-line-numbers-mode 0))))
  61. ;; (set-cursor-color "dodgerblue")
  62. (show-paren-mode 1)
  63. ;; (met-frame-parameter (selected-frame) 'alpha '(85 85))
  64. ;; (add-to-list 'default-frame-alist '(alpha 85 85))
  65. ;; (set-face-attribute 'default nil :background "black"
  66. ;; :foreground "white" :font "Courier" :height 180)
  67. ;; Hide scroll/tool/menu bars
  68. (menu-bar-mode -1)
  69. (tool-bar-mode -1)
  70. (toggle-scroll-bar -1)
  71. ;; Don't show splash screen on load
  72. (setq inhibit-splash-screen t)
  73. (setq inhibit-startup-message t)
  74. ;; (set-face-attribute 'default nil :font "Fira Code Retina" :height 20)
  75. (set-face-attribute 'default nil :height 140)
  76. ;;(setq package-enable-at-startup nil)
  77. (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
  78. ;; org-mode Settings
  79. ;; set up an agenda keybind
  80. (use-package org
  81. :config
  82. (setq org-ellipsis " ▼")
  83. ;; set image width for inline images to nil, so they can be resized inline
  84. (setq org-image-actual-width nil)
  85. ;; make boldface font show red (useful for important/urgent)
  86. (add-to-list 'org-emphasis-alist
  87. '("*" (:foreground "red")
  88. ))
  89. )
  90. (global-set-key (kbd "C-c a") 'org-agenda)
  91. ;; enable org-bullet-mode, replace asterisks with bullets
  92. (use-package org-bullets)
  93. ;;(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
  94. (add-hook 'org-mode-hook #'org-bullets-mode)
  95. ;; helm setup
  96. ;; (use-package helM
  97. ;; :init
  98. ;; (progn
  99. ;; (require 'helm-config)
  100. ;; ;; limit max number of matches displayed for speed
  101. ;; (setq helm-candidate-number-limit 100)
  102. ;; ;; replace locate with spotlight on Mac
  103. ;; (setq helm-locate-command "locate"))
  104. ;; :bind (("C-x f" . helm-for-files)))
  105. ;; intelligently wrap lines in all text modes, including ORG
  106. (setq auto-fill-mode 1)
  107. (add-hook 'text-mode-hook 'visual-line-mode)
  108. ;; specify my TODO.org file as file for the agenda
  109. (setq org-agenda-files '("~/TODO.org"))
  110. (setq org-log-done 'time)
  111. ;; Doom ModeLine
  112. (use-package doom-modeline
  113. :init (doom-modeline-mode 1)
  114. :config
  115. )
  116. (use-package all-the-icons-gnus)
  117. ;; Powerline
  118. ;; (use-package powerline)
  119. ;;(use-package powerline)
  120. ;;(powerline-center-evil-theme)
  121. ;; (use-package spacemacs-common
  122. ;; :ensure spacemacs-theme
  123. ;; :config
  124. ;; (load-theme 'spacemacs-dark t))
  125. ;; Doom Themes settings
  126. (use-package doom-themes
  127. :config
  128. ;; Global settings (defaults)
  129. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  130. doom-themes-enable-italic t) ; if nil, italics is universally disabled
  131. (load-theme 'doom-palenight t)
  132. ;; Corrects (and improves) org-mode's native fontification.
  133. (doom-themes-org-config))
  134. ;; (load-theme 'wombat)
  135. ;; Evil mode
  136. (setq evil-undo-system 'undo-fu)
  137. (use-package evil
  138. :init
  139. (setq evil-want-integration t) ;; This is optional since it's already set to t by default.
  140. (setq evil-want-keybinding nil)
  141. :config
  142. (evil-mode 1))
  143. ;; undo-fu provides redo functionality
  144. (use-package undo-fu)
  145. ;; set undo/redo bindings
  146. (define-key evil-normal-state-map "u" 'undo-fu-only-undo)
  147. (define-key evil-normal-state-map "\C-r" 'undo-fu-only-redo)
  148. (setq initial-major-mode 'evil-mode)
  149. ;; make Ctrl-i jump forward in jump list
  150. (setq evil-want-C-i-jump 1)
  151. ;; enable gcc for comments
  152. (evil-commentary-mode)
  153. ;; remap colon/semi-colon, though I don't quite understand how
  154. (with-eval-after-load 'evil-maps
  155. (define-key evil-motion-state-map (kbd ":") 'evil-repeat-find-char)
  156. (define-key evil-motion-state-map (kbd ";") 'evil-ex))
  157. (use-package evil-surround
  158. :config
  159. (global-evil-surround-mode 1))
  160. (use-package evil-collection
  161. :after evil
  162. config
  163. (evil-collection-init))
  164. (use-package lorem-ipsum)
  165. (lorem-ipsum-use-default-bindings)
  166. ;; default bindings
  167. ;; C-c l p lorem-ipsum-insert-paragraphs
  168. ;; C-c l s lorem-ipsum-insert-sentences
  169. ;; C-c l l lorem-ipsum-insert-list
  170. ;;========================================
  171. ;; Deprecated variants
  172. ;;(define-key key-translation-map (kbd ";") (kbd ":"))
  173. ;;(define-key key-translation-map (kbd ":") (kbd ";"))
  174. ;; (require 'undo-fu)
  175. ;; (require 'evil)
  176. ;;========================================
  177. (custom-set-variables
  178. ;; custom-set-variables was added by Custom.
  179. ;; If you edit it by hand, you could mess it up, so be careful.
  180. ;; Your init file should contain only one such instance.
  181. ;; If there is more than one, they won't work right.
  182. '(ansi-color-names-vector
  183. ["#292D3E" "#ff5370" "#c3e88d" "#ffcb6b" "#82aaff" "#c792ea" "#89DDFF" "#EEFFFF"])
  184. '(custom-safe-themes
  185. (quote
  186. ("c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" "a3bdcbd7c991abd07e48ad32f71e6219d55694056c0c15b4144f370175273d16" "8f5a7a9a3c510ef9cbb88e600c0b4c53cdcdb502cfe3eb50040b7e13c6f4e78e" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" default)))
  187. '(fci-rule-color "#676E95")
  188. '(jdee-db-active-breakpoint-face-colors (cons "#1c1f2b" "#c792ea"))
  189. '(jdee-db-requested-breakpoint-face-colors (cons "#1c1f2b" "#c3e88d"))
  190. '(jdee-db-spec-breakpoint-face-colors (cons "#1c1f2b" "#676E95"))
  191. '(objed-cursor-color "#ff5370")
  192. '(org-agenda-files (quote ("~/TODO.org")))
  193. '(package-selected-packages
  194. (quote
  195. (zetteldeft exwm-surf zprint-format darkroom projectile evil-collection markdown-mode ivy-avy org-bullets doom-themes all-the-icons-ivy all-the-icons-gnus doom-modeline zenburn-theme lorem-ipsum ## powerline use-package evil-commentary undo-fu undo-tree evil notmuch)))
  196. '(pdf-view-midnight-colors (cons "#EEFFFF" "#292D3E"))
  197. '(rustic-ansi-faces
  198. ["#292D3E" "#ff5370" "#c3e88d" "#ffcb6b" "#82aaff" "#c792ea" "#89DDFF" "#EEFFFF"])
  199. '(vc-annotate-background "#292D3E")
  200. '(vc-annotate-color-map
  201. (list
  202. (cons 20 "#c3e88d")
  203. (cons 40 "#d7de81")
  204. (cons 60 "#ebd476")
  205. (cons 80 "#ffcb6b")
  206. (cons 100 "#fcb66b")
  207. (cons 120 "#f9a16b")
  208. (cons 140 "#f78c6c")
  209. (cons 160 "#e78e96")
  210. (cons 180 "#d690c0")
  211. (cons 200 "#c792ea")
  212. (cons 220 "#d97dc1")
  213. (cons 240 "#ec6898")
  214. (cons 260 "#ff5370")
  215. (cons 280 "#d95979")
  216. (cons 300 "#b36082")
  217. (cons 320 "#8d678b")
  218. (cons 340 "#676E95")
  219. (cons 360 "#676E95")))
  220. '(vc-annotate-very-old-color nil))
  221. (custom-set-faces
  222. ;; custom-set-faces was added by Custom.
  223. ;; If you edit it by hand, you could mess it up, so be careful.
  224. ;; Your init file should contain only one such instance.
  225. ;; If there is more than one, they won't work right.
  226. )