config.el 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ;;; ~/.config/doom/config.el -*- lexical-binding: t; -*-
  2. ;; (defvar xdg-data (getenv "XDG_DATA_HOME"))
  3. ;; (defvar xdg-bin (getenv "XDG_BIN_HOME"))
  4. ;; (defvar xdg-cache (getenv "XDG_CACHE_HOME"))
  5. ;; (defvar xdg-config (getenv "XDG_CONFIG_HOME"))
  6. (add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
  7. (setq user-full-name "Colin Powell"
  8. user-mail-address "colin@timberwyckfarm.com")
  9. ;;
  10. ;; Keybinds
  11. ;;:m "M-j" '+hlissner:multi-next-line
  12. ;;:m "M-k" '+hlissner:multi-previous-line
  13. (map! ;; Easier window movement
  14. :n "C-h" 'evil-window-left
  15. :n "C-j" 'evil-window-down
  16. :n "C-k" 'evil-window-up
  17. :n "C-l" 'evil-window-right
  18. (:map evil-treemacs-state-map
  19. "C-h" 'evil-window-left
  20. "C-l" 'evil-window-right)
  21. (:when IS-LINUX
  22. "s-x" #'execute-extended-command
  23. "s-;" #'eval-expression
  24. ;; use super for window/frame navigation/manipulation
  25. "s-w" #'delete-window
  26. "s-W" #'delete-frame
  27. "s-n" #'+default/new-buffer
  28. "s-j" #'org-move-subtree-down
  29. "s-k" #'org-move-subtree-up
  30. "s-N" #'make-frame
  31. "s-q" (if (daemonp) #'delete-frame #'evil-quit-all)
  32. ;; Restore OS undo, save, copy, & paste keys (without cua-mode, because
  33. ;; it imposes some other functionality and overhead we don't need)
  34. "s-z" #'undo
  35. "s-c" (if (featurep 'evil) #'evil-yank #'copy-region-as-kill)
  36. "s-v" #'yank
  37. "s-s" #'save-buffer
  38. ;; Buffer-local font scaling
  39. "s-+" (λ! (text-scale-set 0))
  40. "s-=" #'text-scale-increase
  41. "s--" #'text-scale-decrease
  42. ;; Conventional text-editing keys
  43. "s-a" #'mark-whole-buffer
  44. :gi [s-return] #'+default/newline-below
  45. :gi [s-S-return] #'+default/newline-above
  46. :gi [s-backspace] #'doom/backward-kill-to-bol-and-indent)
  47. :leader
  48. (:prefix "f"
  49. :desc "Find file in dotfiles" "t" #'+hlissner/find-in-dotfiles
  50. :desc "Browse dotfiles" "T" #'+hlissner/browse-dotfiles)
  51. (:prefix "t"
  52. :desc "Switch themes" "t" #'load-theme)
  53. (:prefix "o"
  54. :desc "Elfeed feed reader" "f" #'elfeed
  55. :desc "Hckrnews" "h" #'hackernews
  56. :desc "Lobste.rs" "l" #'ivy-lobsters)
  57. (:prefix "b"
  58. :desc "Black format buffer" "f" #'blacken-buffer
  59. :desc "isort buffer" "I" #'py-isort-buffer
  60. :desc "Links in buffer" "l" #'ace-link-org)
  61. (:prefix "s"
  62. :desc "Search project TODOs" "t" #'+ivy/tasks
  63. :desc "Search the web" "w" #'web-search
  64. :desc "Goto URL in eww" "u" #'eww-browse-url
  65. :desc "Search in eww" "3" #'eww-search-words
  66. :desc "Search all the things" "g" #'deadgrep))
  67. ;; app/search
  68. (after! web-search
  69. (push '("Searx" "http://search.unbl.ink/?q=%s")
  70. web-search-providers)
  71. (setq web-search-default-provider "Searx"))
  72. (def-package! org-alert
  73. :commands (org-alert-enable))
  74. (after! org-alert-mode
  75. (setq alert-default-style 'libnotify))
  76. ;;
  77. ;; Modules
  78. (setq +workspaces-switch-project-function #'ignore
  79. +format-on-save-enabled-modes '(python-mode)
  80. +pretty-code-enabled-modes '(emacs-lisp-mode org-mode))
  81. ;; app/mpdel
  82. ;;
  83. (setq libmpdel-hostname "play.unbl.ink")
  84. ;; app/rss
  85. (add-hook! 'elfeed-show-mode-hook (text-scale-set 1.5))
  86. (setq rmh-elfeed-org-files (list "~/org/elfeed.org")
  87. elfeed-search-filter "@1-week-ago +unread ")
  88. (add-hook 'prog-mode-hook #'goto-address-mode) ;; Linkify links!
  89. ;; tools/deft
  90. (setq deft-extensions '("org"))
  91. (setq deft-directory "~/org")
  92. ;; tools/magit
  93. (setq magit-repository-directories '(("~/work" . 2))
  94. magit-save-repository-buffers nil)
  95. ;;; It is the opposite of fill-paragraph
  96. (defun unfill-paragraph ()
  97. "Takes a multi-line paragraph and makes it into a single line of text."
  98. (interactive)
  99. (let ((fill-column (point-max)))
  100. (fill-paragraph nil)))
  101. ;; Handy key definition
  102. (define-key global-map "\M-z" 'unfill-paragraph)
  103. ; A few nice to haves
  104. (nyan-mode) ; a rainbow cat, why not
  105. (beacon-mode) ; show me where my cursor is bouncing around to
  106. (add-to-list 'auto-mode-alist '("\\.plantuml\\'" . planetuml-mode))
  107. (load! "+ui.el")
  108. (load! "+org") ;; Org mode stuff like todos and rebindings
  109. (load! "+org-cal")
  110. (load! "+nov") ;; nov.el epub mode settings
  111. (load! "+mail") ;; Mail stuff
  112. (load! "+eshell")
  113. (load! "+mpd")
  114. (load! "+ranger")
  115. (load! "+mastodon")
  116. (load! "+wttrin") ;; Weather config
  117. (load! "+elfeed") ;; This runs a background web process ...
  118. ;; findout timezone location strings at http://worldtime.io
  119. (setq display-time-world-list '(("America/Los_Angeles" "San Francisco")
  120. ("America/Tegucigalpa" "Tegucigalpa")
  121. ("America/New_York" "New York")
  122. ("Europe/London" "London")
  123. ("Europe/Warsaw" "Warsaw")
  124. ("Europe/Kiev" "Lviv")))
  125. (load! "beancount")
  126. (require 'beancount)
  127. (add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode))