dot_emacs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. ;;; .emacs --- Oleg's Emacs configuration
  2. ;; Copyright © 2017, 2018, 2019, 2020, 2021, 2022, 2023 Oleg Pykhalov <go.wigust@gmail.com>
  3. ;; Released under the GNU GPLv3 or any later version.
  4. ;; Tip: "M-x e" on `(emacs-init-time)'.
  5. ;; Prettify without breaking indentation,
  6. ;; Origin <http://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html>.
  7. ;; Prevent stale elisp bytecode from shadowing more up-to-date source
  8. ;; files. Origin <https://github.com/technomancy/better-defaults>.
  9. ;; Added by Package.el. This must come before configurations of
  10. ;; installed packages. Don't delete this line. If you don't want it,
  11. ;; just comment it out by adding a semicolon to the start of the line.
  12. ;; You may delete these explanatory comments.
  13. ;; (package-initialize)
  14. (setq read-process-output-max (* 1024 1024)) ;; 1mb
  15. (setq gc-cons-threshold 100000000)
  16. ;; [[https://github.com/skeeto/elfeed/issues/95][End of file during parsing · Issue #95 · skeeto/elfeed]]
  17. (setq write-region-inhibit-fsync t)
  18. ;; [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html][gnu.org/s/emacs/manual/html_node/elisp/Startup-Summary.html]]
  19. ;;
  20. ;; Uncomment the following:
  21. ;;
  22. ;; (setq initial-buffer-choice 'text-mode)
  23. ;;
  24. ;; and add to the end of the ~/.emacs file:
  25. ;;
  26. ;; (benchmark-init/show-durations-tabulated)
  27. (autoload 'f-directories "f" nil t)
  28. (autoload 'string-trim-right "subr-x" nil t)
  29. (autoload 'flet "cl" nil t)
  30. (autoload 'beginend-global-mode "beginend" nil t)
  31. (require 'dash) ; TODO: Use `autoload' instead of `require'.
  32. (require 'cl-lib)
  33. (defun load-config-file (file)
  34. (load (concat (getenv "HOME") "/.emacs.d/modules/" file)))
  35. (setq load-prefer-newer t)
  36. (setq epg-gpg-program "gpg")
  37. ;; (require 'benchmark-init)
  38. ;; To disable collection of benchmark data after init is done.
  39. ;; (add-hook 'after-init-hook 'benchmark-init/deactivate)
  40. (setq package-archives nil) ; Makes unpure packages archives unavailable
  41. (setq user-mail-address "go.wigust@gmail.com")
  42. (setq user-full-name "Oleg Pykhalov")
  43. (setq default-input-method "russian-computer") ; <C-\> keyboard layout
  44. ;; https://github.com/skeeto/elfeed/issues/437
  45. ;;
  46. ;; Multibyte characters broken in titles, fixed by running
  47. ;; `toggle-enable-multibyte-characters` twice · Issue #437 ·
  48. ;; skeeto/elfeed
  49. ;; (set-language-environment "utf-8")
  50. (autoload 'debbugs-browse-url "debbugs-browse" nil t)
  51. (load-config-file "utils.el")
  52. (load-config-file "dired.el")
  53. (load-config-file "ffap.el")
  54. (load-config-file "nav.el")
  55. (load-config-file "keys.el")
  56. (load-config-file "org.el")
  57. (load-config-file "lisp.el")
  58. (load-config-file "files.el")
  59. (load-config-file "nix.el")
  60. (load-config-file "scheme.el")
  61. (load-config-file "guix.el")
  62. (load-config-file "yaml.el")
  63. (load-config-file "kubernetes.el")
  64. (load-config-file "term.el")
  65. (load-config-file "audio.el")
  66. (load-config-file "mail.el")
  67. (load-config-file "c.el")
  68. (load-config-file "version-control-lexical.el")
  69. (load-config-file "version-control.el")
  70. (load-config-file "erc.el")
  71. (load-config-file "rfc.el")
  72. (load-config-file "web.el")
  73. (load-config-file "outline.el")
  74. (load-config-file "snippets.el")
  75. (load-config-file "copyright.el")
  76. (load-config-file "lsp.el")
  77. (add-hook 'emacs-startup-hook (lambda () (load-config-file "theme.el")))
  78. (load-config-file "ci.el")
  79. (load-config-file "compile.el")
  80. (load-config-file "hooks.el")
  81. (load-config-file "debug.el")
  82. (load-config-file "elfeed.el")
  83. (load-config-file "time.el")
  84. (load-config-file "debbugs.el")
  85. (load-config-file "text.el")
  86. (load-config-file "groovy.el")
  87. (load-config-file "haskell.el")
  88. (load-config-file "completion.el")
  89. (load-config-file "ftp.el")
  90. (load-config-file "info.el")
  91. (load-config-file "majordomo.el")
  92. (load-config-file "blog.el")
  93. (load-config-file "po.el")
  94. (load-config-file "python.el")
  95. (load-config-file "java.el")
  96. (load-config-file "js.el")
  97. (load-config-file "perl.el")
  98. (load-config-file "rust.el")
  99. (load-config-file "ml.el")
  100. (load-config-file "tramp.el")
  101. ;; (load-config-file "twitch.el")
  102. ;; (load-config-file "youtube.el")
  103. (autoload 'get-synonyms "thesaurus" nil t)
  104. (autoload 'mf/mirror-region-in-multifile "multifiles" nil t)
  105. ;; (autoload 'org-notifications-start "org-notifications" nil t)
  106. ;; (setq org-notifications-non-agenda-file
  107. ;; (list (expand-file-name "~/src/gitlab.com/wigust/notes/agenda.org")))
  108. ;; ;; (setq org-notifications-notify-before-time 5)
  109. ;; (org-notifications-start)
  110. (setq ewmctrl-wmctrl-path "/run/current-system/profile/bin/wmctrl")
  111. (defalias 'rg 'deadgrep)
  112. ;; TODO: debpaste API broken
  113. ;; (setq debpaste-user-name "wigust")
  114. (custom-set-variables
  115. ;; custom-set-variables was added by Custom.
  116. ;; If you edit it by hand, you could mess it up, so be careful.
  117. ;; Your init file should contain only one such instance.
  118. ;; If there is more than one, they won't work right.
  119. '(build-farm-build-arguments '("jobset=guix-master" "system=x86_64-linux"))
  120. '(company-backends
  121. '(company-abbrev company-bbdb company-eclim company-semantic company-xcode company-cmake company-capf company-files
  122. (company-dabbrev-code company-gtags company-etags company-keywords)
  123. company-oddmuse company-dabbrev))
  124. '(custom-safe-themes
  125. '("e1ad4299390cb3fc0cbf5a705442eaf08510aa947c90c8bc83b1d7308befb475" "0568a5426239e65aab5e7c48fa1abde81130a87ddf7f942613bf5e13bf79686b" "076ee9f2c64746aac7994b697eb7dbde23ac22988d41ef31b714fc6478fee224" "d9864caf2fc6cd9bc5bed941c526a4690bf6c27f0d8c1ca28ff7e05806b57204" "aa85228e4b6d188c3c0b8553548142c2c75726429614376c26255a51378982f5" "a10ca93d065921865932b9d7afae98362ce3c347f43cb0266d025d70bec57af1" "4ce515d79ef94f3b7651c8e2a7c7d81814b9ca911eb2a16955f45f4555faf524" "ba881f92a04cf56df49740324caea02d25442a327f1c33d1a1946f0b9a846f53" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default))
  126. '(dap-auto-configure-mode nil)
  127. '(dap-tooltip-mode nil)
  128. '(dap-ui-controls-mode nil nil (dap-ui))
  129. '(dap-ui-many-windows-mode nil)
  130. '(dap-ui-mode nil nil (dap-ui))
  131. '(debug-on-error nil)
  132. '(indent-tabs-mode nil)
  133. '(org-agenda-files '("~/org/inbox.org" "~/org/todo.org" "~/org/web.org"))
  134. '(python-shell-interpreter "python3")
  135. '(safe-local-variable-values
  136. '((geiser-repl-per-project-p . t)
  137. (eval progn
  138. (setq-local create-lockfiles nil))
  139. (eval let
  140. ((root-dir-unexpanded
  141. (locate-dominating-file default-directory ".dir-locals.el")))
  142. (when root-dir-unexpanded
  143. (let*
  144. ((root-dir
  145. (file-local-name
  146. (expand-file-name root-dir-unexpanded)))
  147. (root-dir*
  148. (directory-file-name root-dir)))
  149. (unless
  150. (boundp 'geiser-guile-load-path)
  151. (defvar geiser-guile-load-path 'nil))
  152. (make-local-variable 'geiser-guile-load-path)
  153. (require 'cl-lib)
  154. (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))))
  155. (projectile-project-compilation-cmd . ".direnv/aliases/shell -- .direnv/aliases/build")
  156. (eval progn
  157. (when
  158. (boundp #'projectile-project-root)
  159. (setenv "GUIX_PACKAGE_PATH"
  160. (concat
  161. (projectile-project-root)
  162. "dotfiles/guixsd/modules")))
  163. (setq-local geiser-guile-load-path
  164. (append
  165. (list
  166. (concat
  167. (getenv "HOME")
  168. "/src/cgit.duckdns.org/guix/guix-wigust/guix"))
  169. (list
  170. (concat
  171. (getenv "HOME")
  172. "/src/gitlab.com/nonguix/nonguix"))
  173. (if
  174. (boundp #'projectile-project-root)
  175. (list
  176. (concat
  177. (projectile-project-root)
  178. "dotfiles/guixsd/modules"))
  179. 'nil))))
  180. (eval with-eval-after-load 'yasnippet
  181. (let
  182. ((guix-yasnippets
  183. (expand-file-name "etc/snippets/yas"
  184. (locate-dominating-file default-directory ".dir-locals.el"))))
  185. (unless
  186. (member guix-yasnippets yas-snippet-dirs)
  187. (add-to-list 'yas-snippet-dirs guix-yasnippets)
  188. (yas-reload-all))))
  189. (eval add-to-list 'completion-ignored-extensions ".go")
  190. (eval setq-local geiser-guile-load-path
  191. (append
  192. (list
  193. (concat
  194. (getenv "HOME")
  195. "/src/cgit.duckdns.org/guix/guix-wigust/guix"))
  196. (list
  197. (concat
  198. (getenv "HOME")
  199. "/src/gitlab.com/nonguix/nonguix"))
  200. (if
  201. (boundp #'projectile-project-root)
  202. (list
  203. (concat
  204. (projectile-project-root)
  205. "dotfiles/guixsd/modules"))
  206. 'nil)))
  207. (eval progn
  208. (require 'lisp-mode)
  209. (defun emacs27-lisp-fill-paragraph
  210. (&optional justify)
  211. (interactive "P")
  212. (or
  213. (fill-comment-paragraph justify)
  214. (let
  215. ((paragraph-start
  216. (concat paragraph-start "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
  217. (paragraph-separate
  218. (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
  219. (fill-column
  220. (if
  221. (and
  222. (integerp emacs-lisp-docstring-fill-column)
  223. (derived-mode-p 'emacs-lisp-mode))
  224. emacs-lisp-docstring-fill-column fill-column)))
  225. (fill-paragraph justify))
  226. t))
  227. (setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph))
  228. (eval setq-local geiser-guile-load-path
  229. (append
  230. (list
  231. (concat
  232. (getenv "HOME")
  233. "/src/cgit.duckdns.org/git/guix/guix-wigust/guix"))
  234. (list
  235. (concat
  236. (getenv "HOME")
  237. "/src/gitlab.com/nonguix/nonguix"))
  238. (if
  239. (boundp #'projectile-project-root)
  240. (list
  241. (concat
  242. (projectile-project-root)
  243. "dotfiles/guixsd/modules"))
  244. 'nil)))
  245. (eval setq-local geiser-guile-load-path
  246. (append
  247. (list
  248. (concat
  249. (getenv "HOME")
  250. "/src/cgit.duckdns.org/git/guix/guix-wigust"))
  251. (if
  252. (boundp #'projectile-project-root)
  253. (list
  254. (concat
  255. (projectile-project-root)
  256. "dotfiles/guixsd/modules"))
  257. 'nil)))
  258. (magit-todos-depth)
  259. (magit-todos-exclude-globs "*.go" "*.info" "*.po")
  260. (magit-todos-update)
  261. (magit-todos-depth . 1)
  262. (eval progn
  263. (let
  264. ((top
  265. (locate-dominating-file default-directory ".dir-locals.el")))
  266. (add-to-list 'geiser-guile-load-path top)))
  267. (geiser-active-implementations guile)
  268. (eval c-set-offset 'arglist-cont-nonempty
  269. '(c-lineup-gcc-asm-reg c-lineup-arglist))
  270. (eval c-set-offset 'arglist-close 0)
  271. (eval c-set-offset 'arglist-intro '++)
  272. (eval c-set-offset 'case-label 0)
  273. (eval c-set-offset 'statement-case-open 0)
  274. (eval setq-local geiser-guile-load-path
  275. (list
  276. (concat
  277. (projectile-project-root)
  278. "dotfiles/guixsd/modules")
  279. (concat
  280. (getenv "HOME")
  281. "/src/cgit.duckdns.org/git/guix/guix-wigust/guix")))
  282. (projectile-project-compilation-cmd . "nix-shell --run 'nix build -L'")
  283. (eval add-hook 'before-save-hook 'time-stamp)
  284. (projectile-project-test-cmd . "/home/oleg/src/git.savannah.gnu.org/git/guix/pre-inst-env ./test.sh")
  285. (projectile-project-compilation-cmd . "/home/oleg/src/git.savannah.gnu.org/git/guix/pre-inst-env guix build --with-source=file://$PWD guile-bash")
  286. (projectile-project-install-cmd . "/home/oleg/src/git.savannah.gnu.org/git/guix/pre-inst-env guix package --with-source=file://$PWD -i guile-bash")
  287. (projectile-project-test-cmd . "./test.sh")
  288. (projectile-project-compilation-cmd . "guix build --with-source=file://$PWD guile-bash")
  289. (projectile-project-install-cmd . "guix package --with-source=file://$PWD -i guile-bash")
  290. (projectile-project-configure-cmd . "./configure")
  291. (projectile-project-install-cmd . "make install")
  292. (eval let
  293. ((root-dir-unexpanded
  294. (concat
  295. (locate-dominating-file default-directory ".dir-locals.el")
  296. "guix/")))
  297. (when root-dir-unexpanded
  298. (let*
  299. ((root-dir
  300. (expand-file-name root-dir-unexpanded))
  301. (root-dir*
  302. (directory-file-name root-dir)))
  303. (unless
  304. (boundp 'geiser-guile-load-path)
  305. (defvar geiser-guile-load-path 'nil))
  306. (make-local-variable 'geiser-guile-load-path)
  307. (require 'cl-lib)
  308. (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))))
  309. (eval setq-local guix-directory
  310. (concat
  311. (locate-dominating-file default-directory ".dir-locals.el")
  312. "guix/"))
  313. (eval setq-local geiser-guile-load-path
  314. (list
  315. (concat
  316. (projectile-project-root)
  317. "dotfiles/guixsd/modules")))
  318. (eval c-set-offset 'inlambda 0)
  319. (c-block-comment-prefix . " ")
  320. (eval let
  321. ((root-dir-unexpanded
  322. (locate-dominating-file default-directory ".dir-locals.el")))
  323. (when root-dir-unexpanded
  324. (let*
  325. ((root-dir
  326. (expand-file-name root-dir-unexpanded))
  327. (root-dir*
  328. (directory-file-name root-dir)))
  329. (unless
  330. (boundp 'geiser-guile-load-path)
  331. (defvar geiser-guile-load-path 'nil))
  332. (make-local-variable 'geiser-guile-load-path)
  333. (require 'cl-lib)
  334. (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))))
  335. (eval setq-local guix-directory
  336. (locate-dominating-file default-directory ".dir-locals.el"))
  337. (eval let*
  338. ((root-dir
  339. (expand-file-name
  340. (locate-dominating-file default-directory ".dir-locals.el")))
  341. (root-dir*
  342. (directory-file-name root-dir)))
  343. (unless
  344. (boundp 'geiser-guile-load-path)
  345. (defvar geiser-guile-load-path 'nil))
  346. (make-local-variable 'geiser-guile-load-path)
  347. (require 'cl-lib)
  348. (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))
  349. (eval let*
  350. ((root-dir
  351. (expand-file-name
  352. (locate-dominating-file default-directory ".dir-locals.el")))
  353. (root-dir*
  354. (directory-file-name root-dir)))
  355. (unless
  356. (boundp 'geiser-guile-load-path)
  357. (defvar geiser-guile-load-path 'nil))
  358. (make-local-variable 'geiser-guile-load-path)
  359. (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))
  360. (eval setq guix-directory
  361. (locate-dominating-file default-directory ".dir-locals.el"))
  362. (eval setq-local indent-tabs-mode t)
  363. (projectile-project-test-cmd . "make check")
  364. (git-auto-commit-mode . t)
  365. (eval progn
  366. (put 'with-directory 'scheme-indent-function 1)
  367. (put 'with-repository 'scheme-indent-function 2))
  368. (TeX-master . "guile.texi")
  369. (eval c-set-offset 'access-label '-)
  370. (eval c-set-offset 'substatement-open 0)
  371. (eval c-set-offset 'arglist-cont-nonempty '+)
  372. (eval c-set-offset 'arglist-cont 0)
  373. (eval c-set-offset 'arglist-intro '+)
  374. (eval c-set-offset 'inline-open 0)
  375. (eval c-set-offset 'defun-open 0)
  376. (eval c-set-offset 'innamespace 0)
  377. (indicate-empty-lines . t)
  378. (eval modify-syntax-entry 43 "'")
  379. (eval modify-syntax-entry 36 "'")
  380. (eval modify-syntax-entry 126 "'")
  381. (bug-reference-bug-regexp . "<https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/\\([0-9]+\\)>")))
  382. '(tramp-default-method "ssh")
  383. '(warning-suppress-types
  384. '(((defvaralias losing-value geiser-debug-show-debug-p))
  385. (emacs)
  386. (comp))))
  387. (put 'list-timers 'disabled nil)
  388. (setq auto-mode-alist (delete (assoc "\\.drv" auto-mode-alist) auto-mode-alist))
  389. ;; TODO: Package emacs-rainbow-fart
  390. ;; (load (expand-file-name "~/src/emacs-rainbow-fart/rainbow-fart.el") t)
  391. ;; (setq rainbow-fart-keyword-interval nil)
  392. ;; (setq rainbow-fart-voice-model "built-in-voice-english")
  393. ;;; .emacs ends here
  394. (custom-set-faces
  395. ;; custom-set-faces was added by Custom.
  396. ;; If you edit it by hand, you could mess it up, so be careful.
  397. ;; Your init file should contain only one such instance.
  398. ;; If there is more than one, they won't work right.
  399. '(default ((t (:family "Liberation Mono" :foundry "1ASC" :slant normal :weight normal :height 136 :width normal))))
  400. '(highlight-indent-guides-character-face ((t (:foreground "gray15"))))
  401. '(vterm-color-black ((t (:background "gray15" :foreground "gray15"))))
  402. '(vterm-color-blue ((t (:background "steel blue" :foreground "steel blue")))))