dotfiles/doom/.config/doom/config.el

122 lines
4.1 KiB
EmacsLisp

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
(setq user-full-name "earnest ma"
user-mail-address "me@earne.link")
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
(load! ".local" doom-user-dir t)
(load! "+ui") ; theme, font, and appearance tweaks
(load! "+projects") ; project-related
(load! "+smudge") ; spotify
(load! "+ess") ; ess, R
(load! "+mail") ; mu4e
;; Defaults
(setq-default delete-by-moving-to-trash t)
(setq undo-limit 80000000 ; 80Mb
evil-want-fine-undo t ; more history when in insert mode
evil-split-window-below t ; switch to window after creation
evil-vsplit-window-right t
evil-kill-on-visual-paste nil ; copy pasting
truncate-string-ellipsis "" ; Unicode ellispis are nicer than "...", and also save /precious/ space
password-cache-expiry nil ; don't expire
)
(global-subword-mode 1) ; Iterate through CamelCase words
;; speed-type
(use-package! speed-type)
;; company
(after! company
(setq company-idle-delay 0.1
company-minimum-prefix-length 2
;; doesn't show in childframe, but might be useful in terminal
company-show-quick-access 1))
;; pinentry for emacs ssh gpg
(use-package! pinentry
:init (setq epg-pinentry-mode `loopback)
(pinentry-start))
;; pandoc mode
;; use C-c / after (pandoc-mode)
(use-package! pandoc-mode)
;; Wakatime mode
(use-package! wakatime-mode
:config
(global-wakatime-mode))
;; Bind SPC s c to clear evil search
(map! :leader
:desc "Clear recent search result"
"s c" #'evil-ex-nohighlight)
(use-package! redacted)
;; :config
;; (add-hook 'redacted-mode-hook (lambda () (read-only-mode (if redacted-mode 1 -1)))))
(use-package! subed
:config
;; This assures evil does not conflict with subed keybinds.
;; https://github.com/haditim/.doom.d
(map! :map (subed-mode subed-srt-mode-map)
:n "M-p" #'subed-backward-subtitle-text
:n "M-n" #'subed-forward-subtitle-text
:leader
:desc "MPV play/pause" "<RET>" #'subed-mpv-toggle-pause))
(defun open-in-pympress ()
"Open the current buffer (assumed to be a tex file that has the same name as
the compiled PDF version) in pympress."
(interactive)
(start-process "pympress" nil "pympress" (replace-regexp-in-string "\.tex" ".pdf" buffer-file-name)))
;; (async-shell-command (concat "pympress " (replace-regexp-in-string "\.tex" ".pdf" buffer-file-name))))
(use-package! ispell
:config
(setq ispell-personal-dictionary (expand-file-name "~/.aspell.en.pws"))
(setq ispell-dictionary "en_CA"))
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.