1 ;;; config.el -*- lexical-binding: t; -*-
3 ;; DOC: https://git.v0.io/hlissner/doom-emacs/src/commit/a680a4c96d2b57fcb75635bd1a918e1235e72890/docs/api.org
4 ;; DOC: https://github.com/daviwil/emacs-from-scratch
6 ;; Line numbers are pretty slow all around. The performance boost of
7 ;; disabling them outweighs the utility of always keeping them on.
8 (setq display-line-numbers-type nil)
10 ;; Focus new window after splitting
11 (setq evil-split-window-below t
12 evil-vsplit-window-right t
16 (setq undo-tree-auto-save-history t
17 undo-tree-history-directory-alist '(("." . "~/.cache/emacs/undo"))
21 (setq doom-font-increment 1
23 ;doom-font-name "DejaVu Sans Mono"
25 ;doom-font-name "Unifont"
26 doom-font (font-spec :family doom-font-name :size doom-font-size :antialias t)
27 doom-unicode-font (font-spec :family "Symbola" :antialias t)
28 doom-variable-pitch-font (font-spec :family doom-font-name :antialias t)
29 ivy-posframe-font (font-spec :family doom-font-name :antialias t)
31 (setq x-underline-at-descent-line t)
34 ;;(setq +doom-dashboard-banner-file (expand-file-name "banner.png" doom-private-dir))
35 (defun bury-messages-and-scratch ()
36 (mapcar #'bury-buffer '("*Messages*" "*scratch*")))
37 (add-hook 'emacs-startup-hook #'bury-messages-and-scratch)
40 (setq haskell-stylish-on-save nil)
41 (setq lsp-haskell-formatting-provider "fourmolu")
42 (setq +format-on-save-enabled-modes
43 '(not emacs-lisp-mode ; works well enough without it
44 sql-mode ; sqlformat is broken
45 tex-mode ; latexindent is broken
46 latex-mode ; latexindent is broken
47 bibtex-mode ; is broken
48 ess-r-mode ; styler takes forever
53 (setq doom-theme 'doom-vibrant)
54 (custom-theme-set-faces! '(doom-vibrant)
55 '(default :background "black" :foreground "white")
56 '(hl-line :background "black")
57 '(cursor :background "DarkOrange" :foreground "black")
59 '(font-lock-string-face :foreground "magenta")
60 '(highlight-numbers-number :foreground "DeepSkyBlue" :bold t)
61 '(font-lock-comment-face :foreground "cyan3")
62 '(font-lock-doc-face :foreground "cyan1")
63 ;'(haskell-constructor-face :foreground "#c4451d")
64 ;'(haskell-keyword-face :foreground "#af005f")
65 ;'(haskell-keyword-face :foreground "RoyalBlue")
66 ;'(haskell-keyword-face :foreground "#44385f")
67 ;'(haskell-keyword-face :foreground "#906238" :bold t)
68 ;'(haskell-keyword-face :foreground "green4" :bold t)
69 '(haskell-keyword-face :foreground "LightGreen" :bold nil)
70 ;'(haskell-pragma-face :foreground "#2aa198")
71 '(haskell-pragma-face :foreground "#8f4e8b")
72 ;'(haskell-type-face :foreground "#9e358f")
73 '(haskell-operator-face :foreground "yellow" :bold nil)
74 ;'(haskell-type-face :foreground "SaddleBrown")
75 ;'(haskell-constructor-face :foreground "darkgoldenrod4")
76 '(haskell-definition-face :foreground "white" :bold nil)
77 '(swiper-line-face :background "grey15")
78 '(swiper-match-face-1 :foreground "grey50" :background "black") ; what is between matches
79 '(swiper-match-face-2 :foreground "black" :background "yellow2")
80 '(swiper-match-face-3 :foreground "black" :background "yellow3")
81 '(swiper-match-face-4 :foreground "black" :background "yellow4")
82 '(swiper-background-match-face-2 :foreground "black" :background "yellow2")
83 '(swiper-background-match-face-3 :foreground "black" :background "yellow3")
84 '(swiper-background-match-face-4 :foreground "black" :background "yellow4")
85 '(evil-ex-lazy-highlight :foreground "black" :background "yellow2")
86 '(region :foreground "black" :background "yellow") ; selected area
87 '(doom-modeline-buffer-modified :foreground "orange")
88 '(git-gutter-fr:added :foreground "green4" :background "black")
89 '(git-gutter-fr:deleted :foreground "red4" :background "black")
90 '(git-gutter-fr:modified :foreground "orange4" :background "black")
91 '(flycheck-fringe-error :foreground "red")
92 '(flycheck-fringe-warning :foreground "orange")
93 '(flycheck-fringe-info :foreground "purple")
94 '(flycheck-info :underline '(:color "SkyBlue4" :style wave))
95 '(flycheck-warning :underline '(:color "orange" :style wave))
96 '(flycheck-error :underline '(:color "red" :style wave))
97 '(warning :foreground "orange")
98 '(error :foreground "red")
99 '(ivy-minibuffer-match-face-1 :foreground "grey50" :background "black") ; what is between matches
100 '(ivy-minibuffer-match-face-2 :foreground "black" :background "yellow2")
101 '(ivy-minibuffer-match-face-3 :foreground "black" :background "yellow3")
102 '(ivy-minibuffer-match-face-4 :foreground "black" :background "yellow4")
104 ;'(haskell-operator-face :foreground "yellow3")
105 ;'(haskell-type-face :foreground "#5a4e82")
106 ;'(haskell-constructor-face :foreground "#8a4f88")
107 ;'(haskell-constructor-face :foreground "#8a4c87")
108 '(haskell-constructor-face :foreground "white" :bold t)
109 ; Almost the same as haskell-constructor-face
110 ; because that pattern does not match on type-contexts correctly
111 '(haskell-type-face :foreground "white" :bold t)
112 '(lsp-face-highlight-read :background "gray10")
113 '(lsp-face-highlight-write :background "gray10")
114 '(mode-line :background "gray20")
115 '(mode-line-inactive :background "gray5")
116 '(solaire-default-face :background "gray10")
117 '(solaire-mode-line-face :background "gray20")
118 '(solaire-mode-line-inactive-face :background "gray5")
119 '(doom-modeline-project-dir :foreground "DeepSkyBlue" :bold t)
120 ;'(magit-diff-context-highlight :foreground "white" :background "black")
121 '(magit-diff-added-highlight :foreground "green")
122 '(magit-diff-removed-highlight :foreground "red")
123 ;;'(font-lock-comment-face ((t (:foreground "cyan" :italic t :slant oblique))))
124 ;;'(font-lock-comment-delimiter-face ((t (:foreground "cyan"))))
125 ;;'(fringe ((t (:foreground "red" :background "black"))))
126 ;;'(whitespace-indentation ((t (:foreground "gray50" :bold t))))
127 ;;'(whitespace-space ((t (:foreground "black" :bold t))))
128 ;;'(whitespace-tab ((t (:foreground "gray50" :bold t))))
129 ;;'(whitespace-trailing ((t (:foreground "red" :bold t))))
130 ;;'(font-lock-builtin-face ((t (:foreground "yellow" :weight bold))))
131 ;;'(font-lock-keyword-face ((t (:foreground "yellow" :weight bold))))
132 ;;'(font-lock-string-face ((t (:foreground "magenta"))))
133 ;;'(font-lock-variable-name-face ((t (:foreground "SpringGreen3" :weight bold))))
134 ;;'(nix-antiquote-face ((t (:foreground "blue"))))
135 ;;'(mode-line ((t (:background "midnight blue" :box (:line-width 1 :color "blue") :height 1.0))))
136 ;;'(mode-line-inactive ((t (:background "grey30" :foreground "white" :box (:line-width 1 :color "grey30") :weight light :height 1.0))))
137 ;;'(mode-line ((t (:family "Noto Sans" :height 0.9))))
138 ;;'(mode-line-inactive ((t (:family "Noto Sans" :height 0.9))))
139 ;;'(solaire-mode-line-inactive-face ((t (:background "gray10"))))
143 (use-package! polymode)
144 (define-hostmode poly-haskell-hostmode
146 ;; Support org tables in Haskell files
147 (defun pm--org-table-tail-matcher (ahead)
148 (when (re-search-forward "^[^|]" nil t ahead)
149 (cons (match-beginning 0) (match-end 0))))
150 (define-innermode poly-haskell-org-table-innermode
153 :tail-matcher #'pm--org-table-tail-matcher
156 (define-polymode poly-haskell-mode
157 :hostmode 'poly-haskell-hostmode
158 :innermodes '(poly-haskell-org-table-innermode))
160 ;; Language Server Protocol
161 (setq ;+lsp-prompt-to-install-server 'quiet
162 ;lsp-enable-file-watchers nil
163 ;lsp-enable-indentation nil
164 ;lsp-enable-on-type-formatting nil
165 ;lsp-enable-symbol-highlighting nil
166 lsp-enable-symbol-highlighting nil ; slow
167 lsp-ui-doc-enable nil ; slow
168 ;lsp-ui-sideline-enable nil ; not anymore useful than flycheck
169 ;lsp-ui-peek-enable t
170 ;lsp-ui-peek-always-show nil
171 ;lsp-ui-flycheck-enable t
172 ;lsp-ui-flycheck-live-reporting t
173 ;; Disable help mouse-overs for mode-line segments (i.e. :help-echo text).
174 ;; They're generally unhelpful and only add confusing visual clutter.
175 mode-line-default-help-echo nil
176 show-help-function nil
177 global-prettify-symbols-mode nil
178 prettify-symbols-mode -1
179 lsp-treemacs-errors-position-params `((side . right))
180 lsp-log-io nil ; Only for debugging
181 lsp-restart 'auto-restart
182 ; Only load lsp-clients to speed up loading
183 ; See https://github.com/emacs-lsp/lsp-mode/pull/1498
184 lsp-client-packages '(lsp-clients)
187 ;; The modeline is not useful to me in the popup window.
188 ;; It looks much nicer to hide it.
189 (remove-hook 'emacs-everywhere-init-hooks #'hide-mode-line-mode)
191 ;;(remove-hook 'window-setup-hook #'doom-init-theme-h)
192 ;;(add-hook 'after-init-hook #'doom-init-theme-h 'append)
193 ;;(delq! t custom-theme-load-path)
195 (setq auto-save-default t ; Nobody likes to loose work, I certainly don't
196 confirm-kill-emacs nil
197 make-backup-files nil
198 password-cache-expiry nil ; I can trust my computers ... can't I?
200 ;; scroll-preserve-screen-position 'always ; Don't have `point' jump around
201 truncate-string-ellipsis "…" ; Unicode ellispis are nicer than "...", and also save /precious/ space
202 kill-whole-line t ; Make Ctrl-K remove the whole line, instead of just emptying it
203 undo-limit 80000000 ; Raise undo-limit to 80MB
204 x-stretch-cursor nil ; Disorienting
208 ;(setq debug-on-quit t)
211 (setq haskell-process-log nil
212 haskell-interactive-popup-errors nil
214 (add-hook 'haskell-mode-hook
216 (set (make-local-variable 'company-backends)
217 (append '((company-capf company-dabbrev-code))
219 (define-hostmode poly-haskell-hostmode
223 (setq split-height-threshold nil
224 split-width-threshold 160
228 ; flycheck-error-list-buffer
229 (set-popup-rule! (rx bos "*Flycheck errors*" eos) :side 'right :size 0.45)
230 ; M-x lsp-ui-flycheck-list
231 (setq lsp-ui-flycheck-list-position 'right)
232 (add-hook 'flycheck-error-list-mode-hook
233 (lambda () (setq tabulated-list-sort-key (list "Level"))))
235 ;(add-hook 'flycheck-error-list-after-refresh-hook
237 ; (with-selected-window (flycheck-get-error-list-window t)
238 ; (fit-window-to-buffer (flycheck-get-error-list-window t) 30))))
241 (add-hook 'after-init-hook 'global-company-mode)
242 ;(setq company-idle-delay nil)
247 ; (:map ivy-minibuffer-map
248 ; ("RET" . 'ivy-alt-done)
249 ; ("TAB" . 'ivy-alt-done))
251 ; (setq ivy-extra-directories nil
255 ;(add-hook! 'org-mode-hook #'mixed-pitch-mode)
256 ;(add-hook! 'org-mode-hook #'solaire-mode)
257 ;(setq mixed-pitch-variable-pitch-cursor nil)
259 ;(add-hook! org-mode :append
261 ; #'variable-pitch-mode)
263 (setq doom-modeline-enable-word-count nil)
265 (map! "C-x b" #'counsel-buffer-or-recentf
266 "C-x C-b" #'counsel-switch-buffer)
267 (defun recentf-track-visited-file (_prev _curr)
268 (and buffer-file-name
269 (recentf-add-file buffer-file-name)))
271 (add-hook 'switch-buffer-functions #'recentf-track-visited-file))
274 ; DOC: https://rgoswami.me/posts/org-note-workflow/
275 ; ToStudy: https://github.com/abo-abo/orca
276 ; ToStudy: https://github.com/weirdNox/org-noter
277 ; ToStudy: https://github.com/bastibe/org-journal
278 ; ToStudy: https://orgmode.org/manual/Org-Crypt.html
279 ; DOC: http://www.wouterspekkink.org/academia/writing/tool/doom-emacs/2021/02/27/writing-academic-papers-with-org-mode.html
280 ; DOC: https://jonathanabennett.github.io/blog/2019/05/29/writing-academic-papers-with-org-mode/
281 ; ToStudy: https://github.com/org-roam/org-roam-ui
282 ; ToStudy: https://blog.tecosaur.com/tmio/2021-07-31-citations.html
283 ; ToStudy: https://github.com/jkitchin/org-ref-cite
284 (setq org-directory "~/documents/notes")
285 (setq org-noter-notes-search-path '("~/notes/path/"))
289 org-log-into-drawer t
290 org-special-ctrl-a/e t
292 ;org-hide-emphasis-markers t
294 (add-to-list 'org-capture-templates
295 '("e" "English" table-line ; key, name, type
296 (file "english/vocabulary.org") ; target
297 "|%^{English}|%^{Français}|%^{Registre|Courant|Soutenu|Familier}|"
299 (add-to-list 'org-capture-templates
300 '("x" "Expense" plain
302 "\n%(org-read-date) * send %^{Send to} %^{For why}\nExpense:Gifts %^{Amount}\n %^{Currency|EUR|USD|JPY}\n Assets:%^{Account||Personal|Home}"))
303 ;; Firefox and Chrome
304 ;(add-to-list 'org-capture-templates
305 ; `("P" "Protocol" entry ; key, name, type
306 ; (file+headline +org-capture-notes-file "Inbox") ; target
307 ; "* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
308 ; :prepend t ; properties
310 ;(add-to-list 'org-capture-templates
311 ; `("L" "Protocol Link" entry
312 ; (file+headline +org-capture-notes-file "Inbox")
313 ; "* %? [[%:link][%(transform-square-brackets-to-round-ones \"%:description\")]]\n"
319 (map! :after counsel :map org-mode-map
320 "C-c l l h" #'counsel-org-link)
322 (setq counsel-outline-display-style 'title))
325 ; ;; Do not create ID if a CUSTOM_ID exists
326 ; (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
330 ; ;; (setq org-agenda-prefix-format
331 ; ;; '((agenda . " %i %-12:c%?-12t% s")
332 ; ;; ;; Indent todo items by level to show nesting
333 ; ;; (todo . " %i %-12:c%l")
334 ; ;; (tags . " %i %-12:c")
335 ; ;; (search . " %i %-12:c")))
336 ; (setq org-agenda-include-diary t)
339 ;(use-package! org-roam
341 ; :hook ((after-init . org-roam-mode))
343 ; (setq org-roam-directory "~/documents/notes/org-roam")
345 ; ;; Let's set up some org-roam capture templates
346 ; (setq org-roam-capture-templates
347 ; '(("d" "default" plain (function org-roam--capture-get-point)
349 ; :file-name "%<%Y-%m-%d-%H%M%S>-${slug}"
350 ; :head "#+title: ${title}\n"
353 ; ;; And now we set necessary variables for org-roam-dailies
354 ; (setq org-roam-dailies-capture-templates
355 ; '(("d" "default" entry
356 ; #'org-roam-capture--get-point
358 ; :file-name "daily/%<%Y-%m-%d>"
359 ; :head "#+title: %<%Y-%m-%d>\n\n")))
362 ;(use-package! org-ref
365 ; (setq reftex-default-bibliography bibliography-files
366 ; org-ref-default-bibliography bibliography-files
367 ; org-ref-bibliography-notes "~/documents/notes/org-roam/bibnotes.org" ;; Is this even needed?
368 ; org-ref-notes-directory "~/documents/notes/org-roam"
369 ; org-ref-notes-function 'orb-edit-notes
370 ; ;org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex)
373 ;(use-package! bibtex-completion
376 ; (setq bibtex-completion-notes-path "~/documents/notes/org-roam/"
377 ; bibtex-completion-pdf-field "file"
378 ; bibtex-completion-bibliography bibliography-files
382 ;(defvar orb-title-format "${author-or-editor-abbrev} (${date}). ${title}."
383 ; "Format of the title to use for `orb-templates'.")
385 ;(use-package! org-roam-bibtex
387 ; :hook (org-roam-mode . org-roam-bibtex-mode)
388 ; :bind (:map org-mode-map
389 ; (("C-c n a" . orb-note-actions)))
391 ; (setq orb-preformat-keywords
392 ; '(("citekey" . "=key=") "title" "date" "author-or-editor-abbrev")
395 ; (function org-roam-capture--get-point)
397 ; :file-name "${citekey}"
398 ; :head ,(s-join "\n"
400 ; (concat "#+TITLE: " orb-title-format)
401 ; "#+ROAM_KEY: ${ref}"
408 ; ("n" "ref + noter" plain
409 ; (function org-roam-capture--get-point)
411 ; :file-name "${citekey}"
412 ; :head ,(s-join "\n"
414 ; (concat "#+TITLE: " orb-title-format)
415 ; "#+ROAM_KEY: ${ref}"
419 ; "* Annotations :noter:"
421 ; ":NOTER_DOCUMENT: %(orb-process-file-field \"${citekey}\")"
426 ;(map! :after pdf-tools
427 ; :map pdf-view-mode-map
430 ; (if (bound-and-true-p org-noter-doc-mode)
431 ; (org-noter-kill-session)
432 ; (kill-current-buffer)))
435 ;(use-package! org-noter
436 ; :after (:any org pdf-view)
438 ; (setq org-noter-notes-search-path '("~/documents/notes/org-roam")
439 ; org-noter-always-create-frame nil
443 ;(setq lsp-lens-mode t)
444 (setq doom-modeline-height 1)
445 (setq doom-modeline-lsp t)
446 ;(setq doom-modeline-minor-modes t)
447 ;(setq lsp-modeline-diagnostics-enable t)
450 (setq-default tab-width 2)
451 (setq indent-tabs-mode nil)
454 (global-superword-mode t)
455 ; https://emacs.stackexchange.com/questions/9583/how-to-treat-underscore-as-part-of-the-word
456 (modify-syntax-entry ?_ "w")
457 (defun swiper-all/search-word-at-point ()
459 (swiper-all (format "%s" (thing-at-point 'word))))
460 ; Highlight without jumping to the next match
461 ; See: https://emacs.stackexchange.com/questions/52411/evil-star-visualstar-without-moving-the-cursor
462 (defun search-word-at-point ()
464 (evil-search (progn (evil-ex-search-word-forward)
465 (evil-ex-search-previous)
467 (defun search-unbounded-word-at-point ()
469 (evil-search (progn (evil-ex-search-unbounded-word-forward)
470 (evil-ex-search-unbounded-word-previous)
472 (setq ivy-case-fold-search-default nil ; case-sensitive search by default
475 ;(general-define-key "C-s" '(counsel-grep-or-swiper :which-key "search"))
476 ;(general-define-key :keymaps '(swiper-map) "C-u" '(lambda () (interactive) (kill-line 0)))
477 ;(general-nvmap "/" '(counsel-grep-or-swiper :which-key "search in buffer"))
478 (evil-define-key 'normal global-map
480 (kbd "C-f") 'swiper-all
481 (kbd "C-/") 'swiper-all/search-word-at-point
482 (kbd "*") 'search-word-at-point
483 (kbd "g*") 'search-unbounded-word-at-point
489 (setq evil-want-fine-undo t
491 (customize-set-variable 'evil-want-Y-yank-to-eol nil)
492 (evil-define-key 'normal global-map (kbd "K") 'evil-join)
493 (evil-define-key 'insert global-map (kbd "C-u") '(lambda () (interactive) (kill-line 0)))
494 (evil-define-key 'normal global-map (kbd "SPC g d") 'git-gutter:popup-hunk)
496 (setq +vc-gutter-default-style nil
498 (customize-set-variable 'git-gutter:update-interval 2)
499 ;(customize-set-variable 'git-gutter:window-width 2)
500 (after! git-gutter-fringe
501 (require 'fringe-helper)
502 ; Narrower vertical bar, matching the one in the "+" of git-gutter-fr:added
503 (fringe-helper-define 'git-gutter-fr:modified nil
512 ; Narrower horizontql bar, matching the one in the "+" of git-gutter-fr:added
513 (fringe-helper-define 'git-gutter-fr:deleted nil
526 (defun set-selective-display/at-point (&optional level)
527 "Fold text indented same of more than the cursor.
528 If level is set, set the indent level to LEVEL.
529 If 'selective-display' is already set to LEVEL,
530 calling it again will unset 'selective-display' by setting it to 0."
532 (if (eq selective-display (1+ (current-column)))
533 (set-selective-display 0)
534 (set-selective-display (or level (1+ (current-column))))))
536 (evil-define-key 'normal global-map
537 (kbd "C-d") 'set-selective-display/at-point)
540 ;; DOC: https://github.com/noctuid/evil-guide
542 (setq evil-cross-lines t
543 evil-move-cursor-back nil
545 evil-want-C-i-jump nil
549 (evil-define-key 'motion 'global
550 (kbd "<C-i>") 'evil-prev-buffer ; Does not work without the angles ('<' and '>')
551 (kbd "C-k") 'evil-next-buffer
553 ;(define-key evil-normal-state-map [tab] 'evil-prev-buffer)
556 (evil-define-key 'motion 'global
557 (kbd "C-u") 'better-jumper-jump-backward
558 (kbd "C-o") 'better-jumper-jump-forward
561 ;; Moving with ijkl (instead of hjkl)
562 (evil-define-key '(motion normal visual) 'global
563 (kbd "i") 'evil-previous-visual-line
564 (kbd "j") 'evil-backward-char
565 (kbd "k") 'evil-next-visual-line
566 (kbd "h") 'evil-insert
569 ;; Switching windows with SPC-w + ijkl (instead of hjkl)
570 (define-key evil-window-map "i" 'evil-window-up)
571 (define-key evil-window-map "I" 'evil-window-move-very-top)
572 (define-key evil-window-map "j" 'evil-window-left)
573 (define-key evil-window-map "J" 'evil-window-move-far-left)
574 (define-key evil-window-map "k" 'evil-window-down)
575 (define-key evil-window-map "K" 'evil-window-move-very-bottom)
576 ;(define-key evil-emacs-state-map "\C-w" 'evil-window-map)
577 ;;(evil-define-key 'window global-map "l" 'evil-window-right)
578 ;;(evil-define-key 'window global-map "L" 'evil-window-move-far-right)
581 ;;(evil-define-key 'normal dired-mode-map "i" 'evil-previous-line)
584 (evil-define-key 'motion 'global
585 (kbd "C-j") 'previous-error
586 (kbd "C-l") 'next-error
588 ;(bind-key "C-j" #'previous-error)
589 ;(bind-key "C-l" #'next-error)
591 (after! auto-yasnippet
592 (evil-define-key '(motion normal) 'global
593 (kbd "C-<tab>") 'evil-switch-to-windows-last-buffer
596 (after! (evil magit evil-collection-magit)
597 (evil-define-key '(motion normal) magit-mode-map
598 (kbd "C-i") 'evil-prev-buffer
599 (kbd "i") 'evil-previous-visual-line
600 (kbd "k") 'evil-next-visual-line
601 (kbd "C-k") 'evil-next-buffer
602 (kbd "j") 'magit-section-backward
603 (kbd "l") 'magit-section-forward
606 (after! (evil magit git-rebase)
607 (evil-define-key '(motion normal) git-rebase-mode-map
608 (kbd "C-i") 'evil-prev-buffer
609 (kbd "i") 'evil-previous-visual-line
610 (kbd "k") 'evil-next-visual-line
611 (kbd "C-k") 'evil-next-buffer
612 (kbd "j") 'evil-backward-char
615 ;;(eval-after-load 'evil ; to run after evil-integration.el
617 ;; (define-key Buffer-menu-mode-map "\C-i" 'evil-prev-buffer)
618 ;; (define-key Buffer-menu-mode-map "\C-k" 'evil-next-buffer)
619 ;; (define-key messages-buffer-mode-map "\C-i" 'evil-prev-buffer)
620 ;; (define-key messages-buffer-mode-map "\C-k" 'evil-next-buffer)
621 ;; (define-key completion-list-mode-map "\C-i" 'evil-prev-buffer)
622 ;; (define-key completion-list-mode-map "\C-k" 'evil-next-buffer)
623 ;; ;(define-key custom-theme-mode-map "\C-i" 'evil-prev-buffer)
624 ;; ;(define-key custom-theme-mode-map "\C-k" 'evil-next-buffer)
628 ;;(with-eval-after-load 'evil-maps
629 ;; (define-key evil-motion-state-map (kbd "TAB") nil))
632 ; See also: Managing ArXiv RSS Feeds in Emacs https://cundy.me/post/elfeed/
635 elfeed-enable-web-interface t
638 ;(global-set-key (kbd "C-x w") 'elfeed)
640 (defun elfeed-mark-all-as-read ()
643 (elfeed-search-untag-all-unread))
645 ; Functions to support syncing .elfeed between machines
646 ; makes sure elfeed reads index from disk before launching
647 (defun elfeed-load-db-and-open ()
648 "Wrapper to load the elfeed db from disk before opening"
652 (elfeed-search-update--force))
654 ; Write to disk when quiting
655 (defun elfeed-save-db-and-bury ()
656 "Wrapper to save the elfeed db to disk before burying buffer"
661 (defun elfeed-toggle-star ()
664 (elfeed-search-tag-all '*)
666 (after! (evil elfeed evil-collection-elfeed)
667 (evil-define-key 'motion elfeed-search-mode-map "m" #'elfeed-toggle-star)
670 (defun elfeed-org-update-incremental ()
671 "Automatically update the feeds from feeds.org when updated"
672 (setq my-elfeed-org-last (or (and (boundp 'elfeed-feeds) elfeed-feeds) nil))
674 (setq my-elfeed-org-current elfeed-feeds)
675 (let ((elfeed-feeds (-difference my-elfeed-org-current my-elfeed-org-last)))
676 ;; You don't need the line below if you don't want to see a message about what feeds are being updated
677 (message "%s" elfeed-feeds)
678 (mapc #'elfeed-update-feed (elfeed--shuffle (elfeed-feed-list))))
679 (setq elfeed-feeds my-elfeed-org-current))