doomemacs configuration
Table of Contents
- 1. looks
- 2. evil
- 3. org-mode
- 4. org-roam
- 4.1. capture templates
- 4.2. References
- 4.3. tag each node draft on creation
- 4.4. consult-org-roam
- 4.5. completion everywhere
- 4.6. citar-org-roam-mode
- 4.7. promoting node to it’s own file
- 4.8. slipbox
- 4.9. org-roam-ui
- 4.10. Multiple directories
- 4.11. publish
- 4.12. bulk node insert
- 4.13. time
- 4.14. activity report
- 4.15. latex tikz
- 5. org-media-note
- 6. capture everywhere in macOS
- 7. org-drill
- 8. rime
- 9. clipboard
- 10. statistics
- 11. chatgpt
- 12. ace-window
- 13. pdf-tools
- 14. browser
- 15. mobile org
- 16. spray
- 17. freeplane
- 18. obsidian
- 19. eww
- 20. dirvish
- 21. codeium
- Backlinks
This file holds my configuration on doomemacs
- system configuration
- t2-KUbuntu 23.04 with kernel 6.4.8-t2-lunar.
1. looks
1.1. font
(setq doom-font "Hurmit Nerd Font") (setq doom-big-font "Hurmit Nerd Font") (setq doom-emoji-font "Hurmit Nerd Font") (setq doom-unicode-font "Cascadia Code") ;; (setq doom-unicode-font nil) (setq doom-symbol-font "Cascadia Code") ;; (setq doom-symbol-font nil) (setq doom-theme 'doom-zenburn)
1.2. Frame
;; when using i3 and picom (not necessary, but it's my setup) ;;(doom/set-frame-opacity 75) (after! org-roam (add-to-list 'safe-local-variable-values '(frame-title-format . ("%b - org-roam - Doom Emacs")) ))
1.3. ligature
(set-ligatures! 'MAJOR-MODE ;; Functional :lambda "lambda keyword" :def "function keyword" :composition "composition" :map "map/dictionary keyword" ;; Types :null "null type" ;; :true "true keyword" ;; :false "false keyword" :int "int keyword" :float "float keyword" :str "string keyword" :bool "boolean keyword" :list "list keyword" ;; Flow :not "not operator" :in "in operator" :not-in "not in operator" :and "and keyword" :or "or keyword" :for "for keyword" :some "some keyword" :return "return" :yield "yeild" ;; Other :union "Union keyword" :intersect "Intersect keyword" :diff "diff keyword" :tuple "Tuple Keyword " :pipe "Pipe Keyword" :dot "Dot operator") (plist-put! +ligatures-extra-symbols ;; org :name "»" :src_block "»" :src_block_end "«" :quote "“" :quote_end "”" ;; Functional :lambda "λ" :def "" :composition "" ;; :map "↦" ;; Types :null "" :true "" :false "" :int "" :float "" :str "" :bool "" :list "" ;; Flow ;; :not "¬" :in "∈" :not-in "∉" :and "∧" :or "∨" :for "∀" :some "∃" :return "⟼" :yield "⟻" ;; Other :union "⋃" :intersect "∩" :diff "∖" :tuple "⨂" :pipe "" :dot "•")
2. evil
(after! evil-snipe (setq evil-snipe-scope 'visible) )
3. org-mode
3.1. File-locations
(after! org (setq org-directory ;;"~/Notes/" "~/Dropbox/Notes/" org-roam-directory (concat org-directory "RoamNotes/")) (setq! bibtex-completion-bibliography (list (concat org-directory "master.bib")) citar-bibliography bibtex-completion-bibliography org-ref-default-bibliography bibtex-completion-bibliography ) )
3.2. file-template
(after! org (set-file-template! 'org-mode :trigger "__t" ))
3.3. Basic faces
(after! org (setq org-todo-keywords '((sequence "TODO(t)" "PROJ(p)" ; A project, which usually contains other tasks ;; "LOOP(r)" ; A recurring task ;; "STRT(s)" ; A task that is in progress "DOING(i)" "WAIT(w)" ; Something external is holding up this task "HOLD(h)" ; This task is paused/on hold because of me "NEXT(n)" ; next action in GTD "|" "DONE(d)" ; Task successfully completed "KILL(k)")) org-todo-keyword-faces '( ("WAIT" . +org-todo-onhold) ("HOLD" . +org-todo-onhold) ("PROJ" . +org-todo-project)) ) ;; (setq org-clock-in-switch-to-state "DOING") ;; (setq org-clock-out-switch-to-state "HOLD") (setq org-log-done 'time) )
3.4. Agenda List
3.4.1. simple agenda list
Just 1 file: Task.org
(after! org (setq org-agenda-files `(,(concat org-directory "OrgNotes/Tasks.org"))) )
3.5. refile
part of my GTD workflow where I process inbox to different places
(after! org (add-to-list 'org-refile-targets `(,(concat org-directory "OrgNotes/Tasks.org") :level . 1)) (add-to-list 'org-refile-targets `(,(concat org-directory "OrgNotes/someday.org") :level . 1)) (add-to-list 'org-refile-targets `(,(concat org-directory "RoamNotes/inbox.org") :level . 0)) (add-to-list 'org-refile-targets `(,(concat org-directory "reference_files/bookmarks.org") :level . 1)))
3.6. capture template
(defun transform-square-brackets-to-round-ones(string-to-transform) "Transforms [ into ( and ] into ), other chars left unchanged. from https://github.com/sprig/org-capture-extension " (concat (mapcar #'(lambda (c) (if (equal c ?[) ?\( (if (equal c ?]) ?\) c))) string-to-transform)) ) (after! org (setq org-capture-templates `( ("c" "capture" entry (file ,(concat org-directory "OrgNotes/capture.org" )) "* %?\n %U\n %a\n %i" :empty-lines 1) ("C" "clock note" item (clock) "[note] %? ::" ) ("t" "Task" entry (file+headline ,(concat org-directory "OrgNotes/Tasks.org" )"Inbox") "* %?\n %U\n %a\n %i" :empty-lines 1) ("j" "journal") ("jm" "morning page" entry (file+olp+datetree ,(concat org-directory "OrgNotes/journals.org")) "* %? :morning_page:" :clock-in :clock-resume) ("jj" "diary/journal" entry (file+olp+datetree ,(concat org-directory "OrgNotes/journals.org")) "* %? :journal:" :clock-in :clock-resume) ("jp" "daily plan" entry (file+olp+datetree ,(concat org-directory"OrgNotes/journals.org")) "* daily plan - %? :daily_plan:" :clock-in :clock-resume) ;;org-protocol ;;https://github.com/sprig/org-capture-extension ("p" "Protocol" entry (file+headline ,(concat org-directory "OrgNotes/capture.org") "Browser") "* %:description \nSource: %u, %:link \n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n" :immediate-finish t ) ("L" "Protocol Link" entry (file+headline ,(concat org-directory "OrgNotes/capture.org") "Browser") "* [[%:link][%(transform-square-brackets-to-round-ones \"%:description\")]] \nCaptured On: %U" :immediate-finish t ) ;; note \"\" escape is required fro stirng literals in template function calls. ) )) ;; Kill the frame if one was created for the capture ;;https://github.com/sprig/org-capture-extension ;; use this for the L if :immediate-finish does not work and frame remains ;; ("L" "Protocol Link" entry (file+headline ,(concat org-directory "notes.org") "Inbox") ;; "* %? [[%:link][%:description]] %(progn (setq kk/delete-frame-after-capture 2) \"\")\nCaptured On: %U" ;; :empty-lines 1) (defvar kk/delete-frame-after-capture 0 "Whether to delete the last frame after the current capture") (defun kk/delete-frame-if-neccessary (&rest r) (cond ((= kk/delete-frame-after-capture 0) nil) ((> kk/delete-frame-after-capture 1) (setq kk/delete-frame-after-capture (- kk/delete-frame-after-capture 1))) (t (setq kk/delete-frame-after-capture 0) (delete-frame)))) ;; (advice-add 'org-capture-finalize :after 'kk/delete-frame-if-neccessary) ;; (advice-add 'org-capture-kill :after 'kk/delete-frame-if-neccessary) ;; (advice-add 'org-capture-refile :after 'kk/delete-frame-if-neccessary)
3.7. latex
(after! org (use-package! ox-extra :config (ox-extras-activate '(latex-header-blocks ignore-headlines))))
(after! org ;; Import ox-latex to get org-latex-classes and other funcitonality ;; for exporting to LaTeX from org (use-package! ox-latex :init ;; code here will run immediately :config ;; code here will run after the package is loaded (setq org-latex-pdf-process '("pdflatex -interaction nonstopmode -output-directory %o %f" "bibtex %b" "pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f")) (setq org-latex-with-hyperref nil) ;; stop org adding hypersetup{author..} to latex export ;; (setq org-latex-prefer-user-labels t) ;; deleted unwanted file extensions after latexMK (setq org-latex-logfiles-extensions (quote ("lof" "lot" "tex~" "aux" "idx" "log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" "brf" "fls" "entoc" "ps" "spl" "bbl" "xmpi" "run.xml" "bcf" "acn" "acr" "alg" "glg" "gls" "ist"))) (unless (boundp 'org-latex-classes) (setq org-latex-classes nil))) (when (string-equal system-name "linfeng-MacBookPro") (plist-put org-format-latex-options :scale (* 2 (plist-get org-format-latex-options :scale))) ) )
3.8. plantuml
(setq org-plantuml-jar-path "~/jar/plantuml-1.2023.12.jar")
3.9. visibility
(setq org-cycle-include-plain-lists 'integrate)
3.10. citation TODO
here is a little script to create TODO items with a list of cites, with citar.
I did not assign a keybinding, as citar-select-refs
allow multiple selection, so this method is likely to be called only once each time it is used.
(defun hermanhel-insert-citation-TODO () (interactive) (let ((citekeys (citar-select-refs)) ) (cl-loop for citekey in citekeys do ;;(let ((title (citar-get-value "title" citekey))) (org-insert-todo-heading nil) ;; could use org-insert-todo-heading-respect-content (insert (citar-get-value "title" citekey) "\n") (citar-insert-citation (list citekey)) ))) (defun hermanhel-insert-citation-list () (interactive) (let ((citekeys (citar-select-refs)) ) (cl-loop for citekey in citekeys do ;;(let ((title (citar-get-value "title" citekey))) ;; (org-insert-todo-heading nil) ;; could use org-insert-todo-heading-respect-content (insert "+ " (citar-get-value "title" citekey) " ") (citar-insert-citation (list citekey)) (insert "\n") )))
3.11. use flameshot
(after! org (setq org-download-screenshot-method "flameshot gui --raw > %s") )
3.12. todo behaviours
(after! org (setq org-agenda-span 'day) (setq org-agenda-todo-ignore-scheduled 'future) (setq org-agenda-todo-ignore-time-comparison-use-seconds t) (setq org-agenda-custom-commands `(("n" "Agenda / INTR / PROG / NEXT" ((agenda) (todo "INTR" nil ,(concat org-directory "OrgNotes/Tasks.org")) (todo "HOLD" nil) (todo "NEXT" nil)) nil))) )
3.13. clock in minibuffer
clock info is in org-mode-line-string
;; (defun hermanhelf-subtract-text-from-propertized-string (str) "str is a propertized string, have font and colour etc. this function return the raw string without font and colour etc. of str" (car (read (substring (format "%S" str) 1))) ) (defun hermanhelf-clock-info () (interactive) (if (org-clocking-p) ;;if clocking, give current org clock string (message (hermanhelf-subtract-text-from-propertized-string org-mode-line-string)) ;;if not clocking, give most recent org clock string, which appears have not been cleared when clock is stopped. This may break when someday they remember to clear the clock string when clock is concluded. At that time an additional clock-out hook is required to achieve the same effect. ;; I may want to add start/end time to the message. ;; only time that org-mode-line-string is empty is when emacs's just started and you have not clocked-in yet (message "Not clocked in any task, last task: %s" (ignore-errors (hermanhelf-subtract-text-from-propertized-string org-mode-line-string)))) ) (map! :map doom-leader-map "z" #'hermanhelf-clock-info )
3.14. graphics
(setq org-ditaa-jar-path "~/.local/bin/ditaa0_9.jar")
3.15. eldoc error
when indenting, this error pops more then often lately (Wed Feb 21 18:38:05 2024)
org-src-get-lang-mode: Symbol’s function definition is void: org-eldoc-get-src-lang
;; Prevents getting an annoying error (autoload 'org-eldoc-get-src-lang "org-eldoc")
4. org-roam
If org-roam-node-find doesn’t show node, do org-roam-db-sync
4.1. capture templates
(after! org (setq org-roam-capture-templates '(("i" "inbox" plain "* ${title}\n" :if-new (file "inbox.org") :immediate-finish nil :unnarrowed nil) ("m" "main" plain "%?" :if-new (file+head "main/${slug}.org" "#+title: ${title}\n") :immediate-finish t :unnarrowed t) ("r" "reference" plain "%?" :if-new (file+head "reference/${slug}.org" "#+title: ${title}\n") :immediate-finish t :unnarrowed t) ("a" "article" plain "%?" :if-new (file+head "article/${slug}.org" "#+title: ${title}\n#+filetags: :article:\n") :immediate-finish t :unnarrowed t) ("d" "doc" plain "%?" :if-new (file+head "doc/${slug}.org" "#+title: ${title}\n#+filetags: :doc:\n") :immediate-finish t :unnarrowed t) ("p" "project" plain "%?" :if-new (file+head "project/${slug}.org" "#+title: ${title}\n#+filetags: :machine:project:\n") :immediate-finish t :unnarrowed t) ;;temporary for my need to review a course ;; ("t" "todo" plain "%?" ;; :target ;; (file+olp "~/Notes/RoamNotes/project/comp201.org" "notes" "Nodes" "** ${title} :todo:\n: PROPERTIES:\n :ID: %(org-id-uuid)\n :END:\n%t\n") ;; :immediate-finish t ;; :unnarrowed t ;; ) ;; ("0" "202" plain "*** ${title} :todo:\n:PROPERTIES:\n :ID: %(org-id-uuid)\n :END:\n%?\n" ;; :if-new ;; (file+olp "~/Notes/RoamNotes/project/comp202.org" ("notes" "Nodes inbox" )) ;; ;; :immediate-finish t ;; :unnarrowed t ;; ) )))
4.2. References
normally I just use (citar-open-notes)
now to create org-roam-note for the reference
(defun delete-curly (string) "delete every curly in the string; used to format title string in bibtex" (setq string (string-replace "{" "" string)) (setq string (string-replace "}" "" string)) ) (delete-curly "{jheo}" ) (defun jethro/org-roam-node-from-cite (key) (interactive (list (org-ref-read-key ;;:multiple nil ))) ;; (message "%S" keys-entries) ;; (message "%S" (car keys-entries)) (let ((title (format "%s - %s" (delete-curly (org-ref-bibtex-get-entry-value key "author")) (delete-curly (org-ref-bibtex-get-entry-value key "title"))) )) (org-roam-capture- :templates '(("r" "reference" plain "%?" :if-new (file+head "reference/${citekey}.org" ":PROPERTIES:\n:ROAM_REFS: cite:&${citekey}\n:END:\n#+title: ${title}\n" ) :immediate-finish t :unnarrowed t)) :info (list :citekey key) :node (org-roam-node-create :title title) :props '(:finalize find-file)))) ;; (spacemacs/set-leader-keys ;; "aorr" #'jethro/org-roam-node-from-cite)
4.3. tag each node draft on creation
(defun jethro/tag-new-node-as-draft () (org-roam-tag-add '("draft"))) (add-hook 'org-roam-capture-new-node-hook #'jethro/tag-new-node-as-draft)
4.4. consult-org-roam
mainly it could handily be used to perform in-line search on org-roam notes, complementing it’s function of title search
(use-package consult-org-roam :ensure t :after org-roam :init (require 'consult-org-roam) ;; Activate the minor mode (consult-org-roam-mode 1) :custom ;; Use `ripgrep' for searching with `consult-org-roam-search' (consult-org-roam-grep-func #'consult-ripgrep) ;; Configure a custom narrow key for `consult-buffer' (consult-org-roam-buffer-narrow-key ?r) ;; Display org-roam buffers right after non-org-roam buffers ;; in consult-buffer (and not down at the bottom) (consult-org-roam-buffer-after-buffers t) :config ;; Eventually suppress previewing for certain functions (consult-customize consult-org-roam-forward-links :preview-key (kbd "M-.")) :bind ;; Define some convenient keybindings as an addition ("C-c n e" . consult-org-roam-file-find) ("C-c n b" . consult-org-roam-backlinks) ("C-c n l" . consult-org-roam-forward-links) ("C-c n r" . consult-org-roam-search))
4.5. completion everywhere
(setq org-roam-completion-everywhere nil)
4.6. citar-org-roam-mode
(citar-org-roam-mode) (setq citar-org-roam-note-title-template "${author editor} ::: ${title}") (setq citar-org-roam-subdir "reference")
4.7. promoting node to it’s own file
this function copy the current subtree node and translate it to a file node
(defun hermanhel/org-roam-from-subtree () "promote the current node from subtree in a file to it's own file." (interactive) (let* ((file-title (org-roam-node-slug (org-roam-node-at-point))) (file-path (read-directory-name "target directory")) (file-name (concat file-path file-title ".org")) (file-title (org-roam-node-title (org-roam-node-at-point))) (node-start-point (org-roam-node-point (org-roam-node-at-point))) (drawer-start-point (save-excursion (goto-char node-start-point) (next-line) (org-element-property :begin (org-element-at-point)) )) (drawer-end-point (save-excursion (goto-char node-start-point) (next-line) (org-element-property :end (org-element-at-point)) )) (tags (save-excursion (goto-char node-start-point) (org-get-tags) )) (content-start-point drawer-end-point) (content-end-point (save-excursion (goto-char node-start-point) (next-line) (outline-end-of-subtree) (point) )) (file-contents (buffer-substring content-start-point content-end-point)) (file-drawers (buffer-substring drawer-start-point drawer-end-point)) ) ;; (kill-region node-start-point content-end-point) (with-temp-file file-name (insert file-drawers "#+title: " file-title "\n#+filetags: :" ) (dolist (tag tags) (insert tag ":") ) (insert "\n" file-contents) ) (message file-name) ))
4.8. slipbox
(after! org (push ;; other capture templates `("s" "Slipbox" entry (file ,(concat org-directory"RoamNotes/inbox.org")) "* %?\n") org-capture-templates)) (defun jethro/org-capture-slipbox () (interactive) (org-capture nil "s"))
4.9. org-roam-ui
(use-package! websocket :after org-roam) (use-package! org-roam-ui :after org-roam ;; or :after org ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have ;; a hookable mode anymore, you're advised to pick something yourself ;; if you don't care about startup time, use ;; :hook (after-init . org-roam-ui-mode) :config (setq org-roam-ui-sync-theme t org-roam-ui-follow t org-roam-ui-update-on-save t org-roam-ui-open-on-start t))
4.10. Multiple directories
(setq org-roam-dirs `(("main" (org-roam-directory . ,(concat org-directory"RoamNotes/")) (org-roam-db-location . "~/emacs-distros/doomemacs/.local/cache/org-roam.db") ) ("comp329" (org-roam-directory . "~/playground/projects/uol/comp329/cw" ) (org-roam-db-location . "~/playground/projects/uol/comp329/cw/org-roam.db"))) ) ;; wrap org-roam-node-find and org-roam-node-insert (defun hermanhelf-org-roam-multidir (func arg ) (interactive "p") (cond ;; no prefix ((eq arg 1) (funcall func)) ;; C-u ((eq arg 4) (let* ((profile (completing-read "org-roam note base" (mapcar 'car org-roam-dirs))) (profile (car (-filter (lambda (item) (equal (car item) profile)) org-roam-dirs))) (org-roam-directory (cdr (second profile))) (org-roam-db-location (cdr (third profile))) ) (funcall func) ;; org-roam-db-location ) ) ) ) (defun hermanhelf-org-roam-multidir-node-find (arg) (interactive "p") (hermanhelf-org-roam-multidir 'org-roam-node-find arg) ) (defun hermanhelf-org-roam-multidir-node-insert (arg) (interactive "p") (hermanhelf-org-roam-multidir 'org-roam-node-insert arg) ) (after! org (map! :map doom-leader-notes-map "r f" #'hermanhelf-org-roam-multidir-node-find ))
4.11. publish
It’s a full file with comments and provide
and I don’t feel like moving it just yet.
Most of it is in Gehninfel.
(load "~/playground/projects/braindump/braindump-utilities/publish.el")
4.12. bulk node insert
especially when I’m making navigation nodes, doing compilation etc.
(after! (:and org citar) (defun hermanhel-strings-to-hash (strings) "Convert a list of STRINGS to a hash table with the strings as keys." (let ((hash (make-hash-table :test 'equal))) (dolist (str strings) (puthash str t hash)) hash)) (defun hermanhel-org-roam-insert-multiple-nodes-as-list () (interactive) (let ( (candidates (hermanhel-strings-to-hash (org-roam--get-titles))) (selected-nodes (citar--select-multiple "References: " candidates)) ) (dolist (title selected-nodes) (insert "+ " "[[roam:" title "]]" "\n") ) ) ))
4.13. time
(org-roam-timestamps-mode)
4.14. activity report
(require 'org-roam-activity-report)
4.15. latex tikz
(setq org-latex-create-formula-image-program 'imagemagick) (setq org-latex-packages-alist (quote (("" "color" t) ("" "minted" t) ("" "parskip" t) ("" "tikz" t))))
5. org-media-note
(use-package! org-media-note :hook (org-mode . org-media-note-mode) :bind ( ("C-c d" . org-media-note-hydra/body)) ;; Main entrance :config (setq org-media-note-screenshot-image-dir (concat org-directory"imgs/")) ;; Folder to save screenshot )
6. capture everywhere in macOS
from this blog note that the usage of noflet in `timu-func-make-capture-frame’ is to achive the effect that org-capture take up the whole frame rather than a split of the window
(add-to-list 'load-path "~/emacs-distros/site-lisp/emacs-noflet") (after! org (require 'noflet) (defun timu-func-make-capture-frame () "Create a new frame and run `org-capture'." (interactive) (let ((+popup-mode nil)) (make-frame '((name . "capture") (top . 300) (left . 700) (width . 80) (height . 25))) (select-frame-by-name "capture") (delete-other-windows) (noflet ((switch-to-buffer-other-window (buf &optional norecord) (switch-to-buffer buf))) (org-capture)) ) ) (defadvice org-capture-finalize (after delete-capture-frame activate) "Advise capture-finalize to close the frame." (if (equal "capture" (frame-parameter nil 'name)) (delete-frame))) (defadvice org-capture-destroy (after delete-capture-frame activate) "Advise capture-destroy to close the frame." (if (equal "capture" (frame-parameter nil 'name)) (delete-frame))))
7. org-drill
(after! org (add-to-list 'load-path "~/emacs-distros/site-lisp/org-drill") (require 'org-drill) (setq org-drill-learn-fraction 0.4) (defun wrapped-org-drill () (interactive) (if (window-system) (org-drill) (noflet ((org--latex-preview-region (BEG END) (message "latex preview disabled in character-only terminal"))) (org-drill) ) ) ))
The structure of an org-drill card doc:
- A Headline with :drill: tag at card root
- the description of root
- the subheadline
- in property drawer of root, set DRILLCARDTYPE twosided
- in perperty drawer of root, set DRILLCARDTYPE multisided
- superheading with tag :explain:
7.0.1. running drill sessions
run org-drill
to do it as scheduled
run org-dril-cram
to drill on all cards (as they are all due)
8. rime
;; 默认值 (after! rime (setq rime-translate-keybindings '("C-`" "C-f" "C-b" "C-n" "C-p" "C-g" "<left>" "<right>" "<up>" "<down>" "<prior>" "<next>" "<delete>")))
9. clipboard
https://list.orgmode.org/87d1qkro2n.fsf@ericabrahamsen.net/t/ x-selection-timeout is default to 5000. A 10 do the job for most. I chnage it because org-capture is taking way too long waiting for “selection owner” recently somehow Mon Oct 2 17:05:13 2023
(setq x-selection-timeout 10)
10. statistics
10.1. keyfreq
(add-to-list 'load-path "~/emacs-distros/site-lisp/keyfreq") (require 'keyfreq) (keyfreq-mode 1) (keyfreq-autosave-mode 1) (setq keyfreq-excluded-commands '(self-insert-command org-self-insert-command forward-char backward-char previous-line next-line))
11. chatgpt
(use-package! gptel :config (setq! gptel-api-key "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") (setq! gptel-default-mode #'org-mode) ) (*(/ 5 .03) 750) (use-package! gptel :config (setq! gptel-api-key "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") (setq! gptel-default-mode #'org-mode)) ;; (use-package! chatgpt ;; :defer t ;; :bind ("C-c q" . chatgpt-query)) ;; (setenv "OPENAI_API_KEY" "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") ;; (setq chatgpt-cli-file-path "/home/linfeng/.pyvenv/emacs/bin/lwe")
12. ace-window
(map! :map evil-window-map "w" #'ace-window)
13. pdf-tools
I’m using pdf tools and it is annoying to have to press C-c C-a h to highlight stuff. As I’m not typying in it anyway, I’m mapping h to hightlight
(map! :map pdf-view-mode-map :v "h" #'pdf-annot-add-highlight-markup-annotation)
14. browser
(setq browse-url-browser-function 'browse-url-firefox)
15. mobile org
(setq org-mobile-directory "~/org/webdav/") (setq org-mobile-force-id-on-agenda-items nil) (setq org-mobile-inbox-for-pull "~/Notes/OrgNotes/capture.org") (setq org-mobile-files '(org-agenda-files "~/Notes/OrgNotes/lifeScriptCheatSheet.org" ))
16. spray
(add-to-list 'load-path "~/emacs-distros/site-lisp/spray") (require 'spray) (setq spray-wpm 600) (global-set-key (kbd "<f6>") 'spray-mode)
17. freeplane
- https://www.reddit.com/r/orgmode/comments/1aorsa2/turning_freeplane_mindmaps_into_orgmode_outlines/
- https://www.reddit.com/r/orgmode/comments/o8x9qm/org_vs_mind_map/
- https://www.reddit.com/r/orgmode/comments/jibi9b/open_freeplane_node_from_emacs/
(add-to-list 'org-file-apps '("\\.mm\\'" . "freeplane %s")) (defun hermanhel-new-freeplane-file () (interactive) (let* ((mindmap-dir (concat org-directory "MindMaps/")) (template-file "sky-template.mm") (filename (read-file-name "prompt:" mindmap-dir))) (when (not (file-exists-p filename)) (async-shell-command (concat "cp " mindmap-dir template-file " " filename " && freeplane " filename )) ) ))
18. obsidian
to use obsidian in emacs.
19. eww
(defun mpv-play-eww () "Start an mpv process playing the video stream at URL." (interactive) (let ((url (shr-url-at-point current-prefix-arg))) (unless (mpv--url-p url) (user-error "Invalid argument: `%s' (must be a valid URL)" url)) (if (not mpv--process) ;; mpv isnt running play file (mpv-start url) ;; mpv running append file to playlist (mpv--playlist-append url)))) (after! evil-collection (evil-collection-define-key 'normal 'eww-mode-map ";" 'mpv-play-eww)) ;; (setq eww-download-directory) (setq eww-search-prefix "http://www.frogfind.com/?q=")
20. dirvish
(dirvish-override-dired-mode)
21. codeium
Just a reminder, completion is bind to C-SPC in doom. Wow Codeium is amazing, it is super fast and super beautiful
(use-package codeium :init (add-to-list 'completion-at-point-functions #'codeium-completion-at-point) (add-hook 'prog-mode-hook (lambda () (add-to-list 'completion-at-point-functions #'codeium-completion-at-point))) )
Backlinks
old index
(Configurations and Scripts)
These are stuffs that contain snippet I’ll tangle to somewhere to be used by certain program.