├── .DS_Store ├── snippets ├── org-mode │ ├── Pi │ ├── mu │ ├── nu │ ├── pi │ ├── Delta │ ├── beta │ ├── Gamma │ ├── alpha │ ├── cdot │ ├── delta │ ├── dot │ ├── gamma │ ├── hat │ ├── mathbb │ ├── partial │ ├── tilde │ ├── inline math │ ├── mathbbN │ ├── mathbbR │ ├── subscript │ ├── superscript │ ├── boldface │ ├── fraction │ ├── jsx │ ├── bolddot │ ├── operator │ ├── transclusion │ ├── equation │ └── tcolorblock ├── emacs-lisp-mode │ └── defcustom └── typescript-tsx-mode │ └── component ├── .auctex-auto └── config.el ├── custom.el ├── env ├── packages.el ├── init.el ├── oldconfig.el ├── config.el └── config.org /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tefkah/doom-emacs-config/HEAD/.DS_Store -------------------------------------------------------------------------------- /snippets/org-mode/Pi: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Pi 3 | # key: P 4 | # -- 5 | \Pi $0 -------------------------------------------------------------------------------- /snippets/org-mode/mu: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name:mu 3 | # key:mu 4 | # -- 5 | \mu$0 -------------------------------------------------------------------------------- /snippets/org-mode/nu: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name:nu 3 | # key:nu 4 | # -- 5 | \nu$0 -------------------------------------------------------------------------------- /snippets/org-mode/pi: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: pi 3 | # key: p 4 | # -- 5 | \pi $0 -------------------------------------------------------------------------------- /snippets/org-mode/Delta: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name:Delta 3 | # key:D 4 | # -- 5 | \Delta$0 -------------------------------------------------------------------------------- /snippets/org-mode/beta: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: beta 3 | # key: b 4 | # -- 5 | \beta $0 -------------------------------------------------------------------------------- /snippets/org-mode/Gamma: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Gamma 3 | # key: G 4 | # -- 5 | \Gamma $0 -------------------------------------------------------------------------------- /snippets/org-mode/alpha: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: alpha 3 | # key: a 4 | # -- 5 | \alpha -------------------------------------------------------------------------------- /snippets/org-mode/cdot: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: cdot 3 | # key: cd 4 | # -- 5 | \cdot $0 -------------------------------------------------------------------------------- /snippets/org-mode/delta: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: delta 3 | # key: d 4 | # -- 5 | \delta $0 -------------------------------------------------------------------------------- /snippets/org-mode/dot: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: dot 3 | # key: dt 4 | # -- 5 | \dot{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/gamma: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: gamma 3 | # key: g 4 | # -- 5 | \gamma $0 -------------------------------------------------------------------------------- /snippets/org-mode/hat: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: hat 3 | # key: ht 4 | # -- 5 | \hat{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/mathbb: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: mathbb 3 | # key: bb 4 | # -- 5 | \mathbb{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/partial: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: partial 3 | # key: pa 4 | # -- 5 | \partial $0 -------------------------------------------------------------------------------- /snippets/org-mode/tilde: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: tilde 3 | # key: tl 4 | # -- 5 | \tilde{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/inline math: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: inline math 3 | # key: m 4 | # -- 5 | \\($0\\) -------------------------------------------------------------------------------- /snippets/org-mode/mathbbN: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: mathbbN 3 | # key: bbn 4 | # -- 5 | \mathbb{N} $0 -------------------------------------------------------------------------------- /snippets/org-mode/mathbbR: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: mathbbR 3 | # key: bbr 4 | # -- 5 | \mathbb{R} $0 -------------------------------------------------------------------------------- /snippets/org-mode/subscript: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: subscript 3 | # key: sb 4 | # -- 5 | _{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/superscript: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: superscript 3 | # key: sp 4 | # -- 5 | ^{$1} $0 -------------------------------------------------------------------------------- /snippets/org-mode/boldface: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: boldface 3 | # key: bf 4 | # -- 5 | \textbf{$1} $0 6 | -------------------------------------------------------------------------------- /snippets/org-mode/fraction: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: fraction 3 | # key: fr 4 | # -- 5 | \frac{$1}{$2} $0 -------------------------------------------------------------------------------- /snippets/org-mode/jsx: -------------------------------------------------------------------------------- 1 | # key: jsx 2 | # name: jsx 3 | # -- 4 | #+begin_export jsx 5 | $1 6 | #+end_export 7 | $0 8 | -------------------------------------------------------------------------------- /snippets/org-mode/bolddot: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: bolddot 3 | # key: bd 4 | # -- 5 | \cdot{\boldface{$1}} $0 -------------------------------------------------------------------------------- /snippets/org-mode/operator: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: operator 3 | # key: op 4 | # -- 5 | \hat{\mathbf{$1}} $0 -------------------------------------------------------------------------------- /snippets/org-mode/transclusion: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: transclusion 3 | # key: tr 4 | # -- 5 | #+transclude: t 6 | $0 -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defcustom: -------------------------------------------------------------------------------- 1 | # key: defc 2 | # name: defcustom 3 | # -- 4 | (defcustom $1 $2 5 | "$3" 6 | :type $4 7 | :group $5) 8 | $0 -------------------------------------------------------------------------------- /snippets/org-mode/equation: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: equation 3 | # key: eq 4 | # -- 5 | \begin{equation} 6 | $1 7 | \label{eq:$2} 8 | \end{equation} 9 | 10 | $0 11 | -------------------------------------------------------------------------------- /snippets/org-mode/tcolorblock: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: tcolorblock 3 | # key: ctc 4 | # -- 5 | #+attr_latex: :options [title=$2] 6 | #+begin_tcolorbox 7 | $1 8 | #+end_tcolorbox 9 | $0 -------------------------------------------------------------------------------- /snippets/typescript-tsx-mode/component: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: component 3 | # key: com 4 | # -- 5 | 6 | import React from 'react' 7 | 8 | export interface $2Props { 9 | $1 10 | } 11 | 12 | export const $2 = (props: $2props) => { 13 | const {$1} = props 14 | return () 15 | } -------------------------------------------------------------------------------- /.auctex-auto/config.el: -------------------------------------------------------------------------------- 1 | (TeX-add-style-hook 2 | "config" 3 | (lambda () 4 | (TeX-add-to-alist 'LaTeX-provided-class-options 5 | '(("article" "11pt"))) 6 | (TeX-add-to-alist 'LaTeX-provided-package-options 7 | '(("inputenc" "utf8") ("fontenc" "T1") ("ulem" "normalem"))) 8 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "href") 9 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref") 10 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage") 11 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl") 12 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl") 13 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url") 14 | (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path") 15 | (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path") 16 | (TeX-run-style-hooks 17 | "latex2e" 18 | "article" 19 | "art11" 20 | "inputenc" 21 | "fontenc" 22 | "graphicx" 23 | "grffile" 24 | "longtable" 25 | "wrapfig" 26 | "rotating" 27 | "ulem" 28 | "amsmath" 29 | "textcomp" 30 | "amssymb" 31 | "capt-of" 32 | "hyperref" 33 | "tufte-book" 34 | "tufte-book10" 35 | "memoir" 36 | "memoir10")) 37 | :latex) 38 | 39 | -------------------------------------------------------------------------------- /custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables 2 | ;; custom-set-variables was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | '(custom-safe-themes 7 | '("47db50ff66e35d3a440485357fb6acb767c100e135ccdf459060407f8baea7b2" default)) 8 | '(org-agenda-files '("~/Notes/GTD/calendar.org")) 9 | '(safe-local-variable-values 10 | '((eval face-remap-add-relative 'org-level-4 11 | '(default)) 12 | (eval face-remap-add-relative 'org-level-3 13 | '(face-salient default)) 14 | (eval face-remap-add-relative 'org-level-2 15 | '(face-strong face-salient)) 16 | (org-html-link-org-files-as-html)))) 17 | 18 | (custom-set-faces 19 | ;; custom-set-faces was added by Custom. 20 | ;; If you edit it by hand, you could mess it up, so be careful. 21 | ;; Your init file should contain only one such instance. 22 | ;; If there is more than one, they won't work right. 23 | '(mode-line ((t (:family "Fira Code")))) 24 | '(org-block ((t (:background nil)))) 25 | '(org-document-title ((t (:family "Noto Serif" :height 250 :weight medium)))) 26 | '(org-level-1 ((t (:height 1.6 :weight bold :slant normal)))) 27 | '(org-level-2 ((t (:height 1.4 :weight regular :slant normal)))) 28 | '(org-level-3 ((t (:height 1.3 :weight regular :slant italic))))) 29 | -------------------------------------------------------------------------------- /env: -------------------------------------------------------------------------------- 1 | ;; -*- mode: lisp-interaction; coding: utf-8-unix; -*- 2 | ;; --------------------------------------------------------------------------- 3 | ;; This file was auto-generated by `doom env'. It contains a list of environment 4 | ;; variables scraped from your default shell (excluding variables blacklisted 5 | ;; in doom-env-ignored-vars). 6 | ;; 7 | ;; This file is safe to edit by hand, but needs to be loaded manually with: 8 | ;; 9 | ;; (doom-load-envvars-file "path/to/this/file") 10 | ;; 11 | ;; Use 'doom env -o path/to/this/file' to regenerate it. 12 | ("LANG=en_NL.UTF-8" 13 | "_tide_location_color=" 14 | "COLORTERM=truecolor" 15 | "LC_TERMINAL=iTerm2" 16 | "LC_CTYPE=UTF-8" 17 | "LOGNAME=thomas" 18 | "ITERM_SESSION_ID=w0t1p0:AC83B080-482F-4D98-AFCB-83928BCF81A8" 19 | "LC_TERMINAL_VERSION=3.4.10" 20 | "COLORFGBG=15;0" 21 | "XPC_SERVICE_NAME=0" 22 | "XPC_FLAGS=0x0" 23 | "ITERM_PROFILE=Default" 24 | "_=/opt/homebrew/bin/emacs" 25 | "PATH=/Users/thomas/.local/share/nvm/v16.9.1/bin:/Users/thomas/.emacs.d/bin:/opt/homebrew/bin://usr/bin/vendor_perl:/home/thomas/.local/share/gem/ruby/3.0.0/bin:/home/thomas/.local/bin:/home/thomas/JOTEFiles/Backend/Scripts:/home/thomas/JOTEFiles/Backend/Typesetting_Files/:/home/thomas/.emacs.d/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin" 26 | "_tide_color_anchors=" 27 | "nvm_current_version=v16.9.1" 28 | "VIRTUAL_ENV_DISABLE_PROMPT=1" 29 | "COMMAND_MODE=unix2003" 30 | "_tide_reset_to_color_dirs=(B" 31 | "_tide_color_truncated_dirs=" 32 | "TERM_SESSION_ID=w0t1p0:AC83B080-482F-4D98-AFCB-83928BCF81A8" 33 | "TERM_PROGRAM_VERSION=3.4.10" 34 | "_tide_prompt_and_frame_color=(B(B" 35 | "TMPDIR=/var/folders/xj/0p7nhdzs1k750v68lccm5cg80000gn/T/" 36 | "SHELL=/opt/homebrew/bin/fish" 37 | "TERM_PROGRAM=iTerm.app" 38 | ) -------------------------------------------------------------------------------- /packages.el: -------------------------------------------------------------------------------- 1 | ;; -*- no-byte-compile: t; -*- 2 | ;;; $DOOMDIR/packages.el 3 | 4 | ;; To install a package with Doom you must declare them here and run 'doom sync' 5 | ;; on the command line, then restart Emacs for the changes to take effect -- or 6 | ;; use 'M-x doom/reload'. 7 | 8 | 9 | ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: 10 | ;(package! some-package) 11 | 12 | ;; To install a package directly from a remote git repo, you must specify a 13 | ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: 14 | ;; https://github.com/raxod502/straight.el#the-recipe-format 15 | ;(package! another-package 16 | ; :recipe (:host github :repo "username/repo")) 17 | 18 | ;; If the package you are trying to install does not contain a PACKAGENAME.el 19 | ;; file, or is located in a subdirectory of the repo, you'll need to specify 20 | ;; `:files' in the `:recipe': 21 | ;(package! this-package 22 | ; :recipe (:host github :repo "username/repo" 23 | ; :files ("some-file.el" "src/lisp/*.el"))) 24 | 25 | ;; If you'd like to disable a package included with Doom, you can do so here 26 | ;; with the `:disable' property: 27 | ;(package! builtin-package :disable t) 28 | 29 | ;; You can override the recipe of a built in package without having to specify 30 | ;; all the properties for `:recipe'. These will inherit the rest of its recipe 31 | ;; from Doom or MELPA/ELPA/Emacsmirror: 32 | ;(package! builtin-package :recipe (:nonrecursive t)) 33 | ;(package! builtin-package-2 :recipe (:repo "myfork/package")) 34 | 35 | ;; Specify a `:branch' to install a package from a particular branch or tag. 36 | ;; This is required for some packages whose default branch isn't 'master' (which 37 | ;; our package manager can't deal with; see raxod502/straight.el#279) 38 | ;(package! builtin-package :recipe (:branch "develop")) 39 | 40 | ;; Use `:pin' to specify a particular commit to install. 41 | ;(package! builtin-package :pin "1a2b3c4d5e") 42 | 43 | 44 | ;; Doom's packages are pinned to a specific commit and updated from release to 45 | ;; release. The `unpin!' macro allows you to unpin single packages... 46 | ;(unpin! pinned-package) 47 | ;; ...or multiple packages 48 | ;(unpin! pinned-package another-pinned-package) 49 | ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) 50 | ;(unpin!;; When using org-roam via the `+roam` flag 51 | (unpin! org-roam) 52 | (unpin! consult) 53 | 54 | ;; When using bibtex-completion via the `biblio` module 55 | (unpin! bibtex-completion helm-bibtex ivy-bibtex) 56 | 57 | (package! evil-workman-mode 58 | :recipe ( 59 | :host github 60 | :repo "chrisbarrett/evil-workman-mode" 61 | )) 62 | 63 | ;(package! org-roam-server 64 | ; :recipe (:local-repo "~/Projects/org-roam-server" 65 | ; :files ("*") 66 | ; :build (:not compile))) 67 | 68 | ;(package! org-roam-server) 69 | (package! ivy-bibtex) 70 | (package! org-ref :recipe (:host github :repo "/jkitchin/org-ref" :branch "org-ref-2")) 71 | (package! citeproc) 72 | (package! org-roam-bibtex) 73 | (package! org-super-agenda) 74 | (package! org-gtd) 75 | (package! org-noter) 76 | 77 | (package! rainbow-mode) 78 | (package! org-transclusion :recipe (:host github :repo "/nobiot/org-transclusion" 79 | ;:build (:not compile) 80 | )) 81 | (package! org-marginalia :recipe (:host github :repo "nobiot/org-marginalia")) 82 | 83 | ;(package! nroam) 84 | (package! org-fragtog) 85 | (package! org-appear :recipe (:host github :repo "awth13/org-appear")) 86 | (package! org-noter-pdftools) 87 | (package! org-pdftools) 88 | (package! olivetti) 89 | (package! binder) 90 | 91 | (package! focus) 92 | (package! wc-goal-mode) 93 | (package! centered-window) 94 | (package! mixed-pitch) 95 | (package! wwg :recipe (:host github :repo "ag91/writer-word-goals")) 96 | (package! powerthesaurus) 97 | 98 | (package! tree-sitter) 99 | (package! tree-sitter-langs) 100 | 101 | (package! org-ol-tree 102 | :recipe ( 103 | :host github 104 | :repo "Townk/org-ol-tree" 105 | )) 106 | (package! org-sidebar) 107 | 108 | ;(package! engrave-faces 109 | ; :recipe (:host github :repo "tecosaur/engrave-faces")) 110 | (package! mlscroll) 111 | 112 | (package! doom-modeline ) 113 | 114 | 115 | (package! erefactor) 116 | 117 | (package! svg-tag-mode :recipe (:host github :repo "rougier/svg-tag-mode")) 118 | (package! mu4e-dashboard :recipe (:host github :repo "rougier/mu4e-dashboard")) 119 | (package! mu4e-thread-folding :recipe (:host github :repo "rougier/mu4e-thread-folding")) 120 | ;(package! org-agenda :recipe (:host github :repo "rougier/mu4e-thread-folding")) 121 | (package! org-caldav :recipe (:host github :repo "whirm/org-caldav" :branch "sync-todos")) 122 | 123 | (package! dashboard) 124 | ;(package! pulse-cursor :recipe (:host nil :repo https://gist.github.com/jasonjckn/0e92c55f1ab0be0947bb613a4706bc33 )) 125 | (package! smooth-scrolling) 126 | (package! good-scroll) 127 | (package! scroll-on-jump) 128 | (package! iscroll :recipe (:host github :repo "casouri/iscroll")) 129 | ;(package! yascroll) 130 | 131 | (package! ctable) 132 | (package! deferred) 133 | (package! s) 134 | 135 | (package! info-colors) 136 | 137 | (package! org-notifications) 138 | (package! org-wild-notifier) 139 | 140 | ;(package! avy) 141 | (package! visual-regexp) 142 | (package! visual-regexp-steroids) 143 | 144 | (package! font-lock-studio) 145 | (package! face-explorer) 146 | 147 | (package! suggest) 148 | (package! unpackaged :recipe (:host github :repo "alphapapa/unpackaged.el")) 149 | 150 | (package! all-the-icons-ivy-rich) 151 | 152 | (package! page-break-mode :recipe (:local-repo "~/Projects/emacs/page-break-mode")) 153 | 154 | (package! websocket) 155 | (package! org-roam-ui ) 156 | (package! devdocs) 157 | (package! prettier) 158 | 159 | (package! eva 160 | :recipe (:host github :repo "meedstrom/eva" 161 | :files (:defaults "assets" "renv" "*.R" "*.gnuplot"))) 162 | 163 | ;;(package! ivy-posframe) 164 | (package! vertico-posframe :recipe (:host github :repo "tumashu/vertico-posframe")) 165 | 166 | 167 | (package! nano-theme :recipe (:host github :repo "rougier/nano-theme")) 168 | 169 | (package! org-roam-timestamps ) 170 | 171 | (package! srefactor) 172 | 173 | (package! md-roam :recipe (:host github :repo "nobiot/md-roam")) 174 | (package! lister) 175 | (package! delve :recipe (:host github :repo "publicimageltd/delve")) 176 | (package! company-fuzzy) 177 | 178 | (package! citar) 179 | -------------------------------------------------------------------------------- /init.el: -------------------------------------------------------------------------------- 1 | ;;; init.el -*- lexical-binding: t; -*- 2 | 3 | ;; This file controls what Doom modules are enabled and what order they load 4 | ;; in. Remember to run 'doom sync' after modifying it! 5 | 6 | ;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's 7 | ;; documentation. There you'll find a "Module Index" link where you'll find 8 | ;; a comprehensive list of Doom's modules and what flags they support. 9 | 10 | ;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or 11 | ;; 'C-c c k' for non-vim users) to view its documentation. This works on 12 | ;; flags as well (those symbols that start with a plus). 13 | ;; 14 | ;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its 15 | ;; directory (for easy access to its source code). 16 | (doom! :input 17 | ;;chinese 18 | ;;japanese 19 | ;;layout ; auie,ctsrnm is the superior home row 20 | 21 | :completion 22 | company ; the ultimate code completion backend 23 | ;;helm ; the *other* search engine for love and life 24 | ;;ido ; the other *other* search engine... 25 | ;; (ivy +icons +fuzzy +posframe) ; a search engine for love and life 26 | (vertico +icons) 27 | 28 | :ui 29 | deft ; notational velocity for Emacs 30 | doom ; what makes DOOM look the way it does 31 | doom-dashboard ; a nifty splash screen for Emacs 32 | doom-quit ; DOOM quit-message prompts when you quit Emacs 33 | (emoji +unicode) ; 🙂 34 | ;;fill-column ; a `fill-column' indicator 35 | hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW 36 | hydra 37 | indent-guides ; highlighted indent columns 38 | (ligatures +extra ) ; ligatures and symbols to make your code pretty again 39 | minimap ; show a map of the code on the side 40 | modeline ; snazzy, Atom-inspired modeline, plus API 41 | nav-flash ; blink cursor line after big motions 42 | ;;neotree ; a project drawer, like NERDTree for vim 43 | ophints ; highlight the region an operation acts on 44 | (popup +defaults) ; tame sudden yet inevitable temporary windows 45 | tabs ; a tab bar for Emacs 46 | (treemacs +lsp) ; a project drawer, like neotree but cooler 47 | unicode ; extended unicode support for various languages 48 | vc-gutter ; vcs diff in the fringe 49 | ;vi-tilde-fringe ; fringe tildes to mark beyond EOB 50 | window-select ; visually switch windows 51 | workspaces ; tab emulation, persistence & separate workspaces 52 | zen ; distraction-free coding or writing 53 | 54 | :editor 55 | (evil +everywhere); come to the dark side, we have cookies 56 | file-templates ; auto-snippets for empty files 57 | fold ; (nigh) universal code folding 58 | (format +onsave) ; automated prettiness 59 | ;;god ; run Emacs commands without modifier keys 60 | ;;lispy ; vim for lisp, for people who don't like vim 61 | ;;multiple-cursors ; editing in many places at once 62 | ;;objed ; text object editing for the innocent 63 | ;;parinfer ; turn lisp into python, sort of 64 | ;;rotate-text ; cycle region at point between text candidates 65 | snippets ; my elves. They type so I don't have to 66 | ;;word-wrap ; soft wrapping with language-aware indent 67 | 68 | :emacs 69 | (dired +icons +ranger) ; making dired pretty [functional] 70 | electric ; smarter, keyword-based electric-indent 71 | ;;ibuffer ; interactive buffer management 72 | undo ; persistent, smarter undo for your inevitable mistakes 73 | vc ; version-control and Emacs, sitting in a tree 74 | 75 | :term 76 | ;;eshell ; the elisp shell that works everywhere 77 | ;;shell ; simple shell REPL for Emacs 78 | ;;term ; basic terminal emulator for Emacs 79 | vterm ; the best terminal emulation in Emacs 80 | 81 | :checkers 82 | syntax ; tasing you for every semicolon you forget 83 | (spell +flyspell) ; tasing you for misspelling mispelling 84 | grammar ; tasing grammar mistake every you make 85 | 86 | 87 | :tools 88 | ;;ansible 89 | debugger ; FIXME stepping through code, to help you add bugs 90 | ;;direnv 91 | ;;docker 92 | ;;editorconfig ; let someone else argue about tabs vs spaces 93 | ;;ein ; tame Jupyter notebooks with emacs 94 | (eval +overlay) ; run code, run (also, repls) 95 | ;;gist ; interacting with github gists 96 | lookup ; navigate your code and its documentation 97 | lsp 98 | magit ; a git porcelain for Emacs 99 | ;;make ; run make tasks from Emacs 100 | ;;pass ; password manager for nerds 101 | pdf ; pdf enhancements 102 | ;;prodigy ; FIXME managing external services & code builders 103 | rgb ; creating color strings 104 | ;;taskrunner ; taskrunner for all your projects 105 | ;;terraform ; infrastructure as code 106 | ;;tmux ; an API for interacting with tmux 107 | ;;upload ; map local to remote projects via ssh/ftp 108 | 109 | :os 110 | (:if IS-MAC macos) ; improve compatibility with macOS 111 | tty ; improve the terminal Emacs experience 112 | 113 | :lang 114 | ;;agda ; types of types of types of types... 115 | ;;cc ; C/C++/Obj-C madness 116 | ;;clojure ; java with a lisp 117 | ;;common-lisp ; if you've seen one lisp, you've seen them all 118 | ;;coq ; proofs-as-programs 119 | ;;crystal ; ruby at the speed of c 120 | ;;csharp ; unity, .NET, and mono shenanigans 121 | ;;data ; config/data formats 122 | ;;(dart +flutter) ; paint ui and not much else 123 | ;;elixir ; erlang done right 124 | ;;elm ; care for a cup of TEA? 125 | emacs-lisp ; drown in parentheses 126 | ;;erlang ; an elegant language for a more civilized age 127 | ;;ess ; emacs speaks statistics 128 | ;;faust ; dsp, but you get to keep your soul 129 | ;;fsharp ; ML stands for Microsoft's Language 130 | ;;fstar ; (dependent) types and (monadic) effects and Z3 131 | ;;gdscript ; the language you waited for 132 | ;;(go +lsp) ; the hipster dialect 133 | ;;(haskell +dante) ; a language that's lazier than I am 134 | ;;hy ; readability of scheme w/ speed of python 135 | ;;idris ; a language you can depend on 136 | (json +lsp) ; At least it ain't XML 137 | ;;(java +meghanada) ; the poster child for carpal tunnel syndrome 138 | (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) 139 | ;;julia ; a better, faster MATLAB 140 | ;;kotlin ; a better, slicker Java(Script) 141 | (latex +lsp +fold +latexmk) ; writing papers in Emacs has never been so fun 142 | ;;lean 143 | ;;factor 144 | ;;ledger ; an accounting system in Emacs 145 | ;;lua ; one-based indices? one-based indices 146 | (markdown +grip) ; writing docs for people to ignore 147 | ;;nim ; python + lisp at the speed of c 148 | ;;nix ; I hereby declare "nix geht mehr!" 149 | ;;ocaml ; an objective camel 150 | (org +pretty +pomodoro +dragndrop +present +hugo +pandoc +journal +gnuplot +roam2) ; organize your plain life in plain text 151 | ;;php ; perl's insecure younger brother 152 | ;;plantuml ; diagrams for confusing people more 153 | ;;purescript ; javascript, but functional 154 | (python +lsp) ; beautiful is better than ugly 155 | ;;qt ; the 'cutest' gui framework ever 156 | ;;racket ; a DSL for DSLs 157 | ;;raku ; the artist formerly known as perl6 158 | ;;rest ; Emacs as a REST client 159 | ;;rst ; ReST in peace 160 | ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} 161 | ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() 162 | ;;scala ; java, but good 163 | ;;scheme ; a fully conniving family of lisps 164 | sh ; she sells {ba,z,fi}sh shells on the C xor 165 | ;;sml 166 | ;;solidity ; do you need a blockchain? No. 167 | ;;swift ; who asked for emoji variables? 168 | ;;terra ; Earth and Moon in alignment for performance. 169 | (web +lsp) ; the tubes 170 | yaml ; JSON, but readable 171 | 172 | :email 173 | (mu4e +gmail) 174 | ;;notmuch 175 | ;;(wanderlust +gmail) 176 | 177 | :app 178 | calendar 179 | everywhere ; *leave* Emacs!? You must be joking 180 | ;;irc ; how neckbeards socialize 181 | ;;(rss +org) ; emacs as an RSS reader 182 | ;;twitter ; twitter client https://twitter.com/vnought 183 | 184 | :config 185 | literate 186 | (default +bindings +smartparens)) 187 | -------------------------------------------------------------------------------- /oldconfig.el: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;; 2 | ;;; 3 | ;;; Other 4 | ;;; 5 | ;;;;;;;;;;;; 6 | 7 | (setq vterm-shell "/usr/bin/fish") 8 | 9 | (setq evil-escape-key-sequence "qd") 10 | 11 | (add-hook! 'fundamental-mode-hook (solaire-mode -1)) 12 | ;(use-package! tree-sitter 13 | ; :config 14 | ; (require 'tree-sitter-langs) 15 | ; (global-tree-sitter-mode) 16 | ; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) 17 | 18 | 19 | ;(use-package tree-sitter-langs 20 | ; :ensure t 21 | ; :after tree-sitter 22 | ; :config 23 | ; (tree-sitter-require 'tsx) 24 | ; (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))) 25 | 26 | (map! :leader 27 | (:prefix ("r" . "roam") 28 | :desc "find file" "f" #'org-roam-find-file 29 | :desc "highlight" "r" #'org-noter-insert-note 30 | :desc "center scroll" "s" #'prot/scroll-center-cursor-mode 31 | :desc "start taking notes" "S" #'org-noter 32 | :desc "toggle buffer" "b" #'org-roam-buffer-toggle-display 33 | :desc "insert note" "i" #'org-roam-insert 34 | :desc "server" "g" #'org-roam-server 35 | :desc "quit notes" "q" #'org-noter-kill-session 36 | :desc "tag (roam)" "t" #'org-roam-tag-add 37 | :desc "tag (org)" "T" #'org-set-tags-command 38 | :desc "pomodoro" "p" #'org-pomodoro 39 | :desc "change nano-theme" "n" #'nano-change-theme 40 | :desc "rebuid db" "d" #'org-roam-db-build-cache 41 | :desc "cite" "c" #'helm-bibtex 42 | :desc "writing-mode" "w" #'thomas/writing-mode 43 | :desc "outline" "o" #'org-ol-tree 44 | (:prefix ("m" . "transclusion") 45 | :desc "make link" "m" #'org-transclusion-make-from-link 46 | :desc "transclusion mode" "t" #'org-transclusion-mode 47 | :desc "add at point" "a" #'org-transclusion-add-at-point 48 | :desc "add all in buffer" "A" #'org-transclusion-add-all-in-buffer 49 | :desc "remove at point" "r" #'org-transclusion-remove-at-point 50 | :desc "remove all in buffer" "R" #'org-transclusion-remove-all-in-buffer 51 | :desc "start live edit" "s" #'org-transclusion-live-sync-start-at-point 52 | :desc "stop live edit" "S" #'org-transclusion-live-sync-exit-at-point) 53 | ) 54 | (:prefix ("d" . "GTD") 55 | :desc "process inbox" "p"#'org-gtd-process-inbox 56 | :desc "agenda list" "a"#'org-agenda-list 57 | :desc "capture" "c"#'org-gtd-capture 58 | :desc "show next" "n" #'org-gtd-show-all-next 59 | :desc "show stuck project" "s" #'org-gtd-show-stuck-projects) 60 | ) 61 | 62 | (evil-workman-global-mode t) 63 | 64 | ;; If you use `org' and don't want your org files in the default location below, 65 | ;; change `org-directory'. It must be set before org loads! 66 | (setq org-directory "~/OneDrive/org-roam/" 67 | org-roam-directory "~/OneDrive/org-roam") 68 | 69 | ;; This determines the style of line numbers in effect. If set to `nil', line 70 | ;; numbers are disabled. For relative line numbers, set this to `relative'. 71 | (setq display-line-numbers-type t) 72 | (defcustom display-line-numbers-exempt-modes '(vterm-mode eshell-mode shell-mode term-mode ansi-term-mode org-mode) 73 | "Major modes on which to disable the linum mode, exempts them from global requirement" 74 | :group 'display-line-numbers 75 | :type 'list 76 | :version "green") 77 | 78 | (defun display-line-numbers--turn-on () 79 | "turn on line numbers but excempting certain majore modes defined in `display-line-numbers-exempt-modes'" 80 | (if (and 81 | (not (member major-mode display-line-numbers-exempt-modes)) 82 | (not (minibufferp))) 83 | (display-line-numbers-mode))) 84 | 85 | ;; Here are some additional functions/macros that could help you configure Doom: 86 | ;; 87 | ;; - `load!' for loading external *.el files relative to this one 88 | ;; - `use-package!' for configuring packages 89 | ;; - `after!' for running code after a package has loaded 90 | ;; - `add-load-path!' for adding directories to the `load-path', relative to 91 | ;; this file. Emacs searches the `load-path' when you load packages with 92 | ;; `require' or `use-package'. 93 | ;; - `map!' for binding new keys 94 | ;; 95 | ;; To get information about any of these functions/macros, move the cursor over 96 | ;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). 97 | ;; This will open documentation for it, including demos of how they are used. 98 | ;; 99 | ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how 100 | ;; they are implemented. 101 | 102 | ;;;;;Startup function 103 | ;;;;; 104 | (setq-default 105 | delete-by-moving-to-trash t ; Delete files to trash 106 | window-combination-resize t ; take new window space from all other windows (not just current) 107 | x-stretch-cursor t) ; Stretch cursor to the glyph width 108 | 109 | (setq undo-limit 80000000 ; Raise undo-limit to 80Mb 110 | evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular 111 | auto-save-default t ; Nobody likes to loose work, I certainly don't 112 | truncate-string-ellipsis "…") ; Unicode ellispis are nicer than "...", and also save /precious/ 113 | (global-subword-mode 1) 114 | 115 | ;; Doom exposes five (optional) variables for controlling fonts in Doom. Here 116 | ;; are the three important ones: 117 | ;; 118 | ;; + `doom-font' 119 | ;; + `doom-variable-pitch-font' 120 | ;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for 121 | ;; presentations or streaming. 122 | ;; 123 | ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd 124 | ;; font string. You generally only need these two: 125 | (setq doom-theme 'doom-plain) 126 | 127 | (setq doom-font (font-spec :family "Fira Code" :size 15 :weight 'semi-light) 128 | doom-variable-pitch-font (font-spec :family "Noto Serif" :style "Regular" :size 18 :weight 'regular)) 129 | 130 | (use-package! mixed-pitch 131 | :hook (org-mode . mixed-pitch-mode) 132 | :config 133 | (setq mixed-pitch-set-heigth t) 134 | (set-face-attribute 'variable-pitch nil :height 1.3 :family "Noto Serif" :weight 'regular)) 135 | ;; There are two ways to load a theme. Both assume the theme is installed and 136 | ;; available. You an either set `doom-theme' or manually load a theme with the 137 | ;; `load-theme' function. This is the default: 138 | 139 | (defun doom-modeline--set-char-widths (alist) 140 | "Set correct widths of icons characters in ALIST." 141 | (while (char-table-parent char-width-table) 142 | (setq char-width-table (char-table-parent char-width-table))) 143 | (dolist (pair alist) 144 | (let ((width 1) 145 | (chars (cdr pair)) 146 | (table (make-char-table nil))) 147 | (dolist (char chars) 148 | (set-char-table-range table char width)) 149 | (optimize-char-table table) 150 | (set-char-table-parent table char-width-table) 151 | (setq char-width-table table)))) 152 | 153 | (after! doom-modeline 154 | (setq doom-modeline-enable-word-count t 155 | doom-modeline-header-line t 156 | ;doom-modeline-hud nil 157 | doom-themes-padded-modeline t 158 | ;doom-flatwhite-brighter-modeline t) 159 | ) 160 | (doom-modeline-def-modeline 'main 161 | '(bar matches buffer-info vcs word-count) 162 | '(buffer-position misc-info major-mode " ")) 163 | (custom-set-faces! '(mode-line :family "Fira Code")) 164 | (doom-modeline--set-char-widths doom-modeline-rhs-icons-alist)) 165 | 166 | (use-package! mlscroll 167 | :after doom-modeline 168 | :hook (doom-modeline-mode . mlscroll-mode) 169 | :config 170 | (setq mlscroll-right-align nil) 171 | (add-to-list 'mode-line-misc-info '(:eval (mlscroll-mode-line))) 172 | (setq mlscroll-border 10) 173 | (setq mlscroll-width-chars 20) 174 | ) 175 | 176 | ;(setq +doom-dashboard-functions 177 | ; '( 178 | ; doom-dashboard-banner 179 | ; doom-dashboard-loaded 180 | ; thomas-dashboad-text 181 | ; )) 182 | 183 | 184 | (defvar nano-theme-light-var t) 185 | ;(require 'disp-table) 186 | ;(require 'nano-theme-dark) 187 | ;(require 'nano-theme-light) 188 | ;(nano-theme-set-light) 189 | ;(require 'nano-layout) 190 | ;(require 'nano-base-colors) 191 | (require 'nano-faces) 192 | (nano-faces) 193 | ;(require 'nano-theme) 194 | ;(nano-theme) 195 | ;(require 'nano-modeline) 196 | ;(require 'nano-writer) 197 | ;;(nano-theme) 198 | ;; 199 | 200 | (setq default-frame-alist 201 | (append (list 202 | ;; '(font . "Roboto Mono Emacs Regular:size=14") 203 | '(min-height . 1) '(height . 45) 204 | '(min-width . 1) '(width . 81) 205 | '(vertical-scroll-bars . nil) 206 | '(internal-border-width . 24) 207 | '(left-fringe . 0) 208 | '(right-fringe . 0) 209 | '(tool-bar-lines . 0) 210 | '(menu-bar-lines . 0)))) 211 | 212 | 213 | 214 | (defun nano-change-theme-dark () 215 | (interactive) 216 | (nano-theme-set-dark) 217 | (nano-faces) 218 | (nano-theme)) 219 | 220 | (defun nano-change-theme-light () 221 | (interactive) 222 | (nano-theme-set-light) 223 | (nano-faces) 224 | (nano-theme)) 225 | 226 | (defun nano-change-theme () 227 | (interactive) 228 | (if nano-theme-light-var (nano-change-theme-dark) (nano-change-theme-light)) 229 | (setq nano-theme-light-var (not nano-theme-light-var))) 230 | 231 | (defvar +org-roam-open-buffer-on-find-file nil 232 | "If non-nil, open the org-roam buffer when opening an org roam file.") 233 | 234 | 235 | ; (setq centaur-tabs-style "wave") 236 | ; (setq centaur-tabs-set-bar 'under) 237 | ;; Note: If you're not using Spacmeacs, in order for the underline to display 238 | ;; correctly you must add the following line: 239 | ;(setq x-underline-at-descent-line t) 240 | 241 | 242 | ;; 243 | ;;; Packages 244 | 245 | (use-package! org-fragtog 246 | :after org 247 | :hook (org-mode . org-fragtog-mode) 248 | ) 249 | 250 | (use-package! org-transclusion 251 | :after org-roam 252 | ) 253 | 254 | (use-package! org-roam 255 | ;;:hook (org-load . org-roam-mode) 256 | :hook (org-roam-backlinks-mode . turn-on-visual-line-mode) 257 | :commands (org-roam-buffer-toggle-display 258 | org-roam-dailies-find-date 259 | org-roam-dailies-find-today 260 | org-roam-dailies-find-tomorrow 261 | org-roam-dailies-find-yesterday) 262 | :preface 263 | ;; Set this to nil so we can later detect if the user has set custom values 264 | ;; for these variables. If not, default values will be set in the :config 265 | ;; section. 266 | (defvar org-roam-directory nil) 267 | (defvar org-roam-db-location nil) 268 | :init 269 | (map! :after org 270 | :map org-mode-map 271 | :localleader 272 | :prefix ("m" . "org-roam") 273 | "b" #'org-roam-switch-to-buffer 274 | "f" #'org-roam-find-file 275 | "g" #'org-roam-graph 276 | "i" #'org-roam-insert 277 | "I" #'org-roam-insert-immediate 278 | "m" #'org-roam 279 | "t" #'org-roam-tag-add 280 | "T" #'org-roam-tag-delete 281 | (:prefix ("d" . "by date") 282 | :desc "Find previous note" "b" #'org-roam-dailies-find-previous-note 283 | :desc "Find date" "d" #'org-roam-dailies-find-date 284 | :desc "Find next note" "f" #'org-roam-dailies-find-next-note 285 | :desc "Find tomorrow" "m" #'org-roam-dailies-find-tomorrow 286 | :desc "Capture today" "n" #'org-roam-dailies-capture-today 287 | :desc "Find today" "t" #'org-roam-dailies-find-today 288 | :desc "Capture Date" "v" #'org-roam-dailies-capture-date 289 | :desc "Find yesterday" "y" #'org-roam-dailies-find-yesterday 290 | :desc "Find directory" "." #'org-roam-dailies-find-directory)) 291 | :config 292 | (setq org-roam-directory 293 | (file-name-as-directory 294 | (file-truename 295 | (expand-file-name (or org-roam-directory "roam") 296 | org-directory))) 297 | org-roam-db-location (or org-roam-db-location 298 | (concat doom-etc-dir "org-roam.db")) 299 | org-roam-verbose nil ; https://youtu.be/fn4jIlFwuLU 300 | ;; Make org-roam buffer sticky; i.e. don't replace it when opening a 301 | ;; file with an *-other-window command. 302 | org-roam-buffer-window-parameters '((no-delete-other-windows . t)) 303 | org-roam-completion-everywhere t 304 | org-roam-completion-system 305 | (cond ((featurep! :completion helm) 'helm) 306 | ((featurep! :completion ivy) 'ivy) 307 | ((featurep! :completion ido) 'ido) 308 | ('default))) 309 | 310 | ;; Normally, the org-roam buffer doesn't open until you explicitly call 311 | ;; `org-roam'. If `+org-roam-open-buffer-on-find-file' is non-nil, the 312 | ;; org-roam buffer will be opened for you when you use `org-roam-find-file' 313 | ;; (but not `find-file', to limit the scope of this behavior). 314 | (add-hook! 'find-file-hook 315 | (defun +org-roam-open-buffer-maybe-h () 316 | (and +org-roam-open-buffer-on-find-file 317 | (memq 'org-roam-buffer--update-maybe post-command-hook) 318 | (not (window-parameter nil 'window-side)) ; don't proc for popups 319 | (not (eq 'visible (org-roam-buffer--visibility))) 320 | (with-current-buffer (window-buffer) 321 | (org-roam-buffer--get-create))))) 322 | 323 | ;; Hide the mode line in the org-roam buffer, since it serves no purpose. This 324 | ;; makes it easier to distinguish from other org buffers. 325 | (add-hook 'org-roam-buffer-prepare-hook #'hide-mode-line-mode) 326 | 327 | (setq org-roam-capture-templates `(("s" "standard" plain (function org-roam--capture-get-point) 328 | "%?" 329 | :file-name "%<%Y%m%d%H%M%S>-${slug}" 330 | :head "#+title: ${title}\n#+roam_tags: \n\n* ${title}\n\n" 331 | :unnarrowed t) 332 | ("d" "definition" plain (function org-roam--capture-get-point) 333 | "%?" 334 | :file-name "${slug}" 335 | :head "#+title: ${title}\n#+roam_tags: definition \n\n* ${title}\n\n\n* Examples\n" 336 | :unnarrowed t))) 337 | ) 338 | 339 | 340 | ;; Since the org module lazy loads org-protocol (waits until an org URL is 341 | ;; detected), we can safely chain `org-roam-protocol' to it. 342 | (use-package! org-roam-protocol 343 | :after org-protocol) 344 | 345 | (use-package! org-roam-server 346 | :after org-roam 347 | :config 348 | (setq org-roam-server-host "127.0.0.1" 349 | org-roam-server-port 8081 350 | org-roam-server-authenticate nil 351 | org-roam-server-export-inline-images t 352 | org-roam-server-serve-files nil 353 | org-roam-server-served-file-extensions '("pdf" "mp4" "ogv") 354 | org-roam-server-network-poll t 355 | org-roam-server-network-arrows nil 356 | org-roam-server-network-label-truncate t 357 | org-roam-server-network-label-truncate-length 60 358 | org-roam-server-network-label-wrap-length 20 359 | org-roam-server-network-vis-options "{\"physics\": {\"stabilization\": {\"iterations\": 100}}}" 360 | ;i;"{\"physics\": {\"enabled\": true, \"barnesHut\":{\"gravitationalConstant\" : -6000, \"avoidOverlap\" : 0.5, \"springLength\" : 200}, \"stabilization\": {\"enabled\": true, \"iterations\": 30}}, 361 | ;;\"edges\": {\"physics\": true, \"hidden\": false, \"smooth\": {\"enabled\": false, \"type\": \"continuous\"}}}" 362 | org-roam-server-cite-edge-dashes nil 363 | org-roam-server-extra-cite-edge-options (list (cons 'width 3)) 364 | )) 365 | 366 | (defun org-roam-server-open () 367 | "Ensure the server is active, then open the roam graph." 368 | (interactive) 369 | (smartparens-global-mode -1) 370 | (org-roam-server-mode 1) 371 | (browse-url-xdg-open (format "http://localhost:%d" org-roam-server-port)) 372 | (smartparens-global-mode 1)) 373 | 374 | ;; automatically enable server-mode 375 | (after! org-roam 376 | (smartparens-global-mode -1) 377 | (org-roam-server-mode) 378 | (smartparens-global-mode 1)) 379 | 380 | 381 | (use-package! org-ref 382 | ;:after org-roam 383 | :config 384 | (setq 385 | org-ref-completion-library 'org-ref-ivy-cite 386 | org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex 387 | org-ref-default-bibliography (list "/home/thomas/OneDrive/org-roam/bib/Library.bib") 388 | org-ref-bibliography-notes "/home/thomas/OneDrive/org-roam/bibnotes.org" 389 | org-ref-note-title-format "* %y - %t\n :PROPERTIES:\n :Custom_ID: %k\n :NOTER_DOCUMENT: %F\n :ROAM_KEY: cite:%k\n :AUTHOR: %9a\n :JOURNAL: %j\n :YEAR: %y\n :VOLUME: %v\n :PAGES: %p\n :DOI: %D\n :URL: %U\n :END:\n\n" 390 | org-ref-notes-directory "/home/thomas/OneDrive/org-roam/" 391 | org-ref-notes-function 'orb-edit-notes 392 | )) 393 | 394 | (after! org-ref 395 | (setq 396 | bibtex-completion-notes-path "/home/thomas/OneDrive/org-roam/" 397 | bibtex-completion-bibliography "/home/thomas/OneDrive/org-roam/bib/Library.bib" 398 | bibtex-completion-pdf-field "file" 399 | bibtex-completion-notes-template-multiple-files 400 | (concat 401 | "#+TITLE: ${title}\n" 402 | "#+ROAM_KEY: cite:${=key=}\n" 403 | "* TODO Notes\n" 404 | ":PROPERTIES:\n" 405 | ":Custom_ID: ${=key=}\n" 406 | ":NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n" 407 | ":AUTHOR: ${author-abbrev}\n" 408 | ":JOURNAL: ${journaltitle}\n" 409 | ":DATE: ${date}\n" 410 | ":YEAR: ${year}\n" 411 | ":DOI: ${doi}\n" 412 | ":URL: ${url}\n" 413 | ":END:\n\n" 414 | ) 415 | ) 416 | ) 417 | 418 | (use-package! company-org-roam 419 | :after org-roam 420 | :config 421 | (set-company-backend! 'org-mode '(company-org-roam company-yasnippet company-dabbrev))) 422 | 423 | (use-package! org-roam-bibtex 424 | :after org-roam 425 | :hook (org-roam-mode . org-roam-bibtex-mode) 426 | :config 427 | (require 'org-ref) 428 | (setq orb-preformat-keywords 429 | '("citekey" "title" "url" "file" "author-or-editor" "keywords" "pdf" "doi" "author" "tags")) 430 | (setq orb-templates 431 | '(("r" "ref" plain (function org-roam-capture--get-point) 432 | "" 433 | :file-name "${slug}" 434 | :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref} 435 | \n#+ROAM_TAGS: reference ${keywords} \n 436 | \n* ${title}\n :PROPERTIES:\n :Custom_ID: ${citekey}\n :DOI: ${doi}\n :AUTHOR: ${author}\n :END:\n\n 437 | \n* Summary 438 | \n\n\n* Rough note space\n" 439 | :unnarrowed t)))) 440 | ;) 441 | 442 | (use-package! org-noter 443 | :after (:any org pdf-view) 444 | :config 445 | (setq 446 | ;; The WM can handle splits 447 | ;;org-noter-notes-window-location 'other-frame 448 | ;; Please stop opening frames 449 | ;;org-noter-always-create-frame nil 450 | ;; I want to see the whole file 451 | org-noter-hide-other nil 452 | ;; Everything is relative to the rclone mega 453 | org-noter-notes-search-path "/home/thomas/OneDrive/org-roam" 454 | ) 455 | ) 456 | 457 | 458 | (use-package! org-pdftools 459 | :hook (org-load . org-pdftools-setup-link)) 460 | (use-package! org-noter-pdftools 461 | :after org-noter 462 | :config 463 | (with-eval-after-load 'pdf-annot 464 | (add-hook 'pdf-annot-activate-handler-functions #'org-noter-pdftools-jump-to-note))) 465 | 466 | 467 | (use-package! nroam 468 | :after org-roam 469 | :config 470 | (add-hook 'org-roam-mode-hook #'nroam-setup-maybe) 471 | ) 472 | 473 | 474 | (use-package! org-ol-tree 475 | :after org 476 | :commands org-ol-tree 477 | :hook (org-ol-tree-mode . visual-line-mode) 478 | :config 479 | (setq org-ol-tree-ui-window-auto-resize nil 480 | org-ol-tree-ui-window-max-width 0.3 481 | org-ol-tree-ui-window-position 'left)) 482 | (map! :map org-mode-map 483 | :after org 484 | :localleader 485 | :desc "Outline" "O" #'org-ol-tree) 486 | 487 | ;;; Ugly org hooks 488 | (defun nicer-org () 489 | (+org-pretty-mode 1) 490 | (mixed-pitch-mode 1) 491 | (hl-line-mode -1) 492 | (display-line-numbers-mode -1) 493 | (olivetti-mode 1) 494 | (org-num-mode 1) 495 | ;(org-indent-mode -1) 496 | ) 497 | 498 | (add-hook! 'org-mode-hook #'nicer-org) 499 | (after! org 500 | (setq org-startup-with-latex-preview 1 501 | org-startup-with-inline-images 1 502 | org-hide-leading-stars 1 503 | org-startup-indented nil 504 | org-superstar-headline-bullets-list`("\u200b") 505 | ; org-startup-folded nil 506 | ;org-startup-numerated 1 507 | org-pretty-entities 1) 508 | (custom-set-faces! 509 | '((org-block) :background nil) 510 | ) 511 | (defface redd 512 | '((((class color) (min-colors 88) (background light)) 513 | :foreground "red")) 514 | "Red." 515 | :group 'basic-faces) 516 | (custom-set-faces! '(org-level-1 :height 1.6 :weight bold :slant normal) '(org-level-2 :height 1.4 :weight regular :slant normal) '(org-level-3 :height 1.3 :weight regular :slant italic)) 517 | (setq org-emphasis-alist 518 | '(("*" (bold)) 519 | ("/" italic) 520 | ("_" underline) 521 | ("=" redd) 522 | ("~" (:background "deep sky blue" :foreground "MidnightBlue")) 523 | ("+" (:strike-through t)))) 524 | (setq org-ellipsis " ▾ ") 525 | (appendq! +ligatures-extra-symbols 526 | `(:checkbox "☐" 527 | :pending "◼" 528 | :checkedbox "☑" 529 | :list_property "∷" 530 | :em_dash "—" 531 | :ellipses "…" 532 | :arrow_right "→" 533 | :arrow_left "←" 534 | :title "𝙏" 535 | :subtitle "𝙩" 536 | :author "𝘼" 537 | :date "𝘿" 538 | :property "☸" 539 | :options "⌥" 540 | :startup "⏻" 541 | :macro "𝓜" 542 | :html_head "🅷" 543 | :html "🅗" 544 | :latex_class "🄻" 545 | :latex_header "🅻" 546 | :beamer_header "🅑" 547 | :latex "🅛" 548 | :attr_latex "🄛" 549 | :attr_html "🄗" 550 | :attr_org "⒪" 551 | :begin_quote "❝" 552 | :end_quote "❞" 553 | :caption "☰" 554 | :header "›" 555 | :results "🠶" 556 | :begin_export "⏩" 557 | :end_export "⏪" 558 | :properties "⚙" 559 | :end "∎" 560 | :priority_a ,(propertize "⚑" 'face 'all-the-icons-red) 561 | :priority_b ,(propertize "⬆" 'face 'all-the-icons-orange) 562 | :priority_c ,(propertize "■" 'face 'all-the-icons-yellow) 563 | :priority_d ,(propertize "⬇" 'face 'all-the-icons-green) 564 | :priority_e ,(propertize "❓" 'face 'all-the-icons-blue))) 565 | (set-ligatures! 'org-mode 566 | :merge t 567 | :checkbox "[ ]" 568 | :pending "[-]" 569 | :checkedbox "[X]" 570 | :list_property "::" 571 | :em_dash "---" 572 | :ellipsis "..." 573 | :arrow_right "->" 574 | :arrow_left "<-" 575 | :title "#+title:" 576 | :subtitle "#+subtitle:" 577 | :author "#+author:" 578 | :date "#+date:" 579 | :property "#+property:" 580 | :options "#+options:" 581 | :startup "#+startup:" 582 | :macro "#+macro:" 583 | :html_head "#+html_head:" 584 | :html "#+html:" 585 | :latex_class "#+latex_class:" 586 | :latex_header "#+latex_header:" 587 | :beamer_header "#+beamer_header:" 588 | :latex "#+latex:" 589 | :attr_latex "#+attr_latex:" 590 | :attr_html "#+attr_html:" 591 | :attr_org "#+attr_org:" 592 | :begin_quote "#+begin_quote" 593 | :end_quote "#+end_quote" 594 | :caption "#+caption:" 595 | :header "#+header:" 596 | :begin_export "#+begin_export" 597 | :end_export "#+end_export" 598 | :results "#+RESULTS:" 599 | :property ":PROPERTIES:" 600 | :end ":END:" 601 | :priority_a "[#A]" 602 | :priority_b "[#B]" 603 | :priority_c "[#C]" 604 | :priority_d "[#D]" 605 | :priority_e "[#E]") 606 | (plist-put +ligatures-extra-symbols :name "⁍") 607 | ) 608 | 609 | (with-eval-after-load 'org 610 | (plist-put org-format-latex-options :background 'default)) 611 | 612 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 613 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 614 | ; 615 | ; Getting Things Done 616 | ; 617 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 618 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 619 | 620 | (use-package! org-gtd 621 | :after org 622 | :config 623 | ;; where org-gtd will put its files. This value is also the default one. 624 | (setq org-gtd-directory "~/OneDrive/org-roam/") 625 | ;; package: https://github.com/Malabarba/org-agenda-property 626 | ;; this is so you can see who an item was delegated to in the agenda 627 | (setq org-agenda-property-list '("DELEGATED_TO")) 628 | ;; I think this makes the agenda easier to read 629 | (setq org-agenda-property-position 'next-line) 630 | ;; package: https://www.nongnu.org/org-edna-el/ 631 | ;; org-edna is used to make sure that when a project task gets DONE, 632 | ;; the next TODO is automatically changed to NEXT. 633 | (setq org-edna-use-inheritance t) 634 | (org-edna-load) 635 | :bind 636 | (("C-c d c" . org-gtd-capture) ;; add item to inbox 637 | ("C-c d a" . org-agenda-list) ;; see what's on your plate today 638 | ("C-c d p" . org-gtd-process-inbox) ;; process entire inbox 639 | ("C-c d n" . org-gtd-show-all-next) ;; see all NEXT items 640 | ("C-c d s" . org-gtd-show-stuck-projects)) ;; see projects that don't have a NEXT item 641 | :init 642 | (bind-key "C-c c" 'org-gtd-clarify-finalize)) ;; the keybinding to hit when you're done editing an item in the processing phase 643 | 644 | (setq org-agenda-files '("~/OneDrive/org-roam/inbox" "~/OneDrive/org-roam/actionable.org" 645 | "~/OneDrive/org-roam/agenda.org" "~/OneDrive/org-roam/incubate.org" 646 | "~/OneDrive/org-roam/openquestions.org")) 647 | 648 | (after! org 649 | (setq org-capture-templates `(("i" "Inbox" 650 | entry (file "~/OneDrive/org-roam/inbox.org") 651 | "* %?\n%U\n\n %i" 652 | :kill-buffer t) 653 | ("l" "Todo with link" 654 | entry (file "~/OneDrive/org-rom/inbox.org") 655 | "* %?\n%U\n\n %i\n %a" 656 | :kill-buffer t) 657 | ("m" "Meeting" 658 | entry (file+headline "/home/thomas/OneDrive/org-roam/agenda.org" "Future") 659 | ,(concat "* TODO %? :meeting:\n" "<%<%Y-%m-%d %a %H:00>>")) 660 | ("o" "Open Question Thesis" 661 | entry (file+headline "~/OneDrive/org-roam/openquestions.org" "Questions") 662 | "* OPEN %? \n %U\n"))) 663 | (set-face-attribute 'org-headline-done nil :strike-through t) 664 | ) 665 | -------------------------------------------------------------------------------- /config.el: -------------------------------------------------------------------------------- 1 | ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- 2 | 3 | ;; Place your private configuration here! Remember, you do not need to run 'doom 4 | ;; sync' after modifying this file! 5 | 6 | 7 | ;; Some functionality uses this to identify you, e.g. GPG configuration, email 8 | ;; clients, file templates and snippets. 9 | (setq user-full-name "Thomas F. K. Jorna" 10 | user-mail-address "jorna@jtrialerror.com") 11 | 12 | ;; If you use `org' and don't want your org files in the default location below, 13 | ;; change `org-directory'. It must be set before org loads! 14 | (setq org-directory "~/Notes/" 15 | org-roam-directory "~/Notes") 16 | 17 | ;; This determines the style of line numbers in effect. If set to `nil', line 18 | ;; numbers are disabled. For relative line numbers, set this to `relative'. 19 | (setq display-line-numbers-type t) 20 | 21 | ;; Here are some additional functions/macros that could help you configure Doom: 22 | ;; 23 | ;; - `load!' for loading external *.el files relative to this one 24 | ;; - `use-package!' for configuring packages 25 | ;; - `after!' for running code after a package has loaded 26 | ;; - `add-load-path!' for adding directories to the `load-path', relative to 27 | ;; . 28 | 29 | (setq default-frame-alist 30 | (append (list 31 | ;; '(font . "Roboto Mono Emacs Regular:size=14") 32 | '(min-height . 1) '(height . 45) 33 | '(min-width . 1) '(width . 81) 34 | '(vertical-scroll-bars . nil) 35 | '(internal-border-width . 20) 36 | '(left-fringe . 0) 37 | '(right-fringe . 0) 38 | '(tool-bar-lines . 0) 39 | '(menu-bar-lines . 0)))) 40 | 41 | (setq doom-theme 'doom-flatwhite) 42 | 43 | (add-hook! 'solaire-mode-hook 44 | (set-face-attribute 'fringe nil :background (face-background 'solaire-default-face)) 45 | ) 46 | 47 | (use-package! mixed-pitch 48 | :hook (org-mode . mixed-pitch-mode) 49 | :config 50 | (setq mixed-pitch-face 'variable-pitch)) 51 | 52 | (add-hook! 'special-mode-hook (mixed-pitch-mode 1) 53 | 'delve-mode-hook (mixed-pitch-mode 1)) 54 | 55 | (setq doom-font (font-spec :family "FiraCode Nerd Font" :size 15 :weight 'light) 56 | doom-variable-pitch-font (font-spec :family "Roboto" :style "Regular" :size 12 :weight 'regular)) 57 | 58 | ;; There are two ways to load a theme. Both assume the theme is installed and 59 | ;; available. You an either set `doom-theme' or manually load a theme with the 60 | ;; `load-theme' function. This is the default: 61 | 62 | (use-package! good-scroll 63 | :init (good-scroll-mode 1)) 64 | 65 | (tooltip-mode 1) 66 | 67 | (after! doom-modeline 68 | (doom-modeline-def-modeline 'main 69 | '(bar matches buffer-info vcs word-count) 70 | '(buffer-position misc-info major-mode))) 71 | 72 | (defun thomas/centaur-tabs-buffer-tab-label (tab) 73 | "Return a label for TAB. 74 | That is, a string used to represent it on the tab bar." 75 | ;; Init tab style. 76 | ;; Render tab. 77 | (format " %s" 78 | (let* ((rawbufname (if centaur-tabs--buffer-show-groups 79 | (centaur-tabs-tab-tabset tab) 80 | (buffer-name (car tab)))) 81 | (formatted-bufname (if (string= (file-name-extension rawbufname) "org") 82 | (if (and (> (length rawbufname) 14) 83 | (string-match-p "[0-9]\\{14\\}" (substring rawbufname 0 14))) 84 | (substring rawbufname 15) 85 | rawbufname) 86 | rawbufname)) 87 | (bufname (concat " " formatted-bufname))) 88 | (if (> centaur-tabs-label-fixed-length 0) 89 | (centaur-tabs-truncate-string centaur-tabs-label-fixed-length bufname) 90 | bufname)))) 91 | 92 | (after! centaur-tabs 93 | (setq centaur-tabs-display-line nil) 94 | (setq centaur-tabs-style "bar" 95 | centaur-tabs-tab-label-function #'thomas/centaur-tabs-buffer-tab-label 96 | centaur-tabs-label-fixed-length 20 97 | centaur-tabs-height 40 98 | centaur-tabs-bar-height 50 99 | centaur-tabs-close-button "✕" 100 | centaur-tabs-icon-scale-factor 0.8) 101 | (centaur-tabs-change-fonts "Roboto Sans" 140) 102 | (set-face-background 'centaur-tabs-selected (doom-lighten (face-background 'default )0.1)) 103 | (set-face-background 'centaur-tabs-selected-modified (doom-lighten (face-background 'default )0.1))) 104 | 105 | 106 | 107 | (use-package! org-fragtog 108 | :after org 109 | :hook (org-mode . org-fragtog-mode)) 110 | 111 | (use-package! org-appear 112 | :after org 113 | :hook (org-mode . org-appear-mode) 114 | :config (setq 115 | org-appear-autolinks t 116 | org-appear-autoentities t 117 | org-appear-autosubmarkers t )) 118 | 119 | (use-package! org-transclusion 120 | :after org-roam) 121 | 122 | (map! :map org-mode-map 123 | :nie "C-M-SPC" (cmd! (insert "\u200B"))) 124 | 125 | (setq org-roam-v2-ack t) 126 | 127 | (use-package! org-roam 128 | :after org 129 | :config 130 | (setq org-roam-v2-ack t) 131 | (setq org-roam-mode-sections 132 | (list #'org-roam-backlinks-insert-section 133 | #'org-roam-reflinks-insert-section 134 | #'org-roam-unlinked-references-insert-section)) 135 | (org-roam-setup)) 136 | 137 | (defun org-roam-buffer-setup () 138 | "Function to make org-roam-buffer more pretty." 139 | (progn 140 | (setq-local olivetti-body-width 44) 141 | (variable-pitch-mode 1) 142 | (olivetti-mode 1) 143 | (centaur-tabs-local-mode 1) 144 | 145 | (set-face-background 'magit-section-highlight (face-background 'default)))) 146 | 147 | ;; I don't actually like the buffer that much 148 | (after! org-roam 149 | (setq +org-roam-open-buffer-on-find-file nil) 150 | (add-hook! 'org-roam-mode-hook #'org-roam-buffer-setup)) 151 | 152 | (use-package! org-roam-ui 153 | :after org-roam 154 | :config 155 | (setq org-roam-ui-open-on-start nil) 156 | (setq org-roam-ui-browser-function #'xwidget-webkit-browse-url)) 157 | 158 | (after! org-roam 159 | (setq org-roam-capture-templates 160 | `(("s" "standard" plain "%?" 161 | :if-new 162 | (file+head "%<%Y%m%d%H%M%S>-${slug}.org" 163 | "#+title: ${title}\n#+filetags: \n\n ") 164 | :unnarrowed t) 165 | ("d" "definition" plain 166 | "%?" 167 | :if-new 168 | (file+head "${slug}.org" "#+title: ${title}\n#+filetags: definition \n\n* Definition\n\n\n* Examples\n") 169 | :unnarrowed t) 170 | ("r" "ref" plain "%?" 171 | :if-new 172 | (file+head "${citekey}.org" 173 | "#+title: ${slug}: ${title}\n 174 | \n#+filetags: reference ${keywords} \n 175 | \n* ${title}\n\n 176 | \n* Summary 177 | \n\n\n* Rough note space\n") 178 | :unnarrowed t) 179 | ("p" "person" plain "%?" 180 | :if-new 181 | (file+head "${slug}.org" "%^{relation|some guy|family|friend|colleague}p %^{birthday}p %^{address}p 182 | #+title:${slug}\n#+filetags: :person: \n" 183 | :unnarrowed t) 184 | ("ts" "standard (thesis)" plain "%?" 185 | :if-new 186 | (file+head "thesis/%<%Y%m%d%H%M%S>-${slug}.org" 187 | "#+title: ${title}\n#+filetags: \n\n ") 188 | :unnarrowed t) 189 | ("tc" "chapter (thesis)" plain "%?" 190 | :if-new 191 | (file+head "thesis/${slug}.org" 192 | "#+title: ${title}\n#+filetags: :chapter: \n\n 193 | \n - Outline (do this first)\n -") 194 | :unnarrowed t) 195 | ("td" "definition (thesis)" plain 196 | "%?" 197 | :if-new 198 | (file+head "$thesis/{slug}.org" "#+title: ${title}\n#+filetags: definition \n\n* Definition\n\n\n* Examples\n") 199 | :unnarrowed t) 200 | ("tr" "ref (thesis)" plain "%?" 201 | :if-new 202 | (file+head "$thesis/{citekey}.org" 203 | "#+title: ${slug}: ${title}\n 204 | \n#+filetags: reference ${keywords} \n 205 | \n* ${title}\n\n 206 | \n* Summary 207 | \n\n\n* Rough note space\n") 208 | :unnarrowed t))))) 209 | 210 | (use-package! org-ref 211 | ;:after org-roam 212 | :config 213 | (setq 214 | org-ref-completion-library 'org-ref-ivy-cite 215 | org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex 216 | org-ref-default-bibliography (list "/Users/thomas/Notes/bib/Library.bib") 217 | org-ref-bibliography-notes "/Users/thomas/Notes/bibnotes.org" 218 | org-ref-note-title-format "* %y - %t\n :properties:\n :Custom_ID: %k\n :noter_document: %F\n :ROAM_KEY: cite:%k\n :AUTHOR: %9a\n :JOURNAL: %j\n :YEAR: %y\n :VOLUME: %v\n :PAGES: %p\n :DOI: %D\n :URL: %U\n :END:\n\n" 219 | org-ref-notes-directory "/Users/thomas/Notes/" 220 | org-ref-notes-function 'orb-edit-notes 221 | )) 222 | 223 | (after! org-ref 224 | (setq 225 | bibtex-completion-notes-path "/Users/thomas/Notes/" 226 | bibtex-completion-bibliography "/Users/thomas/Notes/bib/Library.bib" 227 | bibtex-completion-pdf-field "file" 228 | bibtex-completion-notes-template-multiple-files 229 | (concat 230 | "#+TITLE: ${title}\n" 231 | "#+ROAM_KEY: cite:${=key=}\n" 232 | "* TODO Notes\n" 233 | ":properties:\n" 234 | ":Custom_ID: ${=key=}\n" 235 | ":NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n" 236 | ":AUTHOR: ${author-abbrev}\n" 237 | ":JOURNAL: ${journaltitle}\n" 238 | ":DATE: ${date}\n" 239 | ":YEAR: ${year}\n" 240 | ":DOI: ${doi}\n" 241 | ":URL: ${url}\n" 242 | ":END:\n\n" 243 | ) 244 | ) 245 | ) 246 | 247 | (use-package! org-roam-bibtex 248 | :after org-roam 249 | :hook (org-mode . org-roam-bibtex-mode) 250 | :config 251 | (require 'org-ref) 252 | (setq orb-preformat-keywords 253 | '("citekey" "title" "url" "file" "author-or-editor" "keywords" "pdf" "doi" "author" "tags" "year" "author-bbrev"))) 254 | ;) 255 | 256 | (use-package! citar 257 | :after org-roam 258 | :config 259 | (setq 260 | org-cite-global-bibliography '("~/Notes/thesis-writing/bibliography/Academic.bib") 261 | citar-bibliography org-cite-global-bibliography 262 | org-cite-insert-processor 'citar 263 | org-cite-follow-processor 'citar 264 | org-cite-activate-processor 'citar 265 | citar-templates 266 | '((main . "${author editor:30} ${date year issued:4} ${title:48}") 267 | (suffix . " ${=key= id:15} ${=type=:12} ${tags keywords:*}") 268 | (note . "Notes on ${author editor}, ${title}")) 269 | citar-symbols 270 | `((file ,(all-the-icons-faicon "file-o" :face 'all-the-icons-green :v-adjust -0.1) . " ") 271 | (note ,(all-the-icons-material "speaker_notes" :face 'all-the-icons-blue :v-adjust -0.3) . " ") 272 | (link ,(all-the-icons-octicon "link" :face 'all-the-icons-orange :v-adjust 0.01) . " ")) 273 | citar-symbol-separator " " 274 | citar-open-note-function 'orb-citar-edit-note 275 | bibtex-completion-bibliography org-cite-global-bibliography 276 | citar-format-note-function 'orb--new-note 277 | org-cite-export-processors '((latex biblatex) 278 | (t basic))) 279 | 280 | ;; optional: org-cite-insert is also bound to C-c C-x C-@ 281 | :bind 282 | (:map org-mode-map :package org ("C-c b" . #'org-cite-insert))) 283 | 284 | (use-package! oc-biblatex 285 | :after oc) 286 | 287 | (after! oc 288 | (defun org-ref-to-org-cite () 289 | "Attempt to convert org-ref citations to org-cite syntax." 290 | (interactive) 291 | (let* ((cite-conversions '(("cite" . "//b") ("Cite" . "//bc") 292 | ("nocite" . "/n") 293 | ("citep" . "") ("citep*" . "//f") 294 | ("parencite" . "") ("Parencite" . "//c") 295 | ("citeauthor" . "/a/f") ("citeauthor*" . "/a") 296 | ("citeyear" . "/na/b") 297 | ("Citep" . "//c") ("Citealp" . "//bc") 298 | ("Citeauthor" . "/a/cf") ("Citeauthor*" . "/a/c") 299 | ("autocite" . "") ("Autocite" . "//c") 300 | ("notecite" . "/l/b") ("Notecite" . "/l/bc") 301 | ("pnotecite" . "/l") ("Pnotecite" . "/l/bc"))) 302 | (cite-regexp (rx (regexp (regexp-opt (mapcar #'car cite-conversions) t)) 303 | ":" (group (+ (not (any "\n ,.)]}"))))))) 304 | (save-excursion 305 | (goto-char (point-min)) 306 | (while (re-search-forward cite-regexp nil t) 307 | (message (format "[cite%s:@%s]" 308 | (cdr (assoc (match-string 1) cite-conversions)) 309 | (match-string 2))) 310 | (replace-match (format "[cite%s:@%s]" 311 | (cdr (assoc (match-string 1) cite-conversions)) 312 | (match-string 2)))))))) 313 | 314 | (defun org-roam-rg-search () 315 | "Search org-roam directory using consult-ripgrep. With live-preview." 316 | (interactive) 317 | (let ((consult-ripgrep-args "rg --null --ignore-case --type org --line-buffered --max-columns=500 --no-heading --line-number --context 2 . ")) 318 | (consult-ripgrep org-roam-directory))) 319 | ;(global-set-key (kbd "C-c rr") 'bms/org-roam-rg-search) 320 | 321 | (after! consult 322 | (setq consult-ripgrep-args 323 | "rg --null --line-buffered --color=never --max-columns=1000 --path-separator /\ 324 | --smart-case --no-heading --line-number --context=3 ." 325 | )) 326 | 327 | (defun zotnote-to-org () 328 | (interactive) 329 | (progn 330 | (save-excursion 331 | (replace-string "\\par" "\n")) 332 | (save-excursion 333 | (replace-string "“" "#+begin_quote\n/")) 334 | (save-excursion 335 | (replace-string "”" "/\n#+end_quote\n\n")) 336 | (save-buffer))) 337 | 338 | (use-package! org-ol-tree 339 | :after org 340 | :commands org-ol-tree 341 | :hook (org-ol-tree-mode . visual-line-mode) 342 | :config 343 | (setq org-ol-tree-ui-window-auto-resize nil 344 | org-ol-tree-ui-window-max-width 0.3)) 345 | (add-hook! 'org-ol-tree-mode-hook (lambda () (when (centaur-tabs-mode) (centaur-tabs-local-mode -1)))) 346 | (map! :map org-mode-map 347 | :after org 348 | :localleader 349 | :desc "Outline" "O" #'org-ol-tree) 350 | 351 | (defun org-mode-remove-stars () 352 | (font-lock-add-keywords 353 | nil 354 | '(("^\\*+ " 355 | (0 356 | (prog1 nil 357 | (put-text-property (match-beginning 0) (match-end 0) 358 | 'invisible t))))))) 359 | 360 | (add-hook! 'org-mode-hook #'org-mode-remove-stars) 361 | 362 | ;; hide title / author ... keywords 363 | 364 | ;;; Ugly org hooks 365 | (defun nicer-org () 366 | (progn 367 | (+org-pretty-mode 1) 368 | (mixed-pitch-mode 1) 369 | (hl-line-mode -1) 370 | (display-line-numbers-mode -1) 371 | (olivetti-mode 1) 372 | ;(org-num-mode 1) 373 | (org-superstar-mode -1) 374 | (org-indent-mode -1) 375 | )) 376 | 377 | (add-hook! 'org-mode-hook #'nicer-org) 378 | 379 | (after! org 380 | (setq org-startup-with-latex-preview nil ;don't preview latex 381 | ;org-latex-create-formula-image-program 'dvipng 382 | ;LaTeX-command "latex" 383 | ;latex-run-command "latex" 384 | org-startup-with-inline-images 1 ;always preview images 385 | ;org-hide-leading-stars 1 386 | org-startup-indented nil ; don't indent 387 | ; org-startup-folded nil 388 | org-hidden-keywords '(filetags title author date startup roam_tags) 389 | org-pretty-entities 1 ; show unicode characters 390 | org-num-max-level 3 ; no 1.1.1.2 391 | org-indirect-buffer-display 'other-window 392 | line-spacing 3 ; let me B R E A T H E 393 | ) 394 | (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin"))) 395 | 396 | (defun +org-tree-to-indirect-buffer-options (option) 397 | (let* ((old-value org-indirect-buffer-display)) 398 | (progn 399 | (setq org-indirect-buffer-display option) 400 | (org-tree-to-indirect-buffer) 401 | (setq org-indirect-buffer-display old-value)))) 402 | 403 | (defun +org-tree-to-indirect-other-window () 404 | (interactive) 405 | (+org-tree-to-indirect-buffer-options 'other-window)) 406 | 407 | (defun +org-tree-to-indirect-current-window () 408 | (interactive) 409 | (+org-tree-to-indirect-buffer-options 'current-window)) 410 | 411 | (defun +org-tree-to-indirect-dedicated-frame () 412 | (interactive) 413 | (+org-tree-to-indirect-buffer-options 'dedicated-frame)) 414 | 415 | (after! org 416 | (custom-set-faces! 417 | '((org-block) :background nil) 418 | ) 419 | (defface redd 420 | '((((class color) (min-colors 88) (background light)) 421 | :foreground "red")) 422 | "Red." 423 | :group 'basic-faces) 424 | 425 | (set-face-font 'org-quote (font-spec :family "Noto Serif")) 426 | (custom-set-faces! 427 | ;'(org-document-title :height 1.6 :weight bold) 428 | '(org-level-1 :height 1.3 :weight extrabold :slant normal) 429 | '(org-level-2 :height 1.2 :weight bold :slant normal) 430 | '(org-level-3 :height 1.1 :weight regular :slant normal) 431 | ;'(org-document-info :inherit 'nano-face-faded) 432 | '(org-document-title ;:foreground ,(doom-color 'black) 433 | :family "Roboto" 434 | :height 250 435 | :weight medium))) 436 | 437 | (after! org 438 | (setq org-emphasis-alist 439 | '(("*" (bold)) 440 | ("/" italic) 441 | ("_" underline) 442 | ("=" redd) 443 | ("~" code) 444 | ("+" (:strike-through t))))) 445 | 446 | (after! org 447 | (setq org-ellipsis " ▾ ") 448 | (appendq! +ligatures-extra-symbols 449 | `(:checkbox "☐" 450 | :pending "◼" 451 | :checkedbox "☑" 452 | :list_property "∷" 453 | :em_dash "—" 454 | :ellipses "…" 455 | :arrow_right "→" 456 | :arrow_left "←" 457 | :title "" 458 | :subtitle "𝙩" 459 | :author "𝘼" 460 | :date "𝘿" 461 | :property "" 462 | :options "⌥" 463 | :startup "⏻" 464 | :macro "𝓜" 465 | :html_head "🅷" 466 | :html "🅗" 467 | :latex_class "🄻" 468 | :latex_header "🅻" 469 | :beamer_header "🅑" 470 | :latex "🅛" 471 | :attr_latex "🄛" 472 | :attr_html "🄗" 473 | :attr_org "⒪" 474 | :begin_quote "❝" 475 | :end_quote "❞" 476 | :caption "☰" 477 | :header "›" 478 | :results "🠶" 479 | :begin_export "⏩" 480 | :end_export "⏪" 481 | :properties "" 482 | :end "∎" 483 | :priority_a ,(propertize "⚑" 'face 'all-the-icons-red) 484 | :priority_b ,(propertize "⬆" 'face 'all-the-icons-orange) 485 | :priority_c ,(propertize "■" 'face 'all-the-icons-yellow) 486 | :priority_d ,(propertize "⬇" 'face 'all-the-icons-green) 487 | :priority_e ,(propertize "❓" 'face 'all-the-icons-blue) 488 | :roam_tags nil 489 | :filetags "")) 490 | (set-ligatures! 'org-mode 491 | :merge t 492 | :checkbox "[ ]" 493 | :pending "[-]" 494 | :checkedbox "[X]" 495 | :list_property "::" 496 | :em_dash "---" 497 | :ellipsis "..." 498 | :arrow_right "->" 499 | :arrow_left "<-" 500 | :title "#+title:" 501 | :subtitle "#+subtitle:" 502 | :author "#+author:" 503 | :date "#+date:" 504 | :property "#+property:" 505 | :options "#+options:" 506 | :startup "#+startup:" 507 | :macro "#+macro:" 508 | :html_head "#+html_head:" 509 | :html "#+html:" 510 | :latex_class "#+latex_class:" 511 | :latex_header "#+latex_header:" 512 | :beamer_header "#+beamer_header:" 513 | :latex "#+latex:" 514 | :attr_latex "#+attr_latex:" 515 | :attr_html "#+attr_html:" 516 | :attr_org "#+attr_org:" 517 | :begin_quote "#+begin_quote" 518 | :end_quote "#+end_quote" 519 | :caption "#+caption:" 520 | :header "#+header:" 521 | :begin_export "#+begin_export" 522 | :end_export "#+end_export" 523 | :results "#+RESULTS:" 524 | :property ":PROPERTIES:" 525 | :end ":END:" 526 | :priority_a "[#A]" 527 | :priority_b "[#B]" 528 | :priority_c "[#C]" 529 | :priority_d "[#D]" 530 | :priority_e "[#E]" 531 | :roam_tags "#+roam_tags:" 532 | ;; :filetags "#+filetags:" 533 | :something "#+filetags:" 534 | :filetags "#+FILETAGS:") 535 | (plist-put +ligatures-extra-symbols :name "⁍") 536 | ) 537 | 538 | (with-eval-after-load 'org 539 | (plist-put org-format-latex-options :background 'default)) 540 | 541 | (use-package! org-caldav 542 | :after org 543 | :config (setq org-caldav-url "https://use03.thegood.cloud/remote.php/dav/calendars/hello@tefkah.com" 544 | org-caldav-calendar-id "personal" 545 | org-caldav-inbox "/Users/thomas/Notes/GTD/calendar.org" 546 | org-caldav-files '("/Users/thomas/Notes/GTD/calendar.org") 547 | org-caldav-sync-changes-to-org 'all 548 | org-icalendar-alarm-time 20 549 | org-icalendar-use-deadline '(event-if-not-todo todo-due) 550 | org-icalendar-use-scheduled '(event-if-not-todo) 551 | org-icalendar-include-todo 'all 552 | org-caldav-sync-todo t 553 | org-icalendar-categories '(local-tags) 554 | org-icalendar-timezone "Europe/Amsterdam")) 555 | 556 | (use-package! org-gtd 557 | :after org 558 | :config 559 | ;; where org-gtd will put its files. This value is also the default one. 560 | (setq org-gtd-directory "~/Notes/") 561 | ;; package: https://github.com/Malabarba/org-agenda-property 562 | ;; this is so you can see who an item was delegated to in the agenda 563 | (setq org-agenda-property-list '("DELEGATED_TO")) 564 | ;; I think this makes the agenda easier to read 565 | (setq org-agenda-property-position 'next-line) 566 | ;; package: https://www.nongnu.org/org-edna-el/ 567 | ;; org-edna is used to make sure that when a project task gets DONE, 568 | ;; the next TODO is automatically changed to NEXT. 569 | (setq org-edna-use-inheritance t) 570 | (org-edna-load) 571 | :bind 572 | (("C-c d c" . org-gtd-capture) ;; add item to inbox 573 | ("C-c d a" . org-agenda-list) ;; see what's on your plate today 574 | ("C-c d p" . org-gtd-process-inbox) ;; process entire inbox 575 | ("C-c d n" . org-gtd-show-all-next) ;; see all NEXT items 576 | ("C-c d s" . org-gtd-show-stuck-projects)) ;; see projects that don't have a NEXT item 577 | :init 578 | (bind-key "C-c c" 'org-gtd-clarify-finalize)) ;; the keybinding to hit when you're done editing an item in the processing phase 579 | 580 | (setq org-agenda-files '("~/Notes/inbox" "~/Notes/actionable.org" 581 | "~/Notes/agenda.org" "~/Notes/incubate.org" 582 | "~/Notes/openquestions.org")) 583 | 584 | (after! org 585 | (setq org-capture-templates `(("i" "Inbox" 586 | entry (file "~/Notes/GTD/calendar.org") 587 | "* TODO %?\n%U\n\n %i" 588 | :kill-buffer t) 589 | ("l" "Todo with link" 590 | entry (file "~/OneDrive/org-rom/inbox.org") 591 | "* %?\n%U\n\n %i\n %a" 592 | :kill-buffer t) 593 | ("m" "Meeting" 594 | entry (file+headline "/Users/thomas/Notes/GTD/calendar.org" "Future") 595 | ,(concat "* %? :meeting:\n" "<%<%Y-%m-%d %a %H:00>>") 596 | :kill-buffer t) 597 | ("o" "Open Question Thesis" 598 | entry (file+headline "~/Notes/openquestions.org" "Questions") 599 | "* OPEN %? \n %U\n"))) 600 | (set-face-attribute 'org-headline-done nil :strike-through t) 601 | ) 602 | 603 | (use-package! org-super-agenda 604 | :hook (org-agenda-mode . org-super-agenda-mode) 605 | ) 606 | 607 | 608 | (setq org-agenda-skip-scheduled-if-done t 609 | org-agenda-skip-deadline-if-done t 610 | org-agenda-include-deadlines t 611 | org-agenda-include-diary t 612 | org-agenda-block-separator nil 613 | org-agenda-compact-blocks t 614 | org-agenda-start-with-log-mode t 615 | org-agenda-start-day nil) 616 | (setq org-agenda-custom-commands 617 | '(("d" "Get Things DONE" 618 | ((agenda "" ((org-agenda-span 1) 619 | (org-super-agenda-groups 620 | '((:name "Today" 621 | :time-grid t 622 | :date nil 623 | :todo "TODAY" 624 | :scheduled nil 625 | :order 1))))) 626 | (alltodo "" ((org-agenda-overriding-header "") 627 | (org-super-agenda-groups 628 | '((:discard (:todo "TODO")) 629 | (:name "Important" 630 | :tag "Important" 631 | :priority "A" 632 | :order 1) 633 | (:name "Due Today" 634 | :deadline today 635 | :order 2) 636 | (:name "Due Soon" 637 | :deadline future 638 | :order 8) 639 | (:name "Overdue" 640 | :deadline past 641 | :order 7) 642 | (:name "Thesis" 643 | :tag "thesis" 644 | :order 10) 645 | (:name "ESN" 646 | :tag "esn" 647 | :order 12) 648 | (:name "JOTE" 649 | :tag "jote" 650 | :order 13) 651 | (:name "Emacs" 652 | :tag "emacs" 653 | :order 14) 654 | (:name "Home" 655 | :tag "home" 656 | :order 30) 657 | (:name "Waiting" 658 | :todo "WAITING" 659 | :order 20) 660 | (:name "Notes" 661 | :tag "notes" 662 | :order 20) 663 | ;(:name "Open Questions" 664 | ; :todo "OPEN" 665 | ; :order 3) 666 | (:name "trivial" 667 | :priority<= "C" 668 | :tag ("Trivial" "Unimportant") 669 | :todo ("SOMEDAY" ) 670 | :order 90) 671 | (:discard (:tag ("Chore" "Routine" "Daily"))))))))))) 672 | 673 | (setq default-frame-alist 674 | (append (list 675 | ;; '(font . "Roboto Mono Emacs Regular:size=14") 676 | '(min-height . 1) '(height . 45) 677 | '(min-width . 1) '(width . 81) 678 | '(vertical-scroll-bars . nil) 679 | '(internal-border-width . 30) 680 | '(left-fringe . 0) 681 | '(right-fringe . 0) 682 | '(tool-bar-lines . 0) 683 | '(menu-bar-lines . 0)))) 684 | 685 | (add-hook! 'solaire-mode-hook (set-face-background 'internal-border (face-background 'fringe))) 686 | 687 | (set-frame-parameter nil 'internal-border-width 60) 688 | 689 | (defvar writing-header--default-format header-line-format 690 | "Storage for the default `mode-line-format'. 691 | So it can be restored when 'writer-header-line-mode' is disabled.") 692 | 693 | (defvar writing-modeline--default-format mode-line-format) 694 | 695 | (define-minor-mode writing-header-line-mode 696 | "Adds a bar with the same color as the fringe as the header-line. 697 | Imitates the look of wordprocessors a bit." 698 | :init-value nil 699 | :global nil 700 | (if writing-header-line-mode 701 | (progn 702 | (setq header-line-format 703 | (concat 704 | (propertize " " 'display (list 'space :width 'left-fringe) 'face 'fringe) 705 | (propertize " " 'display (list 'space :width 'left-margin) 'face (list (list :height 400) 'default)) 706 | (propertize " " 'display (list 'space :width 'text) 'face (list (list :height 400) 'default)) 707 | ;(propertize (format " %dW" (count-words (point-min) (point-max))) 'face 'default) 708 | (propertize " " 'display (list 'space :width 'left-margin) 'face (list (list :height 400) 'default)) 709 | ;;(propertize (format " %dW" (count-words (point-min) (point-max))) 'face 'fringe) 710 | ;; '("" mode-line-misc-info) 711 | (propertize " " 'display (list 'space :width 'left-fringe) 'face 'fringe))) ; 712 | (setq mode-line-format header-line-format)) 713 | (setq header-line-format writing-header--default-format 714 | mode-line-format writing-modeline--default-format))) 715 | 716 | (defcustom double-modeline-margin-inner-height 60 717 | "inner" 718 | :type 'integer) 719 | (defcustom double-modeline-margin-outer-height 10 720 | "outer" 721 | :type 'integer) 722 | 723 | (after! org 724 | (require 'svg)) 725 | (defun make-svg-rectangle (width height-1 bg-1 height-2 bg-2) 726 | (let* ((svg (svg-create width (+ height-1 height-2)))) 727 | (svg-rectangle svg 0 0 width height-1 :fill-color bg-1) 728 | (svg-rectangle svg 0 height-1 width height-2 :fill-color bg-2) 729 | svg)) 730 | 731 | (defun make-svg-rectangles (width height-1 bg-1 &rest other) 732 | (let* ((temptt 0) 733 | (height-temp height-1) 734 | (svg (svg-create width 735 | (+ height-1 736 | (dotimes 737 | (i (/ (length other) 2) temptt) 738 | (setq temptt 739 | (+ 740 | (nth (* i 2) other) 741 | temptt))))))) 742 | (svg-rectangle svg 0 0 width height-1 :fill-color bg-1) 743 | (when other 744 | (dotimes (i (/ (length other) 2)) 745 | (svg-rectangle svg 0 746 | (if (eq i 0) height-1 747 | (setq-local height-temp 748 | (+ height-temp 749 | (nth (* (- i 2) 2) other)))) 750 | width 751 | (nth (* i 2) other) 752 | :fill-color (nth (+ (* i 2) 1) other)))) 753 | svg)) 754 | 755 | (defun mode-line-compose (height-1 bg-1 height-2 bg-2 756 | header) 757 | (let* ((fringe-width (car (window-fringes nil))) 758 | (body-width (window-body-width nil t)) 759 | (margin-width (* (frame-char-width) 760 | (+ (car (window-margins)) 761 | (cdr (window-margins)))))) 762 | (concat 763 | (format-mode-line 764 | (propertize " " 'display (svg-image 765 | (make-svg-rectangle fringe-width height-1 766 | bg-1 height-2 bg-1)))) 767 | (format-mode-line 768 | (propertize " " 'display (svg-image 769 | (if header 770 | (make-svg-rectangle 771 | (+ margin-width body-width) 772 | height-1 bg-1 height-2 bg-2) 773 | (make-svg-rectangle 774 | (+ margin-width body-width) 775 | height-2 bg-2 height-1 bg-1))))) 776 | (format-mode-line 777 | (propertize " " 'display (svg-image 778 | (make-svg-rectangle fringe-width height-1 779 | bg-1 height-2 bg-1))))))) 780 | 781 | (defvar double-modeline--default-header-format header-line-format 782 | "Storage for the default `mode-line-format'. 783 | So it can be restored when 'writer-header-line-mode' is disabled.") 784 | 785 | (defvar double-modeline--default-modeline-format mode-line-format) 786 | 787 | (define-minor-mode double-header-line-mode 788 | "Adds a bar with the same color as the fringe as the header-line. 789 | Imitates the look of wordprocessors a bit." 790 | :init-value nil 791 | :global nil 792 | (if double-header-line-mode 793 | (progn 794 | (set-face-attribute 'mode-line nil :box nil) 795 | (set-face-attribute 'header-line nil :box nil) 796 | (set-face-attribute 'mode-line-inactive nil :box nil) 797 | (setq header-line-format '((:eval (mode-line-compose 798 | double-modeline-margin-outer-height 799 | (face-background 'fringe) 800 | double-modeline-margin-inner-height 801 | (face-background 'default) 802 | t 803 | )))) 804 | (setq mode-line-format '((:eval (mode-line-compose 805 | double-modeline-margin-outer-height 806 | (face-background 'fringe) 807 | double-modeline-margin-inner-height 808 | (face-background 'default) 809 | nil 810 | ))))) 811 | (setq header-line-format 'double-modeline--default-header-format 812 | mode-line-format 'double-modeline--default-modeline-format))) 813 | 814 | (after! olivetti-mode (setq double-modeline-margin-inner-height (round (* 0.6 (* (frame-char-width) (car (window-margins))))))) 815 | 816 | (use-package! page-break-mode) 817 | 818 | (use-package! olivetti 819 | :after org 820 | ;:hook (olivetti-mode . double-header-line-mode) 821 | :config 822 | (setq olivetti-min-body-width 50 823 | olivetti-body-width 68 824 | olivetti-style 'fancy ; fantastic new layout 825 | olivetti-margin-width 12) 826 | (add-hook! 'olivetti-mode-hook (window-divider-mode -1)) 827 | (add-hook! 'olivetti-mode-hook (set-face-attribute 'window-divider nil :foreground (face-background 'fringe) :background (face-background 'fringe))) 828 | (add-hook! 'olivetti-mode-hook (set-face-attribute 'vertical-border nil :foreground (face-background 'fringe) :background (face-background 'fringe)))) 829 | 830 | (require 'org-inlinetask) 831 | 832 | ;(use-package! org-sidebar 833 | ; :after org 834 | ; :config 835 | ;(setq org-sidebar-default-fns '(org-sidebar--todo-items)) 836 | ;(add-hook! 'org-sidebar-window-after-display-hook (solaire-mode 1)) 837 | ; ) 838 | 839 | (after! org 840 | (remove-hook 'org-agenda-finalize-hook '+org-exclude-agenda-buffers-from-workspace-h) 841 | (remove-hook 'org-agenda-finalize-hook 842 | '+org-defer-mode-in-agenda-buffers-h)) 843 | 844 | (defun thomas/org-get-overview () 845 | "Open outline and sidebar." 846 | (progn 847 | (org-ol-tree) 848 | (org-sidebar))) 849 | 850 | (use-package! focus 851 | :after org-roam 852 | :config 853 | (add-to-list 'focus-mode-to-thing '(org-mode . paragraph)) 854 | ) 855 | ;(require 'nano-writer) 856 | 857 | ;;;;; 858 | 859 | 860 | ;; 861 | ;; Custom Minor Modes 862 | ;; 863 | ;;;;; 864 | 865 | (define-minor-mode prot/scroll-center-cursor-mode 866 | "Toggle centred cursor scrolling behavior" 867 | :init-value nil 868 | :lighter " S=" 869 | :global nil 870 | (if prot/scroll-center-cursor-mode 871 | (setq-local scroll-margin (* (frame-height) 2) 872 | scroll-conservatively 0 873 | maximum-scroll-margin 0.5) 874 | (dolist (local '(scroll-preserve-screen-position 875 | scroll-conservatively 876 | maximum-scroll-margin 877 | scroll-margin)) 878 | (kill-local-variable `,local))) 879 | ) 880 | 881 | (define-minor-mode prot/variable-pitch-mode 882 | "Toggle 'mixed-pitch-modei, except for programming modes" 883 | :init-value nil 884 | :global nil 885 | (if prot/variable-pitch-mode 886 | (unless (derived-mode-p 'prog-mode) 887 | (variable-pitch-mode 1)) 888 | (variable-pitch-mode -1))) 889 | 890 | (define-minor-mode prot/display-line-number-mode 891 | "Disable line numbers, except for programming modes." 892 | :init-value nil 893 | :global nil 894 | (if prot/display-line-number-mode 895 | (unless (derived-mode-p 'prog-mode) 896 | (display-line-numbers-mode -1)) 897 | (display-line-numbers-mode 1))) 898 | 899 | ;;;;;;;; 900 | ;; 901 | ;; org-latex-export 902 | ;; 903 | ;;;;;;;; 904 | 905 | (after! org 906 | (add-to-list 'org-latex-classes 907 | '("tufte" 908 | "\\documentclass{tufte-book}" 909 | ("\\part{%s}" . "\\part*{%s}") 910 | ("\\chapter{%s}" . "\\chapter*{%s}") 911 | ("\\section{%s}" . "\\section*{%s}") 912 | ("\\subsection{%s}" . "\\subsection*{%s}") 913 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) 914 | (add-to-list 'org-latex-classes 915 | '("memoir" 916 | "\\documentclass{memoir}" 917 | ("\\part{%s}" . "\\part*{%s}") 918 | ("\\chapter{%s}" . "\\chapter*{%s}") 919 | ("\\section{%s}" . "\\section*{%s}") 920 | ("\\subsection{%s}" . "\\subsection*{%s}") 921 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) 922 | ) 923 | (setq org-latex-text-markup-alist '((bold . "\\textbf{%s}") 924 | (code . protectedtexttt) 925 | (italic . "\\emph{%s}") 926 | (strike-through . "\\sout{%s}") 927 | (underline . "\\uline{%s}") 928 | (verbatim . "{\\color{red}%s}"))) 929 | (setq org-latex-default-packages-alist 930 | '( 931 | ;("AUTO" "inputenc" t 932 | ; ("pdflatex")) 933 | ;("T1" "fontenc" t 934 | ; ("pdflatex")) 935 | ("utf8" "inputenc" nil) 936 | ("" "graphicx" t) 937 | ("" "grffile" t) 938 | ("" "longtable" nil) 939 | ("" "wrapfig" nil) 940 | ("" "rotating" nil) 941 | ("normalem" "ulem" t) 942 | ("" "amsmath" t) 943 | ("" "textcomp" t) 944 | ("" "amssymb" t) 945 | ("" "capt-of" nil) 946 | ("style=apa, backend=biber" "biblatex" nil) 947 | ("" "braket" nil) 948 | ("" "xcolor" nil) 949 | ("" "hyperref" nil)) 950 | ) 951 | (setq org-latex-pdf-process 952 | '("latexmk -shell-escape -bibtex -pdf %f -f") 953 | org-latex-compiler "xelatex" 954 | org-latex-bib-compiler "biber") 955 | ) 956 | ;(add-to-list 'org-latex-default-packages-alist 957 | ; '("" "xcolor" nil)) 958 | ;(add-to-list 'org-latex-default-packages-alist 959 | ; '("" "braket" nil)) 960 | ;(add-to-list 'org-latex-default-packages-alist '("style=apa, backend=biber" "biblatex" nil))) 961 | ;(setq org-format-latex-header (concat org-format-latex-header "\n\\"))) 962 | 963 | (add-hook! 'latex-mode-hook (setq TeX-engine 'luatex) 99) 964 | 965 | ; (call-process TeX-shell nil (TeX-process-buffer-name file) nil 966 | ; TeX-shell-command-option (concat command file)))) 967 | 968 | (after! latex 969 | (setq 970 | TeX-view-program-list 971 | '(("Evince" "evince --page-index=%(outpage) %o") 972 | ("preview-pane" latex-preview-pane-mode))) 973 | (setq TeX-view-program-selection 974 | '((output-pdf "Evince") 975 | (output-dvi "open") 976 | (output-pdf "open") 977 | (output-html "open") 978 | (output-pdf "preview-pane")))) 979 | 980 | (after! latex 981 | (defun latex-dwim () 982 | "Compile the current file if it's a .tex file using LaTeXMK. 983 | Otherwise compile the TeX file with the same name as the current TeXey file, 984 | such as a .cls or .bib. 985 | Otherwise compile all the .tex files you find using LaTexMK." 986 | (interactive) 987 | (save-buffer) 988 | (if-let ((files (thomas/find-tex-file)) 989 | (command 990 | "latexmk -pdf -pdflatex=lualatex --synctex=1 -interaction=nonstopmode -file-line-error ") 991 | (hook (nth 2 (assoc "LatexMk" TeX-command-list)))) 992 | (if (stringp files) 993 | (TeX-run-format "LatexMk" (concat command files) files) 994 | (dolist (file files) 995 | (TeX-run-format "LatexMk" (concat command file) file))) 996 | (message "No file found, whoops."))) 997 | 998 | (defun thomas/find-tex-file () 999 | "Find the correct TeX file(s)." 1000 | (let* ((fname (buffer-file-name)) 1001 | (ext (file-name-extension fname)) 1002 | (potential-main (f-join (f-slash (f-parent fname)) (concat (f-base fname) ".tex"))) 1003 | (alltex (f-entries (f-parent fname) (lambda (f) (f-ext-p f "tex")))) 1004 | (correct-file 1005 | (cond ((string= ext "tex") 1006 | fname) 1007 | ((seq-contains-p '("bib" "cls" "sty") ext) 1008 | (if (f-exists-p potential-main) 1009 | potential 1010 | alltex)) 1011 | (t nil)))) 1012 | correct-file))) 1013 | 1014 | (map! :map 'doom-leader-regular-map 1015 | :desc "LatexMk dwim" "l" #'latex-dwim) 1016 | 1017 | (use-package! eva 1018 | :init 1019 | (setq ess-history-file "~/OneDrive/self/data/.Rhistory") 1020 | (setq ess-ask-for-ess-directory nil) 1021 | (setq eva-ai-name "Ea" 1022 | eva-user-name "Thomas" 1023 | eva-user-birthday "2021-07-16" 1024 | eva-user-short-title "Bruh" 1025 | eva-fallback-to-emacs-idle t) 1026 | ; (setq eva--idle-secs-fn #'eva--idle-secs-gnome) 1027 | (setq eva-idle-log-path "~/OneDrive/self/data/idle.tsv") 1028 | (setq eva-buffer-focus-log-path "~/OneDrive/self/data/buffer-focus.tsv") 1029 | (setq eva-buffer-info-path "~/OneDrive/self/data/buffer-info.tsv") 1030 | (setq eva-main-ledger-path "~/OneDrive/self/journal/finances/l.ledger") 1031 | (setq eva-main-datetree-path "~/Notes/diary.org") 1032 | :config 1033 | (setq org-journal-dir "~/Notes/journal") 1034 | (setq org-journal-file-format "%F.org") 1035 | (require 'eva-builtin) 1036 | (require 'eva-activity) 1037 | (add-hook 'eva-after-load-vars-hook #'eva-check-dangling-clock) 1038 | (add-hook 'eva-after-load-vars-hook #'eva-check-org-variables) 1039 | (setq eva-items 1040 | (list 1041 | (eva-item-create :fn #'eva-greet 1042 | :min-hours-wait 1) 1043 | 1044 | (eva-item-create :fn #'eva-query-mood 1045 | :dataset "~/OneDrive/self/data/mood.tsv" 1046 | :min-hours-wait 1) 1047 | 1048 | (eva-item-create :fn #'eva-query-activity 1049 | :dataset "~/OneDrive/self/data/activities.tsv" 1050 | :min-hours-wait 1) 1051 | 1052 | (eva-item-create :fn #'eva-present-diary 1053 | :max-successes-per-day 1) 1054 | 1055 | (eva-item-create :fn #'eva-query-weight 1056 | :dataset "~/OneDrive/self/data/weight.tsv" 1057 | :max-entries-per-day 1) 1058 | 1059 | (eva-item-create :fn #'eva-plot-weight 1060 | :max-entries-per-day 1) 1061 | 1062 | (eva-item-create :fn #'eva-query-sleep 1063 | :dataset "~/OneDrive/self/data/sleep.tsv" 1064 | :min-hours-wait 5 1065 | :lookup-posted-time t) 1066 | 1067 | (eva-item-create :fn #'eva-present-ledger-report) 1068 | 1069 | (eva-item-create :fn #'eva-present-org-agenda) 1070 | 1071 | (eva-item-create :fn #'eva-query-ingredients 1072 | :dataset "~/OneDrive/self/data/ingredients.tsv" 1073 | :min-hours-wait 5) 1074 | 1075 | (eva-item-create :fn #'eva-query-cold-shower 1076 | :dataset "~/OneDrive/self/data/cold.tsv" 1077 | :max-entries-per-day 1) 1078 | 1079 | ;; you can inline define the functions too 1080 | (eva-item-create 1081 | :fn (eva-defun my-bye () 1082 | (message (eva-emit "All done for now.")) 1083 | (bury-buffer (eva-buffer-chat))) 1084 | :min-hours-wait 0))) 1085 | (transient-replace-suffix 'eva-dispatch '(0) 1086 | '["General actions" 1087 | ("q" "Quit" bury-buffer) 1088 | ("l" "View Ledger report" eva-present-ledger-report) 1089 | ("f" "View Ledger file" eva-present-ledger-file) 1090 | ("a" "View Org agenda" org-agenda-list)]) 1091 | 1092 | (define-key eva-chat-mode-map (kbd "l") #'eva-present-ledger-report) 1093 | (define-key eva-chat-mode-map (kbd "a") #'org-agenda-list) 1094 | 1095 | ;; Activities 1096 | (setq eva-activity-list 1097 | (list (eva-activity-create :name "sleep" 1098 | :cost-false-pos 3 1099 | :cost-false-neg 3) 1100 | 1101 | (eva-activity-create :name "studying" 1102 | :cost-false-pos 8 1103 | :cost-false-neg 8) 1104 | 1105 | (eva-activity-create :name "coding" 1106 | :cost-false-pos 5 1107 | :cost-false-neg 5) 1108 | 1109 | (eva-activity-create :name "working" 1110 | :cost-false-pos 5 1111 | :cost-false-neg 5) 1112 | (eva-activity-create :name "unknown" 1113 | :cost-false-pos 0 1114 | :cost-false-neg 0))) 1115 | (eva-mode)) 1116 | 1117 | ;(use-package! tree-sitter 1118 | ; :config 1119 | ; (require 'tree-sitter-langs) 1120 | ; (global-tree-sitter-mode) 1121 | ; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) 1122 | 1123 | 1124 | ;(use-package tree-sitter-langs 1125 | ; :ensure t 1126 | ; :after tree-sitter 1127 | ; :config 1128 | ; (tree-sitter-require 'tsx) 1129 | ;(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))) 1130 | 1131 | (use-package! info-colors 1132 | :commands (info-colors-fontify-node)) 1133 | 1134 | (add-hook 'Info-selection-hook 'info-colors-fontify-node) 1135 | 1136 | (map! "C-w" nil) 1137 | (global-set-key (kbd "C-") #'evil-window-next) 1138 | (global-set-key (kbd "C-") #'evil-window-prev) 1139 | (global-set-key (kbd "C-w") #'ace-window) 1140 | 1141 | (map! 1142 | :nvig "C-" #'evil-window-prev 1143 | :nvig "C-w" #'ace-window) 1144 | (map! :nvig "C-" #'evil-window-next) 1145 | 1146 | (map! :nvig "C-'" #'er/expand-region) 1147 | 1148 | (evil-workman-global-mode t) 1149 | 1150 | (map! 1151 | :map evil-window-map 1152 | "y" #'evil-window-left 1153 | "Y" #'+evil/window-move-left 1154 | "n" #'evil-window-down 1155 | "N" #'+evil/window-move-down 1156 | "e" #'evil-window-up 1157 | "E" #'+evil/window-move-up 1158 | "o" #'evil-window-right 1159 | "O" #'+evil/window-move-right) 1160 | 1161 | (defun set-evil-keybindings () 1162 | (progn 1163 | ;(iscroll-mode 1) 1164 | (setq evil-org-movement-bindings 1165 | '((up . "e") 1166 | (down . "n") 1167 | (left . "y") 1168 | (right . "o"))) 1169 | (evil-define-key 'normal evil-org-mode-map 1170 | "o" 'evil-forward-char 1171 | "l" 'evil-org-open-below 1172 | "L" 'evil-org-open-above 1173 | "gy" 'org-backward-element 1174 | "gn" 'org-down-element 1175 | "ge" 'org-up-element 1176 | "go" 'org-forward-element 1177 | "n" 'evil-next-visual-line 1178 | "e" 'evil-previous-visual-line 1179 | ; "n" 'iscroll-forward-line 1180 | ; "e" 'iscroll-previous-line 1181 | "N" 'evil-next-line 1182 | "E" 'evil-previous-line 1183 | (kbd "C-n") 'follow-scroll-up 1184 | (kbd "C-e") 'follow-scroll-down 1185 | "zn" '+org-tree-to-indirect-other-window 1186 | "zs" '+org-tree-to-indirect-current-window 1187 | "zv" '+org-tree-to-indirect-other-frame) 1188 | )) 1189 | 1190 | (after! org (set-evil-keybindings)) 1191 | 1192 | ;; JUST TO BE REALLY FUCKING SURE 1193 | (add-hook 'org-mode-hook #'set-evil-keybindings 99) 1194 | (defun iscroll-mode-keybinds () 1195 | (when (eq iscroll-mode t) 1196 | (evil-define-key 'normal evil-org-mode-map 1197 | "n" 'iscroll-forward-line 1198 | "e" 'iscroll-previous-line))) 1199 | 1200 | (use-package! vertico-posframe 1201 | :after vertico 1202 | :config (vertico-posframe-mode 1) 1203 | (setq vertico-posframe-border-width 10 1204 | vertico-posframe-parameters '((internal-border-width . 10))) 1205 | (add-hook! 'vertico-posframe-mode-hook (set-face-background 'vertico-posframe-border (face-background 'fringe)))) 1206 | 1207 | (defun margin-width-pixel (&optional right) 1208 | "Return the width of the left or optionally right margin in pixels." 1209 | (if (window-margins) 1210 | (if right 1211 | (* (frame-char-width) (cdr (window-margins))) ;;right margin 1212 | (* (frame-char-width) (car (window-margins)))) 1213 | 0)) 1214 | 1215 | (defun org-latex-refresh () 1216 | (interactive) 1217 | (progn 1218 | (org-clear-latex-preview) 1219 | (org--latex-preview-region (buffer-end -1) (buffer-end 1)))) 1220 | 1221 | (defun org-latex-clear-preview () 1222 | (interactive) 1223 | (org-clear-latex-preview)) 1224 | 1225 | (server-start) 1226 | 1227 | (after! doom-modeline 1228 | (setq doom-modeline-enable-word-count t 1229 | doom-modeline-header-line nil 1230 | ;doom-modeline-hud nil 1231 | doom-themes-padded-modeline t 1232 | doom-flatwhite-brighter-modeline nil 1233 | doom-plain-brighter-modeline nil)) 1234 | (add-hook! 'doom-modeline-mode-hook 1235 | (progn 1236 | (set-face-attribute 'header-line nil 1237 | :background (face-background 'mode-line) 1238 | :foreground (face-foreground 'mode-line)) 1239 | )) 1240 | 1241 | ;;;;;;;;;;;;; 1242 | ;;; 1243 | ;;; Other 1244 | ;;; 1245 | ;;;;;;;;;;;; 1246 | 1247 | (setq vterm-shell "/usr/bin/fish") 1248 | 1249 | (setq evil-escape-key-sequence "qd") 1250 | 1251 | (map! :leader 1252 | (:prefix-map ("r" . "regular") 1253 | :desc "edit org-block" "e" #'org-edit-special 1254 | :desc "find note" "f" #'org-roam-node-find 1255 | :desc "find ref" "F" #'org-roam-ref-find 1256 | :desc "sync calendar" "s" #'org-caldav-sync 1257 | :desc "center scroll" "S" #'prot/scroll-center-cursor-mode 1258 | :desc "toggle buffer" "b" #'org-roam-buffer-toggle 1259 | :desc "insert note" "i" #'org-roam-node-insert 1260 | :desc "rg search roam" "g" #'org-roam-rg-search 1261 | :desc "quit notes" "q" #'org-noter-kill-session 1262 | :desc "tag (roam)" "t" #'org-roam-tag-add 1263 | :desc "tag (org)" "T" #'org-set-tags-command 1264 | :desc "pomodoro" "p" #'org-pomodoro 1265 | :desc "rebuid db" "d" #'org-roam-db-build-cache 1266 | :desc "cite" "c" #'helm-bibtex 1267 | :desc "thesaurus this word" "w" #'powerthesaurus-lookup-word-at-point 1268 | :desc "thesaurus lookup word" "W" #'powerthesaurus-lookup-word 1269 | :desc "outline" "o" #'org-ol-tree 1270 | (:prefix ("r" . "orui") 1271 | :desc "orui-mode" "r" #'org-roam-ui-mode 1272 | :desc "zoom" "z" #'orui-node-zoom 1273 | :desc "open" "o" #'orui-open 1274 | :desc "local" "l" #'orui-node-local 1275 | :desc "sync theme" "t" #'orui-sync-theme 1276 | :desc "follow" "f" #'orui-follow-mode) 1277 | (:prefix ("m" . "transclusion") 1278 | :desc "make link" "m" #'org-transclusion-make-from-link 1279 | :desc "transclusion mode" "t" #'org-transclusion-mode 1280 | :desc "add at point" "a" #'org-transclusion-add-at-point 1281 | :desc "add all in buffer" "A" #'org-transclusion-add-all-in-buffer 1282 | :desc "remove at point" "r" #'org-transclusion-remove-at-point 1283 | :desc "remove all in buffer" "R" #'org-transclusion-remove-all-in-buffer 1284 | :desc "start live edit" "s" #'org-transclusion-live-sync-start-at-point 1285 | :desc "stop live edit" "S" #'org-transclusion-live-sync-exit-at-point) ) 1286 | (:prefix ("d" . "GTD") 1287 | :desc "process inbox" "p"#'org-gtd-process-inbox 1288 | :desc "agenda list" "a"#'org-agenda-list 1289 | :desc "capture" "c"#'org-gtd-capture 1290 | :desc "show next" "n" #'org-gtd-show-all-next 1291 | :desc "show stuck project" "s" #'org-gtd-show-stuck-projects)) 1292 | -------------------------------------------------------------------------------- /config.org: -------------------------------------------------------------------------------- 1 | 'load-path "~/.config/doom/elisp") 2 | #+end_src 3 | 4 | Yooooooooooo let's go 5 | 6 | #+BEGIN_SRC emacs-lisp :tangle yes 7 | ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- 8 | 9 | ;; Place your private configuration here! Remember, you do not need to run 'doom 10 | ;; sync' after modifying this file! 11 | 12 | 13 | ;; Some functionality uses this to identify you, e.g. GPG configuration, email 14 | ;; clients, file templates and snippets. 15 | (setq user-full-name "Thomas F. K. Jorna" 16 | user-mail-address "jorna@jtrialerror.com") 17 | #+end_src 18 | ** ... 19 | #+begin_src emacs-lisp :tangle yes 20 | 21 | ;; If you use `org' and don't want your org files in the default location below, 22 | ;; change `org-directory'. It must be set before org loads! 23 | (setq org-directory "~/Notes/" 24 | org-roam-directory "~/Notes") 25 | 26 | ;; This determines the style of line numbers in effect. If set to `nil', line 27 | ;; numbers are disabled. For relative line numbers, set this to `relative'. 28 | (setq display-line-numbers-type t) 29 | 30 | ;; Here are some additional functions/macros that could help you configure Doom: 31 | ;; 32 | ;; - `load!' for loading external *.el files relative to this one 33 | ;; - `use-package!' for configuring packages 34 | ;; - `after!' for running code after a package has loaded 35 | ;; - `add-load-path!' for adding directories to the `load-path', relative to 36 | ;; . 37 | #+end_src 38 | * UI 39 | 40 | 41 | ** Theme 42 | *** Nano 43 | 44 | Basic things you can keep in place without being locked into nano 45 | #+begin_src emacs-lisp :tangle no 46 | (setq nano-font-family-monospaced "Overpass Mono") 47 | (setq nano-font-family-proportional "Noto Serif") 48 | (setq nano-font-size 13) 49 | 50 | ;(defvar nano-theme-light-var t) 51 | (require 'disp-table) 52 | (require 'nano-theme-dark) 53 | (require 'nano-theme-light) 54 | ;(require 'nano-layout) 55 | ;(require 'nano-base-colors) 56 | (require 'nano-faces) 57 | (nano-faces) 58 | #+end_src 59 | 60 | The real fun begins here 61 | #+begin_src emacs-lisp :tangle no 62 | (require 'nano-theme) 63 | (nano-theme) 64 | (require 'nano-modeline) 65 | ;(require 'nano-writer) 66 | ;;(nano-theme) 67 | ;; 68 | #+end_src 69 | 70 | 71 | #+begin_src emacs-lisp :tangle yes 72 | (setq default-frame-alist 73 | (append (list 74 | ;; '(font . "Roboto Mono Emacs Regular:size=14") 75 | '(min-height . 1) '(height . 45) 76 | '(min-width . 1) '(width . 81) 77 | '(vertical-scroll-bars . nil) 78 | '(internal-border-width . 20) 79 | '(left-fringe . 0) 80 | '(right-fringe . 0) 81 | '(tool-bar-lines . 0) 82 | '(menu-bar-lines . 0)))) 83 | 84 | 85 | 86 | #+end_src 87 | *** Doom 88 | I'm either using nano or doom-theme, this is the latter 89 | #+begin_src emacs-lisp :tangle yes 90 | (setq doom-theme 'doom-flatwhite) 91 | #+end_src 92 | 93 | To set the fringes how i want them, i.e, in the opposite color of the background. 94 | #+begin_src emacs-lisp :tangle yes 95 | (add-hook! 'solaire-mode-hook 96 | (set-face-attribute 'fringe nil :background (face-background 'solaire-default-face)) 97 | ) 98 | #+end_src 99 | 100 | ** Fonts 101 | 102 | It's nice to have both mono and proportional fonts in org-mode, but mostly proportional, as we are writing. 103 | #+begin_src emacs-lisp :tangle yes 104 | (use-package! mixed-pitch 105 | :hook (org-mode . mixed-pitch-mode) 106 | :config 107 | (setq mixed-pitch-face 'variable-pitch)) 108 | #+end_src 109 | And actually, I would like that in a lot of modes tbh 110 | 111 | #+begin_src emacs-lisp :tangle yes 112 | (add-hook! 'special-mode-hook (mixed-pitch-mode 1) 113 | 'delve-mode-hook (mixed-pitch-mode 1)) 114 | #+end_src 115 | 116 | There's not a lot of good fonts I've noticed. Fira code is the one I keep coming back to. 117 | #+begin_src emacs-lisp :tangle yes 118 | (setq doom-font (font-spec :family "FiraCode Nerd Font" :size 15 :weight 'light) 119 | doom-variable-pitch-font (font-spec :family "Roboto" :style "Regular" :size 12 :weight 'regular)) 120 | 121 | ;; There are two ways to load a theme. Both assume the theme is installed and 122 | ;; available. You an either set `doom-theme' or manually load a theme with the 123 | ;; `load-theme' function. This is the default: 124 | #+end_src 125 | 126 | ** Feel 127 | 128 | It's been a while since I checked but =good-scroll-mode= has gotten quite good since I last used it, so let's just use it all the time! 129 | #+begin_src emacs-lisp :tangle yes 130 | (use-package! good-scroll 131 | :init (good-scroll-mode 1)) 132 | #+end_src 133 | 134 | ** Tooltips 135 | 136 | 137 | Love hovering 138 | #+begin_src emacs-lisp :tangle yes 139 | (tooltip-mode 1) 140 | #+end_src 141 | 142 | ** Modeline 143 | *** Doom-modeline settings 144 | 145 | #+begin_src elisp :tangle yes 146 | (after! doom-modeline 147 | (setq doom-modeline-enable-word-count t 148 | doom-modeline-header-line nil 149 | ;doom-modeline-hud nil 150 | doom-themes-padded-modeline t 151 | doom-flatwhite-brighter-modeline nil 152 | doom-plain-brighter-modeline nil)) 153 | (add-hook! 'doom-modeline-mode-hook 154 | (progn 155 | (set-face-attribute 'header-line nil 156 | :background (face-background 'mode-line) 157 | :foreground (face-foreground 'mode-line)) 158 | )) 159 | #+end_src 160 | 161 | Trying to make my own thing work 162 | #+begin_src emacs-lisp :tangle yes 163 | (after! doom-modeline 164 | (doom-modeline-def-modeline 'main 165 | '(bar matches buffer-info vcs word-count) 166 | '(buffer-position misc-info major-mode))) 167 | #+end_src 168 | 169 | ** Centaur tabs 170 | 171 | Love me some tabs, but the doom defaults could be better. 172 | 173 | Better label function: org-roams timestamp in front of the file is nice, but not very legible. 174 | 175 | #+begin_src emacs-lisp :tangle yes 176 | (defun thomas/centaur-tabs-buffer-tab-label (tab) 177 | "Return a label for TAB. 178 | That is, a string used to represent it on the tab bar." 179 | ;; Init tab style. 180 | ;; Render tab. 181 | (format " %s" 182 | (let* ((rawbufname (if centaur-tabs--buffer-show-groups 183 | (centaur-tabs-tab-tabset tab) 184 | (buffer-name (car tab)))) 185 | (formatted-bufname (if (string= (file-name-extension rawbufname) "org") 186 | (if (and (> (length rawbufname) 14) 187 | (string-match-p "[0-9]\\{14\\}" (substring rawbufname 0 14))) 188 | (substring rawbufname 15) 189 | rawbufname) 190 | rawbufname)) 191 | (bufname (concat " " formatted-bufname))) 192 | (if (> centaur-tabs-label-fixed-length 0) 193 | (centaur-tabs-truncate-string centaur-tabs-label-fixed-length bufname) 194 | bufname)))) 195 | #+end_src 196 | 197 | #+begin_src emacs-lisp :tangle yes 198 | (after! centaur-tabs 199 | (setq centaur-tabs-display-line nil) 200 | (setq centaur-tabs-style "bar" 201 | centaur-tabs-tab-label-function #'thomas/centaur-tabs-buffer-tab-label 202 | centaur-tabs-label-fixed-length 20 203 | centaur-tabs-height 40 204 | centaur-tabs-bar-height 50 205 | centaur-tabs-close-button "✕" 206 | centaur-tabs-icon-scale-factor 0.8) 207 | (centaur-tabs-change-fonts "Roboto Sans" 140) 208 | (set-face-background 'centaur-tabs-selected (doom-lighten (face-background 'default )0.1)) 209 | (set-face-background 'centaur-tabs-selected-modified (doom-lighten (face-background 'default )0.1))) 210 | #+end_src 211 | 212 | #+begin_src emacs-lisp :tangle yes 213 | 214 | #+end_src 215 | * Org-Mode 216 | 217 | 218 | Allows you to jump in and out of latex fragments without using `C-c C-x C-l` all the time, beautiful. 219 | #+begin_src emacs-lisp :tangle yes 220 | (use-package! org-fragtog 221 | :after org 222 | :hook (org-mode . org-fragtog-mode)) 223 | #+end_src 224 | 225 | Org-appear for everything else. 226 | #+begin_src emacs-lisp :tangle yes 227 | (use-package! org-appear 228 | :after org 229 | :hook (org-mode . org-appear-mode) 230 | :config (setq 231 | org-appear-autolinks t 232 | org-appear-autoentities t 233 | org-appear-autosubmarkers t )) 234 | #+end_src 235 | 236 | Buggy yet beautiful transclusion of org-content from another file in the current buffer. Very cool that this is possible, but I don't use it consistently as the "code" is kind of a bitch to write and gets rid of org-roam links. 237 | #+begin_src emacs-lisp :tangle yes 238 | (use-package! org-transclusion 239 | :after org-roam) 240 | #+end_src 241 | 242 | Having zero-width spaces can be very useful /sometimes/​! 243 | #+begin_src emacs-lisp :tangle yes 244 | (map! :map org-mode-map 245 | :nie "C-M-SPC" (cmd! (insert "\u200B"))) 246 | #+end_src 247 | 248 | ** Org-roam 249 | Fantastic package which allows you to backlink etc. 250 | 251 | *** v2 baby 252 | #+begin_src emacs-lisp :tangle yes 253 | (setq org-roam-v2-ack t) 254 | 255 | (use-package! org-roam 256 | :after org 257 | :config 258 | (setq org-roam-v2-ack t) 259 | (setq org-roam-mode-sections 260 | (list #'org-roam-backlinks-insert-section 261 | #'org-roam-reflinks-insert-section 262 | #'org-roam-unlinked-references-insert-section)) 263 | (org-roam-setup)) 264 | #+end_src 265 | 266 | *** Hotter Buffer 267 | 268 | #+begin_src emacs-lisp :tangle yes 269 | (defun org-roam-buffer-setup () 270 | "Function to make org-roam-buffer more pretty." 271 | (progn 272 | (setq-local olivetti-body-width 44) 273 | (variable-pitch-mode 1) 274 | (olivetti-mode 1) 275 | (centaur-tabs-local-mode 1) 276 | 277 | (set-face-background 'magit-section-highlight (face-background 'default)))) 278 | 279 | ;; I don't actually like the buffer that much 280 | (after! org-roam 281 | (setq +org-roam-open-buffer-on-find-file nil) 282 | (add-hook! 'org-roam-mode-hook #'org-roam-buffer-setup)) 283 | #+end_src 284 | 285 | *** Org-Roam-UI 286 | 287 | My baby 288 | It's of course fantastic so I don't need a lot of setup. 289 | #+begin_src emacs-lisp :tangle yes 290 | (use-package! org-roam-ui 291 | :after org-roam 292 | :config 293 | (setq org-roam-ui-open-on-start nil) 294 | (setq org-roam-ui-browser-function #'xwidget-webkit-browse-url)) 295 | #+end_src 296 | 297 | 298 | *** Org-roam-capture templates 299 | #+begin_src emacs-lisp :tangle yes 300 | (after! org-roam 301 | (setq org-roam-capture-templates 302 | `(("s" "standard" plain "%?" 303 | :if-new 304 | (file+head "%<%Y%m%d%H%M%S>-${slug}.org" 305 | "#+title: ${title}\n#+filetags: \n\n ") 306 | :unnarrowed t) 307 | ("d" "definition" plain 308 | "%?" 309 | :if-new 310 | (file+head "${slug}.org" "#+title: ${title}\n#+filetags: definition \n\n* Definition\n\n\n* Examples\n") 311 | :unnarrowed t) 312 | ("r" "ref" plain "%?" 313 | :if-new 314 | (file+head "${citekey}.org" 315 | "#+title: ${slug}: ${title}\n 316 | \n#+filetags: reference ${keywords} \n 317 | \n* ${title}\n\n 318 | \n* Summary 319 | \n\n\n* Rough note space\n") 320 | :unnarrowed t) 321 | ("p" "person" plain "%?" 322 | :if-new 323 | (file+head "${slug}.org" "%^{relation|some guy|family|friend|colleague}p %^{birthday}p %^{address}p 324 | ,#+title:${slug}\n#+filetags: :person: \n" 325 | :unnarrowed t) 326 | ("ts" "standard (thesis)" plain "%?" 327 | :if-new 328 | (file+head "thesis/%<%Y%m%d%H%M%S>-${slug}.org" 329 | "#+title: ${title}\n#+filetags: \n\n ") 330 | :unnarrowed t) 331 | ("tc" "chapter (thesis)" plain "%?" 332 | :if-new 333 | (file+head "thesis/${slug}.org" 334 | "#+title: ${title}\n#+filetags: :chapter: \n\n 335 | \n - Outline (do this first)\n -") 336 | :unnarrowed t) 337 | ("td" "definition (thesis)" plain 338 | "%?" 339 | :if-new 340 | (file+head "$thesis/{slug}.org" "#+title: ${title}\n#+filetags: definition \n\n* Definition\n\n\n* Examples\n") 341 | :unnarrowed t) 342 | ("tr" "ref (thesis)" plain "%?" 343 | :if-new 344 | (file+head "$thesis/{citekey}.org" 345 | "#+title: ${slug}: ${title}\n 346 | \n#+filetags: reference ${keywords} \n 347 | \n* ${title}\n\n 348 | \n* Summary 349 | \n\n\n* Rough note space\n") 350 | :unnarrowed t))))) 351 | 352 | #+end_src 353 | 354 | 355 | *** Citations 356 | #+begin_src emacs-lisp :tangle yes 357 | (use-package! org-ref 358 | ;:after org-roam 359 | :config 360 | (setq 361 | org-ref-completion-library 'org-ref-ivy-cite 362 | org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex 363 | org-ref-default-bibliography (list "/Users/thomas/Notes/bib/Library.bib") 364 | org-ref-bibliography-notes "/Users/thomas/Notes/bibnotes.org" 365 | org-ref-note-title-format "* %y - %t\n :properties:\n :Custom_ID: %k\n :noter_document: %F\n :ROAM_KEY: cite:%k\n :AUTHOR: %9a\n :JOURNAL: %j\n :YEAR: %y\n :VOLUME: %v\n :PAGES: %p\n :DOI: %D\n :URL: %U\n :END:\n\n" 366 | org-ref-notes-directory "/Users/thomas/Notes/" 367 | org-ref-notes-function 'orb-edit-notes 368 | )) 369 | 370 | (after! org-ref 371 | (setq 372 | bibtex-completion-notes-path "/Users/thomas/Notes/" 373 | bibtex-completion-bibliography "/Users/thomas/Notes/bib/Library.bib" 374 | bibtex-completion-pdf-field "file" 375 | bibtex-completion-notes-template-multiple-files 376 | (concat 377 | "#+TITLE: ${title}\n" 378 | "#+ROAM_KEY: cite:${=key=}\n" 379 | "* TODO Notes\n" 380 | ":properties:\n" 381 | ":Custom_ID: ${=key=}\n" 382 | ":NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n" 383 | ":AUTHOR: ${author-abbrev}\n" 384 | ":JOURNAL: ${journaltitle}\n" 385 | ":DATE: ${date}\n" 386 | ":YEAR: ${year}\n" 387 | ":DOI: ${doi}\n" 388 | ":URL: ${url}\n" 389 | ":END:\n\n" 390 | ) 391 | ) 392 | ) 393 | 394 | #+end_src 395 | 396 | 397 | ORB 398 | 399 | #+begin_src emacs-lisp :tangle yes 400 | (use-package! org-roam-bibtex 401 | :after org-roam 402 | :hook (org-mode . org-roam-bibtex-mode) 403 | :config 404 | (require 'org-ref) 405 | (setq orb-preformat-keywords 406 | '("citekey" "title" "url" "file" "author-or-editor" "keywords" "pdf" "doi" "author" "tags" "year" "author-bbrev"))) 407 | ;) 408 | #+end_src 409 | 410 | *** Citar 411 | 412 | #+begin_src emacs-lisp :tangle yes 413 | (use-package! citar 414 | :after org-roam 415 | :config 416 | (setq 417 | org-cite-global-bibliography '("~/Notes/thesis-writing/bibliography/Academic.bib") 418 | citar-bibliography org-cite-global-bibliography 419 | org-cite-insert-processor 'citar 420 | org-cite-follow-processor 'citar 421 | org-cite-activate-processor 'citar 422 | citar-templates 423 | '((main . "${author editor:30} ${date year issued:4} ${title:48}") 424 | (suffix . " ${=key= id:15} ${=type=:12} ${tags keywords:*}") 425 | (note . "Notes on ${author editor}, ${title}")) 426 | citar-symbols 427 | `((file ,(all-the-icons-faicon "file-o" :face 'all-the-icons-green :v-adjust -0.1) . " ") 428 | (note ,(all-the-icons-material "speaker_notes" :face 'all-the-icons-blue :v-adjust -0.3) . " ") 429 | (link ,(all-the-icons-octicon "link" :face 'all-the-icons-orange :v-adjust 0.01) . " ")) 430 | citar-symbol-separator " " 431 | citar-open-note-function 'orb-citar-edit-note 432 | bibtex-completion-bibliography org-cite-global-bibliography 433 | citar-format-note-function 'orb--new-note 434 | org-cite-export-processors '((latex biblatex) 435 | (t basic))) 436 | 437 | ;; optional: org-cite-insert is also bound to C-c C-x C-@ 438 | :bind 439 | (:map org-mode-map :package org ("C-c b" . #'org-cite-insert))) 440 | #+end_src 441 | 442 | biblatex 443 | 444 | #+begin_src emacs-lisp :tangle yes 445 | (use-package! oc-biblatex 446 | :after oc) 447 | #+end_src 448 | 449 | 450 | **** Convert org-ref to org-cite (from Tecosaur) 451 | #+begin_src emacs-lisp :tangle yes 452 | (after! oc 453 | (defun org-ref-to-org-cite () 454 | "Attempt to convert org-ref citations to org-cite syntax." 455 | (interactive) 456 | (let* ((cite-conversions '(("cite" . "//b") ("Cite" . "//bc") 457 | ("nocite" . "/n") 458 | ("citep" . "") ("citep*" . "//f") 459 | ("parencite" . "") ("Parencite" . "//c") 460 | ("citeauthor" . "/a/f") ("citeauthor*" . "/a") 461 | ("citeyear" . "/na/b") 462 | ("Citep" . "//c") ("Citealp" . "//bc") 463 | ("Citeauthor" . "/a/cf") ("Citeauthor*" . "/a/c") 464 | ("autocite" . "") ("Autocite" . "//c") 465 | ("notecite" . "/l/b") ("Notecite" . "/l/bc") 466 | ("pnotecite" . "/l") ("Pnotecite" . "/l/bc"))) 467 | (cite-regexp (rx (regexp (regexp-opt (mapcar #'car cite-conversions) t)) 468 | ":" (group (+ (not (any "\n ,.)]}"))))))) 469 | (save-excursion 470 | (goto-char (point-min)) 471 | (while (re-search-forward cite-regexp nil t) 472 | (message (format "[cite%s:@%s]" 473 | (cdr (assoc (match-string 1) cite-conversions)) 474 | (match-string 2))) 475 | (replace-match (format "[cite%s:@%s]" 476 | (cdr (assoc (match-string 1) cite-conversions)) 477 | (match-string 2)))))))) 478 | #+end_src 479 | *** Custom functions 480 | 481 | #+begin_src emacs-lisp :tangle yes 482 | (defun org-roam-rg-search () 483 | "Search org-roam directory using consult-ripgrep. With live-preview." 484 | (interactive) 485 | (let ((consult-ripgrep-args "rg --null --ignore-case --type org --line-buffered --max-columns=500 --no-heading --line-number --context 2 . ")) 486 | (consult-ripgrep org-roam-directory))) 487 | ;(global-set-key (kbd "C-c rr") 'bms/org-roam-rg-search) 488 | #+end_src 489 | 490 | Some other rg 491 | 492 | #+begin_src emacs-lisp :tangle yes 493 | (after! consult 494 | (setq consult-ripgrep-args 495 | "rg --null --line-buffered --color=never --max-columns=1000 --path-separator /\ 496 | --smart-case --no-heading --line-number --context=3 ." 497 | )) 498 | #+end_src 499 | ** To do things with pdfs with 500 | 501 | 502 | *** Zotero integrations 503 | 504 | Speaking of which: the note taking functionality in Zotero is very nice, but I want to copy it to org. This function prettifies that 505 | 506 | 507 | #+begin_src emacs-lisp :tangle yes 508 | (defun zotnote-to-org () 509 | (interactive) 510 | (progn 511 | (save-excursion 512 | (replace-string "\\par" "\n")) 513 | (save-excursion 514 | (replace-string "“" "#+begin_quote\n/")) 515 | (save-excursion 516 | (replace-string "”" "/\n#+end_quote\n\n")) 517 | (save-buffer))) 518 | #+end_src 519 | 520 | *** Old org-noter 521 | #+begin_src emacs-lisp :tangle no 522 | (use-package! org-noter 523 | :after (:any org pdf-view) 524 | :config 525 | (setq 526 | ;; The WM can handle splits 527 | ;;org-noter-notes-window-location 'other-frame 528 | ;; Please stop opening frames 529 | ;;org-noter-always-create-frame nil 530 | ;; I want to see the whole file 531 | org-noter-hide-other nil 532 | ;; Everything is relative to the rclone mega 533 | org-noter-notes-search-path "/Users/thomas/Notes" 534 | ) 535 | ) 536 | 537 | 538 | (use-package! org-pdftools 539 | :hook (org-load . org-pdftools-setup-link)) 540 | (use-package! org-noter-pdftools 541 | :after org-noter 542 | :config 543 | (with-eval-after-load 'pdf-annot 544 | (add-hook 'pdf-annot-activate-handler-functions #'org-noter-pdftools-jump-to-note))) 545 | 546 | 547 | #+end_src 548 | 549 | nroam puts the org-roam buffer on the bottom, much more natural and less obstrustive, but not does cause some problems. 550 | #+begin_src emacs-lisp :tangle no 551 | (use-package! nroam 552 | :after org-roam 553 | :config 554 | (add-hook 'org-roam-mode-hook #'nroam-setup-maybe) 555 | ) 556 | 557 | 558 | #+end_src 559 | 560 | *** Org-ol 561 | 562 | Outliners on the side, neat. 563 | 564 | #+begin_src emacs-lisp :tangle yes 565 | (use-package! org-ol-tree 566 | :after org 567 | :commands org-ol-tree 568 | :hook (org-ol-tree-mode . visual-line-mode) 569 | :config 570 | (setq org-ol-tree-ui-window-auto-resize nil 571 | org-ol-tree-ui-window-max-width 0.3)) 572 | (add-hook! 'org-ol-tree-mode-hook (lambda () (when (centaur-tabs-mode) (centaur-tabs-local-mode -1)))) 573 | (map! :map org-mode-map 574 | :after org 575 | :localleader 576 | :desc "Outline" "O" #'org-ol-tree) 577 | #+end_src 578 | 579 | ** Hooks 580 | 581 | *** Hook to get rid of stars 582 | 583 | You know what I hate? Organized lists. 584 | No but when I'm writing I don't want org's usual indentation and stars and all that bullshit, I want it to look like a wordprocessor, so no stars! 585 | 586 | #+begin_src emacs-lisp :tangle yes 587 | (defun org-mode-remove-stars () 588 | (font-lock-add-keywords 589 | nil 590 | '(("^\\*+ " 591 | (0 592 | (prog1 nil 593 | (put-text-property (match-beginning 0) (match-end 0) 594 | 'invisible t))))))) 595 | 596 | (add-hook! 'org-mode-hook #'org-mode-remove-stars) 597 | #+end_src 598 | 599 | 600 | *** Setup very pretty org-mode 601 | 602 | #+begin_src emacs-lisp :tangle yes 603 | ;; hide title / author ... keywords 604 | 605 | ;;; Ugly org hooks 606 | (defun nicer-org () 607 | (progn 608 | (+org-pretty-mode 1) 609 | (mixed-pitch-mode 1) 610 | (hl-line-mode -1) 611 | (display-line-numbers-mode -1) 612 | (olivetti-mode 1) 613 | ;(org-num-mode 1) 614 | (org-superstar-mode -1) 615 | (org-indent-mode -1) 616 | )) 617 | 618 | (add-hook! 'org-mode-hook #'nicer-org) 619 | 620 | #+end_src 621 | 622 | *** Org variables 623 | 624 | fuckin latex 625 | For some reason it can't find the dang latex executable, so we're just adding the path to it by hand like some sort of caveman 626 | #+begin_src emacs-lisp :tangle no 627 | (setq org-preview-latex-process-alist 628 | '((dvipng 629 | :programs ("/Library/TeX/texbin/latex" "/Library/TeX/texbin/dvipng") 630 | :description "dvi > png" 631 | :message "you need to install the programs: latex and dvipng." 632 | :image-input-type "dvi" 633 | :image-output-type "png" 634 | :image-size-adjust (1.0 . 1.0) 635 | :latex-compiler ("/Library/TeX/texbin/latex -interaction nonstopmode -output-directory %o %f") 636 | :image-converter ("/Library/TeX/texbin/dvipng -D %D -T tight -bg Transparent -o %O %f")) 637 | (dvisvgm 638 | :programs ("/Library/TeX/texbin/latex" "/Library/TeX/texbin/dvisvgm") 639 | :description "dvi > svg" 640 | :message "you need to install the programs: latex and dvisvgm." 641 | :image-input-type "dvi" 642 | :image-output-type "svg" 643 | :image-size-adjust (1.7 . 1.5) 644 | :latex-compiler ("/Library/TeX/texbin/latex -interaction nonstopmode -output-directory %o %f") 645 | :image-converter ("/Library/TeX/texbin/dvisvgm %f -n -b min -c %S -o %O")) 646 | (imagemagick 647 | :programs ("latex" "convert") 648 | :description "pdf > png" 649 | :message "you need to install the programs: latex and imagemagick." 650 | :image-input-type "pdf" 651 | :image-output-type "png" 652 | :image-size-adjust (1.0 . 1.0) 653 | :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") 654 | :image-converter 655 | ("convert -density %D -trim -antialias %f -quality 100 %O")))) 656 | #+end_src 657 | 658 | 659 | #+begin_src emacs-lisp :tangle yes 660 | (after! org 661 | (setq org-startup-with-latex-preview nil ;don't preview latex 662 | ;org-latex-create-formula-image-program 'dvipng 663 | ;LaTeX-command "latex" 664 | ;latex-run-command "latex" 665 | org-startup-with-inline-images 1 ;always preview images 666 | ;org-hide-leading-stars 1 667 | org-startup-indented nil ; don't indent 668 | ; org-startup-folded nil 669 | org-hidden-keywords '(filetags title author date startup roam_tags) 670 | org-pretty-entities 1 ; show unicode characters 671 | org-num-max-level 3 ; no 1.1.1.2 672 | org-indirect-buffer-display 'other-window 673 | line-spacing 3 ; let me B R E A T H E 674 | ) 675 | (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin"))) 676 | #+end_src 677 | 678 | **** Better indirect buffers 679 | Sometimes I want to move a tree to an indirect buffer, but sometimes I want to put it in another window, sometimes the same one, and sometimes to another frame. By default there are no functions for this but are controlled by ~org-indirect-buffer-display~. This is a hacky way of achieving this 680 | #+begin_src emacs-lisp :tangle yes 681 | (defun +org-tree-to-indirect-buffer-options (option) 682 | (let* ((old-value org-indirect-buffer-display)) 683 | (progn 684 | (setq org-indirect-buffer-display option) 685 | (org-tree-to-indirect-buffer) 686 | (setq org-indirect-buffer-display old-value)))) 687 | 688 | (defun +org-tree-to-indirect-other-window () 689 | (interactive) 690 | (+org-tree-to-indirect-buffer-options 'other-window)) 691 | 692 | (defun +org-tree-to-indirect-current-window () 693 | (interactive) 694 | (+org-tree-to-indirect-buffer-options 'current-window)) 695 | 696 | (defun +org-tree-to-indirect-dedicated-frame () 697 | (interactive) 698 | (+org-tree-to-indirect-buffer-options 'dedicated-frame)) 699 | #+end_src 700 | 701 | *** Custom faces 702 | 703 | A lil bigger. No a lil smaller. Peeerrrfect. 704 | #+begin_src emacs-lisp :tangle yes 705 | (after! org 706 | (custom-set-faces! 707 | '((org-block) :background nil) 708 | ) 709 | (defface redd 710 | '((((class color) (min-colors 88) (background light)) 711 | :foreground "red")) 712 | "Red." 713 | :group 'basic-faces) 714 | 715 | (set-face-font 'org-quote (font-spec :family "Noto Serif")) 716 | (custom-set-faces! 717 | ;'(org-document-title :height 1.6 :weight bold) 718 | '(org-level-1 :height 1.3 :weight extrabold :slant normal) 719 | '(org-level-2 :height 1.2 :weight bold :slant normal) 720 | '(org-level-3 :height 1.1 :weight regular :slant normal) 721 | ;'(org-document-info :inherit 'nano-face-faded) 722 | '(org-document-title ;:foreground ,(doom-color 'black) 723 | :family "Roboto" 724 | :height 250 725 | :weight medium))) 726 | #+end_src 727 | 728 | *** Emphasis faces 729 | 730 | I want to be able to do some kind of custom highlighting, so = becomes =red=. 731 | #+begin_src emacs-lisp :tangle yes 732 | (after! org 733 | (setq org-emphasis-alist 734 | '(("*" (bold)) 735 | ("/" italic) 736 | ("_" underline) 737 | ("=" redd) 738 | ("~" code) 739 | ("+" (:strike-through t))))) 740 | #+end_src 741 | 742 | Ideally I would be able to add my own custom bullshit in here, but I don't know how to do that. 743 | 744 | *** Ligatures 745 | 746 | Yes make them pretty 747 | 748 | #+begin_src emacs-lisp :tangle yes 749 | (after! org 750 | (setq org-ellipsis " ▾ ") 751 | (appendq! +ligatures-extra-symbols 752 | `(:checkbox "☐" 753 | :pending "◼" 754 | :checkedbox "☑" 755 | :list_property "∷" 756 | :em_dash "—" 757 | :ellipses "…" 758 | :arrow_right "→" 759 | :arrow_left "←" 760 | :title "" 761 | :subtitle "𝙩" 762 | :author "𝘼" 763 | :date "𝘿" 764 | :property "" 765 | :options "⌥" 766 | :startup "⏻" 767 | :macro "𝓜" 768 | :html_head "🅷" 769 | :html "🅗" 770 | :latex_class "🄻" 771 | :latex_header "🅻" 772 | :beamer_header "🅑" 773 | :latex "🅛" 774 | :attr_latex "🄛" 775 | :attr_html "🄗" 776 | :attr_org "⒪" 777 | :begin_quote "❝" 778 | :end_quote "❞" 779 | :caption "☰" 780 | :header "›" 781 | :results "🠶" 782 | :begin_export "⏩" 783 | :end_export "⏪" 784 | :properties "" 785 | :end "∎" 786 | :priority_a ,(propertize "⚑" 'face 'all-the-icons-red) 787 | :priority_b ,(propertize "⬆" 'face 'all-the-icons-orange) 788 | :priority_c ,(propertize "■" 'face 'all-the-icons-yellow) 789 | :priority_d ,(propertize "⬇" 'face 'all-the-icons-green) 790 | :priority_e ,(propertize "❓" 'face 'all-the-icons-blue) 791 | :roam_tags nil 792 | :filetags "")) 793 | (set-ligatures! 'org-mode 794 | :merge t 795 | :checkbox "[ ]" 796 | :pending "[-]" 797 | :checkedbox "[X]" 798 | :list_property "::" 799 | :em_dash "---" 800 | :ellipsis "..." 801 | :arrow_right "->" 802 | :arrow_left "<-" 803 | :title "#+title:" 804 | :subtitle "#+subtitle:" 805 | :author "#+author:" 806 | :date "#+date:" 807 | :property "#+property:" 808 | :options "#+options:" 809 | :startup "#+startup:" 810 | :macro "#+macro:" 811 | :html_head "#+html_head:" 812 | :html "#+html:" 813 | :latex_class "#+latex_class:" 814 | :latex_header "#+latex_header:" 815 | :beamer_header "#+beamer_header:" 816 | :latex "#+latex:" 817 | :attr_latex "#+attr_latex:" 818 | :attr_html "#+attr_html:" 819 | :attr_org "#+attr_org:" 820 | :begin_quote "#+begin_quote" 821 | :end_quote "#+end_quote" 822 | :caption "#+caption:" 823 | :header "#+header:" 824 | :begin_export "#+begin_export" 825 | :end_export "#+end_export" 826 | :results "#+RESULTS:" 827 | :property ":PROPERTIES:" 828 | :end ":END:" 829 | :priority_a "[#A]" 830 | :priority_b "[#B]" 831 | :priority_c "[#C]" 832 | :priority_d "[#D]" 833 | :priority_e "[#E]" 834 | :roam_tags "#+roam_tags:" 835 | ;; :filetags "#+filetags:" 836 | :something "#+filetags:" 837 | :filetags "#+FILETAGS:") 838 | (plist-put +ligatures-extra-symbols :name "⁍") 839 | ) 840 | 841 | (with-eval-after-load 'org 842 | (plist-put org-format-latex-options :background 'default)) 843 | 844 | #+end_src 845 | 846 | ** Getting Things Done/Agenda 847 | 848 | Oh yeah this is definitely working for me I've definitely changed as a person. 849 | 850 | *** Agenda 851 | I kind of like the /idea/ of org-agenda, but it requires way too much manual intervention in order to be useable. 852 | That's why I mostly use it outside of org-mode, and for that CalDAV is what you want. 853 | #+begin_src emacs-lisp :tangle yes 854 | (use-package! org-caldav 855 | :after org 856 | :config (setq org-caldav-url "https://use03.thegood.cloud/remote.php/dav/calendars/hello@tefkah.com" 857 | org-caldav-calendar-id "personal" 858 | org-caldav-inbox "/Users/thomas/Notes/GTD/calendar.org" 859 | org-caldav-files '("/Users/thomas/Notes/GTD/calendar.org") 860 | org-caldav-sync-changes-to-org 'all 861 | org-icalendar-alarm-time 20 862 | org-icalendar-use-deadline '(event-if-not-todo todo-due) 863 | org-icalendar-use-scheduled '(event-if-not-todo) 864 | org-icalendar-include-todo 'all 865 | org-caldav-sync-todo t 866 | org-icalendar-categories '(local-tags) 867 | org-icalendar-timezone "Europe/Amsterdam")) 868 | #+end_src 869 | 870 | 871 | *** GTD package 872 | 873 | It's pretty good, but it doesn't do my organizing for me sadly. 874 | #+begin_src emacs-lisp :tangle yes 875 | (use-package! org-gtd 876 | :after org 877 | :config 878 | ;; where org-gtd will put its files. This value is also the default one. 879 | (setq org-gtd-directory "~/Notes/") 880 | ;; package: https://github.com/Malabarba/org-agenda-property 881 | ;; this is so you can see who an item was delegated to in the agenda 882 | (setq org-agenda-property-list '("DELEGATED_TO")) 883 | ;; I think this makes the agenda easier to read 884 | (setq org-agenda-property-position 'next-line) 885 | ;; package: https://www.nongnu.org/org-edna-el/ 886 | ;; org-edna is used to make sure that when a project task gets DONE, 887 | ;; the next TODO is automatically changed to NEXT. 888 | (setq org-edna-use-inheritance t) 889 | (org-edna-load) 890 | :bind 891 | (("C-c d c" . org-gtd-capture) ;; add item to inbox 892 | ("C-c d a" . org-agenda-list) ;; see what's on your plate today 893 | ("C-c d p" . org-gtd-process-inbox) ;; process entire inbox 894 | ("C-c d n" . org-gtd-show-all-next) ;; see all NEXT items 895 | ("C-c d s" . org-gtd-show-stuck-projects)) ;; see projects that don't have a NEXT item 896 | :init 897 | (bind-key "C-c c" 'org-gtd-clarify-finalize)) ;; the keybinding to hit when you're done editing an item in the processing phase 898 | #+end_src 899 | 900 | *** Set agenda files 901 | Because you can't trust ~custom.el~ 902 | #+begin_src emacs-lisp :tangle yes 903 | 904 | (setq org-agenda-files '("~/Notes/inbox" "~/Notes/actionable.org" 905 | "~/Notes/agenda.org" "~/Notes/incubate.org" 906 | "~/Notes/openquestions.org")) 907 | #+end_src 908 | 909 | *** Org capture Templates 910 | 911 | Set some capture templates, which I rarely use tbrqhwy 912 | #+begin_src emacs-lisp :tangle yes 913 | (after! org 914 | (setq org-capture-templates `(("i" "Inbox" 915 | entry (file "~/Notes/GTD/calendar.org") 916 | "* TODO %?\n%U\n\n %i" 917 | :kill-buffer t) 918 | ("l" "Todo with link" 919 | entry (file "~/OneDrive/org-rom/inbox.org") 920 | "* %?\n%U\n\n %i\n %a" 921 | :kill-buffer t) 922 | ("m" "Meeting" 923 | entry (file+headline "/Users/thomas/Notes/GTD/calendar.org" "Future") 924 | ,(concat "* %? :meeting:\n" "<%<%Y-%m-%d %a %H:00>>") 925 | :kill-buffer t) 926 | ("o" "Open Question Thesis" 927 | entry (file+headline "~/Notes/openquestions.org" "Questions") 928 | "* OPEN %? \n %U\n"))) 929 | (set-face-attribute 'org-headline-done nil :strike-through t) 930 | ) 931 | #+end_src 932 | 933 | *** Org-super agenda 934 | 935 | Why yes, I also copied this one example from the ~org-super-agenda~ github, how could you tell? 936 | 937 | This does not work nearly as well as I would like it to, like, utility wise. Way too long, way too much information, bubububuh. I want more of a calendar than an agenda I think. 938 | #+begin_src emacs-lisp :tangle yes 939 | (use-package! org-super-agenda 940 | :hook (org-agenda-mode . org-super-agenda-mode) 941 | ) 942 | 943 | 944 | (setq org-agenda-skip-scheduled-if-done t 945 | org-agenda-skip-deadline-if-done t 946 | org-agenda-include-deadlines t 947 | org-agenda-include-diary t 948 | org-agenda-block-separator nil 949 | org-agenda-compact-blocks t 950 | org-agenda-start-with-log-mode t 951 | org-agenda-start-day nil) 952 | (setq org-agenda-custom-commands 953 | '(("d" "Get Things DONE" 954 | ((agenda "" ((org-agenda-span 1) 955 | (org-super-agenda-groups 956 | '((:name "Today" 957 | :time-grid t 958 | :date nil 959 | :todo "TODAY" 960 | :scheduled nil 961 | :order 1))))) 962 | (alltodo "" ((org-agenda-overriding-header "") 963 | (org-super-agenda-groups 964 | '((:discard (:todo "TODO")) 965 | (:name "Important" 966 | :tag "Important" 967 | :priority "A" 968 | :order 1) 969 | (:name "Due Today" 970 | :deadline today 971 | :order 2) 972 | (:name "Due Soon" 973 | :deadline future 974 | :order 8) 975 | (:name "Overdue" 976 | :deadline past 977 | :order 7) 978 | (:name "Thesis" 979 | :tag "thesis" 980 | :order 10) 981 | (:name "ESN" 982 | :tag "esn" 983 | :order 12) 984 | (:name "JOTE" 985 | :tag "jote" 986 | :order 13) 987 | (:name "Emacs" 988 | :tag "emacs" 989 | :order 14) 990 | (:name "Home" 991 | :tag "home" 992 | :order 30) 993 | (:name "Waiting" 994 | :todo "WAITING" 995 | :order 20) 996 | (:name "Notes" 997 | :tag "notes" 998 | :order 20) 999 | ;(:name "Open Questions" 1000 | ; :todo "OPEN" 1001 | ; :order 3) 1002 | (:name "trivial" 1003 | :priority<= "C" 1004 | :tag ("Trivial" "Unimportant") 1005 | :todo ("SOMEDAY" ) 1006 | :order 90) 1007 | (:discard (:tag ("Chore" "Routine" "Daily"))))))))))) 1008 | 1009 | #+end_src 1010 | 1011 | *** Notifications 1012 | 1013 | I want notifications to work so bad but it just isn't working :( 1014 | Seems like ~alert~ is not working, should fix that at some point. 1015 | 1016 | #+begin_src emacs-lisp :tangle no 1017 | (use-package! org-notifications 1018 | :init (org-notifications-start) ) 1019 | #+end_src 1020 | 1021 | ** Nice writing environment for big babies 1022 | 1023 | Just because I use emacs doesn't mean I don't want things to look a e s t h e t i c 1024 | *** Frame parameters 1025 | Nice big border with the color of the fringe 1026 | 1027 | #+begin_src emacs-lisp :tangle yes 1028 | (setq default-frame-alist 1029 | (append (list 1030 | ;; '(font . "Roboto Mono Emacs Regular:size=14") 1031 | '(min-height . 1) '(height . 45) 1032 | '(min-width . 1) '(width . 81) 1033 | '(vertical-scroll-bars . nil) 1034 | '(internal-border-width . 30) 1035 | '(left-fringe . 0) 1036 | '(right-fringe . 0) 1037 | '(tool-bar-lines . 0) 1038 | '(menu-bar-lines . 0)))) 1039 | 1040 | (add-hook! 'solaire-mode-hook (set-face-background 'internal-border (face-background 'fringe))) 1041 | 1042 | (set-frame-parameter nil 'internal-border-width 60) 1043 | #+end_src 1044 | 1045 | *** Paper-like header/mode-line 1046 | 1047 | Lil' minor mode which gives you a nice distraction free header and footer. At the moment its automatically enabled in org-mode, but I would like it to only be enabled in "writing" buffers, not sure how to implement that yet though. 1048 | 1049 | #+begin_src emacs-lisp :tangle yes 1050 | (defvar writing-header--default-format header-line-format 1051 | "Storage for the default `mode-line-format'. 1052 | So it can be restored when 'writer-header-line-mode' is disabled.") 1053 | 1054 | (defvar writing-modeline--default-format mode-line-format) 1055 | 1056 | (define-minor-mode writing-header-line-mode 1057 | "Adds a bar with the same color as the fringe as the header-line. 1058 | Imitates the look of wordprocessors a bit." 1059 | :init-value nil 1060 | :global nil 1061 | (if writing-header-line-mode 1062 | (progn 1063 | (setq header-line-format 1064 | (concat 1065 | (propertize " " 'display (list 'space :width 'left-fringe) 'face 'fringe) 1066 | (propertize " " 'display (list 'space :width 'left-margin) 'face (list (list :height 400) 'default)) 1067 | (propertize " " 'display (list 'space :width 'text) 'face (list (list :height 400) 'default)) 1068 | ;(propertize (format " %dW" (count-words (point-min) (point-max))) 'face 'default) 1069 | (propertize " " 'display (list 'space :width 'left-margin) 'face (list (list :height 400) 'default)) 1070 | ;;(propertize (format " %dW" (count-words (point-min) (point-max))) 'face 'fringe) 1071 | ;; '("" mode-line-misc-info) 1072 | (propertize " " 'display (list 'space :width 'left-fringe) 'face 'fringe))) ; 1073 | (setq mode-line-format header-line-format)) 1074 | (setq header-line-format writing-header--default-format 1075 | mode-line-format writing-modeline--default-format))) 1076 | #+end_src 1077 | 1078 | **** Experiment with Rougier's double modeline 1079 | 1080 | #+begin_src emacs-lisp :tangle no 1081 | ;; ------------------------------------------------------------------- 1082 | ;; A proof of concept for a multi header or mode line 1083 | ;; 1084 | ;; Multi line header or mode line is made possible by generating an 1085 | ;; SVG image made of two small lines of text. It is certainly memory 1086 | ;; hungry but it seems to be fast enough to display line/column while 1087 | ;; typing text. It can probably be extended in a number of ways. 1088 | ;; 1089 | ;; Feel free to modify it for your own needs. 1090 | ;; ------------------------------------------------------------------- 1091 | (require 'svg) 1092 | 1093 | (defun tag (line-1 font-size-1 font-family-1 foreground-1 1094 | line-2 font-size-2 font-family-2 foreground-2 1095 | left) 1096 | (let* ((font-size-1 (or font-size-1 14)) 1097 | (char-width-1 (* font-size-1 0.6)) 1098 | (char-height-1 (+ font-size-1 0.0)) 1099 | (width-1 (* char-width-1 20)) 1100 | (height-1 (+ (* char-height-1 2) 1)) 1101 | 1102 | (font-size-2 (or font-size-2 14)) 1103 | (char-width-2 (* font-size-2 0.6)) 1104 | (char-height-2 (+ font-size-2 0.0)) 1105 | (width-2 (* char-width-2 20)) 1106 | (height-2 (+ (* char-height-2 2) 1)) 1107 | 1108 | (width (max width-1 width-2)) 1109 | (height (max height-1 height-2)) 1110 | 1111 | (x1 (if left 0 (- width (* char-width-1 (+ (length line-1) .0))))) 1112 | (x2 (if left 0 (- width (* char-width-2 (+ (length line-2) .0))))) 1113 | (y1 char-height-1) 1114 | (y2 (+ (* char-height-2 2) 1)) 1115 | (svg (svg-create width height))) 1116 | (svg-text svg line-1 1117 | :font-family font-family-1 1118 | :font-size font-size-1 :fill foreground-1 1119 | :x x1 :y y1) 1120 | 1121 | (svg-text svg line-2 1122 | :font-family font-family-2 1123 | :font-size font-size-2 :fill foreground-2 1124 | :x x2 :y y2) 1125 | svg)) 1126 | 1127 | (define-key mode-line-major-mode-keymap [header-line] 1128 | (lookup-key mode-line-major-mode-keymap [mode-line])) 1129 | 1130 | (defun mode-line-render (left right) 1131 | (let* ((available-width (- (window-width) (length left)))) 1132 | (format (format "%%s %%%ds" available-width) left right))) 1133 | 1134 | (setq header-line-format 1135 | '((:eval 1136 | (mode-line-render 1137 | (format-mode-line 1138 | (propertize (make-string 20 ?\ ) 1139 | 'display (svg-image 1140 | (tag (format-mode-line "%m") 12 "Roboto Mono Light" "#00008b" 1141 | (format-mode-line "%b") 14 "Roboto Mono" "black" 1142 | t) :ascent 100))) 1143 | (format-mode-line 1144 | (propertize (make-string 18 ?\ ) 1145 | 'display (svg-image 1146 | (tag (format-mode-line "GNU Emacs 26.3 ") 12 "Roboto Mono Light" "#00008b" 1147 | (format-mode-line "%4l:%2c") 12 "Roboto Mono Light" "#999999" 1148 | nil) :ascent 100))))))) 1149 | #+end_src 1150 | 1151 | 1152 | **** My much better version 1153 | #+begin_src emacs-lisp :tangle yes 1154 | (defcustom double-modeline-margin-inner-height 60 1155 | "inner" 1156 | :type 'integer) 1157 | (defcustom double-modeline-margin-outer-height 10 1158 | "outer" 1159 | :type 'integer) 1160 | #+end_src 1161 | 1162 | #+begin_src emacs-lisp :tangle yes 1163 | (after! org 1164 | (require 'svg)) 1165 | (defun make-svg-rectangle (width height-1 bg-1 height-2 bg-2) 1166 | (let* ((svg (svg-create width (+ height-1 height-2)))) 1167 | (svg-rectangle svg 0 0 width height-1 :fill-color bg-1) 1168 | (svg-rectangle svg 0 height-1 width height-2 :fill-color bg-2) 1169 | svg)) 1170 | 1171 | (defun make-svg-rectangles (width height-1 bg-1 &rest other) 1172 | (let* ((temptt 0) 1173 | (height-temp height-1) 1174 | (svg (svg-create width 1175 | (+ height-1 1176 | (dotimes 1177 | (i (/ (length other) 2) temptt) 1178 | (setq temptt 1179 | (+ 1180 | (nth (* i 2) other) 1181 | temptt))))))) 1182 | (svg-rectangle svg 0 0 width height-1 :fill-color bg-1) 1183 | (when other 1184 | (dotimes (i (/ (length other) 2)) 1185 | (svg-rectangle svg 0 1186 | (if (eq i 0) height-1 1187 | (setq-local height-temp 1188 | (+ height-temp 1189 | (nth (* (- i 2) 2) other)))) 1190 | width 1191 | (nth (* i 2) other) 1192 | :fill-color (nth (+ (* i 2) 1) other)))) 1193 | svg)) 1194 | 1195 | (defun mode-line-compose (height-1 bg-1 height-2 bg-2 1196 | header) 1197 | (let* ((fringe-width (car (window-fringes nil))) 1198 | (body-width (window-body-width nil t)) 1199 | (margin-width (* (frame-char-width) 1200 | (+ (car (window-margins)) 1201 | (cdr (window-margins)))))) 1202 | (concat 1203 | (format-mode-line 1204 | (propertize " " 'display (svg-image 1205 | (make-svg-rectangle fringe-width height-1 1206 | bg-1 height-2 bg-1)))) 1207 | (format-mode-line 1208 | (propertize " " 'display (svg-image 1209 | (if header 1210 | (make-svg-rectangle 1211 | (+ margin-width body-width) 1212 | height-1 bg-1 height-2 bg-2) 1213 | (make-svg-rectangle 1214 | (+ margin-width body-width) 1215 | height-2 bg-2 height-1 bg-1))))) 1216 | (format-mode-line 1217 | (propertize " " 'display (svg-image 1218 | (make-svg-rectangle fringe-width height-1 1219 | bg-1 height-2 bg-1))))))) 1220 | 1221 | (defvar double-modeline--default-header-format header-line-format 1222 | "Storage for the default `mode-line-format'. 1223 | So it can be restored when 'writer-header-line-mode' is disabled.") 1224 | 1225 | (defvar double-modeline--default-modeline-format mode-line-format) 1226 | 1227 | (define-minor-mode double-header-line-mode 1228 | "Adds a bar with the same color as the fringe as the header-line. 1229 | Imitates the look of wordprocessors a bit." 1230 | :init-value nil 1231 | :global nil 1232 | (if double-header-line-mode 1233 | (progn 1234 | (set-face-attribute 'mode-line nil :box nil) 1235 | (set-face-attribute 'header-line nil :box nil) 1236 | (set-face-attribute 'mode-line-inactive nil :box nil) 1237 | (setq header-line-format '((:eval (mode-line-compose 1238 | double-modeline-margin-outer-height 1239 | (face-background 'fringe) 1240 | double-modeline-margin-inner-height 1241 | (face-background 'default) 1242 | t 1243 | )))) 1244 | (setq mode-line-format '((:eval (mode-line-compose 1245 | double-modeline-margin-outer-height 1246 | (face-background 'fringe) 1247 | double-modeline-margin-inner-height 1248 | (face-background 'default) 1249 | nil 1250 | ))))) 1251 | (setq header-line-format 'double-modeline--default-header-format 1252 | mode-line-format 'double-modeline--default-modeline-format))) 1253 | 1254 | (after! olivetti-mode (setq double-modeline-margin-inner-height (round (* 0.6 (* (frame-char-width) (car (window-margins))))))) 1255 | #+end_src 1256 | *** Page-break-mode 1257 | #+begin_src emacs-lisp :tangle yes 1258 | (use-package! page-break-mode) 1259 | #+end_src 1260 | *** KILL obsolete pages break 1261 | #+begin_src emacs-lisp :tangle no 1262 | 1263 | (defun change-page-break () 1264 | (interactive) 1265 | (font-lock-add-keywords 'org-mode 1266 | `((,page-delimiter 1267 | ;; variable with the regexp (usually "^\f" or "^^L") 1268 | 0 1269 | (prog1 nil 1270 | ;(compose-region (match-beginning 0) (match-end 0) "") 1271 | ;(testtest) 1272 | (put-text-property (match-beginning 0) (match-end 0) 1273 | 'display (svg-image (make-svg-rectangles 1274 | ;; just to be sure 1275 | (* 3 (window-body-width nil t)) 1276 | 30 "red" 40 "yellow" 30 "red")) 1277 | ;(put-text-property (match-beginning 0) (match-end 0) 'display (make-svg-rectangle (window-body-width nil t) 40 (face-background 'fringe) 30 (face-background 'default))) 1278 | )) t)))) 1279 | #+end_src 1280 | 1281 | #+begin_src emacs-lisp :tangle no 1282 | 1283 | (defun change-page-break () 1284 | (interactive) 1285 | (font-lock-add-keywords 'org-mode 1286 | `((,page-delimiter 1287 | ;; variable with the regexp (usually "^\f" or "^^L") 1288 | 0 1289 | (prog1 nil 1290 | ;(compose-region (match-beginning 0) (match-end 0) "") 1291 | ;(testtest) 1292 | ;(put-text-property (match-beginning 0) (match-end 0) 'display (make-svg-rectangle (window-body-width nil t) 40 (face-background 'fringe) 30 (face-background 'default))) 1293 | ;; don't display ^L 1294 | (make-line-break (* (frame-char-width) (car (window-margins))) 1295 | (face-background 'default) 40 (face-background 'fringe))) t)))) 1296 | 1297 | (defun make-line-break (h1 bg1 h2 bg2) 1298 | (compose-region (match-beginning 0) (match-end 0) "") 1299 | ;; make an overlay (like in hl-line) 1300 | (let ((pdl (make-overlay (line-beginning-position) (line-beginning-position 2)))) 1301 | (overlay-put pdl 'put-image t) 1302 | ;(overlay-put pdl 'after-string 1303 | ; (propertize "x" 1304 | ; 'display (list (list 'margin 'left-margin) 1305 | ; (svg-image (make-svg-rectangles (* (frame-char-width) (car (window-margins))) h1 bg1 h2 bg2 h1 bg1 ))))) 1306 | (overlay-put pdl 'before-string 1307 | (concat 1308 | (propertize "x" 1309 | 'display (list (list 'margin 'right-margin) 1310 | (svg-image (make-svg-rectangles (* (frame-char-width) (car (window-margins))) h1 bg1 h2 bg2 h1 bg1)))) 1311 | (propertize "x" 1312 | 'display (list (list 'margin 'left-margin) 1313 | (svg-image (make-svg-rectangles (* (frame-char-width) (car (window-margins))) h1 bg1 h2 bg2 h1 bg1 )))))) 1314 | (overlay-put pdl 'map image-map) 1315 | (overlay-put pdl 'display (svg-image (make-svg-rectangles (- (window-body-width nil t) 0 ) h1 bg1 h2 bg2 h1 bg1))) 1316 | (overlay-put pdl 'modification-hooks 1317 | ;; these arguments are received from modification-hooks 1318 | '((lambda (overlay after-p begin end &optional length) 1319 | (delete-overlay overlay)))) 1320 | (overlay-put pdl 'insert-in-front-hooks '((lambda (overlay after-p begin end &optional length) 1321 | (delete-overlay overlay)))))) 1322 | 1323 | 1324 | #+end_src 1325 | This should go somewhere else 1326 | #+begin_src emacs-lisp :tangle no 1327 | (after! org (change-page-break)) 1328 | #+end_src 1329 | #+begin_src emacs-lisp :tangle no 1330 | (defun testtest () 1331 | (interactive) 1332 | (aayyy 30 (face-background 'default) 40 (face-background 'fringe))) 1333 | 1334 | (defun aayyy (h1 bg1 h2 bg2) 1335 | (progn 1336 | ;(concat 1337 | ;(propertize " " 1338 | ;'display '((margin left-margin) "a")) 1339 | ;(propertize " " 1340 | ; 'display '((margin right-margin) "b")) 1341 | (insert-image (svg-image (make-svg-rectangles (* (frame-char-width) (car (window-margins))) h1 bg1 h2 bg2 h1 bg1)) nil 'left-margin) 1342 | (insert-image (svg-image (make-svg-rectangles (* (frame-char-width) (cdr (window-margins))) h1 bg1 h2 bg2 h1 bg1)) nil 'right-margin) 1343 | (insert (propertize " " 1344 | 'display (svg-image (make-svg-rectangles (window-body-width nil t) h1 bg1 h2 bg2 h1 bg1)))) 1345 | )) 1346 | #+end_src 1347 | 1348 | **** Pseudocode to get what i want 1349 | 1350 | This basically sets up the structure for how I want the minor-mode to work. It's not very complicated and there are probably a lot of edge cases, but its rather close to what I want ti 1351 | 1352 | #+begin_src emacs-lisp :tangle no 1353 | (defun change-lines-hook () 1354 | (unless (check-if-we-need-to-change-anything) 1355 | (disable-all-my-overlays) 1356 | (put-overlays))) 1357 | 1358 | ;;either 1359 | (add-hook! 'after-save-hook 'change-lines-hook) 1360 | 1361 | ;;or, much too expensive probably. 1362 | (add-hook! 'after-change-functions 'change-lines-hook) 1363 | ;mwah maybe okay, org-num-verify also does this and it's somewhat complicated. Really depends on how hard it is to change things. 1364 | 1365 | (defun check-if-no-annoying-env () 1366 | ;; some regex which determines where we are in basically anything that's not a paragraph, such as a heading, a latex environment, a link , a table, or a src block 1367 | ;; There's probably a function that already does this 1368 | ;; This is not super important for environtments since the overlay won't be part of the text, but it do be kind of annoying 1369 | ;(org-at-table-p) 1370 | ;(org-at-property-p) 1371 | ;(org-at-property-drawer-p) 1372 | ;(org-at-property-block-p) 1373 | ;(org-at-block-p) 1374 | ;(org-at-heading-p) 1375 | ;(org-at-heading-or-item-p) 1376 | ;(org-at-planning-p) 1377 | 1378 | ;check whether we are in a paragraph and not a latex section 1379 | (and (eq (car (org--paragraph-at-point) 'headline)) 1380 | (not (latex)))) 1381 | 1382 | (define-minor-mode auto-page-break-overlay-mode nil 1383 | "Adds out page breaks, neat." 1384 | :global nil 1385 | :group wysiwyg 1386 | (if auto-page-break-overlay-mode 1387 | (setq some-defaults-i-need-to-rememeber) 1388 | (progn 1389 | (run-once) 1390 | (add-hooks) 1391 | ;change-lines 1392 | ) 1393 | (progn ;else 1394 | (remove-my-overlays) 1395 | (remove-hooks) 1396 | ;change-lines 1397 | (setq-default some-defaults-i-need-to-remember) 1398 | )) 1399 | ) 1400 | 1401 | 1402 | 1403 | #+end_src 1404 | 1405 | Big problem with visual line approach is that you cannot scale past a certain point, only until the margins run out, when it suddenly scaling becomes bigger font size. 1406 | I need to make this work with olivetti mode better, or if necessary implement it myself. Don't really want to do that though, would rather rely on olivetti mode. 1407 | 1408 | #+begin_src emacs-lisp :tangle no 1409 | ;; custom pagebreakinterval 1410 | (defcustom pagebreakinterval 40) 1411 | 1412 | ;; getting visual line number pos 1413 | (defun get-visual-line-number-pos (number) 1414 | ... 1415 | ) 1416 | ;; putting the overlay there 1417 | (defun put-overlays () 1418 | (dotimes (i (/ (count-screen-lines) pagebreakinterval)) 1419 | (make-overlay (visual-line-number (* pagebreakinterval i)) ;start 1420 | (same) ;end 1421 | 'display (svg-image (rectangle)) ; 1422 | ))) 1423 | 1424 | ;; 1425 | (defun check-if-we-need-to-change-anything () 1426 | "Check if we need to change anything." 1427 | (dolist (list-of-overlays overlay) 1428 | (if (eq (position overlay) (* pagebreakinterval i)) t 1429 | (add-to-list 'overlays-to-change (overlay . new-pos))))) 1430 | 1431 | ;; some way of making sure that stays like it should 1432 | #+end_src 1433 | Another way of keeping track of position would be keeping track of the number of charachters and setting, somewhat intelligently, a "characters of a certain size per page". 1434 | - Pros 1435 | + Don't care about changing lines 1436 | + Finding nth carachter is easier 1437 | - Cons 1438 | + Can happen in the middle of a visual line (would be on me to compute that). This makes inserting the page-break even trickier 1439 | + Possibly more computation heavy, but probably not, the other thing is already very heavy 1440 | 1441 | #+begin_src emacs-lisp :tangle no 1442 | ;;similar as above, only the (check-if-we-need-to-change-anything) 1443 | ;; and (put-overlays) need to change 1444 | (defcustom number-of-charchters-per-page 2500 1445 | "Page is like 500 words, word has 5 characters by default, badabing badoom.") 1446 | 1447 | (defun put-overlays-chars () 1448 | (dotimes (i (round (/ (char-count) number-of-characters-per-page))) 1449 | (if (check-if-no-annoying-env) 1450 | (make-overlay (* number-of-charachters-per-page i) 1451 | (same) 1452 | 'display etc) 1453 | (progn ;else 1454 | (make-overlay (+ (* number-of-charachters-per-page i) (check-closest-distance-to-safety)) ;;maybe do it anyway if it's too far 1455 | etc 1456 | ) 1457 | ) 1458 | ))) 1459 | #+end_src 1460 | 1461 | ANSWER: I should use both! Count characters, but also lines: if there are too many lines, pagebreak, if there are too many characters, page break as well! Maybe just use the lines then anyway. 1462 | 1463 | **** Creating some cohesion between margins, line-numbers and font-size 1464 | 1465 | One of the big problems i need to solve (or opitons i need to provide) is whether zooming=zooming or zooming=scaling, i.e. does it just change the visual appearance of everything or does it increase the font size? 1466 | I think the best would be if that were two options, and by default it would do it badly like you would expect, and then I provide a new command which keeps everything nice. 1467 | 1468 | The main problem now is that the margins do not scale at all when zooming. This is probably something mr olivetti can fix, but I should take it into account nonetheless. 1469 | 1470 | **** Remembering pages 1471 | 1472 | I should just create a list with pages. 1473 | Either with line or character positions. I can update this instead of the page immediately, should save some trouble. 1474 | #+begin_src emacs-lisp :tangle no 1475 | (setq page-list (0)) 1476 | #+end_src 1477 | 1478 | **** Numbering pages 1479 | 1480 | I would like to not only have pages, but give them a page number, you know, for that extra pizzaz. 1481 | 1482 | The way to do this is probably to 1483 | a) keep track of page numbers, see above 1484 | b) give ~make-svg-rectangles~ the possibility of having a page number displayed 1485 | c) give the big assigning function/minor mode the tools to assign it to it 1486 | #+begin_src emacs-lisp :tangle no 1487 | ;; for the svg 1488 | (defun make-svg-rectangles h1 bg1 &opt page &rest other 1489 | "yayayya" 1490 | ;;let part 1491 | .. 1492 | ... 1493 | ... 1494 | ;; actual svg part 1495 | (when page 1496 | (svg-text svg 1497 | page ; maybe have options for roman numerals at some point 1498 | :font-size 60 ;idk 1499 | :x (round (/ (margin-width-pixel) 2)) 1500 | :y (/ h1 2) 1501 | :text-anchor "middle" 1502 | :fill-color (foreground-color 'comment) 1503 | )) 1504 | 1505 | ) 1506 | #+end_src 1507 | 1508 | 1509 | I want thing to be in the middle, and with olivetti mode the fringes become larger so it looks like a word processor, fantastic! 1510 | 1511 | 1512 | 1513 | #+begin_src emacs-lisp :tangle yes 1514 | (use-package! olivetti 1515 | :after org 1516 | ;:hook (olivetti-mode . double-header-line-mode) 1517 | :config 1518 | (setq olivetti-min-body-width 50 1519 | olivetti-body-width 68 1520 | olivetti-style 'fancy ; fantastic new layout 1521 | olivetti-margin-width 12) 1522 | (add-hook! 'olivetti-mode-hook (window-divider-mode -1)) 1523 | (add-hook! 'olivetti-mode-hook (set-face-attribute 'window-divider nil :foreground (face-background 'fringe) :background (face-background 'fringe))) 1524 | (add-hook! 'olivetti-mode-hook (set-face-attribute 'vertical-border nil :foreground (face-background 'fringe) :background (face-background 'fringe)))) 1525 | #+end_src 1526 | 1527 | *** Trying to get overviews 1528 | #+begin_src emacs-lisp :tangle yes 1529 | (require 'org-inlinetask) 1530 | #+end_src 1531 | 1532 | #+begin_src emacs-lisp :tangle yes 1533 | ;(use-package! org-sidebar 1534 | ; :after org 1535 | ; :config 1536 | ;(setq org-sidebar-default-fns '(org-sidebar--todo-items)) 1537 | ;(add-hook! 'org-sidebar-window-after-display-hook (solaire-mode 1)) 1538 | ; ) 1539 | #+end_src 1540 | *************** TODO tasktask 1541 | *************** END 1542 | 1543 | #+begin_src emacs-lisp :tangle yes 1544 | (after! org 1545 | (remove-hook 'org-agenda-finalize-hook '+org-exclude-agenda-buffers-from-workspace-h) 1546 | (remove-hook 'org-agenda-finalize-hook 1547 | '+org-defer-mode-in-agenda-buffers-h)) 1548 | 1549 | (defun thomas/org-get-overview () 1550 | "Open outline and sidebar." 1551 | (progn 1552 | (org-ol-tree) 1553 | (org-sidebar))) 1554 | #+end_src 1555 | 1556 | 1557 | *** STAY FOCUSED 1558 | Pretty cool: focus only the paragraph you're looking at. Don't really use it though. 1559 | #+begin_src emacs-lisp :tangle yes 1560 | (use-package! focus 1561 | :after org-roam 1562 | :config 1563 | (add-to-list 'focus-mode-to-thing '(org-mode . paragraph)) 1564 | ) 1565 | ;(require 'nano-writer) 1566 | #+end_src 1567 | 1568 | *** My eyes, they don't work so good no more 1569 | Increase the font-size a bit in org-mode 1570 | 1571 | FIXME: This is not how you do that dipshit 1572 | This increas the font size every singe time you open an org file, not ideal. 1573 | #+begin_src emacs-lisp :tangle no 1574 | (add-hook! 'org-mode-hook (doom/increase-font-size 1)) 1575 | #+end_src 1576 | 1577 | ** Custom org-mode profiles 1578 | 1579 | I would like org-mode to look and behave differently depending on what kind of note I'm visiting. Sometimes I want to write in an undistracted environment, sometimes I want to take notes and see a lot of things, sometimes I am configuring this thing and other times I'm going through my tasks: there's no real reason for org to look the same for all of these, and in fact that will probably end up more distracting than anything. 1580 | 1581 | I'm not sure what the best way of going about this is, but I'm thinking a minor mode will do. 1582 | 1583 | #+begin_src emacs-lisp :tangle no 1584 | (define-minor-mode org-profile-mode 1585 | "Sets a profile of hooks and minor-modes depending on the file-name." 1586 | :init-value nil 1587 | :global t 1588 | (when org-profile-mode 1589 | (when (eq major-mode 'org-mode) 1590 | (cond 1591 | ((string-match-p "[0-9]\\{14\\}" buffer-file-name) 1592 | (message "Note buffer")) 1593 | ((string-match-p "config.org" buffer-file-name) 1594 | (message "Config buffer")) 1595 | ((string-match-p "chapter" buffer-file-name) 1596 | (message "chapter buffer")) 1597 | ((org-agenda-file-p buffer-file-name) 1598 | (message "org-agenda buffer") 1599 | )) 1600 | ))) 1601 | #+end_src 1602 | 1603 | Something like: if file name contains YYYYMMDD-whatever.org, notes profile. 1604 | If file name is in org-agedenda, GTD profile. 1605 | Else, writing? No, would be better to have writing be a separate tag/file name thing. 1606 | 1607 | You should be able to indefinitely add profiles. This could be a big list, but that would get kind of hard and I don't know how those work. 1608 | 1609 | For now I can just hard code it, it's fine. 1610 | 1611 | 1612 | ** Custom Minor Modes 1613 | 1614 | Guaranteed not stolen. 1615 | Thank you Prot 1616 | #+begin_src emacs-lisp :tangle yes 1617 | ;;;;; 1618 | 1619 | 1620 | ;; 1621 | ;; Custom Minor Modes 1622 | ;; 1623 | ;;;;; 1624 | 1625 | (define-minor-mode prot/scroll-center-cursor-mode 1626 | "Toggle centred cursor scrolling behavior" 1627 | :init-value nil 1628 | :lighter " S=" 1629 | :global nil 1630 | (if prot/scroll-center-cursor-mode 1631 | (setq-local scroll-margin (* (frame-height) 2) 1632 | scroll-conservatively 0 1633 | maximum-scroll-margin 0.5) 1634 | (dolist (local '(scroll-preserve-screen-position 1635 | scroll-conservatively 1636 | maximum-scroll-margin 1637 | scroll-margin)) 1638 | (kill-local-variable `,local))) 1639 | ) 1640 | 1641 | 1642 | #+end_src 1643 | 1644 | 1645 | Make everything variable pitch, who the hell likes reading fixed-pitch? 1646 | 1647 | #+begin_src emacs-lisp :tangle yes 1648 | (define-minor-mode prot/variable-pitch-mode 1649 | "Toggle 'mixed-pitch-modei, except for programming modes" 1650 | :init-value nil 1651 | :global nil 1652 | (if prot/variable-pitch-mode 1653 | (unless (derived-mode-p 'prog-mode) 1654 | (variable-pitch-mode 1)) 1655 | (variable-pitch-mode -1))) 1656 | #+end_src 1657 | 1658 | NO line numbers. 1659 | 1660 | #+begin_src emacs-lisp :tangle yes 1661 | 1662 | (define-minor-mode prot/display-line-number-mode 1663 | "Disable line numbers, except for programming modes." 1664 | :init-value nil 1665 | :global nil 1666 | (if prot/display-line-number-mode 1667 | (unless (derived-mode-p 'prog-mode) 1668 | (display-line-numbers-mode -1)) 1669 | (display-line-numbers-mode 1))) 1670 | #+end_src 1671 | 1672 | Throw everything together, but in a bad way. 1673 | I don't use this anymore, but it did work, except for nano's writing mode, which was very hacky. 1674 | #+begin_src emacs-lisp :tangle no 1675 | (define-minor-mode thomas/writing-mode 1676 | "Toggle mixed-pitch-mode, center-text, scroll-center and disable line numbers, in writing modes." 1677 | :init-value nil 1678 | :global nil 1679 | (if thomas/writing-mode 1680 | (unless (derived-mode-p 'prog-mode) 1681 | (nano/writer-mode 1) 1682 | (prot/display-line-number-mode 1) 1683 | (prot/variable-pitch-mode 1) 1684 | (prot/scroll-center-cursor-mode 1) 1685 | (olivetti-mode 1) 1686 | (focus-mode 1) 1687 | (org-fragtog-mode 1) 1688 | (org-roam-buffer-deactivate) 1689 | (hl-line-mode -1) 1690 | (org-indent-mode -1) 1691 | (minimap-mode) 1692 | ;(centaur-tabs-mode -1) 1693 | ;(org-mode-restart) 1694 | ) 1695 | (prot/display-line-number-mode -1) 1696 | (prot/variable-pitch-mode -1) 1697 | (prot/scroll-center-cursor-mode -1) 1698 | (nano/writer-mode -1) 1699 | (olivetti-mode -1) 1700 | (focus-mode -1) 1701 | (org-fragtog-mode -1) 1702 | ;(centaur-tabs-mode 1 ) 1703 | (org-indent-mode 1) 1704 | (minimap-mode -1) 1705 | ;;(org-mode-restart) 1706 | 1707 | )) 1708 | 1709 | (defun thomas/writing-mode-fun () 1710 | "Toggle mixed-pitch-mode, center-text, scroll-center and disable line numbers, in writing modes." 1711 | ;;(interactive) 1712 | (org-superstar-mode -1) 1713 | (require 'nano-writer) 1714 | (writer-mode) 1715 | (prot/display-line-number-mode 1) 1716 | (prot/mixed-pitch-mode 1) 1717 | (prot/scroll-center-cursor-mode 1) 1718 | (olivetti-mode 1) 1719 | ) 1720 | 1721 | 1722 | #+end_src 1723 | 1724 | *** Nano writer mode implementation, not used atm 1725 | 1726 | #+begin_src elisp :tangle no 1727 | (defun writer-mode--num-format (numbering) 1728 | "Alternative numbering format for org-num. 1729 | First level: 1 | xxx 1730 | Second level: 1.1 — xxx 1731 | Third level: 1.1.1 - xxx 1732 | etc." 1733 | (if (= (length numbering) 1) 1734 | (propertize (concat (mapconcat 1735 | #'number-to-string 1736 | numbering ".") " | " ) 1737 | 'face `(:family "Roboto Condensed" 1738 | :height 250 1739 | :foreground ,nano-color-faded)) 1740 | (propertize (concat (mapconcat 1741 | #'number-to-string 1742 | numbering ".") " — " ) 1743 | 'face `(:family "Roboto Condensed" 1744 | :foreground ,nano-color-faded)))) 1745 | 1746 | ;; Specific face for headline stars 1747 | ;(font-lock-add-keywords 'writer-mode 1748 | ; '(("^*+ " 0 `(:family "Roboto Mono" 1749 | ; :height 140 1750 | ; :foreground ,nano-color-faded) prepend) 1751 | ; ) 'append) 1752 | 1753 | (defun writer-mode--compute-prefixes () 1754 | "Compute prefix strings for regular text and headlines." 1755 | 1756 | (setq org-indent--heading-line-prefixes 1757 | (make-vector org-indent--deepest-level nil)) 1758 | (setq org-indent--inlinetask-line-prefixes 1759 | (make-vector org-indent--deepest-level nil)) 1760 | (setq org-indent--text-line-prefixes 1761 | (make-vector org-indent--deepest-level nil)) 1762 | 1763 | (let* ((min-indent 5) 1764 | (indent (+ 1 (seq-max 1765 | (org-element-map 1766 | (org-element-parse-buffer) 'headline 1767 | #'(lambda (item) 1768 | (org-element-property :level item)))))) 1769 | (indent (max indent min-indent))) 1770 | 1771 | (dotimes (n org-indent--deepest-level) 1772 | (aset org-indent--heading-line-prefixes n 1773 | (make-string 1774 | (min indent (max 0 (- indent 1 n))) ?\s)) 1775 | (aset org-indent--inlinetask-line-prefixes n 1776 | (make-string indent ?\s)) 1777 | (aset org-indent--text-line-prefixes n 1778 | (make-string indent ?\s))))) 1779 | 1780 | 1781 | 1782 | (define-minor-mode nano/writer-mode 1783 | "Minor mode which makes writing a lot nicer by moving all the headllines to the left." 1784 | :init-value nil 1785 | :global nil 1786 | ;; Faces 1787 | (face-remap-add-relative 'org-level-1 1788 | :height 180) 1789 | (face-remap-add-relative 'org-level-2 1790 | :height 160) 1791 | (face-remap-add-relative 'org-level-3 1792 | :height 150) 1793 | (face-remap-add-relative 'org-document-info 1794 | :inherit 'nano-face-faded) 1795 | (face-remap-add-relative 'org-document-title 1796 | :foreground (face-foreground 'default) 1797 | :family "Roboto Slab" 1798 | :height 200 1799 | :weight 'medium) 1800 | ;; hide title / author ... keywords 1801 | (setq-local org-hidden-keywords '(title author date startup)) 1802 | 1803 | ;; Header line 1804 | (setq header-line-format nil) 1805 | 1806 | ;; Layout 1807 | (setq fill-column 72) 1808 | (setq-default line-spacing 1) 1809 | 1810 | ;; Indentation 1811 | (setq org-startup-folded nil) 1812 | (org-indent-mode) 1813 | (setq org-level-color-stars-only nil) 1814 | (setq org-hide-leading-stars nil) 1815 | (advice-add 'org-indent--compute-prefixes :override 1816 | #'writer-mode--compute-prefixes) 1817 | 1818 | ;; Numbering 1819 | (setq org-num-skip-unnumbered t) 1820 | (setq org-num-skip-footnotes t) 1821 | (setq org-num-max-level 3) 1822 | (setq org-num-face nil) 1823 | (org-num-mode) 1824 | (setq org-num-format-function 'writer-mode--num-format)) 1825 | 1826 | ;; Fringe shit 1827 | ;; 1828 | 1829 | #+end_src 1830 | 1831 | *** Trying to make olivetti-mode better, and failing 1832 | #+begin_src emacs-lisp :tangle no 1833 | (setq solaire-mode-remap-fringe nil) 1834 | ;(set-face-background 'solaire-fringe-face (face-background 'solaire-hl-line-face)) 1835 | 1836 | 1837 | (setq thomas-fringe-size 500) 1838 | (setq thomas-margin-size 10) 1839 | ; "Variable which sets the size of the fringes." 1840 | ; :type 'integer 1841 | ; :group 'thomas-aesthetics) 1842 | 1843 | (after! solaire-mode 1844 | (define-minor-mode thomas-fringe-mode 1845 | "Minor mode to hide the mode-line in the current buffer." 1846 | :init-value nil 1847 | :group 'thomas-aesthetics 1848 | (if (not thomas-fringe-mode) 1849 | (progn 1850 | (set-face-background 'solaire-fringe-face (face-background 'solaire-default-face)) 1851 | (setq left-fringe-width nil 1852 | right-fringe-width nil)) 1853 | (progn (set-face-background 'solaire-fringe-face (face-background 'solaire-hl-line-face)) 1854 | (setq left-fringe-width thomas-fringe-size 1855 | right-fringe-width thomas-fringe-size 1856 | left-margin-width thomas-margin-size 1857 | right-margin-width thomas-margin-size))))) 1858 | 1859 | ;(add-hook! 'org-mode-hook #'thomas-fringe-mode) 1860 | (add-hook! thomas-fringe-mode-hook (custom-set-faces! '(solaire-fringe-face :background (face-background)))) 1861 | ;(setq solaire-mode-remap-fringe nil) 1862 | 1863 | 1864 | #+end_src 1865 | 1866 | ** Org-latex export 1867 | 1868 | Why does it not simply do what I intend? 1869 | #+begin_src emacs-lisp :tangle yes 1870 | ;;;;;;;; 1871 | ;; 1872 | ;; org-latex-export 1873 | ;; 1874 | ;;;;;;;; 1875 | 1876 | (after! org 1877 | (add-to-list 'org-latex-classes 1878 | '("tufte" 1879 | "\\documentclass{tufte-book}" 1880 | ("\\part{%s}" . "\\part*{%s}") 1881 | ("\\chapter{%s}" . "\\chapter*{%s}") 1882 | ("\\section{%s}" . "\\section*{%s}") 1883 | ("\\subsection{%s}" . "\\subsection*{%s}") 1884 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) 1885 | (add-to-list 'org-latex-classes 1886 | '("memoir" 1887 | "\\documentclass{memoir}" 1888 | ("\\part{%s}" . "\\part*{%s}") 1889 | ("\\chapter{%s}" . "\\chapter*{%s}") 1890 | ("\\section{%s}" . "\\section*{%s}") 1891 | ("\\subsection{%s}" . "\\subsection*{%s}") 1892 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) 1893 | ) 1894 | (setq org-latex-text-markup-alist '((bold . "\\textbf{%s}") 1895 | (code . protectedtexttt) 1896 | (italic . "\\emph{%s}") 1897 | (strike-through . "\\sout{%s}") 1898 | (underline . "\\uline{%s}") 1899 | (verbatim . "{\\color{red}%s}"))) 1900 | (setq org-latex-default-packages-alist 1901 | '( 1902 | ;("AUTO" "inputenc" t 1903 | ; ("pdflatex")) 1904 | ;("T1" "fontenc" t 1905 | ; ("pdflatex")) 1906 | ("utf8" "inputenc" nil) 1907 | ("" "graphicx" t) 1908 | ("" "grffile" t) 1909 | ("" "longtable" nil) 1910 | ("" "wrapfig" nil) 1911 | ("" "rotating" nil) 1912 | ("normalem" "ulem" t) 1913 | ("" "amsmath" t) 1914 | ("" "textcomp" t) 1915 | ("" "amssymb" t) 1916 | ("" "capt-of" nil) 1917 | ("style=apa, backend=biber" "biblatex" nil) 1918 | ("" "braket" nil) 1919 | ("" "xcolor" nil) 1920 | ("" "hyperref" nil)) 1921 | ) 1922 | (setq org-latex-pdf-process 1923 | '("latexmk -shell-escape -bibtex -pdf %f -f") 1924 | org-latex-compiler "xelatex" 1925 | org-latex-bib-compiler "biber") 1926 | ) 1927 | ;(add-to-list 'org-latex-default-packages-alist 1928 | ; '("" "xcolor" nil)) 1929 | ;(add-to-list 'org-latex-default-packages-alist 1930 | ; '("" "braket" nil)) 1931 | ;(add-to-list 'org-latex-default-packages-alist '("style=apa, backend=biber" "biblatex" nil))) 1932 | ;(setq org-format-latex-header (concat org-format-latex-header "\n\\"))) 1933 | 1934 | 1935 | #+end_src 1936 | 1937 | 1938 | 1939 | 1940 | * Latex 1941 | My eternal enemy 1942 | 1943 | ** Compilation 1944 | I almost always want to fuck around with the fonts, so XeTeX is pretty much necessary. Although I would really like to learn LuaTex, I just haven't really seen any cool usecases of it. 1945 | #+begin_src emacs-lisp :tangle yes 1946 | (add-hook! 'latex-mode-hook (setq TeX-engine 'luatex) 99) 1947 | 1948 | ; (call-process TeX-shell nil (TeX-process-buffer-name file) nil 1949 | ; TeX-shell-command-option (concat command file)))) 1950 | #+end_src 1951 | 1952 | #+begin_src emacs-lisp :tangle yes 1953 | (after! latex 1954 | (setq 1955 | TeX-view-program-list 1956 | '(("Evince" "evince --page-index=%(outpage) %o") 1957 | ("preview-pane" latex-preview-pane-mode))) 1958 | (setq TeX-view-program-selection 1959 | '((output-pdf "Evince") 1960 | (output-dvi "open") 1961 | (output-pdf "open") 1962 | (output-html "open") 1963 | (output-pdf "preview-pane")))) 1964 | #+end_src 1965 | 1966 | 1967 | #+begin_src emacs-lisp :tangle yes 1968 | (after! latex 1969 | (defun latex-dwim () 1970 | "Compile the current file if it's a .tex file using LaTeXMK. 1971 | Otherwise compile the TeX file with the same name as the current TeXey file, 1972 | such as a .cls or .bib. 1973 | Otherwise compile all the .tex files you find using LaTexMK." 1974 | (interactive) 1975 | (save-buffer) 1976 | (if-let ((files (thomas/find-tex-file)) 1977 | (command 1978 | "latexmk -pdf -pdflatex=lualatex --synctex=1 -interaction=nonstopmode -file-line-error ") 1979 | (hook (nth 2 (assoc "LatexMk" TeX-command-list)))) 1980 | (if (stringp files) 1981 | (TeX-run-format "LatexMk" (concat command files) files) 1982 | (dolist (file files) 1983 | (TeX-run-format "LatexMk" (concat command file) file))) 1984 | (message "No file found, whoops."))) 1985 | 1986 | (defun thomas/find-tex-file () 1987 | "Find the correct TeX file(s)." 1988 | (let* ((fname (buffer-file-name)) 1989 | (ext (file-name-extension fname)) 1990 | (potential-main (f-join (f-slash (f-parent fname)) (concat (f-base fname) ".tex"))) 1991 | (alltex (f-entries (f-parent fname) (lambda (f) (f-ext-p f "tex")))) 1992 | (correct-file 1993 | (cond ((string= ext "tex") 1994 | fname) 1995 | ((seq-contains-p '("bib" "cls" "sty") ext) 1996 | (if (f-exists-p potential-main) 1997 | potential 1998 | alltex)) 1999 | (t nil)))) 2000 | correct-file))) 2001 | #+end_src 2002 | 2003 | #+begin_src emacs-lisp :tangle yes 2004 | (map! :map 'doom-leader-regular-map 2005 | :desc "LatexMk dwim" "l" #'latex-dwim) 2006 | #+end_src 2007 | #+RESULTS: 2008 | : thomas/find-tex-file 2009 | 2010 | * Project management 2011 | ** Treemacs 2012 | Pretty useful, and looks cool. I almost always want it on, so let's just add a hook for that. 2013 | 2014 | #+begin_src emacs-lisp :tangle no 2015 | (add-hook! 'after-init-hook #'treemacs) 2016 | #+end_src 2017 | 2018 | Get rid of that fugly divider 2019 | #+begin_src emacs-lisp :tangle no 2020 | (after! treemacs 2021 | (add-hook! 'treemacs-mode-hook (setq window-divider-mode -1 2022 | variable-pitch-mode 1 2023 | treemacs-follow-mode 1)) 2024 | ) 2025 | #+end_src 2026 | * COMMENT Programming 2027 | ** Regex 2028 | 2029 | Emacs regex sucks. Luckily, there are packages which make this much better, including making changes visual. 2030 | 2031 | #+begin_src emacs-lisp :tangle yes 2032 | (use-package! visual-regexp 2033 | :config 2034 | (map! :map 'doom-leader-regular-map 2035 | (:prefix ("v" . "visual regex") 2036 | :desc "Replace regexp" "r"#'vr/replace))) 2037 | 2038 | (use-package! visual-regexp-steroids 2039 | :after 'visual-regexp) 2040 | #+end_src 2041 | ** Docs 2042 | #+begin_src emacs-lisp :tangle yes 2043 | (use-package! devdocs 2044 | :after lsp 2045 | :config 2046 | (add-hook! 'devdocs-mode-hook 2047 | (face-remap-add-relative 'variable-pitch '(:family "Noto Sans")))) 2048 | #+end_src 2049 | ** LSP 2050 | LSP auto format is nice, but not as configurable as prettier, better let prettier handle it. 2051 | #+begin_src emacs-lisp :tangle yes 2052 | (add-hook! 'after-init-hook 2053 | (progn 2054 | (setq-hook! 'typescript-mode-hook +format-with :nil) 2055 | (add-hook! 'typescript-mode-hook 'prettier-mode) 2056 | (setq-hook! 'rjsx-mode-hook +format-with :nil) 2057 | (add-hook! 'rjsx-mode-hook 'prettier-mode) 2058 | (setq-hook! 'js2-mode-hook +format-with :nil) 2059 | (add-hook! 'js2-mode-hook 'prettier-mode) 2060 | (setq-hook! 'typescript-tsx-mode-hook +format-with :nil) 2061 | (add-hook! 'typescript-tsx-mode-hook 'prettier-mode) 2062 | )) 2063 | #+end_src 2064 | 2065 | ** Org 2066 | Settings for org-source blocks. 2067 | 2068 | *** JSX 2069 | #+begin_src emacs-lisp :tangle yes 2070 | (after! org 2071 | (add-to-list 'org-src-lang-modes '("jsx" . rjsx))) 2072 | #+end_src 2073 | 2074 | *** Special editing 2075 | * EVA 2076 | 2077 | The future is here. 2078 | #+begin_src emacs-lisp :tangle yes 2079 | 2080 | (use-package! eva 2081 | :init 2082 | (setq ess-history-file "~/OneDrive/self/data/.Rhistory") 2083 | (setq ess-ask-for-ess-directory nil) 2084 | (setq eva-ai-name "Ea" 2085 | eva-user-name "Thomas" 2086 | eva-user-birthday "2021-07-16" 2087 | eva-user-short-title "Bruh" 2088 | eva-fallback-to-emacs-idle t) 2089 | ; (setq eva--idle-secs-fn #'eva--idle-secs-gnome) 2090 | (setq eva-idle-log-path "~/OneDrive/self/data/idle.tsv") 2091 | (setq eva-buffer-focus-log-path "~/OneDrive/self/data/buffer-focus.tsv") 2092 | (setq eva-buffer-info-path "~/OneDrive/self/data/buffer-info.tsv") 2093 | (setq eva-main-ledger-path "~/OneDrive/self/journal/finances/l.ledger") 2094 | (setq eva-main-datetree-path "~/Notes/diary.org") 2095 | :config 2096 | (setq org-journal-dir "~/Notes/journal") 2097 | (setq org-journal-file-format "%F.org") 2098 | (require 'eva-builtin) 2099 | (require 'eva-activity) 2100 | (add-hook 'eva-after-load-vars-hook #'eva-check-dangling-clock) 2101 | (add-hook 'eva-after-load-vars-hook #'eva-check-org-variables) 2102 | (setq eva-items 2103 | (list 2104 | (eva-item-create :fn #'eva-greet 2105 | :min-hours-wait 1) 2106 | 2107 | (eva-item-create :fn #'eva-query-mood 2108 | :dataset "~/OneDrive/self/data/mood.tsv" 2109 | :min-hours-wait 1) 2110 | 2111 | (eva-item-create :fn #'eva-query-activity 2112 | :dataset "~/OneDrive/self/data/activities.tsv" 2113 | :min-hours-wait 1) 2114 | 2115 | (eva-item-create :fn #'eva-present-diary 2116 | :max-successes-per-day 1) 2117 | 2118 | (eva-item-create :fn #'eva-query-weight 2119 | :dataset "~/OneDrive/self/data/weight.tsv" 2120 | :max-entries-per-day 1) 2121 | 2122 | (eva-item-create :fn #'eva-plot-weight 2123 | :max-entries-per-day 1) 2124 | 2125 | (eva-item-create :fn #'eva-query-sleep 2126 | :dataset "~/OneDrive/self/data/sleep.tsv" 2127 | :min-hours-wait 5 2128 | :lookup-posted-time t) 2129 | 2130 | (eva-item-create :fn #'eva-present-ledger-report) 2131 | 2132 | (eva-item-create :fn #'eva-present-org-agenda) 2133 | 2134 | (eva-item-create :fn #'eva-query-ingredients 2135 | :dataset "~/OneDrive/self/data/ingredients.tsv" 2136 | :min-hours-wait 5) 2137 | 2138 | (eva-item-create :fn #'eva-query-cold-shower 2139 | :dataset "~/OneDrive/self/data/cold.tsv" 2140 | :max-entries-per-day 1) 2141 | 2142 | ;; you can inline define the functions too 2143 | (eva-item-create 2144 | :fn (eva-defun my-bye () 2145 | (message (eva-emit "All done for now.")) 2146 | (bury-buffer (eva-buffer-chat))) 2147 | :min-hours-wait 0))) 2148 | (transient-replace-suffix 'eva-dispatch '(0) 2149 | '["General actions" 2150 | ("q" "Quit" bury-buffer) 2151 | ("l" "View Ledger report" eva-present-ledger-report) 2152 | ("f" "View Ledger file" eva-present-ledger-file) 2153 | ("a" "View Org agenda" org-agenda-list)]) 2154 | 2155 | (define-key eva-chat-mode-map (kbd "l") #'eva-present-ledger-report) 2156 | (define-key eva-chat-mode-map (kbd "a") #'org-agenda-list) 2157 | 2158 | ;; Activities 2159 | (setq eva-activity-list 2160 | (list (eva-activity-create :name "sleep" 2161 | :cost-false-pos 3 2162 | :cost-false-neg 3) 2163 | 2164 | (eva-activity-create :name "studying" 2165 | :cost-false-pos 8 2166 | :cost-false-neg 8) 2167 | 2168 | (eva-activity-create :name "coding" 2169 | :cost-false-pos 5 2170 | :cost-false-neg 5) 2171 | 2172 | (eva-activity-create :name "working" 2173 | :cost-false-pos 5 2174 | :cost-false-neg 5) 2175 | (eva-activity-create :name "unknown" 2176 | :cost-false-pos 0 2177 | :cost-false-neg 0))) 2178 | (eva-mode)) 2179 | #+end_src 2180 | * Some other things, such as vterm 2181 | ** Mail 2182 | 2183 | #+begin_src emacs-lisp :tangle no 2184 | (require 'nano-mu4e) 2185 | (require 'nano-agenda) 2186 | #+end_src 2187 | 2188 | Misc 2189 | #+begin_src elisp :tangle yes 2190 | ;;;;;;;;;;;;; 2191 | ;;; 2192 | ;;; Other 2193 | ;;; 2194 | ;;;;;;;;;;;; 2195 | 2196 | (setq vterm-shell "/usr/bin/fish") 2197 | 2198 | (setq evil-escape-key-sequence "qd") 2199 | 2200 | #+end_src 2201 | 2202 | I would like to use tree-sitter instead of font-lock, but it does not really work well with .tsx and org-mode, so for now it will remain here. 2203 | #+begin_src emacs-lisp :tangle yes 2204 | 2205 | ;(use-package! tree-sitter 2206 | ; :config 2207 | ; (require 'tree-sitter-langs) 2208 | ; (global-tree-sitter-mode) 2209 | ; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) 2210 | 2211 | 2212 | ;(use-package tree-sitter-langs 2213 | ; :ensure t 2214 | ; :after tree-sitter 2215 | ; :config 2216 | ; (tree-sitter-require 'tsx) 2217 | ;(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))) 2218 | #+end_src 2219 | 2220 | Colors in the info box, jeej. 2221 | #+begin_src emacs-lisp :tangle yes 2222 | (use-package! info-colors 2223 | :commands (info-colors-fontify-node)) 2224 | 2225 | (add-hook 'Info-selection-hook 'info-colors-fontify-node) 2226 | 2227 | #+end_src 2228 | 2229 | * Keyboard shortcuts 2230 | 2231 | ** Great keybindings by moi 2232 | 2233 | I just map everything to SPC-r because doom is not using it and r stands for roam. 2234 | #+begin_src elisp :tangle yes 2235 | (map! :leader 2236 | (:prefix-map ("r" . "regular") 2237 | :desc "edit org-block" "e" #'org-edit-special 2238 | :desc "find note" "f" #'org-roam-node-find 2239 | :desc "find ref" "F" #'org-roam-ref-find 2240 | :desc "sync calendar" "s" #'org-caldav-sync 2241 | :desc "center scroll" "S" #'prot/scroll-center-cursor-mode 2242 | :desc "toggle buffer" "b" #'org-roam-buffer-toggle 2243 | :desc "insert note" "i" #'org-roam-node-insert 2244 | :desc "rg search roam" "g" #'org-roam-rg-search 2245 | :desc "quit notes" "q" #'org-noter-kill-session 2246 | :desc "tag (roam)" "t" #'org-roam-tag-add 2247 | :desc "tag (org)" "T" #'org-set-tags-command 2248 | :desc "pomodoro" "p" #'org-pomodoro 2249 | :desc "rebuid db" "d" #'org-roam-db-build-cache 2250 | :desc "cite" "c" #'helm-bibtex 2251 | :desc "thesaurus this word" "w" #'powerthesaurus-lookup-word-at-point 2252 | :desc "thesaurus lookup word" "W" #'powerthesaurus-lookup-word 2253 | :desc "outline" "o" #'org-ol-tree 2254 | (:prefix ("r" . "orui") 2255 | :desc "orui-mode" "r" #'org-roam-ui-mode 2256 | :desc "zoom" "z" #'orui-node-zoom 2257 | :desc "open" "o" #'orui-open 2258 | :desc "local" "l" #'orui-node-local 2259 | :desc "sync theme" "t" #'orui-sync-theme 2260 | :desc "follow" "f" #'orui-follow-mode) 2261 | (:prefix ("m" . "transclusion") 2262 | :desc "make link" "m" #'org-transclusion-make-from-link 2263 | :desc "transclusion mode" "t" #'org-transclusion-mode 2264 | :desc "add at point" "a" #'org-transclusion-add-at-point 2265 | :desc "add all in buffer" "A" #'org-transclusion-add-all-in-buffer 2266 | :desc "remove at point" "r" #'org-transclusion-remove-at-point 2267 | :desc "remove all in buffer" "R" #'org-transclusion-remove-all-in-buffer 2268 | :desc "start live edit" "s" #'org-transclusion-live-sync-start-at-point 2269 | :desc "stop live edit" "S" #'org-transclusion-live-sync-exit-at-point) ) 2270 | (:prefix ("d" . "GTD") 2271 | :desc "process inbox" "p"#'org-gtd-process-inbox 2272 | :desc "agenda list" "a"#'org-agenda-list 2273 | :desc "capture" "c"#'org-gtd-capture 2274 | :desc "show next" "n" #'org-gtd-show-all-next 2275 | :desc "show stuck project" "s" #'org-gtd-show-stuck-projects)) 2276 | #+end_src 2277 | 2278 | #+RESULTS: 2279 | : org-gtd-show-stuck-projects 2280 | 2281 | ** Window movement 2282 | The default window movement keys are super cumbersome, here are some better defaults. 2283 | 2284 | #+begin_src emacs-lisp :tangle yes 2285 | (map! "C-w" nil) 2286 | (global-set-key (kbd "C-") #'evil-window-next) 2287 | (global-set-key (kbd "C-") #'evil-window-prev) 2288 | (global-set-key (kbd "C-w") #'ace-window) 2289 | 2290 | (map! 2291 | :nvig "C-" #'evil-window-prev 2292 | :nvig "C-w" #'ace-window) 2293 | (map! :nvig "C-" #'evil-window-next) 2294 | #+end_src 2295 | 2296 | ** Selection 2297 | Wow, I wish I knew this was a thing before 2298 | 2299 | #+begin_src emacs-lisp :tangle yes 2300 | (map! :nvig "C-'" #'er/expand-region) 2301 | #+end_src 2302 | 2303 | ** Workman 2304 | 2305 | I use the Workman keyboard layout, this package sets most of the evil shortcuts to more sensible positions. I still need to add some more specific shortcuts, for instance for moving windows. 2306 | #+begin_src emacs-lisp :tangle yes 2307 | (evil-workman-global-mode t) 2308 | #+end_src 2309 | 2310 | #+begin_src emacs-lisp :tangle no 2311 | (evil-define-key '(normal) 2312 | "n" 'evil-next-visual-line 2313 | "e" 'evil-previous-visual-line 2314 | ) 2315 | #+end_src 2316 | This does not fix the window bindings, so we have to do that manually 2317 | 2318 | #+begin_src emacs-lisp :tangle yes 2319 | (map! 2320 | :map evil-window-map 2321 | "y" #'evil-window-left 2322 | "Y" #'+evil/window-move-left 2323 | "n" #'evil-window-down 2324 | "N" #'+evil/window-move-down 2325 | "e" #'evil-window-up 2326 | "E" #'+evil/window-move-up 2327 | "o" #'evil-window-right 2328 | "O" #'+evil/window-move-right) 2329 | #+end_src 2330 | 2331 | 2332 | This does not apply them to org-mode, which uses evil-org.el, but those are easily customized 2333 | 2334 | #+begin_src emacs-lisp :tangle yes 2335 | 2336 | (defun set-evil-keybindings () 2337 | (progn 2338 | ;(iscroll-mode 1) 2339 | (setq evil-org-movement-bindings 2340 | '((up . "e") 2341 | (down . "n") 2342 | (left . "y") 2343 | (right . "o"))) 2344 | (evil-define-key 'normal evil-org-mode-map 2345 | "o" 'evil-forward-char 2346 | "l" 'evil-org-open-below 2347 | "L" 'evil-org-open-above 2348 | "gy" 'org-backward-element 2349 | "gn" 'org-down-element 2350 | "ge" 'org-up-element 2351 | "go" 'org-forward-element 2352 | "n" 'evil-next-visual-line 2353 | "e" 'evil-previous-visual-line 2354 | ; "n" 'iscroll-forward-line 2355 | ; "e" 'iscroll-previous-line 2356 | "N" 'evil-next-line 2357 | "E" 'evil-previous-line 2358 | (kbd "C-n") 'follow-scroll-up 2359 | (kbd "C-e") 'follow-scroll-down 2360 | "zn" '+org-tree-to-indirect-other-window 2361 | "zs" '+org-tree-to-indirect-current-window 2362 | "zv" '+org-tree-to-indirect-other-frame) 2363 | )) 2364 | 2365 | (after! org (set-evil-keybindings)) 2366 | 2367 | ;; JUST TO BE REALLY FUCKING SURE 2368 | (add-hook 'org-mode-hook #'set-evil-keybindings 99) 2369 | (defun iscroll-mode-keybinds () 2370 | (when (eq iscroll-mode t) 2371 | (evil-define-key 'normal evil-org-mode-map 2372 | "n" 'iscroll-forward-line 2373 | "e" 'iscroll-previous-line))) 2374 | #+end_src 2375 | #+begin_src emacs-lisp :tangle no 2376 | (add-hook! 'org-mode-hook #'iscroll-mode) 2377 | (add-hook! 'iscroll-mode-hook #'iscroll-mode-keybinds) 2378 | #+end_src 2379 | 2380 | ** Ivy 2381 | 2382 | #+begin_src emacs-lisp :tangle no 2383 | (use-package! all-the-icons-ivy-rich 2384 | :init (all-the-icons-ivy-rich-mode)) 2385 | #+end_src 2386 | 2387 | ** Vertico 2388 | 2389 | #+begin_src emacs-lisp :tangle yes 2390 | (use-package! vertico-posframe 2391 | :after vertico 2392 | :config (vertico-posframe-mode 1) 2393 | (setq vertico-posframe-border-width 10 2394 | vertico-posframe-parameters '((internal-border-width . 10))) 2395 | (add-hook! 'vertico-posframe-mode-hook (set-face-background 'vertico-posframe-border (face-background 'fringe)))) 2396 | #+end_src 2397 | 2398 | ** Markdown 2399 | Add .mdx support 2400 | #+begin_src emacs-lisp :tangle yes 2401 | (add-to-list 'auto-mode-alist '("\\.mdx\\'" . markdown-mode)) 2402 | #+end_src` 2403 | * Custom functions I keep using 2404 | 2405 | ** Get margin width in pixel 2406 | #+begin_src emacs-lisp :tangle yes 2407 | (defun margin-width-pixel (&optional right) 2408 | "Return the width of the left or optionally right margin in pixels." 2409 | (if (window-margins) 2410 | (if right 2411 | (* (frame-char-width) (cdr (window-margins))) ;;right margin 2412 | (* (frame-char-width) (car (window-margins)))) 2413 | 0)) 2414 | #+end_src 2415 | ** Refresh org-latex 2416 | #+begin_src emacs-lisp :tangle yes 2417 | (defun org-latex-refresh () 2418 | (interactive) 2419 | (progn 2420 | (org-clear-latex-preview) 2421 | (org--latex-preview-region (buffer-end -1) (buffer-end 1)))) 2422 | #+end_src 2423 | 2424 | #+begin_src emacs-lisp :tangle yes 2425 | (defun org-latex-clear-preview () 2426 | (interactive) 2427 | (org-clear-latex-preview)) 2428 | #+end_src 2429 | * To configure 2430 | 2431 | ** Some packages to check out 2432 | 2433 | Binder 2434 | Org-marginalia 2435 | ... 2436 | 2437 | ** Tweaks I want to make 2438 | Make olivetti mode margins scale with the text size better 2439 | 2440 | Smaller headings, they are a bit ridiculous. 2441 | Zoom in a bit by default. 2442 | 2443 | ** TODO Set org env based on title 2444 | 2445 | I want some way to have emacs recognize settings based on either the title of the org file or its tags. The way I set things up is not conducive for every situation. 2446 | *** GTD 2447 | 2448 | Not sure yet. 2449 | *** Config 2450 | 2451 | Colorful theme so you can see the parentheses well. 2452 | No flyspell etc. 2453 | 2454 | *** Notes 2455 | 2456 | Less extreme distraction freeness, possibility to open multiple notes 2457 | Sans serif 2458 | Nroam/org-roam-buffer 2459 | Little EAF window with the map 2460 | Treemacs? 2461 | 2462 | *** Writing 2463 | 2464 | Distraction free layout with olivetti 2465 | Org num 2466 | Marginalia 2467 | Serif 2468 | ** PAGES 2469 | 2470 | *** Iscroll 2471 | 2472 | Works, but "forward-line" is very slow compared to "evil-next-visual-line", should make that compatible with both. 2473 | * Server 2474 | Emacs daemon gives me nothing but headaches. This is not ideal, but it at least works. 2475 | #+begin_src emacs-lisp :tangle yes 2476 | (server-start) 2477 | #+end_src 2478 | --------------------------------------------------------------------------------