├── .gitattributes ├── .gitignore ├── README.org ├── banner.txt ├── banner_min.txt ├── jake-emacs ├── custom.el ├── early-init.el ├── init.el ├── init.org ├── jib-funcs.el └── jib-variables.el ├── org ├── setupfiles_html │ ├── bigblow.setup │ ├── latex_css.setup │ ├── org.min_css.setup │ └── readtheorg.setup └── setupfiles_latex │ └── jake-beamer.setup ├── snippets ├── c-mode │ └── roland ├── java-mode │ ├── java_main_class │ └── system.out.println └── org-mode │ ├── ctrtbl │ ├── defintion │ ├── jake_lab_setup │ ├── left_arrow │ ├── notes_header │ ├── options │ ├── org_elisp_src_block │ ├── org_latex_block │ ├── org_properties │ ├── org_quote_block │ ├── org_src_block │ ├── quickoptions │ ├── right_arrow │ ├── setup_html │ ├── setup_latex │ ├── setup_title │ └── setup_title_stripped ├── sty_to_org.py ├── sync-emacs.sh └── themes ├── jake-doom-plain-classy-theme.el ├── jake-doom-plain-dark-theme.el ├── jake-doom-plain-theme.el └── nano-theme.el /.gitattributes: -------------------------------------------------------------------------------- 1 | *.org linguist-detectable=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | bookmarks 3 | jake-emacs/private.el 4 | lisp/ 5 | org/setupfiles_latex/jake-latex-* 6 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | jake-emacs/init.org -------------------------------------------------------------------------------- /banner.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | .ooooo. ooo. .oo. .oo. .oooo. .ooooo. .oooo.o 8 | d88' `88b `888P"Y88bP"Y88b `P )88b d88' `"Y8 d88( "8 9 | 888ooo888 888 888 888 .oP"888 888 `"Y88b. 10 | 888 .o 888 888 888 d8( 888 888 .o8 o. )88b 11 | `Y8bod8P' o888o o888o o888o `Y888""8o `Y8bod8P' 8""888P' 12 | 13 | 14 | -------------------------------------------------------------------------------- /banner_min.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | .ooooo. ooo. .oo. .oo. .oooo. .ooooo. .oooo.o 4 | d88' `88b `888P"Y88bP"Y88b `P )88b d88' `"Y8 d88( "8 5 | 888ooo888 888 888 888 .oP"888 888 `"Y88b. 6 | 888 .o 888 888 888 d8( 888 888 .o8 o. )88b 7 | `Y8bod8P' o888o o888o o888o `Y888""8o `Y8bod8P' 8""888P' 8 | 9 | MINIMAL EDITION 10 | -------------------------------------------------------------------------------- /jake-emacs/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-file "/Users/jake/.emacs.default/custom.el") 7 | '(custom-safe-themes 8 | '("e7820b899036ae7e966dcaaec29fd6b87aef253748b7de09e74fdc54407a7a02" "1781e8bccbd8869472c09b744899ff4174d23e4f7517b8a6c721100288311fa5" "6c98bc9f39e8f8fd6da5b9c74a624cbb3782b4be8abae8fd84cbc43053d7c175" "4a5aa2ccb3fa837f322276c060ea8a3d10181fecbd1b74cb97df8e191b214313" "3d54650e34fa27561eb81fc3ceed504970cc553cfd37f46e8a80ec32254a3ec3" "4b6b6b0a44a40f3586f0f641c25340718c7c626cbf163a78b5a399fbe0226659" "0568a5426239e65aab5e7c48fa1abde81130a87ddf7f942613bf5e13bf79686b" "5f19cb23200e0ac301d42b880641128833067d341d22344806cdad48e6ec62f6" "3a0d3f2a02d7bbd1ea19bd242f9a53adf2798c0870a9f437372a28bbc1a278df" "1ca9614f572a10bdbdbfde80dc909790df530ca6e5fee3e270f918321c947fbf" "6c386d159853b0ee6695b45e64f598ed45bd67c47f671f69100817d7db64724d" "8f5a7a9a3c510ef9cbb88e600c0b4c53cdcdb502cfe3eb50040b7e13c6f4e78e" "a6838a652cdc2f7c4591998db5b5c8d1b872fc49e3985163a3aabc0263d6c2fd" "82dc7736d9cb3940fd995cf4fb5191fc82d737fa9a970952d0c83e666c1ede50" "c256ccc73bc6588b5cf77f0e4c9d9bb80a6ebec19c7841ea21fd920642740f2d" "7546a14373f1f2da6896830e7a73674ef274b3da313f8a2c4a79842e8a93953e" default)) 9 | '(org-agenda-files '("/Users/jake/Dropbox/org/work.org")) 10 | '(org-agenda-sorting-strategy 11 | '((agenda scheduled-up habit-down time-up priority-down category-keep) 12 | (todo priority-down category-keep) 13 | (tags priority-down category-keep) 14 | (search category-keep))) 15 | '(org-ql-views 16 | '(("Columbia Todo" :buffers-files org-agenda-files :query 17 | (and 18 | (todo) 19 | (not 20 | (tags "defer")) 21 | (or 22 | (tags "p") 23 | (tags "jib") 24 | (tags "ec") 25 | (tags "lt") 26 | (todo "PROJ") 27 | (todo "STUDY") 28 | (deadline auto))) 29 | :title "Columbia Todo" :sort 30 | (deadline date priority) 31 | :super-groups 32 | ((:name "Personal:" :tag "p" :order 10) 33 | (:name "Extracurricular:" :tag "ec" :order 7) 34 | (:name "LitHum:" :tag "lit") 35 | (:name "Education Foundations" :tag "edu") 36 | (:name "Calculus:" :tag "calc3") 37 | (:name "FroSci:" :tag "sci") 38 | (:name "Data Structures:" :tag "ds")) 39 | :narrow nil) 40 | ("CPB Todos and Ideas " :buffers-files 41 | ("~/Dropbox/org/cpb.org") 42 | :query 43 | (or 44 | (tags "todo") 45 | (tags "idea")) 46 | :title "CPB Todos, Ideas, Projects " :super-groups 47 | ((:auto-outline-path)) 48 | :narrow nil) 49 | ("Refile" :buffers-files 50 | ("~/Dropbox/org/cpb.org") 51 | :query 52 | (parent 53 | (heading "Refile")) 54 | :super-groups 55 | ((:auto-outline-path))) 56 | ("CPB Articles All" :query 57 | (tags "article") 58 | :title "CPB Articles All" :super-groups 59 | ((:auto-outline-path)) 60 | :buffers-files "~/Dropbox/org/cpb.org") 61 | ("CPB Articles Notes on Life" :query 62 | (and 63 | (olps "Notes on Life") 64 | (tags "article")) 65 | :title "CPB Articles Notes on Life" :super-groups 66 | ((:auto-outline-path)) 67 | :buffers-files "~/Dropbox/org/cpb.org") 68 | ("All Todos" :buffers-files 69 | ("~/Dropbox/org/work.org") 70 | :query 71 | (todo) 72 | :title "All Todos" :sort 73 | (deadline date priority) 74 | :super-groups 75 | ((:name "Personal:" :tag "p" :order 10) 76 | (:name "LitHum:" :tag "lit") 77 | (:name "Education Foundations:" :tag "edu") 78 | (:name "Calculus:" :tag "calc3") 79 | (:name "FroSci:" :tag "sci") 80 | (:name "Data Structures:" :tag "ds") 81 | (:name "Extracurricular:" :tag "ec")) 82 | :narrow nil) 83 | ("Unscheduled TODOs" :buffers-files 84 | ("~/Dropbox/org/work.org") 85 | :query 86 | (and 87 | (todo) 88 | (not 89 | (scheduled))) 90 | :title "Unscheduled Todos" :sort 91 | (deadline date priority) 92 | :super-groups 93 | ((:name "Personal:" :tag "p" :order 10) 94 | (:name "LitHum:" :tag "lit") 95 | (:name "Education Foundations" :tag "edu") 96 | (:name "Calculus:" :tag "calc3") 97 | (:name "FroSci:" :tag "sci") 98 | (:name "Data Structures:" :tag "ds") 99 | (:name "Extracurricular" :tag "ec")) 100 | :narrow nil))) 101 | '(package-selected-packages 102 | '(jinx ox-moderncv writegood-mode org-fragtog valign nano-theme org-pomodoro markdown-mode auctex default-text-scale ef-themes shell-here quickrun org-modern org-hyperscheduler yasnippet avy flyspell-correct prescient ivy kind-icon corfu hydra aio org-vcard hl-prog-extra org-preview-html org-preview-html-mode cape fontaine pdf-tools tablist doom-modeline pyvenv org-super-agenda visual-fill-column evil popper writeroom-mode which-key web-mode use-package unfill undo-fu svg-lib super-save smartparens simpleclip shrink-path reveal-in-osx-finder restart-emacs rainbow-mode python-mode presentation ox-reveal ox-hugo org-tree-slide org-superstar org-ql org-gcal org-download org-appear org-analyzer mw-thesaurus modus-themes mixed-pitch magit kaolin-themes ivy-prescient ivy-hydra htmlize hl-todo hide-mode-line gnuplot general gcmh flyspell-correct-ivy evil-surround evil-snipe evil-org evil-collection evil-anzu esxml elpy doom-themes diminish deft dashboard counsel centered-cursor-mode burly bufler auto-virtualenv all-the-icons-ivy-rich ace-window)) 103 | '(pdf-view-midnight-colors (cons "#bbc2cf" "#282c34")) 104 | '(safe-local-variable-values 105 | '((eval flyspell-mode-off) 106 | (org-cycle-include-plain-lists . integrade) 107 | (org-cycle-include-plain-lists) 108 | (org-use-tag-inheritance) 109 | (org-image-actual-width . 500) 110 | (org-cycle-include-plain-lists . integrate))) 111 | '(warning-suppress-types 112 | '((comp) 113 | ((defvaralias losing-value modus-themes-slanted-constructs)) 114 | (yasnippet backquote-change)))) 115 | 116 | (custom-set-faces 117 | ;; custom-set-faces was added by Custom. 118 | ;; If you edit it by hand, you could mess it up, so be careful. 119 | ;; Your init file should contain only one such instance. 120 | ;; If there is more than one, they won't work right. 121 | '(mode-line ((t (:height 135)))) 122 | '(mode-line-inactive ((t (:height 135)))) 123 | '(org-deadline ((t (:foreground nil :inherit org-scheduled-today)))) 124 | '(org-drawer ((t (:height 0.6 :inherit shadow)))) 125 | '(org-ellipsis ((t (:foreground unspecified :inherit 'shadow)))) 126 | '(org-imminent-deadline ((t (:foreground nil :inherit org-warning)))) 127 | '(org-level-3 ((t (:inherit outline-3 :weight regular)))) 128 | '(org-level-4 ((t (:inherit outline-4 :weight regular)))) 129 | '(org-level-5 ((t (:inherit outline-5 :weight regular)))) 130 | '(org-link ((t (:inherit link :weight regular)))) 131 | '(org-scheduled-previously ((t (:foreground nil :weight bold :foreground "red1" :inherit org-scheduled)))) 132 | '(org-scheduled-today ((t (:foreground nil :weight bold :inherit org-scheduled)))) 133 | '(org-upcoming-deadline ((t (:foreground nil :inherit org-warning)))) 134 | '(org-upcoming-distant-deadline ((t (:foreground nil :weight normal :inherit org-warning)))) 135 | '(org-warning ((t (:underline nil)))) 136 | '(variable-pitch ((t (:height 1.0 :family "Nunito Sans"))))) 137 | -------------------------------------------------------------------------------- /jake-emacs/early-init.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t; -*- 2 | 3 | ;; -------------------------------------------------------------------------------- ;; 4 | ;; This early-init.el file was auto-tangled from an orgmode file. (C) Jake B ;; 5 | ;; -------------------------------------------------------------------------------- ;; 6 | 7 | ;; Garbage Collections 8 | (setq gc-cons-percentage 0.6) 9 | 10 | ;; Compile warnings 11 | ;; (setq warning-minimum-level :emergency) 12 | (setq native-comp-async-report-warnings-errors 'silent) ;; native-comp warning 13 | (setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local)) 14 | 15 | 16 | ;; MISC OPTIMIZATIONS ---- 17 | ;;; optimizations (froom Doom's core.el). See that file for descriptions. 18 | (setq idle-update-delay 1.0) 19 | 20 | ;; Disabling bidi (bidirectional editing stuff) 21 | (setq-default bidi-display-reordering 'left-to-right 22 | bidi-paragraph-direction 'left-to-right) 23 | (setq bidi-inhibit-bpa t) ; emacs 27 only - disables bidirectional parenthesis 24 | 25 | (setq-default cursor-in-non-selected-windows nil) 26 | (setq highlight-nonselected-windows nil) 27 | (setq fast-but-imprecise-scrolling t) 28 | (setq inhibit-compacting-font-caches t) 29 | 30 | (menu-bar-mode 0) 31 | 32 | (setq mac-command-modifier 'meta 33 | mac-option-modifier nil 34 | mac-control-modifier 'control 35 | mac-right-command-modifier 'super 36 | mac-right-control-modifier 'hyper) 37 | 38 | (global-set-key (kbd "") 'keyboard-escape-quit) 39 | 40 | ;; Window configuration 41 | (setq frame-inhibit-implied-resize t) ;; Supposed to hasten startup 42 | 43 | ;; Less clutter (this is what dfrosted12 uses so I trust that) 44 | (add-to-list 'default-frame-alist '(tool-bar-lines . 0)) 45 | (add-to-list 'default-frame-alist '(menu-bar-lines . 0)) 46 | (add-to-list 'default-frame-alist '(vertical-scroll-bars)) 47 | 48 | ;; This makes the Aqua titlebar color the same as Emacs. 49 | (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) 50 | -------------------------------------------------------------------------------- /jake-emacs/init.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t; -*- 2 | ;;; 3 | ;;; Jake B's Emacs Configuration 4 | ;;; 5 | 6 | ;; Copyright (C) Jake B 7 | ;; Author: Jake B 8 | ;; URL: https://github.com/jakebox/.emacs 9 | ;; This file is not part of GNU Emacs. 10 | ;; This file is free software. 11 | 12 | ;; ------- The following code was auto-tangled from an Orgmode file. ------- ;; 13 | 14 | (require 'package) 15 | 16 | (setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) 17 | 18 | (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) ;; ELPA and NonGNU ELPA are default in Emacs28 19 | 20 | (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") ;; w/o this Emacs freezes when refreshing ELPA 21 | 22 | (package-initialize) 23 | (setq package-enable-at-startup nil) 24 | 25 | (require 'use-package) 26 | (setq use-package-always-ensure t) 27 | (setq use-package-verbose nil) 28 | 29 | (use-package gcmh 30 | :diminish gcmh-mode 31 | :config 32 | (setq gcmh-idle-delay 5 33 | gcmh-high-cons-threshold (* 16 1024 1024)) ; 16mb 34 | (gcmh-mode 1)) 35 | 36 | (add-hook 'emacs-startup-hook 37 | (lambda () 38 | (setq gc-cons-percentage 0.1))) ;; Default value for `gc-cons-percentage' 39 | 40 | (add-hook 'emacs-startup-hook 41 | (lambda () 42 | (message "Emacs ready in %s with %d garbage collections." 43 | (format "%.2f seconds" 44 | (float-time 45 | (time-subtract after-init-time before-init-time))) 46 | gcs-done))) 47 | 48 | (load (expand-file-name "jib-variables.el" user-emacs-directory)) 49 | 50 | ;;;;;;;;;;;;;;;;;;;;;;;;;; 51 | ;; Calculated variables ;; 52 | ;;;;;;;;;;;;;;;;;;;;;;;;;; 53 | 54 | ;; Set `jib/computer' to 'laptop or 'desktop. 55 | (let ((sys (system-name))) 56 | (if (or (string= sys "MJBs-MacBook-Air.local") (string= sys "mjbs-air.lan")) 57 | (setq jib/computer 'laptop) 58 | (setq jib/computer 'desktop))) 59 | 60 | (let ((sys (system-name))) 61 | (if (string= sys "KilgoreTrout.local") 62 | (setq jib/computer 'laptopN))) 63 | 64 | (setq jib/computer 'laptopN) ;; manual override 2022-09-14 65 | 66 | (load (expand-file-name "jib-funcs.el" user-emacs-directory)) 67 | (load (expand-file-name "private.el" user-emacs-directory)) 68 | (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) 69 | 70 | (load custom-file) 71 | 72 | ;; I put mostly stuff I find online in this "lisp" folder in my emacs-stuff. 73 | ;; Add every directory in that folder to the load-path. 74 | (let ((default-directory (directory-file-name (concat jib/emacs-stuff "/lisp")))) 75 | (normal-top-level-add-subdirs-to-load-path)) 76 | 77 | (require 'on) ;; on.el – utility hooks and functions from Doom Emacs 78 | 79 | (setq register-preview-delay 0) ;; Show registers ASAP 80 | 81 | (set-register ?i (cons 'file (concat org-directory "/cpb.org"))) 82 | (set-register ?h (cons 'file (concat org-directory "/work.org"))) 83 | (set-register ?C (cons 'file (concat jib/emacs-stuff "/jake-emacs/init.org"))) 84 | (set-register ?A (cons 'file (concat org-directory "/org-archive/homework-archive.org_archive"))) 85 | (set-register ?T (cons 'file (concat org-directory "/org-archive/todo-archive.org_archive"))) 86 | 87 | ;; (if (eq jib/computer 'laptopN) 88 | ;; (progn 89 | ;; (setenv "PATH" "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.pyenv/bin:/usr/local/sbin:/Users/jake/bin:/Users/jake/.doom-emacs/bin:/Library/TeX/texbin") 90 | ;; ;; (setq exec-path '("/opt/homebrew/bin" "/opt/homebrew/sbin" "/usr/local/bin" "/usr/bin" "/usr/sbin" "/bin")) 91 | ;; ) 92 | ;; (progn 93 | ;; ;; (setenv "PATH" "/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/jake/.pyenv/shims:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin:/Users/jake/bin:/Users/jake/doom-emacs/bin:/Library/TeX/texbin") 94 | ;; (setq exec-path '("/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims" 95 | ;; "/Users/jake/.pyenv/shims" "/usr/local/bin" "/bin" 96 | ;; "/usr/bin" "/usr/sbin" "/usr/local/sbin" "/sbin" 97 | ;; "/Users/jake/bin" "/Users/jake/doom-emacs/bin" 98 | ;; "/Library/TeX/texbin")))) 99 | 100 | (if (eq jib/computer 'laptopN) 101 | (setq insert-directory-program "/opt/homebrew/bin/gls") 102 | (setq insert-directory-program "/usr/local/bin/gls")) 103 | 104 | (setq browse-url-firefox-program "/Applications/Firefox.app/Contents/MacOS/firefox") 105 | (setq browse-url-chrome-program "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome") 106 | 107 | (server-start) 108 | 109 | ;; A cool mode to revert window configurations. 110 | (winner-mode 1) 111 | 112 | ;; INTERACTION ----- 113 | (setq use-short-answers t) ;; When emacs asks for "yes" or "no", let "y" or "n" suffice 114 | (setq confirm-kill-emacs 'yes-or-no-p) ;; Confirm to quit 115 | (setq initial-major-mode 'org-mode ;; Major mode of new buffers 116 | initial-scratch-message "" 117 | initial-buffer-choice t) ;; Blank scratch buffer 118 | 119 | ;; WINDOW ----------- 120 | (setq frame-resize-pixelwise t) 121 | (setq ns-pop-up-frames nil) ;; When opening a file (like double click) on Mac, use an existing frame 122 | (setq window-resize-pixelwise nil) 123 | (setq split-width-threshold 80) ;; How thin the window should be to stop splitting vertically (I think) 124 | 125 | ;; LINES ----------- 126 | (setq-default truncate-lines t) 127 | (setq-default tab-width 4) 128 | (setq-default fill-column 80) 129 | (setq line-move-visual t) ;; C-p, C-n, etc uses visual lines 130 | 131 | (use-package paren 132 | ;; highlight matching delimiters 133 | :ensure nil 134 | :config 135 | (setq show-paren-delay 0.1 136 | show-paren-highlight-openparen t 137 | show-paren-when-point-inside-paren t 138 | show-paren-when-point-in-periphery t) 139 | (show-paren-mode 1)) 140 | 141 | (setq sentence-end-double-space nil) ;; Sentences end with one space 142 | 143 | (setq bookmark-set-fringe-mark nil) 144 | 145 | ;; SCROLLING --------- 146 | (setq scroll-conservatively 101) 147 | (setq 148 | mouse-wheel-follow-mouse 't 149 | mouse-wheel-progressive-speed nil 150 | ;; The most important setting of all! Make each scroll-event move 2 lines at 151 | ;; a time (instead of 5 at default). Simply hold down shift to move twice as 152 | ;; fast, or hold down control to move 3x as fast. Perfect for trackpads. 153 | mouse-wheel-scroll-amount '(1 ((shift) . 3) ((control) . 6))) 154 | (setq mac-redisplay-dont-reset-vscroll t ;; sane trackpad/mouse scroll settings (doom) 155 | mac-mouse-wheel-smooth-scroll nil) 156 | 157 | ;; BELL/WARNING ------------ 158 | (setq visible-bell nil) ;; Make it ring (so no visible bell) (default) 159 | (setq ring-bell-function 'ignore) ;; BUT ignore it, so we see and hear nothing 160 | 161 | 162 | ;; Uses system trash rather than deleting forever 163 | (setq trash-directory (concat jib/home ".Trash")) 164 | (setq delete-by-moving-to-trash t) 165 | 166 | ;; Try really hard to keep the cursor from getting stuck in the read-only prompt 167 | ;; portion of the minibuffer. 168 | (setq minibuffer-prompt-properties '(read-only t intangible t cursor-intangible t face minibuffer-prompt)) 169 | (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) 170 | 171 | ;; Explicitly define a width to reduce the cost of on-the-fly computation 172 | (setq-default display-line-numbers-width 3) 173 | 174 | ;; When opening a symlink that links to a file in a git repo, edit the file in the 175 | ;; git repo so we can use the Emacs vc features (like Diff) in the future 176 | (setq vc-follow-symlinks t) 177 | 178 | ;; BACKUPS/LOCKFILES -------- 179 | ;; Don't generate backups or lockfiles. 180 | (setq create-lockfiles nil 181 | make-backup-files nil 182 | ;; But in case the user does enable it, some sensible defaults: 183 | version-control t ; number each backup file 184 | backup-by-copying t ; instead of renaming current file (clobbers links) 185 | delete-old-versions t ; clean up after itself 186 | kept-old-versions 5 187 | kept-new-versions 5 188 | backup-directory-alist (list (cons "." (concat user-emacs-directory "backup/")))) 189 | 190 | (use-package recentf 191 | :ensure nil 192 | :config 193 | (setq ;;recentf-auto-cleanup 'never 194 | ;; recentf-max-menu-items 0 195 | recentf-max-saved-items 200) 196 | (setq recentf-filename-handlers ;; Show home folder path as a ~ 197 | (append '(abbreviate-file-name) recentf-filename-handlers)) 198 | (recentf-mode)) 199 | 200 | (require 'uniquify) 201 | (setq uniquify-buffer-name-style 'forward) 202 | 203 | ;; ENCODING ------------- 204 | (when (fboundp 'set-charset-priority) 205 | (set-charset-priority 'unicode)) ; pretty 206 | (prefer-coding-system 'utf-8) ; pretty 207 | (setq locale-coding-system 'utf-8) ; please 208 | 209 | (setq default-input-method "spanish-postfix") ;; When I need to type in Spanish (switch with C-\) 210 | 211 | (setq blink-cursor-interval 0.6) 212 | (blink-cursor-mode 0) 213 | 214 | (setq save-interprogram-paste-before-kill t 215 | apropos-do-all t 216 | mouse-yank-at-point t) 217 | 218 | (setq what-cursor-show-names t) ;; improves C-x = 219 | 220 | ;; Weird thing where `list-colors-display` doesn't show all colors. 221 | ;; https://bug-gnu-emacs.gnu.narkive.com/Bo6OdySs/bug-5683-23-1-93-list-colors-display-doesn-t-show-all-colors 222 | (setq x-colors (ns-list-colors)) 223 | 224 | (setq dired-kill-when-opening-new-dired-buffer t) 225 | 226 | (setq reb-re-syntax 'string) ;; https://www.masteringemacs.org/article/re-builder-interactive-regexp-builder 227 | 228 | (use-package which-key 229 | :diminish which-key-mode 230 | :init 231 | (which-key-mode) 232 | (which-key-setup-minibuffer) 233 | :config 234 | (setq which-key-idle-delay 0.3) 235 | (setq which-key-prefix-prefix "◉ ") 236 | (setq which-key-sort-order 'which-key-key-order-alpha 237 | which-key-min-display-lines 3 238 | which-key-max-display-columns nil)) 239 | 240 | (use-package evil 241 | :init 242 | (setq evil-want-keybinding nil) ;; don't load Evil keybindings in other modes 243 | (setq evil-want-fine-undo t) 244 | (setq evil-want-Y-yank-to-eol t) 245 | :config 246 | 247 | (evil-set-initial-state 'dashboard-mode 'motion) 248 | (evil-set-initial-state 'debugger-mode 'motion) 249 | (evil-set-initial-state 'pdf-view-mode 'motion) 250 | (evil-set-initial-state 'bufler-list-mode 'emacs) 251 | (evil-set-initial-state 'inferior-python-mode 'emacs) 252 | (evil-set-initial-state 'term-mode 'emacs) 253 | (evil-set-initial-state 'calc-mode 'emacs) 254 | 255 | ;; ----- Keybindings 256 | ;; I tried using evil-define-key for these. Didn't work. 257 | (define-key evil-window-map "\C-q" 'evil-delete-buffer) ;; Maps C-w C-q to evil-delete-buffer (The first C-w puts you into evil-window-map) 258 | (define-key evil-window-map "\C-w" 'kill-this-buffer) 259 | (define-key evil-motion-state-map "\C-b" 'evil-scroll-up) ;; Makes C-b how C-u is 260 | (define-key evil-motion-state-map [?\s-\\] 'evil-execute-in-emacs-state) ;; `super-\', by default it's just `\' 261 | 262 | ;; ----- Setting cursor colors 263 | (setq evil-emacs-state-cursor '("#649bce" box)) 264 | (setq evil-normal-state-cursor '("#d9a871" box)) 265 | (setq evil-operator-state-cursor '("#ebcb8b" hollow)) 266 | (setq evil-visual-state-cursor '("#677691" box)) 267 | (setq evil-insert-state-cursor '("#eb998b" (bar . 2))) 268 | (setq evil-replace-state-cursor '("#eb998b" hbar)) 269 | (setq evil-motion-state-cursor '("#ad8beb" box)) 270 | 271 | (evil-mode 1)) 272 | 273 | (use-package evil-surround 274 | :after evil 275 | :defer 2 276 | :config 277 | (global-evil-surround-mode 1)) 278 | 279 | ;; (use-package evil-collection 280 | ;; :after evil 281 | ;; :config 282 | ;; (setq evil-collection-mode-list '(dired (custom cus-edit) (package-menu package) calc diff-mode)) 283 | ;; (evil-collection-init)) 284 | 285 | ;; (use-package evil-snipe 286 | ;; :diminish evil-snipe-mode 287 | ;; :diminish evil-snipe-local-mode 288 | ;; :after evil 289 | ;; :config 290 | ;; (evil-snipe-mode +1)) 291 | 292 | ;; not working right now, from https://jblevins.org/log/dired-open 293 | ;; (evil-define-key 'motion 'dired-mode-map "s-o" '(lambda () (interactive) 294 | ;; (let ((fn (dired-get-file-for-visit))) 295 | ;; (start-process "default-app" nil "open" fn)))) 296 | 297 | ;; (evil-define-key 'motion 'dired-mode-map "Q" 'kill-this-buffer) 298 | (evil-define-key 'motion help-mode-map "q" 'kill-this-buffer) 299 | (evil-define-key 'motion calendar-mode-map "q" 'kill-this-buffer) 300 | 301 | (use-package general) 302 | 303 | (general-define-key 304 | :states '(normal motion visual) 305 | :keymaps 'override 306 | :prefix "SPC" 307 | 308 | ;; Top level functions 309 | "/" '(jib/rg :which-key "ripgrep") 310 | ";" '(spacemacs/deft :which-key "deft") 311 | ":" '(project-find-file :which-key "p-find file") 312 | "." '(counsel-find-file :which-key "find file") 313 | "," '(counsel-recentf :which-key "recent files") 314 | "TAB" '(switch-to-prev-buffer :which-key "previous buffer") 315 | "SPC" '(counsel-find-file :which-key "M-x") 316 | "q" '(save-buffers-kill-terminal :which-key "quit emacs") 317 | "r" '(jump-to-register :which-key "registers") 318 | "c" 'org-capture 319 | 320 | ;; "Applications" 321 | "a" '(nil :which-key "applications") 322 | "ao" '(org-agenda :which-key "org-agenda") 323 | "am" '(mu4e :which-key "mu4e") 324 | "aC" '(calc :which-key "calc") 325 | "ac" '(org-capture :which-key "org-capture") 326 | "aqq" '(org-ql-view :which-key "org-ql-view") 327 | "aqs" '(org-ql-search :which-key "org-ql-search") 328 | 329 | "ab" '(nil :which-key "browse url") 330 | "abf" '(browse-url-firefox :which-key "firefox") 331 | "abc" '(browse-url-chrome :which-key "chrome") 332 | "abx" '(xwidget-webkit-browse-url :which-key "xwidget") 333 | "abg" '(jib/er-google :which-key "google search") 334 | 335 | "ad" '(dired :which-key "dired") 336 | 337 | ;; Buffers 338 | "b" '(nil :which-key "buffer") 339 | "bb" '(counsel-switch-buffer :which-key "switch buffers") 340 | "bd" '(evil-delete-buffer :which-key "delete buffer") 341 | "bs" '(jib/switch-to-scratch-buffer :which-key "scratch buffer") 342 | "bm" '(jib/kill-other-buffers :which-key "kill other buffers") 343 | "bi" '(clone-indirect-buffer :which-key "indirect buffer") 344 | "br" '(revert-buffer :which-key "revert buffer") 345 | 346 | ;; Files 347 | "f" '(nil :which-key "files") 348 | "fb" '(counsel-bookmark :which-key "bookmarks") 349 | "ff" '(counsel-find-file :which-key "find file") 350 | "fn" '(spacemacs/new-empty-buffer :which-key "new file") 351 | "fr" '(counsel-recentf :which-key "recent files") 352 | "fR" '(rename-file :which-key "rename file") 353 | "fs" '(save-buffer :which-key "save buffer") 354 | "fS" '(evil-write-all :which-key "save all buffers") 355 | "fo" '(reveal-in-osx-finder :which-key "reveal in finder") 356 | "fO" '(jib/open-buffer-file-mac :which-key "open buffer file") 357 | 358 | ;; Jake 359 | "j" '(nil :which-key "jake") 360 | "jb" '((lambda() (interactive) (find-file (concat jib/dropbox "org/work.org"))) :which-key "work.org") 361 | "jc" '((lambda() (interactive) (find-file (concat jib/dropbox "org/cpb.org"))) :which-key "cpb.org") 362 | 363 | "jr" '(restart-emacs :which-key "restart emacs") 364 | 365 | "jh" '(nil :which-key "hydras") 366 | "jht" '(jb-hydra-theme-switcher/body :which-key "themes") 367 | "jhf" '(jb-hydra-variable-fonts/body :which-key "mixed-pitch face") 368 | "jhw" '(jb-hydra-window/body :which-key "window control") 369 | 370 | "jm" '(nil :which-key "macros/custom commands") 371 | "jml" '(jib/listify :which-key "Listify") 372 | "jmL" '(jib|SubListify :which-key "SubListify") 373 | "jmo" '(jib/org-temp-export-html :which-key "org temp export region") 374 | 375 | "jk" '(nil :which-key "agenda/ql") 376 | "jkq" '((lambda () (interactive) (org-ql-view "Jake Work Full View")) :which-key "jake ql") 377 | 378 | ;; Help/emacs 379 | "h" '(nil :which-key "help/emacs") 380 | 381 | "hv" '(counsel-describe-variable :which-key "des. variable") 382 | "hb" '(counsel-descbinds :which-key "des. bindings") 383 | "hM" '(describe-mode :which-key "des. mode") 384 | "hf" '(counsel-describe-function :which-key "des. func") 385 | "hF" '(counsel-describe-face :which-key "des. face") 386 | "hk" '(describe-key :which-key "des. key") 387 | 388 | "hed" '((lambda () (interactive) (jump-to-register 67)) :which-key "edit dotfile") 389 | 390 | "hm" '(nil :which-key "switch mode") 391 | "hme" '(emacs-lisp-mode :which-key "elisp mode") 392 | "hmo" '(org-mode :which-key "org mode") 393 | "hmt" '(text-mode :which-key "text mode") 394 | 395 | "hp" '(nil :which-key "packages") 396 | "hpr" 'package-refresh-contents 397 | "hpi" 'package-install 398 | "hpd" 'package-delete 399 | 400 | ;; Help/emacs 401 | "x" '(nil :which-key "text") 402 | "xC" '(jib/copy-whole-buffer-to-clipboard :which-key "copy whole buffer to clipboard") 403 | "xr" '(anzu-query-replace :which-key "find and replace") 404 | "xs" '(yas-insert-snippet :which-key "insert yasnippet") 405 | "xf" '(flush-lines :which-key "flush-lines") 406 | "xR" '(replace-regexp :which-key "replace-regexp") 407 | 408 | ;; Toggles 409 | "t" '(nil :which-key "toggles") 410 | "tt" '(toggle-truncate-lines :which-key "truncate lines") 411 | "tv" '(visual-line-mode :which-key "visual line mode") 412 | "tn" '(display-line-numbers-mode :which-key "display line numbers") 413 | "ta" '(mixed-pitch-mode :which-key "variable pitch mode") 414 | "ty" '(counsel-load-theme :which-key "load theme") 415 | "tw" '(writeroom-mode :which-key "writeroom-mode") 416 | "tR" '(read-only-mode :which-key "read only mode") 417 | "tI" '(toggle-input-method :which-key "toggle input method") 418 | "tr" '(display-fill-column-indicator-mode :which-key "fill column indicator") 419 | "tm" '(hide-mode-line-mode :which-key "hide modeline mode") 420 | 421 | ;; Windows 422 | "w" '(nil :which-key "window") 423 | "wm" '(jib/toggle-maximize-buffer :which-key "maximize buffer") 424 | "wN" '(make-frame :which-key "make frame") 425 | "wd" '(evil-window-delete :which-key "delete window") 426 | "wc" '(evil-window-delete :which-key "delete window") 427 | "w-" '(jib/split-window-vertically-and-switch :which-key "split below") 428 | "w/" '(jib/split-window-horizontally-and-switch :which-key "split right") 429 | "wr" '(jb-hydra-window/body :which-key "hydra window") 430 | "wl" '(evil-window-right :which-key "evil-window-right") 431 | "wh" '(evil-window-left :which-key "evil-window-left") 432 | "wj" '(evil-window-down :which-key "evil-window-down") 433 | "wk" '(evil-window-up :which-key "evil-window-up") 434 | "wz" '(text-scale-adjust :which-key "text zoom") 435 | ) ;; End SPC prefix block 436 | 437 | ;; All-mode keymaps 438 | (general-def 439 | :keymaps 'override 440 | 441 | ;; Emacs -------- 442 | "M-x" 'counsel-M-x 443 | "ß" 'evil-window-next ;; option-s 444 | "Í" 'other-frame ;; option-shift-s 445 | "C-S-B" 'counsel-switch-buffer 446 | "∫" 'counsel-switch-buffer ;; option-b 447 | "s-b" 'counsel-switch-buffer ;; super-b 448 | "s-o" 'jb-hydra-window/body 449 | 450 | ;; Remapping normal help features to use Counsel version 451 | "C-h v" 'counsel-describe-variable 452 | "C-h o" 'counsel-describe-symbol 453 | "C-h f" 'counsel-describe-function 454 | "C-h F" 'counsel-describe-face 455 | 456 | ;; Editing ------ 457 | "M-v" 'simpleclip-paste 458 | "M-V" 'evil-paste-after ;; shift-paste uses the internal clipboard 459 | "M-c" 'simpleclip-copy 460 | "M-u" 'capitalize-dwim ;; Default is upcase-dwim 461 | "M-U" 'upcase-dwim ;; M-S-u (switch upcase and capitalize) 462 | 463 | ;; Utility ------ 464 | "C-c c" 'org-capture 465 | "C-c a" 'org-agenda 466 | "C-s" 'swiper ;; Large files will use grep (faster) 467 | "s-\"" 'ispell-word ;; that's super-shift-' 468 | "M-+" 'jib/calc-speaking-time 469 | "M-=" 'count-words 470 | "C-'" 'avy-goto-char-2 471 | "C-x C-b" 'bufler-list 472 | 473 | ;; super-number functions 474 | "s-1" 'mw-thesaurus-lookup-dwim 475 | "s-!" 'mw-thesaurus-lookup 476 | "s-2" 'ispell-buffer 477 | "s-3" 'revert-buffer 478 | "s-4" '(lambda () (interactive) (counsel-file-jump nil jib/dropbox)) 479 | "s-5" '(lambda () (interactive) (counsel-rg nil jib/dropbox)) 480 | "s-6" 'org-capture 481 | "s-7" 'jib/open-dropbox-folder-in-finder 482 | "s-8" 'jib/zoxide-wrapper 483 | 484 | "s-w" 'kill-this-buffer 485 | ) 486 | 487 | ;; Non-insert mode keymaps 488 | (general-def 489 | :states '(normal visual motion) 490 | "gc" 'comment-dwim 491 | "gC" 'comment-line 492 | 493 | "u" 'undo-fu-only-undo 494 | "U" 'undo-fu-only-redo 495 | 496 | "j" 'evil-next-visual-line ;; I prefer visual line navigation 497 | "k" 'evil-previous-visual-line ;; " 498 | 499 | "gf" 'xah-open-file-at-cursor 500 | "f" 'evil-avy-goto-char-in-line 501 | 502 | "/" 'jib/split-window-horizontally-and-switch 503 | "-" 'jib/split-window-vertically-and-switch 504 | 505 | "\\" '(lambda () (interactive) (org-agenda nil "c")) 506 | "|" '(lambda () (interactive) (org-ql-view "Columbia Todo")) 507 | "]\\" '(lambda () (interactive) (org-agenda nil "w")) 508 | ) 509 | 510 | (general-def 511 | :states '(normal visual motion) 512 | :keymaps 'override 513 | "s" 'swiper 514 | "?" 'evil-search-forward) 515 | 516 | ;; Insert keymaps 517 | ;; Many of these are emulating standard Emacs bindings in Evil insert mode, such as C-a, or C-e. 518 | (general-def 519 | :states '(insert) 520 | "C-a" 'evil-beginning-of-visual-line 521 | "C-e" 'evil-end-of-visual-line 522 | "C-S-a" 'evil-beginning-of-line 523 | "C-S-e" 'evil-end-of-line 524 | "C-n" 'evil-next-visual-line 525 | "C-p" 'evil-previous-visual-line 526 | ) 527 | 528 | (general-def 529 | :keymaps 'emacs 530 | "C-w C-q" 'kill-this-buffer 531 | ) 532 | 533 | (use-package hydra :defer t) 534 | 535 | ;; This Hydra lets me swich between variable pitch fonts. 536 | (defhydra jb-hydra-variable-fonts (:pre (mixed-pitch-mode 0) 537 | :post (mixed-pitch-mode 1)) 538 | ("t" (set-face-attribute 'variable-pitch nil :family "Times New Roman" :height 160) "Times New Roman") 539 | ("g" (set-face-attribute 'variable-pitch nil :family "EB Garamond" :height 160 :weight 'normal) "EB Garamond") 540 | ("n" (set-face-attribute 'variable-pitch nil :slant 'normal :weight 'normal :height 160 :width 'normal :foundry "nil" :family "Nunito") "Nunito") 541 | ) 542 | 543 | (defhydra jb-hydra-theme-switcher (:hint nil) 544 | " 545 | Dark ^Light^ 546 | ---------------------------------------------- 547 | _1_ one _z_ one-light 548 | _2_ vivendi _x_ operandi 549 | _3_ molokai _c_ jake-plain 550 | _4_ snazzy _v_ flatwhite 551 | _5_ old-hope _b_ tomorrow-day 552 | _6_ henna ^ 553 | _7_ kaolin-galaxy ^ 554 | _8_ peacock ^ 555 | _9_ jake-plain-dark ^ 556 | _0_ monokai-machine ^ 557 | _-_ xcode ^ 558 | _q_ quit ^ 559 | ^ ^ 560 | " 561 | 562 | ;; Dark 563 | ("1" (jib/load-theme 'doom-one) "one") 564 | ("2" (jib/load-theme 'modus-vivendi) "modus-vivendi") 565 | ("3" (jib/load-theme 'doom-molokai) "molokai") 566 | ("4" (jib/load-theme 'doom-snazzy) "snazzy") 567 | ("5" (jib/load-theme 'doom-old-hope) "old-hope") 568 | ("6" (jib/load-theme 'doom-henna) "henna") 569 | ("7" (jib/load-theme 'kaolin-galaxy) "kaolin-galaxy") 570 | ("8" (jib/load-theme 'doom-peacock) "peacock") 571 | ("9" (jib/load-theme 'jake-doom-plain-dark) "jake-plain-dark") 572 | ("0" (jib/load-theme 'doom-monokai-machine) "monokai-machine") 573 | ("-" (jib/load-theme 'doom-xcode) "xcode") 574 | 575 | ;; Light 576 | ("z" (jib/load-theme 'doom-one-light) "one-light") 577 | ("x" (jib/load-theme 'modus-operandi) "modus-operandi") 578 | ("c" (jib/load-theme 'jake-doom-plain) "jake-plain") 579 | ("v" (jib/load-theme 'doom-flatwhite) "flatwhite") 580 | ("b" (jib/load-theme 'doom-opera-light) "tomorrow-day") 581 | ("q" nil)) 582 | 583 | ;; I think I need to initialize windresize to use its commands 584 | ;;(windresize) 585 | ;;(windresize-exit) 586 | 587 | ;;(require 'windresize) 588 | 589 | ;; All-in-one window managment. Makes use of some custom functions, 590 | ;; `ace-window' (for swapping), `windmove' (could probably be replaced 591 | ;; by evil?) and `windresize'. 592 | ;; inspired by https://github.com/jmercouris/configuration/blob/master/.emacs.d/hydra.el#L86 593 | (defhydra jb-hydra-window (:hint nil) 594 | " 595 | Movement ^Split^ ^Switch^ ^Resize^ 596 | ---------------------------------------------------------------- 597 | _M-_ < _/_ vertical _b_uffer __ < 598 | _M-_ > _-_ horizontal _f_ind file __ ↓ 599 | _M-_ ↑ _m_aximize _s_wap __ ↑ 600 | _M-_ ↓ _c_lose _[_backward __ > 601 | _q_uit _e_qualize _]_forward ^ 602 | ^ ^ _K_ill ^ 603 | ^ ^ ^ ^ 604 | " 605 | ;; Movement 606 | ("M-" windmove-left) 607 | ("M-" windmove-down) 608 | ("M-" windmove-up) 609 | ("M-" windmove-right) 610 | 611 | ;; Split/manage 612 | ("-" jib/split-window-vertically-and-switch) 613 | ("/" jib/split-window-horizontally-and-switch) 614 | ("c" evil-window-delete) 615 | ("d" evil-window-delete) 616 | ("m" delete-other-windows) 617 | ("e" balance-windows) 618 | 619 | ;; Switch 620 | ("b" counsel-switch-buffer) 621 | ("f" counsel-find-file) 622 | ("P" project-find-file) 623 | ("s" ace-swap-window) 624 | ("[" previous-buffer) 625 | ("]" next-buffer) 626 | ("K" kill-this-buffer) 627 | 628 | ;; Resize 629 | ("" windresize-left) 630 | ("" windresize-right) 631 | ("" windresize-down) 632 | ("" windresize-up) 633 | 634 | ("q" nil)) 635 | 636 | (defhydra jb-hydra-org-table () 637 | " 638 | _c_ insert col _v_ delete col Move col: _h_, _l_ 639 | _r_ insert row _d_ delete row Move row: _j_, _k_ 640 | _n_ create table _i_ create hline 641 | _u_ undo 642 | _q_ quit 643 | 644 | " 645 | ("n" org-table-create "create table") 646 | ("c" org-table-insert-column "insert col") 647 | ("r" org-table-insert-row "insert row") 648 | ("v" org-table-delete-column "delete col") 649 | ("d" org-table-kill-row "delete row") 650 | ("i" org-table-insert-hline "hline") 651 | 652 | ("u" undo-fu-only-undo "undo") 653 | 654 | ("h" org-table-move-column-left "move col left") 655 | ("l" org-table-move-column-right "move col right") 656 | ("k" org-table-move-row-up "move row up") 657 | ("j" org-table-move-row-down "move row down") 658 | 659 | ("" org-table-previous-field) 660 | ("" org-table-next-field) 661 | ("" previous-line) 662 | ("" org-table-next-row) 663 | 664 | ("q" nil "quit")) 665 | 666 | (use-package corfu 667 | :init 668 | (global-corfu-mode) 669 | :config 670 | (setq corfu-auto t 671 | corfu-echo-documentation t 672 | corfu-scroll-margin 0 673 | corfu-count 8 674 | corfu-max-width 50 675 | corfu-min-width corfu-max-width 676 | corfu-auto-prefix 2) 677 | 678 | ;; Make Evil and Corfu play nice 679 | (evil-make-overriding-map corfu-map) 680 | (advice-add 'corfu--setup :after 'evil-normalize-keymaps) 681 | (advice-add 'corfu--teardown :after 'evil-normalize-keymaps) 682 | 683 | (corfu-history-mode 1) 684 | (savehist-mode 1) 685 | (add-to-list 'savehist-additional-variables 'corfu-history) 686 | 687 | (defun corfu-enable-always-in-minibuffer () 688 | (setq-local corfu-auto nil) 689 | (corfu-mode 1)) 690 | (add-hook 'minibuffer-setup-hook #'corfu-enable-always-in-minibuffer 1) 691 | 692 | :general 693 | (:keymaps 'corfu-map 694 | :states 'insert 695 | "C-n" 'corfu-next 696 | "C-p" 'corfu-previous 697 | "C-j" 'corfu-next 698 | "C-k" 'corfu-previous 699 | "RET" 'corfu-complete 700 | "" 'corfu-quit 701 | )) 702 | 703 | (use-package cape 704 | :init 705 | (add-to-list 'completion-at-point-functions #'cape-file) 706 | (add-to-list 'completion-at-point-functions #'cape-keyword) 707 | ;; kinda confusing re length, WIP/TODO 708 | ;; :hook (org-mode . (lambda () (add-to-list 'completion-at-point-functions #'cape-dabbrev))) 709 | ;; :config 710 | ;; (setq dabbrev-check-other-buffers nil 711 | ;; dabbrev-check-all-buffers nil 712 | ;; cape-dabbrev-min-length 6) 713 | ) 714 | 715 | 716 | (use-package kind-icon 717 | :config 718 | (setq kind-icon-default-face 'corfu-default) 719 | (setq kind-icon-default-style '(:padding 0 :stroke 0 :margin 0 :radius 0 :height 0.9 :scale 1)) 720 | (setq kind-icon-blend-frac 0.08) 721 | (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter) 722 | (add-hook 'counsel-load-theme #'(lambda () (interactive) (kind-icon-reset-cache))) 723 | (add-hook 'load-theme #'(lambda () (interactive) (kind-icon-reset-cache)))) 724 | 725 | (use-package ivy 726 | :diminish ivy-mode 727 | :config 728 | (setq ivy-extra-directories nil) ;; Hides . and .. directories 729 | (setq ivy-initial-inputs-alist nil) ;; Removes the ^ in ivy searches 730 | (if (eq jib/computer 'laptop) 731 | (setq-default ivy-height 10) 732 | (setq-default ivy-height 11)) 733 | (setq ivy-fixed-height-minibuffer t) 734 | (add-to-list 'ivy-height-alist '(counsel-M-x . 7)) ;; Don't need so many lines for M-x, I usually know what command I want 735 | 736 | (ivy-mode 1) 737 | 738 | ;; Shows a preview of the face in counsel-describe-face 739 | (add-to-list 'ivy-format-functions-alist '(counsel-describe-face . counsel--faces-format-function)) 740 | 741 | :general 742 | (general-define-key 743 | ;; Also put in ivy-switch-buffer-map b/c otherwise switch buffer map overrides and C-k kills buffers 744 | :keymaps '(ivy-minibuffer-map ivy-switch-buffer-map) 745 | "S-SPC" 'nil 746 | "C-SPC" 'ivy-restrict-to-matches ;; Default is S-SPC, changed this b/c sometimes I accidentally hit S-SPC 747 | ;; C-j and C-k to move up/down in Ivy 748 | "C-k" 'ivy-previous-line 749 | "C-j" 'ivy-next-line) 750 | ) 751 | 752 | ;; Nice icons in Ivy. Replaces all-the-icons-ivy. 753 | (use-package all-the-icons-ivy-rich 754 | :init (all-the-icons-ivy-rich-mode 1) 755 | :config 756 | (setq all-the-icons-ivy-rich-icon-size 1.0)) 757 | 758 | (use-package ivy-rich 759 | :after ivy 760 | :init 761 | (setq ivy-rich-path-style 'abbrev) 762 | (setcdr (assq t ivy-format-functions-alist) #'ivy-format-function-line) 763 | :config 764 | (ivy-rich-mode 1)) 765 | 766 | (use-package counsel 767 | :config 768 | (setq default-directory jib/home) 769 | (setq counsel-switch-buffer-preview-virtual-buffers nil) ;; Removes recentfiles/bookmarks from counsel-switch-buffer 770 | (setq counsel-find-file-ignore-regexp 771 | (concat 772 | ;; That weird Icon? file in Dropbox. 773 | "\\(Icon\ \\)" 774 | ;; Hides file names beginning with # or . 775 | "\\|\\(?:\\`[#.]\\)")) 776 | 777 | ;; emacs regexp notes: had to put \\| before the second regexp to make this work 778 | 779 | ;; Sorts counsel-recentf in order of time last accessed 780 | (add-to-list 'ivy-sort-functions-alist 781 | '(counsel-recentf . file-newer-than-file-p)) 782 | 783 | (add-to-list 'recentf-exclude 784 | (expand-file-name "projectile-bookmarks.eld" user-emacs-directory)) 785 | 786 | ;; Use fd 787 | (setq find-program "fd") 788 | (setq counsel-file-jump-args (split-string "-L --type f -H")) ;; follow symlinks, files, show hidden 789 | 790 | :general 791 | (general-define-key :keymaps 'counsel-find-file-map 792 | "C-c f" 'counsel-file-jump-from-find) ;; when in counsel-find-file, run this to search the whole directory recursively 793 | ) 794 | 795 | (use-package prescient 796 | :config 797 | (setq-default history-length 1000) 798 | (setq-default prescient-history-length 1000) ;; More prescient history 799 | (prescient-persist-mode +1)) 800 | 801 | ;; Use `prescient' for Ivy menus. 802 | (use-package ivy-prescient 803 | :after ivy 804 | :config 805 | ;; don't prescient sort these commands 806 | (dolist (command '(org-ql-view counsel-find-file fontaine-set-preset)) 807 | (setq ivy-prescient-sort-commands (append ivy-prescient-sort-commands (list command)))) 808 | (ivy-prescient-mode +1)) 809 | 810 | ;; (use-package company-prescient 811 | ;; :defer 2 812 | ;; :after company 813 | ;; :config 814 | ;; (company-prescient-mode +1)) 815 | 816 | (use-package smartparens 817 | :diminish smartparens-mode 818 | :defer 1 819 | :config 820 | ;; Load default smartparens rules for various languages 821 | (require 'smartparens-config) 822 | (setq sp-max-prefix-length 25) 823 | (setq sp-max-pair-length 4) 824 | (setq sp-highlight-pair-overlay nil 825 | sp-highlight-wrap-overlay nil 826 | sp-highlight-wrap-tag-overlay nil) 827 | 828 | (with-eval-after-load 'evil 829 | (setq sp-show-pair-from-inside t) 830 | (setq sp-cancel-autoskip-on-backward-movement nil) 831 | (setq sp-pair-overlay-keymap (make-sparse-keymap))) 832 | 833 | (let ((unless-list '(sp-point-before-word-p 834 | sp-point-after-word-p 835 | sp-point-before-same-p))) 836 | (sp-pair "'" nil :unless unless-list) 837 | (sp-pair "\"" nil :unless unless-list)) 838 | 839 | ;; In lisps ( should open a new form if before another parenthesis 840 | (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p)) 841 | 842 | ;; Don't do square-bracket space-expansion where it doesn't make sense to 843 | (sp-local-pair '(emacs-lisp-mode org-mode markdown-mode gfm-mode) 844 | "[" nil :post-handlers '(:rem ("| " "SPC"))) 845 | 846 | 847 | (dolist (brace '("(" "{" "[")) 848 | (sp-pair brace nil 849 | :post-handlers '(("||\n[i]" "RET") ("| " "SPC")) 850 | ;; Don't autopair opening braces if before a word character or 851 | ;; other opening brace. The rationale: it interferes with manual 852 | ;; balancing of braces, and is odd form to have s-exps with no 853 | ;; whitespace in between, e.g. ()()(). Insert whitespace if 854 | ;; genuinely want to start a new form in the middle of a word. 855 | :unless '(sp-point-before-word-p sp-point-before-same-p))) 856 | (smartparens-global-mode t)) 857 | 858 | ;; "Enable Flyspell mode, which highlights all misspelled words. " 859 | (use-package flyspell 860 | :defer t 861 | :config 862 | (add-to-list 'ispell-skip-region-alist '("~" "~")) 863 | (add-to-list 'ispell-skip-region-alist '("=" "=")) 864 | (add-to-list 'ispell-skip-region-alist '("^#\\+BEGIN_SRC" . "^#\\+END_SRC")) 865 | (add-to-list 'ispell-skip-region-alist '("^#\\+BEGIN_EXPORT" . "^#\\+END_EXPORT")) 866 | (add-to-list 'ispell-skip-region-alist '("^#\\+BEGIN_EXPORT" . "^#\\+END_EXPORT")) 867 | (add-to-list 'ispell-skip-region-alist '(":\\(PROPERTIES\\|LOGBOOK\\):" . ":END:")) 868 | 869 | (dolist (mode '( 870 | ;;org-mode-hook 871 | mu4e-compose-mode-hook)) 872 | (add-hook mode (lambda () (flyspell-mode 1)))) 873 | 874 | (setq flyspell-issue-welcome-flag nil 875 | flyspell-issue-message-flag nil) 876 | 877 | :general ;; Switches correct word from middle click to right click 878 | (general-define-key :keymaps 'flyspell-mouse-map 879 | "" #'ispell-word 880 | "" nil) 881 | (general-define-key :keymaps 'evil-motion-state-map 882 | "zz" #'ispell-word) 883 | ) 884 | 885 | ;; (use-package flyspell-correct 886 | ;; :after flyspell 887 | ;; :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper))) 888 | 889 | ;; (use-package flyspell-correct-ivy 890 | ;; :after flyspell-correct) 891 | 892 | (use-package evil-anzu :defer t) 893 | 894 | (use-package avy 895 | :defer t 896 | :config 897 | (setq avy-case-fold-search nil)) 898 | 899 | (use-package simpleclip :config (simpleclip-mode 1)) 900 | 901 | ;; Allows pasting in minibuffer with M-v 902 | (defun jib/paste-in-minibuffer () 903 | (local-set-key (kbd "M-v") 'simpleclip-paste)) 904 | (add-hook 'minibuffer-setup-hook 'jib/paste-in-minibuffer) 905 | 906 | (use-package undo-fu) 907 | 908 | (use-package super-save 909 | :diminish super-save-mode 910 | :defer 2 911 | :config 912 | (setq super-save-auto-save-when-idle t 913 | super-save-idle-duration 5 ;; after 5 seconds of not typing autosave 914 | super-save-triggers ;; Functions after which buffers are saved (switching window, for example) 915 | '(evil-window-next evil-window-prev balance-windows other-window next-buffer previous-buffer) 916 | super-save-max-buffer-size 10000000) 917 | (super-save-mode +1)) 918 | 919 | ;; After super-save autosaves, wait __ seconds and then clear the buffer. I don't like 920 | ;; the save message just sitting in the echo area. 921 | (defun jib-clear-echo-area-timer () 922 | (run-at-time "2 sec" nil (lambda () (message " ")))) 923 | (advice-add 'super-save-command :after 'jib-clear-echo-area-timer) 924 | 925 | (use-package saveplace 926 | :init (setq save-place-limit 100) 927 | :config (save-place-mode)) 928 | 929 | (use-package yasnippet 930 | :diminish yas-minor-mode 931 | :defer 5 932 | :config 933 | (setq yas-snippet-dirs (list (expand-file-name "snippets" jib/emacs-stuff))) 934 | (yas-global-mode 1)) ;; or M-x yas-reload-all if you've started YASnippet already. 935 | 936 | ;; Silences the warning when running a snippet with backticks (runs a command in the snippet) 937 | (require 'warnings) 938 | (add-to-list 'warning-suppress-types '(yasnippet backquote-change)) 939 | 940 | (setq text-scale-mode-step 1.2) ;; How much to adjust text scale by when using `text-scale-mode' 941 | (setq jib-default-line-spacing 1) ;; This happens in the variables but I guess I have it here too. 942 | 943 | (setq-default line-spacing jib-default-line-spacing) 944 | 945 | ;; Setting text size based on the computer I am on. 946 | (if (eq jib/computer 'laptopN) 947 | (setq jib-text-height 140)) 948 | (if (eq jib/computer 'desktop) 949 | (setq jib-text-height 150)) 950 | 951 | ;; (set-frame-font "SF Mono:size=14" nil t) 952 | ;; (set-frame-font "Menlo:size=14" nil t) 953 | ;; (set-frame-font "Fira Code:size=14" nil t) 954 | (set-frame-font "Roboto Mono:size=14" nil t) 955 | 956 | ;; (set-face-attribute 'default nil :family "Menlo" :weight 'regular :height jib-text-height) 957 | 958 | ;; Float height value (1.0) makes fixed-pitch take height 1.0 * height of default 959 | ;; This means it will scale along with default when the text is zoomed 960 | ;; (set-face-attribute 'fixed-pitch nil :font "Roboto Mono" :weight 'regular :height 1.0) 961 | 962 | ;; Height of 160 seems to match perfectly with 12-point on Google Docs 963 | ;; (set-face-attribute 'variable-pitch nil :family "Times New Roman" :height 160) 964 | 965 | ;; (set-face-attribute 'variable-pitch nil :slant 'normal :weight 'normal :height 180 :width 'normal :foundry "nil" :family "Nunito Sans") 966 | 967 | ;; (set-face-attribute 'variable-pitch nil :slant 'normal :weight 'normal :height 180 :width 'normal :foundry "nil" :family "Nunito Sans") 968 | 969 | (use-package mixed-pitch 970 | :defer t 971 | :config 972 | (setq mixed-pitch-set-height nil) 973 | (dolist (face '(org-date org-priority org-tag org-special-keyword)) ;; Some extra faces I like to be fixed-pitch 974 | (add-to-list 'mixed-pitch-fixed-pitch-faces face))) 975 | 976 | ;; Disables showing system load in modeline, useless anyway 977 | (setq display-time-default-load-average nil) 978 | 979 | (line-number-mode) 980 | (column-number-mode) 981 | (display-time-mode -1) 982 | (size-indication-mode 0) 983 | 984 | (use-package hide-mode-line 985 | :commands (hide-mode-line-mode)) 986 | 987 | (use-package doom-modeline 988 | :config 989 | (doom-modeline-mode) 990 | (setq doom-modeline-buffer-file-name-style 'relative-from-project ;; Just show file name (no path) 991 | doom-modeline-enable-word-count nil 992 | doom-modeline-buffer-encoding nil 993 | doom-modeline-icon t ;; Enable/disable all icons 994 | doom-modeline-modal-icon nil ;; Icon for Evil mode 995 | doom-modeline-major-mode-icon t 996 | doom-modeline-major-mode-color-icon nil 997 | doom-modeline-buffer-state-icon nil 998 | doom-modeline-bar-width 3)) 999 | 1000 | ;; Configure modeline text height based on the computer I'm on. 1001 | ;; These variables are used in the Themes section to ensure the modeline 1002 | ;; stays the right size no matter what theme I use. 1003 | (if (eq jib/computer 'laptop) 1004 | (setq jib-doom-modeline-text-height 135) ;; If laptop 1005 | (setq jib-doom-modeline-text-height 140)) ;; If desktop 1006 | 1007 | (if (eq jib/computer 'laptop) 1008 | (setq doom-modeline-height 25) ;; If laptop 1009 | (setq doom-modeline-height 28)) ;; If desktop 1010 | 1011 | (if (or (eq jib/computer 'laptop) (eq jib/computer 'laptopN)) 1012 | (setq default-frame-alist '((left . 150) 1013 | (width . 120) 1014 | (fullscreen . fullheight) 1015 | (internal-border-width . 3)))) 1016 | 1017 | (if (eq jib/computer 'desktop) 1018 | (setq default-frame-alist '((left . 170) 1019 | (width . 173) 1020 | (top . 64) 1021 | (height . 53) 1022 | (fullscreen . fullheight) 1023 | (internal-border-width . 8)))) 1024 | 1025 | (use-package all-the-icons) 1026 | 1027 | (use-package doom-themes 1028 | :after mixed-pitch 1029 | :config 1030 | (doom-themes-visual-bell-config) 1031 | (doom-themes-org-config) 1032 | :custom-face 1033 | (org-ellipsis ((t (:height 0.8 :inherit 'shadow)))) 1034 | ;; Keep the modeline proper every time I use these themes. 1035 | (mode-line ((t (:height ,jib-doom-modeline-text-height)))) 1036 | (mode-line-inactive ((t (:height ,jib-doom-modeline-text-height)))) 1037 | ;; (doom-modeline ((t (:height ,jib-doom-modeline-text-height)))) 1038 | ;; (doom-modeline-inactive ((t (:height ,jib-doom-modeline-text-height)))) 1039 | (org-scheduled-previously ((t (:background "red"))))) 1040 | 1041 | (use-package kaolin-themes 1042 | :config 1043 | (setq kaolin-themes-modeline-border nil) 1044 | :custom-face 1045 | ;; Keep the modeline proper every time I use these themes. 1046 | (mode-line ((t (:height ,jib-doom-modeline-text-height)))) 1047 | (mode-line-inactive ((t (:height ,jib-doom-modeline-text-height)))) 1048 | ;; Disable underline for org deadline warnings. I don't like the way it looks. 1049 | (org-warning ((t (:underline nil)))) 1050 | ;; Darkens the org-ellipsis (first unset the color, then give it shadow) 1051 | (org-ellipsis ((t (:foreground unspecified :height 0.8 :inherit 'shadow))))) 1052 | 1053 | (use-package modus-themes 1054 | :init 1055 | (setq modus-themes-italic-constructs nil 1056 | modus-themes-bold-constructs t 1057 | modus-themes-region '(bg-only no-extend) 1058 | modus-themes-hl-line '(intense) ;; accented or intense 1059 | modus-themes-syntax '(yellow-comments) 1060 | modus-themes-org-blocks 'gray-background 1061 | modus-themes-mode-line '(moody borderless)) ;; moody or accented is what I use 1062 | 1063 | ;; (setq modus-themes-headings ;; Makes org headings more colorful 1064 | ;; '((t . (rainbow)))) 1065 | 1066 | (setq modus-themes-headings 1067 | (quote ((1 . (variable-pitch 1.1 rainbow)) 1068 | (2 . (regular)) 1069 | (3 . (regular)) 1070 | (4 . (regular)) 1071 | (t . (rainbow)) 1072 | ))) 1073 | (modus-themes-load-themes) 1074 | :custom-face 1075 | (org-ellipsis ((t (:height 0.8 :inherit 'shadow)))) 1076 | ;; Keep the modeline proper every time I use these themes. 1077 | (mode-line ((t (:height ,jib-doom-modeline-text-height)))) 1078 | (mode-line-inactive ((t (:height ,jib-doom-modeline-text-height))))) 1079 | 1080 | (use-package ef-themes 1081 | :init 1082 | (setq ef-themes-headings 1083 | (quote ((1 . (variable-pitch 1.1)) 1084 | (2 . (regular)) 1085 | (3 . (regular)) 1086 | (4 . (regular))))) 1087 | :custom-face 1088 | (org-scheduled-today ((t (:inherit org-level-3))))) 1089 | 1090 | 1091 | ;; loading theme based on the time. 1092 | (let ((hour (string-to-number (substring (current-time-string) 11 13)))) 1093 | (if (or (> hour 19) (< hour 7)) 1094 | (load-theme 'doom-one t) ;; Night 1095 | (load-theme 'doom-opera-light t))) ;; Day 1096 | 1097 | (setq-default fringes-outside-margins nil) 1098 | (setq-default indicate-buffer-boundaries nil) ;; Otherwise shows a corner icon on the edge 1099 | (setq-default indicate-empty-lines nil) ;; Otherwise there are weird fringes on blank lines 1100 | 1101 | (set-face-attribute 'fringe nil :background nil) 1102 | (set-face-attribute 'header-line nil :background nil :inherit 'default) 1103 | 1104 | (add-hook 'prog-mode-hook 'hl-line-mode) 1105 | (add-hook 'prog-mode-hook 'display-line-numbers-mode) 1106 | 1107 | (use-package visual-fill-column 1108 | :defer t 1109 | :config 1110 | (setq visual-fill-column-center-text t) 1111 | (if (eq 'jib/computer 'desktop) 1112 | (setq visual-fill-column-width 100) 1113 | (setq visual-fill-column-width 80)) 1114 | (setq visual-fill-column-center-text t)) 1115 | 1116 | (use-package writeroom-mode 1117 | :defer t 1118 | :config 1119 | (setq writeroom-maximize-window nil 1120 | writeroom-mode-line t 1121 | writeroom-global-effects nil ;; No need to have Writeroom do any of that silly stuff 1122 | writeroom-extra-line-spacing 3) 1123 | (setq writeroom-width visual-fill-column-width) 1124 | ) 1125 | 1126 | (defun my-presentation-on () 1127 | (setq jib-default-line-spacing 3) 1128 | (setq-default line-spacing jib-default-line-spacing) 1129 | (setq-local line-spacing jib-default-line-spacing) 1130 | (setq ivy-height 6)) 1131 | 1132 | (defun my-presentation-off () 1133 | (jib/reset-var 'jib-default-line-spacing) 1134 | (setq-default line-spacing jib-default-line-spacing) 1135 | (setq-local line-spacing jib-default-line-spacing) 1136 | (jib/reset-var 'ivy-height)) 1137 | 1138 | (add-hook 'presentation-on-hook #'my-presentation-on) 1139 | (add-hook 'presentation-off-hook #'my-presentation-off) 1140 | 1141 | (if (eq jib/computer 'laptop) 1142 | (setq presentation-default-text-scale 5) 1143 | (setq presentation-default-text-scale 5)) 1144 | 1145 | (use-package presentation :defer t) 1146 | 1147 | (use-package org-super-agenda 1148 | :after org 1149 | :config 1150 | (setq org-super-agenda-header-map nil) ;; takes over 'j' 1151 | ;; (setq org-super-agenda-header-prefix " ◦ ") ;; There are some unicode "THIN SPACE"s after the ◦ 1152 | ;; Hide the thin width char glyph. This is dramatic but lets me not be annoyed 1153 | (add-hook 'org-agenda-mode-hook 1154 | #'(lambda () (setq-local nobreak-char-display nil))) 1155 | (org-super-agenda-mode)) 1156 | 1157 | (use-package org-superstar 1158 | :config 1159 | (setq org-superstar-leading-bullet " ") 1160 | (setq org-superstar-special-todo-items t) ;; Makes TODO header bullets into boxes 1161 | (setq org-superstar-todo-bullet-alist '(("TODO" . 9744) 1162 | ("INPROG-TODO" . 9744) 1163 | ("WORK" . 9744) 1164 | ("STUDY" . 9744) 1165 | ("SOMEDAY" . 9744) 1166 | ("READ" . 9744) 1167 | ("PROJ" . 9744) 1168 | ("CONTACT" . 9744) 1169 | ("DONE" . 9745))) 1170 | ;; :hook (org-mode . org-superstar-mode) 1171 | ) 1172 | 1173 | ;; Removes gap when you add a new heading 1174 | (setq org-blank-before-new-entry '((heading . nil) (plain-list-item . nil))) 1175 | 1176 | (use-package org-modern 1177 | :hook (org-mode . org-modern-mode) 1178 | :config 1179 | (setq 1180 | ;; org-modern-star '("●" "○" "✸" "✿") 1181 | org-modern-star '( "⌾" "✸" "◈" "◇") 1182 | org-modern-list '((42 . "◦") (43 . "•") (45 . "–")) 1183 | org-modern-tag nil 1184 | org-modern-priority nil 1185 | org-modern-todo nil 1186 | org-modern-table nil)) 1187 | 1188 | (use-package evil-org 1189 | :diminish evil-org-mode 1190 | :after org 1191 | :config 1192 | (add-hook 'org-mode-hook 'evil-org-mode) 1193 | (add-hook 'evil-org-mode-hook 1194 | (lambda () (evil-org-set-key-theme)))) 1195 | 1196 | (require 'evil-org-agenda) 1197 | (evil-org-agenda-set-keys) 1198 | 1199 | (use-package org-gcal 1200 | :defer t 1201 | :config 1202 | (setq org-gcal-down-days '20 ;; Only fetch events 20 days into the future 1203 | org-gcal-up-days '10 ;; Only fetch events 10 days into the past 1204 | org-gcal-recurring-events-mode 'top-level 1205 | org-gcal-remove-api-cancelled-events t) ;; No prompt when deleting removed events 1206 | ;; NOTE - org-gcal ids and calendar configuation is set in 'private.el' for sake of security/privacy. 1207 | ) 1208 | 1209 | (use-package org-appear 1210 | :commands (org-appear-mode) 1211 | :hook (org-mode . org-appear-mode) 1212 | :init 1213 | (setq org-hide-emphasis-markers t ;; A default setting that needs to be t for org-appear 1214 | org-appear-autoemphasis t ;; Enable org-appear on emphasis (bold, italics, etc) 1215 | org-appear-autolinks nil ;; Don't enable on links 1216 | org-appear-autosubmarkers t)) ;; Enable on subscript and superscript 1217 | 1218 | (use-package ox-reveal 1219 | :defer 5) 1220 | 1221 | (setq org-modules '(org-habit)) 1222 | 1223 | (eval-after-load 'org 1224 | '(org-load-modules-maybe t)) 1225 | 1226 | (use-package org-ql 1227 | :defer t 1228 | :general 1229 | (general-define-key :keymaps 'org-ql-view-map 1230 | "q" 'kill-buffer-and-window) 1231 | ) 1232 | 1233 | (use-package org-preview-html 1234 | :defer t 1235 | :config 1236 | (setq org-preview-html-viewer 'xwidget)) 1237 | 1238 | (use-package org-fragtog 1239 | :hook (org-mode . org-fragtog-mode) 1240 | :config 1241 | (setq org-latex-create-formula-image-program 'dvisvgm) ;; sharper 1242 | (plist-put org-format-latex-options :scale 1.5) ;; bigger 1243 | (setq org-latex-preview-ltxpng-directory (concat (temporary-file-directory) "ltxpng/")) 1244 | ) 1245 | 1246 | (use-package org-tree-slide 1247 | :defer t 1248 | :config 1249 | (setq org-tree-slide-slide-in-effect nil 1250 | org-tree-slide-skip-outline-level 3)) 1251 | 1252 | (use-package org-download 1253 | :defer 2 1254 | :config 1255 | (setq org-download-method 'attach) 1256 | (advice-add 'org-download-yank :before 'jib/system-clipboard-to-emacs-clipboard)) 1257 | 1258 | (use-package valign :defer t) 1259 | 1260 | (setq org-special-ctrl-a/e t) 1261 | 1262 | (general-def 1263 | :states 'normal 1264 | :keymaps 'org-mode-map 1265 | "t" 'org-todo 1266 | "" 'org-open-at-point-global 1267 | "K" 'org-shiftup 1268 | "J" 'org-shiftdown 1269 | "" 'org-ctrl-c-ctrl-c) 1270 | 1271 | (general-def 1272 | :states 'insert 1273 | :keymaps 'org-mode-map 1274 | "C-o" 'evil-org-open-above 1275 | "S-" 'org-shiftleft 1276 | "S-" 'org-shiftright) 1277 | 1278 | (general-def 1279 | :keymaps 'org-mode-map 1280 | "M-[" 'org-metaleft 1281 | "M-]" 'org-metaright 1282 | "C-M-=" 'ap/org-count-words 1283 | "s-r" 'org-refile 1284 | "M-k" 'org-insert-link 1285 | "C-c t" 'jib/org-done-keep-todo) 1286 | 1287 | ;; Org-src - when editing an org source block 1288 | (general-def 1289 | :prefix "," 1290 | :states 'normal 1291 | :keymaps 'org-src-mode-map 1292 | "b" '(nil :which-key "org src") 1293 | "bc" 'org-edit-src-abort 1294 | "bb" 'org-edit-src-exit) 1295 | 1296 | (general-define-key 1297 | :prefix "," 1298 | :states 'motion 1299 | :keymaps '(org-mode-map) 1300 | "" nil 1301 | "A" '(org-archive-subtree-default :which-key "org-archive") 1302 | "a" '(org-agenda :which-key "org agenda") 1303 | "6" '(org-sort :which-key "sort") 1304 | "c" '(org-capture :which-key "org-capture") 1305 | "s" '(org-schedule :which-key "schedule") 1306 | "S" '(jib/org-schedule-tomorrow :which-key "schedule tmrw") 1307 | "d" '(org-deadline :which-key "deadline") 1308 | "g" '(counsel-org-goto :which-key "goto heading") 1309 | "t" '(counsel-org-tag :which-key "set tags") 1310 | "p" '(org-set-property :which-key "set property") 1311 | "r" '(jib/org-refile-this-file :which-key "refile in file") 1312 | "e" '(org-export-dispatch :which-key "export org") 1313 | "," '(jib/org-set-startup-visibility :which-key "startup visibility") 1314 | "." '(org-toggle-narrow-to-subtree :which-key "toggle narrow to subtree") 1315 | "H" '(org-html-convert-region-to-html :which-key "convert region to html") 1316 | "C" '(jib/org-copy-link-to-clipboard :which-key "copy link to clipboard") 1317 | "=" '(ap/org-count-words :which-key "ap/org-count-words") 1318 | 1319 | "1" '(org-toggle-link-display :which-key "toggle link display") 1320 | "2" '(org-toggle-inline-images :which-key "toggle images") 1321 | "3" '(jib/org-occur-unchecked-boxes :which-key "occur unchecked boxes") 1322 | 1323 | "b" '(nil :which-key "babel") 1324 | "bt" '(org-babel-tangle :which-key "org-babel-tangle") 1325 | "bb" '(org-edit-special :which-key "org-edit-special") 1326 | "bc" '(org-edit-src-abort :which-key "org-edit-src-abort") 1327 | "bk" '(org-babel-remove-result-one-or-many :which-key "org-babel-remove-result-one-or-many") 1328 | 1329 | "x" '(nil :which-key "text") 1330 | "xb" (spacemacs|org-emphasize spacemacs|org-bold ?*) 1331 | "xb" (spacemacs|org-emphasize spacemacs|org-bold ?*) 1332 | "xc" (spacemacs|org-emphasize spacemacs|org-code ?~) 1333 | "xi" (spacemacs|org-emphasize spacemacs|org-italic ?/) 1334 | "xs" (spacemacs|org-emphasize spacemacs|org-strike-through ?+) 1335 | "xu" (spacemacs|org-emphasize spacemacs|org-underline ?_) 1336 | "xv" (spacemacs|org-emphasize spacemacs|org-verbose ?~) ;; I realized that ~~ is the same and better than == (Github won't do ==) 1337 | 1338 | ;; insert 1339 | "i" '(nil :which-key "insert") 1340 | 1341 | "il" '(org-insert-link :which-key "org-insert-link") 1342 | "l" '(org-insert-link :which-key "org-insert-link") ;; More convenient access 1343 | "iL" '(counsel-org-link :which-key "counsel-org-link") 1344 | "it" '(jb-hydra-org-table/body :which-key "tables") 1345 | 1346 | "is" '(nil :which-key "insert stamp") 1347 | "iss" '((lambda () (interactive) (call-interactively (org-time-stamp-inactive))) :which-key "org-time-stamp-inactive") 1348 | "isS" '((lambda () (interactive) (call-interactively (org-time-stamp nil))) :which-key "org-time-stamp") 1349 | 1350 | ;; clocking 1351 | "c" '(nil :which-key "clocking") 1352 | "ci" '(org-clock-in :which-key "clock in") 1353 | "co" '(org-clock-out :which-key "clock out") 1354 | "cj" '(org-clock-goto :which-key "jump to clock") 1355 | ) 1356 | 1357 | 1358 | ;; Org-agenda 1359 | (general-define-key 1360 | :prefix "," 1361 | :states 'motion 1362 | :keymaps '(org-agenda-mode-map) 1363 | "" nil 1364 | "a" '(org-agenda :which-key "org agenda") 1365 | "c" '(org-capture :which-key "org-capture") 1366 | "s" '(org-agenda-schedule :which-key "schedule") 1367 | "," '(org-agenda-schedule :which-key "schedule") ;; quick access 1368 | "d" '(org-agenda-deadline :which-key "deadline") 1369 | "t" '(org-agenda-set-tags :which-key "set tags") 1370 | ;; clocking 1371 | "c" '(nil :which-key "clocking") 1372 | "ci" '(org-agenda-clock-in :which-key "clock in") 1373 | "co" '(org-agenda-clock-out :which-key "clock out") 1374 | "cj" '(org-clock-goto :which-key "jump to clock") 1375 | ) 1376 | 1377 | (evil-define-key 'motion org-agenda-mode-map 1378 | (kbd "f") 'org-agenda-later 1379 | (kbd "b") 'org-agenda-earlier) 1380 | 1381 | (defface jib-read 1382 | '((t (:foreground "MediumPurple2"))) 1383 | "Custom face for highlighting read." 1384 | :group 'jib) 1385 | 1386 | ;; (defun jib/org-highlight-setup () 1387 | ;; (highlight-regexp "\\<\\(TODO\\|NEXT\\) \\(Read\\)\\>" 'jib-read 2)) 1388 | 1389 | ;; (add-hook 'org-agenda-finalize-hook 'jib/org-highlight-setup) 1390 | ;; (add-hook 'org-mode-hook 'jib/org-highlight-setup) 1391 | 1392 | (defun jib/org-setup () 1393 | (org-indent-mode) ;; Keeps org items like text under headings, lists, nicely indented 1394 | (visual-line-mode 1) ;; Nice line wrapping 1395 | (centered-cursor-mode) ;; Enable centered cursor mode 1396 | (smartparens-mode 0) ;; Disable smartparents 1397 | (hl-prog-extra-mode) ;; Highlighting with regexps 1398 | (setq-local line-spacing (+ jib-default-line-spacing 2)) ;; A bit more line spacing for orgmode 1399 | (valign-mode) 1400 | ) 1401 | 1402 | (use-package org 1403 | ;; :pin elpa 1404 | :hook (org-mode . jib/org-setup) 1405 | :hook (org-mode . jib/prettify-symbols-setup) 1406 | :hook (org-capture-mode . evil-insert-state) ;; Start org-capture in Insert state by default 1407 | :diminish org-indent-mode 1408 | :diminish visual-line-mode 1409 | :config 1410 | 1411 | (setq org-ellipsis "…") 1412 | ;; ⤵ ▼ ⬎   1413 | (setq org-src-fontify-natively t) ;; Syntax highlighting in org src blocks 1414 | (setq org-highlight-latex-and-related '(native)) ;; Highlight inline LaTeX 1415 | (setq org-startup-folded 'showeverything) 1416 | (setq org-image-actual-width 300) 1417 | (setq org-fontify-whole-heading-line t) 1418 | (setq org-pretty-entities t) 1419 | 1420 | (setq org-cycle-separator-lines 1) 1421 | (setq org-catch-invisible-edits 'show-and-error) ;; 'smart 1422 | (setq org-src-tab-acts-natively t) 1423 | 1424 | ;; M-Ret can split lines on items and tables but not headlines and not on anything else (unconfigured) 1425 | (setq org-M-RET-may-split-line '((headline) (item . t) (table . t) (default))) 1426 | (setq org-loop-over-headlines-in-active-region nil) 1427 | 1428 | ;; Opens links to other org file in same frame (rather than splitting) 1429 | (setq org-link-frame-setup '((file . find-file))) 1430 | 1431 | (setq org-log-done t 1432 | org-log-into-drawer t) 1433 | 1434 | ;; Automatically change bullet type when indenting 1435 | ;; Ex: indenting a + makes the bullet a *. 1436 | (setq org-list-demote-modify-bullet 1437 | '(("+" . "*") ("*" . "-") ("-" . "+"))) 1438 | 1439 | ;; Automatically save and close the org files I most frequently archive to. 1440 | ;; I see no need to keep them open and crowding my buffer list. 1441 | ;; Uses my own function jib/save-and-close-this-buffer. 1442 | (dolist (file '("homework-archive.org_archive" "todo-archive.org_archive")) 1443 | (advice-add 'org-archive-subtree-default :after 1444 | (lambda () (jib/save-and-close-this-buffer file)))) 1445 | 1446 | (defun jib/post-org-goto () 1447 | (let ((current-prefix-arg '(4))) ;; emulate C-u 1448 | (call-interactively 'org-reveal)) 1449 | (org-cycle)) 1450 | 1451 | (advice-add 'counsel-org-goto :after #'jib/post-org-goto) 1452 | (advice-add 'org-agenda-goto :after #'jib/post-org-goto) 1453 | (advice-add 'org-agenda-switch-to :after #'jib/post-org-goto) 1454 | 1455 | ;; (setq org-tag-faces '( 1456 | ;; ("Misc" . "tan1") 1457 | ;; ("qp" . "RosyBrown1") ;; Quick-picks 1458 | ;; ("ec" . "PaleGreen3") ;; Extracurricular 1459 | ;; ("st" . "DimGrey") ;; Near-future (aka short term) todo 1460 | ;; )) 1461 | 1462 | (setq org-tags-column -1) 1463 | 1464 | (setq org-todo-keywords '((type 1465 | "TODO(t)" "WAITING(h)" "INPROG-TODO(i)" "WORK(w)" 1466 | "STUDY(s)" "SOMEDAY" "READ(r)" "PROJ(p)" "CONTACT(c)" 1467 | "|" "DONE(d)" "CANCELLED(C@)"))) 1468 | 1469 | (setq org-todo-keyword-faces 1470 | '(("TODO" :inherit (region org-todo) :foreground "DarkOrange1" :weight bold) 1471 | ("WORK" :inherit (org-todo region) :foreground "DarkOrange1" :weight bold) 1472 | ("READ" :inherit (org-todo region) :foreground "MediumPurple2" :weight bold) 1473 | ("PROJ" :inherit (org-todo region) :foreground "orange3" :weight bold) 1474 | ("STUDY" :inherit (region org-todo) :foreground "plum3" :weight bold) 1475 | ("DONE" . "SeaGreen4"))) 1476 | 1477 | (setq org-lowest-priority ?F) ;; Gives us priorities A through F 1478 | (setq org-default-priority ?E) ;; If an item has no priority, it is considered [#E]. 1479 | 1480 | (setq org-priority-faces 1481 | '((65 . "red2") 1482 | (66 . "Gold1") 1483 | (67 . "Goldenrod2") 1484 | (68 . "PaleTurquoise3") 1485 | (69 . "DarkSlateGray4") 1486 | (70 . "PaleTurquoise4"))) 1487 | 1488 | ;; Org-Babel 1489 | (org-babel-do-load-languages 1490 | 'org-babel-load-languages 1491 | '( 1492 | (python . t) 1493 | (shell . t) 1494 | (gnuplot . t) 1495 | (java . t) 1496 | )) 1497 | 1498 | (use-package gnuplot :defer t) 1499 | 1500 | ;; Don't prompt before running code in org 1501 | (setq org-confirm-babel-evaluate nil) 1502 | (setq python-shell-completion-native-enable nil) 1503 | 1504 | ;; How to open buffer when calling `org-edit-special'. 1505 | (setq org-src-window-setup 'current-window) 1506 | 1507 | (setq org-habit-preceding-days 6 1508 | org-habit-following-days 6 1509 | org-habit-show-habits-only-for-today nil 1510 | org-habit-today-glyph ?⍟ ;;‖ 1511 | org-habit-completed-glyph ?✓ 1512 | org-habit-graph-column 40) 1513 | 1514 | ;; custom time stamp format. I don't use this. 1515 | (setq org-time-stamp-custom-formats '("<%A, %B %d, %Y" . "<%m/%d/%y %a %I:%M %p>")) 1516 | 1517 | (setq org-agenda-restore-windows-after-quit t) 1518 | 1519 | (setq org-agenda-window-setup 'current-window) 1520 | 1521 | ;; Only show upcoming deadlines for the next X days. By default it shows 1522 | ;; 14 days into the future, which seems excessive. 1523 | (setq org-deadline-warning-days 3) 1524 | ;; If something is done, don't show its deadline 1525 | (setq org-agenda-skip-deadline-if-done t) 1526 | ;; If something is done, don't show when it's scheduled for 1527 | (setq org-agenda-skip-scheduled-if-done t) 1528 | ;; If something is scheduled, don't tell me it is due soon 1529 | (setq org-agenda-skip-deadline-prewarning-if-scheduled t) 1530 | 1531 | ;; use AM-PM and not 24-hour time 1532 | (setq org-agenda-timegrid-use-ampm t) 1533 | 1534 | ;; A new day is 3am (I work late into the night) 1535 | ;; (setq org-extend-today-until 3) 1536 | 1537 | ;; (setq org-agenda-time-grid '((daily today require-timed) 1538 | ;; (1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200) 1539 | ;; " " "----------------")) 1540 | 1541 | (setq org-agenda-time-grid nil) 1542 | 1543 | ;; (setq org-agenda-span 'day) 1544 | 1545 | (setq org-agenda-block-separator ?-) 1546 | ;; (setq org-agenda-current-time-string "<----------------- Now") 1547 | 1548 | ;; ;; (setq org-agenda-block-separator nil) 1549 | 1550 | ;; (setq org-agenda-scheduled-leaders '("Plan | " "Sched.%2dx: ") ; ⇛ 1551 | ;; org-agenda-deadline-leaders '("Due: " "(in %1d d.) " "Due %1d d. ago: ")) 1552 | 1553 | ;; (setq org-agenda-prefix-format '((agenda . " %-6:T %t%s") 1554 | ;; (todo . " %-6:T %t%s") 1555 | ;; (tags . " %i %-12:c") 1556 | ;; (search . " %i %-12:c"))) 1557 | 1558 | ;;;;; more true to defaults 1559 | 1560 | (setq org-agenda-prefix-format '((agenda . " %-12:T%?-12t% s") 1561 | (todo . " %i %-12:c") 1562 | (tags . " %i %-12:c") 1563 | (search . " %i %-12:c"))) 1564 | 1565 | (setq org-agenda-deadline-leaders '("Deadline: " "In %2d d.: " "%2d d. ago: ")) 1566 | 1567 | (add-hook 'org-agenda-mode-hook 1568 | #'(lambda () (setq-local line-spacing 3))) 1569 | 1570 | (add-hook 'org-agenda-mode-hook 1571 | #'(lambda () (hide-mode-line-mode))) 1572 | 1573 | (setq org-agenda-custom-commands nil) 1574 | 1575 | (setq org-agenda-hide-tags-regexp "\\(ec\\|lit\\|sci\\|edu\\|ds\\|calc3\\)") 1576 | 1577 | (defvar jib-org-agenda-columbia-productivity-super-groups 1578 | '((:name "Personal Items" :tag "p" :order 10) 1579 | (:name "Extracurricular" :tag "ec" :order 5) 1580 | (:name "Todo" :todo ("TODO") :order 3) 1581 | (:name "Heads Up!" 1582 | :todo ("PROJ" "WORK" "STUDY") :tag "lt" :order 4) 1583 | (:discard (:todo t)))) 1584 | 1585 | (defvar jib-org-columbia-productivity-ql-query 1586 | '(and (not (tags "defer")) 1587 | (not (scheduled)) ;; rationale --- if it's scheduled I don't need the heads-up 1588 | (or (effort 1) 1589 | (todo "TODO" "PROJ" "STUDY") 1590 | (and (todo) 1591 | (tags "p" "ec" "lt"))))) 1592 | 1593 | ;; Day View 1594 | (add-to-list 'org-agenda-custom-commands 1595 | '("c" "Columbia Day View" 1596 | ((agenda "" ((org-agenda-overriding-header "Columbia Productivity View") 1597 | (org-agenda-span 'day) 1598 | (org-agenda-sorting-strategy '(scheduled-up deadline-up priority-down)) 1599 | (org-super-agenda-groups '( 1600 | (:name "Today:" 1601 | :scheduled t 1602 | :order 2) 1603 | (:name "Deadlines:" 1604 | :deadline t 1605 | :order 3) 1606 | (:name "Today's Schedule:" 1607 | :time-grid t 1608 | :discard (:deadline t) 1609 | :order 1))))) 1610 | 1611 | (org-ql-block jib-org-columbia-productivity-ql-query 1612 | ((org-ql-block-header "Productivity Overview:") 1613 | (org-super-agenda-groups jib-org-agenda-columbia-productivity-super-groups)))))) 1614 | 1615 | ;; Day View No Agenda 1616 | (add-to-list 'org-agenda-custom-commands 1617 | '("v" "Columbia Day View No Agenda" 1618 | ((org-ql-block '(todo) 1619 | ((org-super-agenda-groups (push '(:name "Today's Tasks" ;; jib-org-super-agenda-school-groups, with this added on 1620 | :scheduled today 1621 | :deadline today) jib-org-agenda-columbia-productivity-super-groups) 1622 | 1623 | ;; '((:name "Today's Tasks" 1624 | ;; :scheduled today 1625 | ;; :deadline today) 1626 | ;; (:discard (:tag "defer")) 1627 | ;; (:name "Extracurricular:" 1628 | ;; :tag "ec" 1629 | ;; :order 10) 1630 | ;; (:name "Personal:" 1631 | ;; :tag "p" 1632 | ;; :order 5) 1633 | ;; (:name "Projects" 1634 | ;; :todo ("STUDY" "PROJ") 1635 | ;; :tag "lt") 1636 | ;; (:discard (:todo t))) 1637 | )))))) 1638 | 1639 | ;; Three-day view 1640 | (add-to-list 'org-agenda-custom-commands 1641 | '("w" "Columbia Four-Day View" 1642 | ((agenda "" ((org-agenda-span 4) 1643 | (org-agenda-entry-types '(:deadline :scheduled)) 1644 | (org-agenda-start-on-weekday nil) 1645 | (org-deadline-warning-days 0))) 1646 | 1647 | (org-ql-block jib-org-columbia-productivity-ql-query 1648 | ((org-ql-block-header "Productivity Overview:") 1649 | (org-super-agenda-groups jib-org-agenda-columbia-productivity-super-groups)))))) 1650 | 1651 | ;; Six-day view 1652 | (add-to-list 'org-agenda-custom-commands 1653 | '("q" "Columbia Ten-Day View" 1654 | ((agenda "" ((org-agenda-span 10) 1655 | (org-agenda-entry-types '(:deadline :scheduled)) 1656 | (org-agenda-start-on-weekday nil) 1657 | (org-deadline-warning-days 0)))))) 1658 | 1659 | ;; This isn't super needed as I mostly just use my custom refile command 1660 | ;; to refile to only the current buffer. 1661 | ;; (setq org-refile-targets (quote (("~/Dropbox/org/work.org" :maxlevel . 2) 1662 | ;; ("~/Dropbox/org/cpb.org" :maxlevel . 8) 1663 | ;; ;; ("~/Dropbox/notes/columbia/columbia_inbox.org") 1664 | ;; ))) 1665 | 1666 | ;; (setq org-outline-path-complete-in-steps t) ; Refile in a single go 1667 | ;; (setq org-refile-use-outline-path t) ; Show full paths for refiling 1668 | 1669 | ;; By default an org-capture/refile will save a bookmark. This 1670 | ;; disables that and keeps my bookmark list how I want it. 1671 | (setq org-bookmark-names-plist nil) 1672 | 1673 | 1674 | (setq org-capture-templates 1675 | '( 1676 | ("n" "CPB Note" entry (file+headline "~/Dropbox/org/cpb.org" "Refile") 1677 | "** NOTE: %? @ %U" :empty-lines 0 :refile-targets (("~/Dropbox/org/cpb.org" :maxlevel . 8))) 1678 | 1679 | ("i" "CPB Idea" entry (file+headline "~/Dropbox/org/cpb.org" "Refile") 1680 | "** IDEA: %? @ %U :idea:" :empty-lines 0 :refile-targets (("~/Dropbox/org/cpb.org" :maxlevel . 8))) 1681 | 1682 | ("m" "CPB Note Clipboard") 1683 | 1684 | ("mm" "Paste clipboard" entry (file+headline "~/Dropbox/org/cpb.org" "Refile") 1685 | "** NOTE: %(simpleclip-get-contents) %? @ %U" :empty-lines 0 :refile-targets (("~/Dropbox/org/cpb.org" :maxlevel . 8))) 1686 | 1687 | ("ml" "Create link and fetch title" entry (file+headline "~/Dropbox/org/cpb.org" "Refile") 1688 | "** [[%(simpleclip-get-contents)][%(jib/www-get-page-title (simpleclip-get-contents))]] @ %U" :empty-lines 0 :refile-targets (("~/Dropbox/org/cpb.org" :maxlevel . 8))) 1689 | 1690 | ("w" "Work Todo Entries") 1691 | ("we" "No Time" entry (file "~/Dropbox/org/work.org") 1692 | "** %^{Type|HW|READ|TODO|PROJ} %^{Todo title} %?" :prepend t :empty-lines-before 0 1693 | :refile-targets (("~/Dropbox/org/work.org" :maxlevel . 2))) 1694 | 1695 | ("ws" "Scheduled" entry (file "~/Dropbox/org/work.org") 1696 | "** %^{Type|HW|READ|TODO|PROJ} %^{Todo title}\nSCHEDULED: %^t%?" :prepend t :empty-lines-before 0 1697 | :refile-targets (("~/Dropbox/org/work.org" :maxlevel . 2))) 1698 | 1699 | ("wd" "Deadline" entry (file "~/Dropbox/org/work.org") 1700 | "** %^{Type|HW|READ|TODO|PROJ} %^{Todo title}\nDEADLINE: %^t%?" :prepend t :empty-lines-before 0 1701 | :refile-targets (("~/Dropbox/org/work.org" :maxlevel . 2))) 1702 | 1703 | ("ww" "Scheduled & deadline" entry (file "~/Dropbox/org/work.org") 1704 | "** %^{Type|HW|READ|TODO|PROJ} %^{Todo title}\nSCHEDULED: %^t DEADLINE: %^t %?" :prepend t :empty-lines-before 0 1705 | :refile-targets (("~/Dropbox/org/work.org" :maxlevel . 2))) 1706 | 1707 | ("t" "Temp file entry" entry (file "~/Dropbox/.tmp.org") 1708 | "** %^{Heading} @ %u \n%?" :prepend t) 1709 | 1710 | )) 1711 | 1712 | ;; (setq org-export-backends '(ascii beamer html latex md odt)) 1713 | 1714 | (setq org-export-with-broken-links t 1715 | org-export-with-smart-quotes t 1716 | org-export-allow-bind-keywords t) 1717 | 1718 | ;; From https://stackoverflow.com/questions/23297422/org-mode-timestamp-format-when-exported 1719 | (defun org-export-filter-timestamp-remove-brackets (timestamp backend info) 1720 | "removes relevant brackets from a timestamp" 1721 | (cond 1722 | ((org-export-derived-backend-p backend 'latex) 1723 | (replace-regexp-in-string "[<>]\\|[][]" "" timestamp)) 1724 | ((org-export-derived-backend-p backend 'html) 1725 | (replace-regexp-in-string "&[lg]t;\\|[][]" "" timestamp)))) 1726 | 1727 | 1728 | ;; HTML-specific 1729 | (setq org-html-validation-link nil) ;; No validation button on HTML exports 1730 | 1731 | ;; LaTeX Specific 1732 | (eval-after-load 'ox '(add-to-list 1733 | 'org-export-filter-timestamp-functions 1734 | 'org-export-filter-timestamp-remove-brackets)) 1735 | 1736 | (use-package ox-hugo 1737 | :defer 2 1738 | :after ox 1739 | :config 1740 | (setq org-hugo-base-dir "~/Dropbox/Projects/cpb")) 1741 | 1742 | (use-package ox-moderncv 1743 | :ensure nil 1744 | :init (require 'ox-moderncv)) 1745 | 1746 | (setq org-latex-listings t) ;; Uses listings package for code exports 1747 | (setq org-latex-compiler "xelatex") ;; XeLaTex rather than pdflatex 1748 | 1749 | ;; not sure what this is, look into it 1750 | ;; '(org-latex-active-timestamp-format "\\texttt{%s}") 1751 | ;; '(org-latex-inactive-timestamp-format "\\texttt{%s}") 1752 | 1753 | ;; LaTeX Classes 1754 | (with-eval-after-load 'ox-latex 1755 | (add-to-list 'org-latex-classes 1756 | '("org-plain-latex" ;; I use this in base class in all of my org exports. 1757 | "\\documentclass{extarticle} 1758 | [NO-DEFAULT-PACKAGES] 1759 | [PACKAGES] 1760 | [EXTRA]" 1761 | ("\\section{%s}" . "\\section*{%s}") 1762 | ("\\subsection{%s}" . "\\subsection*{%s}") 1763 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 1764 | ("\\paragraph{%s}" . "\\paragraph*{%s}") 1765 | ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) 1766 | ) 1767 | 1768 | (setq org-clock-mode-line-total 'current) ;; Show only timer from current clock session in modeline 1769 | (setq org-clock-clocked-in-display 'both) 1770 | 1771 | (setq org-attach-id-dir ".org-attach/" 1772 | org-attach-use-inheritance t) 1773 | 1774 | 1775 | ) ;; This parenthesis ends the org use-package. 1776 | 1777 | (use-package magit :defer t) 1778 | (use-package unfill :defer t) 1779 | (use-package burly :defer t) 1780 | (use-package ace-window :defer t) 1781 | (use-package centered-cursor-mode :diminish centered-cursor-mode) 1782 | (use-package restart-emacs :defer t) 1783 | (use-package diminish) 1784 | (use-package reveal-in-osx-finder :commands (reveal-in-osx-finder)) 1785 | 1786 | (use-package bufler 1787 | :config 1788 | (setq bufler-filter-buffer-modes nil ;; Don't hide so many buffers 1789 | bufler-filter-buffer-name-regexps nil) 1790 | (setf bufler-groups (bufler-defgroups 1791 | (group 1792 | ;; Subgroup collecting all named workspaces. 1793 | (auto-workspace)) 1794 | (group 1795 | ;; Subgroup collecting all `help-mode' and `info-mode' buffers. 1796 | (group-or "*Help/Info*" 1797 | (mode-match "*Help*" (rx bos "help-")) 1798 | (mode-match "*Info*" (rx bos "info-")))) 1799 | (group 1800 | ;; Subgroup collecting all special buffers (i.e. ones that are not 1801 | ;; file-backed), except `magit-status-mode' buffers (which are allowed to fall 1802 | ;; through to other groups, so they end up grouped with their project buffers). 1803 | (group-and "*Special*" 1804 | (lambda (buffer) 1805 | (unless (or (funcall (mode-match "Magit" (rx bos "magit-status")) 1806 | buffer) 1807 | (funcall (mode-match "Dired" (rx bos "dired")) 1808 | buffer) 1809 | (funcall (auto-file) buffer)) 1810 | "*Special*"))) 1811 | (group 1812 | ;; Subgroup collecting these "special special" buffers 1813 | ;; separately for convenience. 1814 | (name-match "**Special**" 1815 | (rx bos "*" (or "Messages" "Warnings" "scratch" "Backtrace") "*"))) 1816 | (group 1817 | ;; Subgroup collecting all other Magit buffers, grouped by directory. 1818 | (mode-match "*Magit* (non-status)" (rx bos (or "magit" "forge") "-")) 1819 | (auto-directory)) 1820 | ;; Remaining special buffers are grouped automatically by mode. 1821 | ;; (auto-mode) 1822 | ) 1823 | (group (dir "~/Dropbox/notes/") 1824 | (auto-mode) 1825 | (auto-directory)) 1826 | (group (dir "~/Dropbox/org/")) 1827 | ;; Group remaining buffers by directory, then major mode. 1828 | (auto-directory) 1829 | (auto-mode))) 1830 | :general 1831 | (:keymaps 'bufler-list-mode-map "Q" 'kill-this-buffer)) 1832 | 1833 | (use-package hl-prog-extra 1834 | :commands (hl-prog-extra-mode) 1835 | :config 1836 | (setq hl-prog-extra-list 1837 | (list 1838 | '("\\<\\(TODO\\|NOTE\\)\\(([^)+]+)\\)?" 0 comment 1839 | (:weight bold :inherit diff-removed)) 1840 | ;; Match TKs in quotation marks (hl-prog-extra sees them as strings) 1841 | '("\\(TK\\)+" 0 string '(:weight bold :inherit font-lock-warning-face)) 1842 | ;; Match TKs not in quotation marks 1843 | '("\\(TK\\)+" 0 nil '(:weight bold :inherit font-lock-warning-face)))) 1844 | (global-hl-prog-extra-mode)) 1845 | 1846 | (use-package xwidget 1847 | :general 1848 | (general-define-key :states 'normal :keymaps 'xwidget-webkit-mode-map 1849 | "j" 'xwidget-webkit-scroll-up-line 1850 | "k" 'xwidget-webkit-scroll-down-line 1851 | "gg" 'xwidget-webkit-scroll-top 1852 | "G" 'xwidget-webkit-scroll-bottom)) 1853 | 1854 | (use-package mw-thesaurus 1855 | :defer t 1856 | :config 1857 | (add-hook 'mw-thesaurus-mode-hook 1858 | (lambda () (define-key evil-normal-state-local-map (kbd "q") 'mw-thesaurus--quit)))) 1859 | 1860 | (use-package ansi-term 1861 | :ensure nil 1862 | :general 1863 | (:keymaps 'term-mode-map 1864 | "" 'term-previous-input 1865 | "" 'term-next-input)) 1866 | 1867 | ;; https://github.com/oantolin/epithet 1868 | (use-package epithet 1869 | :ensure nil 1870 | :config 1871 | (add-hook 'Info-selection-hook #'epithet-rename-buffer) 1872 | (add-hook 'help-mode-hook #'epithet-rename-buffer)) 1873 | 1874 | ;; https://github.com/udyantw/most-used-words 1875 | (use-package most-used-words :ensure nil) 1876 | 1877 | (defun jib/deft-kill () 1878 | (kill-buffer "*Deft*")) 1879 | 1880 | (defun jib/deft-evil-fix () 1881 | (evil-insert-state) 1882 | (centered-cursor-mode)) 1883 | 1884 | (use-package deft 1885 | :config 1886 | (setq deft-directory (concat jib/dropbox "notes/") 1887 | deft-extensions '("org" "txt") 1888 | deft-recursive t 1889 | deft-file-limit 40 1890 | deft-use-filename-as-title t) 1891 | 1892 | (add-hook 'deft-open-file-hook 'jib/deft-kill) ;; Once a file is opened, kill Deft 1893 | (add-hook 'deft-mode-hook 'jib/deft-evil-fix) ;; Goes into insert mode automaticlly in Deft 1894 | 1895 | ;; Removes :PROPERTIES: from descriptions 1896 | (setq deft-strip-summary-regexp ":PROPERTIES:\n\\(.+\n\\)+:END:\n") 1897 | :general 1898 | 1899 | (general-define-key :states 'normal :keymaps 'deft-mode-map 1900 | ;; 'q' kills Deft in normal mode 1901 | "q" 'kill-this-buffer) 1902 | 1903 | (general-define-key :states 'insert :keymaps 'deft-mode-map 1904 | "C-j" 'next-line 1905 | "C-k" 'previous-line) 1906 | ) 1907 | 1908 | (use-package latex ;; This is a weird one. Package is auctex but needs to be managed like this. 1909 | :ensure nil 1910 | :defer t 1911 | :init 1912 | (setq TeX-engine 'xetex ;; Use XeTeX 1913 | latex-run-command "xetex") 1914 | 1915 | (setq TeX-parse-self t ; parse on load 1916 | TeX-auto-save t ; parse on save 1917 | ;; Use directories in a hidden away folder for AUCTeX files. 1918 | TeX-auto-local (concat user-emacs-directory "auctex/auto/") 1919 | TeX-style-local (concat user-emacs-directory "auctex/style/") 1920 | 1921 | TeX-source-correlate-mode t 1922 | TeX-source-correlate-method 'synctex 1923 | 1924 | TeX-show-compilation nil 1925 | 1926 | ;; Don't start the Emacs server when correlating sources. 1927 | TeX-source-correlate-start-server nil 1928 | 1929 | ;; Automatically insert braces after sub/superscript in `LaTeX-math-mode'. 1930 | TeX-electric-sub-and-superscript t 1931 | ;; Just save, don't ask before each compilation. 1932 | TeX-save-query nil) 1933 | 1934 | ;; To use pdfview with auctex: 1935 | (setq TeX-view-program-selection '((output-pdf "PDF Tools")) 1936 | TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)) 1937 | TeX-source-correlate-start-server t) 1938 | :general 1939 | (general-define-key 1940 | :prefix "," 1941 | :states 'normal 1942 | :keymaps 'LaTeX-mode-map 1943 | "" nil 1944 | "a" '(TeX-command-run-all :which-key "TeX run all") 1945 | "c" '(TeX-command-master :which-key "TeX-command-master") 1946 | "c" '(TeX-command-master :which-key "TeX-command-master") 1947 | "e" '(LaTeX-environment :which-key "Insert environment") 1948 | "s" '(LaTeX-section :which-key "Insert section") 1949 | "m" '(TeX-insert-macro :which-key "Insert macro") 1950 | ) 1951 | 1952 | ) 1953 | 1954 | (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer) ;; Standard way 1955 | 1956 | ;; (use-package company-auctex 1957 | ;; :after auctex 1958 | ;; :init 1959 | ;; (add-to-list 'company-backends 'company-auctex) 1960 | ;; (company-auctex-init)) 1961 | 1962 | (use-package pdf-tools 1963 | :defer t 1964 | ;; stop pdf-tools being automatically updated when I update the 1965 | ;; rest of my packages, since it would need the installation command and restart 1966 | ;; each time it updated. 1967 | :pin manual 1968 | :mode ("\\.pdf\\'" . pdf-view-mode) 1969 | :config 1970 | (pdf-loader-install) 1971 | (setq-default pdf-view-display-size 'fit-height) 1972 | (setq pdf-view-continuous nil) ;; Makes it so scrolling down to the bottom/top of a page doesn't switch to the next page 1973 | (setq pdf-view-midnight-colors '("#ffffff" . "#121212" )) ;; I use midnight mode as dark mode, dark mode doesn't seem to work 1974 | :general 1975 | (general-define-key :states 'motion :keymaps 'pdf-view-mode-map 1976 | "j" 'pdf-view-next-page 1977 | "k" 'pdf-view-previous-page 1978 | 1979 | "C-j" 'pdf-view-next-line-or-next-page 1980 | "C-k" 'pdf-view-previous-line-or-previous-page 1981 | 1982 | ;; Arrows for movement as well 1983 | (kbd "") 'pdf-view-next-line-or-next-page 1984 | (kbd "") 'pdf-view-previous-line-or-previous-page 1985 | 1986 | (kbd "") 'pdf-view-next-line-or-next-page 1987 | (kbd "") 'pdf-view-previous-line-or-previous-page 1988 | 1989 | (kbd "") 'image-backward-hscroll 1990 | (kbd "") 'image-forward-hscroll 1991 | 1992 | "H" 'pdf-view-fit-height-to-window 1993 | "0" 'pdf-view-fit-height-to-window 1994 | "W" 'pdf-view-fit-width-to-window 1995 | "=" 'pdf-view-enlarge 1996 | "-" 'pdf-view-shrink 1997 | 1998 | "q" 'quit-window 1999 | "Q" 'kill-this-buffer 2000 | "g" 'revert-buffer 2001 | 2002 | "C-s" 'isearch-forward 2003 | ) 2004 | ) 2005 | 2006 | (use-package popper 2007 | :bind (("C-`" . popper-toggle-latest) 2008 | ("M-`" . popper-cycle) 2009 | ("C-M-`" . popper-toggle-type)) 2010 | :init 2011 | (setq popper-reference-buffers 2012 | '("\\*Messages\\*" 2013 | "Output\\*$" 2014 | "\\*Warnings\\*" 2015 | help-mode 2016 | compilation-mode)) 2017 | (popper-mode +1)) 2018 | 2019 | (use-package rainbow-mode :defer t) 2020 | 2021 | (use-package quickrun :defer t 2022 | :general 2023 | (general-define-key :states 'normal :keymaps 'quickrun--mode-map 2024 | "q" 'quit-window 2025 | "s-9" 'quickrun-shell)) 2026 | 2027 | ;; A better python mode (supposedly) 2028 | (use-package python-mode 2029 | :defer t) 2030 | 2031 | (general-define-key :states '(emacs) :keymaps 'inferior-python-mode-map 2032 | "" 'comint-previous-input 2033 | "" 'comint-next-input) 2034 | 2035 | ;; Using my virtual environments 2036 | (use-package pyvenv 2037 | :defer t 2038 | :init 2039 | (setenv "WORKON_HOME" "~/.pyenv/versions")) ;; Where the virtual envs are stored on my computer 2040 | 2041 | 2042 | ;; Automatically set the virtual environment when entering a directory 2043 | (use-package auto-virtualenv 2044 | :defer 2 2045 | :config 2046 | (add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv)) 2047 | 2048 | ;; Python development helper 2049 | ;; (use-package elpy 2050 | ;; :defer t 2051 | ;; :init 2052 | ;; (setq elpy-rpc-virtualenv-path 'current) 2053 | ;; (advice-add 'python-mode :before 'elpy-enable)) 2054 | 2055 | (use-package web-mode 2056 | :defer t 2057 | :init 2058 | (add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode)) ;; Open .html files in web-mode 2059 | :config 2060 | (setq web-mode-enable-current-element-highlight t 2061 | web-mode-enable-current-column-highlight t) 2062 | 2063 | :general 2064 | (general-def 2065 | :prefix "," 2066 | :states 'motion 2067 | :keymaps 'web-mode-map 2068 | "" nil 2069 | "i" '(web-mode-buffer-indent :which-key "web mode indent") 2070 | "c" '(web-mode-fold-or-unfold :which-key "web mode toggle fold") 2071 | )) 2072 | 2073 | (use-package emacs-lisp-mode 2074 | :ensure nil 2075 | :general 2076 | (general-define-key 2077 | :prefix "," 2078 | :states 'motion 2079 | :keymaps 'emacs-lisp-mode-map 2080 | "" nil 2081 | "e" '(nil :which-key "eval") 2082 | "es" '(eval-last-sexp :which-key "eval-sexp") 2083 | "er" '(eval-region :which-key "eval-region") 2084 | "eb" '(eval-buffer :which-key "eval-buffer") 2085 | 2086 | "g" '(counsel-imenu :which-key "imenu") 2087 | "c" '(check-parens :which-key "check parens") 2088 | "I" '(indent-region :which-key "indent-region") 2089 | 2090 | "b" '(nil :which-key "org src") 2091 | "bc" 'org-edit-src-abort 2092 | "bb" 'org-edit-src-exit 2093 | ) 2094 | ) 2095 | -------------------------------------------------------------------------------- /jake-emacs/jib-funcs.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t; -*- 2 | ;;; 3 | ;;; Jake B Functions File 4 | ;;; 5 | 6 | ;; Copyright (C) Jake B 7 | ;; Author: Jake B 8 | ;; URL: https://github.com/jakebox/.emacs 9 | ;; This file is not part of GNU Emacs. 10 | ;; This file is free software. 11 | 12 | ;; JIB Functions 13 | 14 | ;;;;;;;;;;;;;;;;;;;;;; 15 | ;; Helper Functions ;; 16 | ;;;;;;;;;;;;;;;;;;;;;; 17 | 18 | ;; from https://emacs.stackexchange.com/questions/3022/reset-custom-variable-to-default-value-programmatically0 19 | (defun jib/reset-var (symbl) 20 | "Reset SYMBL to its standard value." 21 | (set symbl (eval (car (get symbl 'standard-value))))) 22 | 23 | ;;;;;;;;;;;;;;;;;;;;;; 24 | ;; Window Functions ;; 25 | ;;;;;;;;;;;;;;;;;;;;;; 26 | 27 | (defun jib/split-window-vertically-and-switch () 28 | (interactive) 29 | (split-window-vertically) 30 | (other-window 1)) 31 | (defun jib/split-window-horizontally-and-switch () 32 | (interactive) 33 | (split-window-horizontally) 34 | (other-window 1)) 35 | ;; from https://gist.github.com/3402786 36 | (defun jib/toggle-maximize-buffer () 37 | "Maximize buffer" 38 | (interactive) 39 | (if (and (= 1 (length (window-list))) 40 | (assoc ?_ register-alist)) 41 | (jump-to-register ?_) 42 | (progn 43 | (window-configuration-to-register ?_) 44 | (delete-other-windows)))) 45 | 46 | 47 | ;;;;;;;;;;;;;;;;;;;;;;; 48 | ;; Files and Buffers ;; 49 | ;;;;;;;;;;;;;;;;;;;;;;; 50 | 51 | (defun jib/switch-to-scratch-buffer () 52 | (interactive) 53 | (switch-to-buffer "*scratch*")) 54 | 55 | (defun jib/save-and-close-this-buffer (buffer) 56 | "Saves and closes given buffer." 57 | (if (get-buffer buffer) 58 | (let ((b (get-buffer buffer))) 59 | (save-buffer b) 60 | (kill-buffer b)))) 61 | 62 | ;; found at http://emacswiki.org/emacs/KillingBuffers 63 | (defun jib/kill-other-buffers (&optional arg) 64 | "Kill all other buffers. 65 | If the universal prefix argument is used then will the windows too." 66 | (interactive "P") 67 | (when (yes-or-no-p (format "Killing all buffers except \"%s\"? " 68 | (buffer-name))) 69 | (mapc 'kill-buffer (delq (current-buffer) (buffer-list))) 70 | (when (equal '(4) arg) (delete-other-windows)) 71 | (message "Buffers deleted!"))) 72 | 73 | (defun spacemacs/new-empty-buffer () 74 | "Create a new buffer called untitled()" 75 | (interactive) 76 | (let ((newbuf (generate-new-buffer-name "*scratch*"))) 77 | (switch-to-buffer newbuf))) 78 | 79 | ;; from magnars 80 | (defun spacemacs/rename-current-buffer-file () 81 | "Renames current buffer and file it is visiting." 82 | (interactive) 83 | (let* ((name (buffer-name)) 84 | (filename (buffer-file-name))) 85 | (if (not (and filename (file-exists-p filename))) 86 | (error "Buffer '%s' is not visiting a file!" name) 87 | (let* ((dir (file-name-directory filename)) 88 | (new-name (read-file-name "New name: " dir))) 89 | (cond ((get-buffer new-name) 90 | (error "A buffer named '%s' already exists!" new-name)) 91 | (t 92 | (let ((dir (file-name-directory new-name))) 93 | (when (and (not (file-exists-p dir)) (yes-or-no-p (format "Create directory '%s'?" dir))) 94 | (make-directory dir t))) 95 | (rename-file filename new-name 1) 96 | (rename-buffer new-name) 97 | (set-visited-file-name new-name) 98 | (set-buffer-modified-p nil) 99 | (when (fboundp 'recentf-add-file) 100 | (recentf-add-file new-name) 101 | (recentf-remove-if-non-kept filename)) 102 | (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) 103 | 104 | (defun jib/split-and-scratch-elisp () 105 | "Split window and create new buffer for Emacs Lisp evaluation." 106 | (interactive) 107 | (jib/split-window-horizontally-and-switch) 108 | (spacemacs/new-empty-buffer) 109 | (emacs-lisp-mode)) 110 | 111 | (defun jib/reload-emacs-configuration () 112 | (interactive) 113 | (load (expand-file-name "init.el" user-emacs-directory))) 114 | 115 | (defun jib/open-buffer-file-mac () 116 | "Open current buffer file using Mac `open' command." 117 | (interactive) 118 | (shell-command (concat "open " (buffer-file-name)))) 119 | 120 | (defun jib/zoxide-wrapper (&optional arg) 121 | "Use zoxide to open directory in either Finder (default) or Dired (C-u)." 122 | (interactive "P") 123 | (when (called-interactively-p 'interactive) 124 | (let ((input (completing-read "z: " nil))) 125 | (if (equal '(4) arg) 126 | (dired (shell-command (concat "z " "cs;" " pwd"))) ;; not currently working (shell-command outputs to a buffer) 127 | (shell-command (concat "z " input "; open .")))))) 128 | 129 | ;; Automatically tangle our Emacs.org config file when we save it 130 | ;; from emacs-from-scratch 131 | (defun jib/org-babel-tangle-config () 132 | (interactive) 133 | (when (string-equal (buffer-file-name) 134 | jib/init.org) 135 | ;; Dynamic scoping to the rescue 136 | (let ((org-confirm-babel-evaluate nil)) 137 | (org-babel-tangle)))) 138 | 139 | ;;;;;;;;;;;;; 140 | ;; Utility ;; 141 | ;;;;;;;;;;;;; 142 | ;; https://emacsredux.com/blog/2013/03/28/google/ 143 | (defun jib/er-google () 144 | "Google the selected region if any, display a query prompt otherwise." 145 | (interactive) 146 | (browse-url 147 | (concat 148 | "http://www.google.com/search?ie=utf-8&oe=utf-8&q=" 149 | (url-hexify-string (if mark-active 150 | (buffer-substring (region-beginning) (region-end)) 151 | (read-string "Google: ")))))) 152 | 153 | ;; https://lists.gnu.org/archive/html/help-gnu-emacs/2010-07/msg00291.html 154 | (defun jib/www-get-page-title (url) 155 | (let ((title)) 156 | (with-current-buffer (url-retrieve-synchronously url) 157 | (goto-char (point-min)) 158 | (re-search-forward "\\([^<]*\\)" nil t 1) 159 | (setq title (match-string 1)) 160 | (goto-char (point-min)) 161 | (re-search-forward "charset=\\([-0-9a-zA-Z]*\\)" nil t 1) 162 | (decode-coding-string title (intern (match-string 1)))))) 163 | 164 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 165 | ;; Text Editing/Text Automation ;; 166 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 167 | 168 | ;; Uses simpleclip 169 | (defun jib/copy-whole-buffer-to-clipboard () 170 | "Copy entire buffer to clipboard" 171 | (interactive) 172 | (save-excursion 173 | (mark-whole-buffer) 174 | (simpleclip-copy (point-min) (point-max)) 175 | (deactivate-mark)) 176 | (message "Copied entire buffer to clipboard")) 177 | 178 | (defun jib/emacs-clipboard-to-system-clipboard () 179 | "Set system clipboard to contents of Emacs kill ring." 180 | (interactive) 181 | (simpleclip-set-contents (substring-no-properties (nth 0 kill-ring)))) 182 | 183 | (defun jib/system-clipboard-to-emacs-clipboard () 184 | "Set Emacs kill ring to contents of system clipboard." 185 | (interactive) 186 | (kill-new (simpleclip-get-contents))) 187 | 188 | (defun jib/split-and-close-sentence () 189 | "Deletes current word, inserts a period, and capitalizes the next word - 190 | splits the sentence." 191 | (interactive) 192 | (kill-word 1) 193 | (delete-backward-char 1) 194 | (insert ".") 195 | (capitalize-word 1)) 196 | 197 | (defun jib/listify (&optional count) 198 | "Turn the region's (or count = n lines) into an orgmode list by prepending a +." 199 | (interactive "p") 200 | (let ((lines (count-lines (region-beginning) (region-end)))) ;; By default grab a region 201 | (if (> count 1) (setq lines count)) ;; but if there was an argument, override the # of lines 202 | (save-excursion 203 | (if (use-region-p) ;; If there's a region go to the start and deactivate the region 204 | (goto-char (region-beginning)) (deactivate-mark)) 205 | (while (> lines 0) ;; Add "+ " at the beginning of each line 206 | (beginning-of-line) 207 | (insert "+ ") 208 | (forward-line) 209 | (setq lines (1- lines)))))) 210 | 211 | (defun jib/insert-empty-lines-after-each-line () 212 | "Add a blank line after each line in a region." 213 | (interactive) 214 | (let ((lines (count-lines (region-beginning) (region-end)))) ;; By default grab a region 215 | (save-excursion 216 | (if (use-region-p) ;; If there's a region go to the start and deactivate the region 217 | (goto-char (region-beginning)) (deactivate-mark)) 218 | (while (> lines 0) 219 | (end-of-line) 220 | (open-line 1) 221 | (next-line 2) 222 | (setq lines (1- lines)))))) 223 | 224 | (defun jib/pages-from-page-range () 225 | "Select a page range formatted as: start-end (e.g. 520-614). Calculates and inserts page count." 226 | (interactive) 227 | (if (use-region-p) 228 | (let* 229 | ((range (buffer-substring (region-beginning) (region-end))) 230 | (dash (string-match "-" range)) 231 | (beginning (string-to-number (substring range 0 dash))) 232 | (end (string-to-number (substring range (+ dash 1) nil))) 233 | (difference (+ (- end beginning) 1))) ;; Inclusive (so +1) 234 | (goto-char (region-end)) 235 | (deactivate-mark) 236 | (insert " (" (number-to-string difference) ")")) 237 | (user-error "Error: select a region"))) 238 | 239 | ;;;;;;;;;;;;;;;;;; 240 | ;; Calculations ;; 241 | ;;;;;;;;;;;;;;;;;; 242 | 243 | (defun jib/calc-speaking-time () 244 | "Calculate how long it would take me to speak aloud the selection." 245 | (interactive) 246 | (if (use-region-p) (let* ((wpm 150) 247 | (word-count (float (count-words-region (region-beginning) (region-end)))) 248 | (raw-time (* 60 (/ word-count wpm)))) 249 | (message "%s minutes, %s seconds to speak at %d wpm (%d words)" 250 | (format-seconds "%m" raw-time) 251 | (floor (mod raw-time 60)) wpm word-count)) 252 | (error "Error: select a region."))) 253 | 254 | (defun jib/time-difference () 255 | "Ask for two times/date using `org-read-date' and compute the difference." 256 | (interactive) 257 | (message "%s" (ts-human-format-duration ;; Multiply by -1 so first input can be the earlier time 258 | (* -1 (ts-difference (ts-parse-org (org-read-date)) 259 | (ts-parse-org (org-read-date))))))) 260 | 261 | (defun jib/return-week-number () 262 | (interactive) 263 | (message "It is week %s of the year." (format-time-string "%U"))) 264 | 265 | ;;;;;;;;;;;;;;;;;;;;;;;;;; 266 | ;; Make Packages Better ;; 267 | ;;;;;;;;;;;;;;;;;;;;;;;;;; 268 | 269 | (defun jib/fzf () 270 | "Allows you to select a folder to fzf" 271 | (interactive) 272 | (let ((current-prefix-arg '-)) ;; emulate C-u 273 | (call-interactively 'counsel-fzf))) 274 | 275 | (defun jib/rg () 276 | "Allows you to select a folder to ripgrep." 277 | (interactive) 278 | (let ((current-prefix-arg 4)) ;; emulate C-u 279 | (call-interactively 'counsel-rg))) 280 | 281 | (defun spacemacs/deft () 282 | "Helper to call deft and then fix things so that it is nice and works" 283 | (interactive) 284 | (deft) 285 | ;; Hungry delete wrecks deft's DEL override 286 | (when (fboundp 'hungry-delete-mode) 287 | (hungry-delete-mode -1)) 288 | ;; When opening it you always want to filter right away 289 | (evil-insert-state nil)) 290 | 291 | (defun jib/load-theme (theme) 292 | "Enhance `load-theme' by first disabling enabled themes." 293 | (mapc #'disable-theme custom-enabled-themes) 294 | (load-theme theme t)) 295 | 296 | 297 | ;;;;;;;;;;;;; 298 | ;; Orgmode ;; 299 | ;;;;;;;;;;;;; 300 | 301 | (defun jib/org-agenda-caller (letter) 302 | "Calls a specific org agenda view specified by the letter argument." 303 | (org-agenda nil letter)) 304 | 305 | (defun jib/org-copy-link-to-clipboard () 306 | "Copy orgmode link to clipboard (simpleclip)." 307 | (interactive) 308 | (let ((context (org-element-context))) 309 | (if (eq (org-element-type context) 'link) 310 | (simpleclip-set-contents 311 | (org-element-property :raw-link context)) 312 | (user-error "Not a link")))) 313 | 314 | (defun jib/org-temp-export-html (&optional arg) 315 | "Quick, temporary HTML export of org file. 316 | If region is active, export region. Otherwise, export entire file. 317 | If run with universal argument C-u, insert org options to make export very plain." 318 | (interactive "P") 319 | (save-window-excursion 320 | (if (not (use-region-p)) ;; If there is no region active, mark the whole buffer 321 | (mark-whole-buffer)) 322 | (let ((old-buffer (current-buffer)) (beg (region-beginning)) (end (region-end))) 323 | (with-temp-buffer 324 | (when (equal '(4) arg) 325 | (insert "#+OPTIONS: toc:nil date:nil author:nil num:nil title:nil tags:nil \ 326 | todo:nil html-link-use-abs-url:nil html-postamble:nil html-preamble:nil html-scripts:nil tex:nil \ 327 | html-style:nil html5-fancy:nil tex:nil")) ;; If desired, insert these options for a plain export 328 | (insert "\n \n") 329 | (insert-buffer-substring old-buffer beg end) ;; Insert desired text to export into temp buffer 330 | (org-html-export-as-html) ;; Export to HTML 331 | (write-file (concat (make-temp-file "jibemacsorg") ".html")) ;; Write HTML to temp file 332 | (jib/open-buffer-file-mac) ;; Use my custom function to open the file (Mac only) 333 | (kill-this-buffer))))) 334 | 335 | (defun jib/org-export-markdown-to-clipboard (&optional arg) 336 | "Copy org to clipboard as markdown. 337 | If region is active, use region. Otherwise, use entire file." 338 | (interactive "P") 339 | (save-window-excursion 340 | (if (not (use-region-p)) ;; If there is no region active, mark the whole buffer 341 | (mark-whole-buffer)) 342 | (let ((old-buffer (current-buffer)) (beg (region-beginning)) (end (region-end))) 343 | (with-temp-buffer 344 | (unless (equal '(4) arg) (insert "#+OPTIONS: toc:nil \n")) ;; Unless run with C-u, don't make a TOC 345 | (insert-buffer-substring old-buffer beg end) ;; Insert desired text to export into temp buffer 346 | (org-md-export-as-markdown) ;; Export to markdown buffer 347 | (jib/copy-whole-buffer-to-clipboard) 348 | (kill-this-buffer)))) ;; Kill the markdown buffer 349 | (deactivate-mark)) 350 | 351 | ;; WIP 352 | (defun jib/org-temp-export-pdf (&optional arg) 353 | (interactive "P") 354 | (let* ((use-title (y-or-n-p "Use a title?")) 355 | (use-header (if (eq use-title t) 356 | (y-or-n-p "Use section header as title?"))) 357 | (org-section-title (nth 4 (org-heading-components))) 358 | (style (completing-read "Style" '("quicksport" "basic-notes"))) 359 | (inputted-title (if (and (eq use-title t) (eq use-header nil)) 360 | (read-string "Title? "))) 361 | ) ;; end let* variables section 362 | (if (use-region-p) 363 | (kill-ring-save (region-beginning) (region-end)) ;; If there is a region copy it and use that 364 | (org-copy-subtree)) ;; Else copy the subtree 365 | (save-window-excursion 366 | ;; Maybe better to do this with with-temp-buffer. Not sure. 367 | (find-file (make-temp-file 368 | (concat "jb_" (format-time-string "%m-%d_%I%M-%S") "_") nil ".org")) 369 | 370 | (org-mode) 371 | (yank) 372 | (goto-char (point-min)) 373 | (beginning-of-line) 374 | (open-line 1) 375 | 376 | (yas-expand-snippet (yas-lookup-snippet "LaTeX Setupfile")) 377 | 378 | ;; Setting export style 379 | (cond 380 | ((equal style "quicksport") (insert "/jake-latex-quicksport.setup \n")) 381 | ((equal style "basic-notes") (insert "/jake-latex-basic-notes.setup \n#+OPTIONS: toc:nil \n")) 382 | (t (insert "")) 383 | ) 384 | 385 | (insert "\n#+DATE: \\today \n") 386 | 387 | (if (eq use-title t) 388 | (cond 389 | ((eq use-header t) 390 | (insert "#+TITLE: " org-section-title) 391 | (org-next-visible-heading 1) 392 | (set-mark-command nil) 393 | (ap/org-forward-to-entry-content) 394 | (delete-region (region-beginning) (region-end)) 395 | ) ;; if this, delete the top level heading and its properties drawer (so the first suhead becomes the first section head) 396 | ((eq use-header nil) (insert "#+TITLE: " inputted-title)) ;; If you want a title that's not the section header, just use what was input 397 | (t (insert "")) 398 | ) 399 | ) 400 | 401 | (start-process "default-app" nil "open" (org-latex-export-to-pdf)) 402 | (save-buffer) 403 | (kill-this-buffer) 404 | ) 405 | ) 406 | ) 407 | 408 | (defun jib/org-schedule-tomorrow () 409 | "Org Schedule for tomorrow (+1d)." 410 | (interactive) 411 | (org-schedule t "+1d")) 412 | 413 | (defun jib/org-set-startup-visibility () 414 | "Allows `org-set-startup-visibility' to be used interactively. (it's not an interactive function)" 415 | (interactive) 416 | (org-set-startup-visibility) 417 | (goto-char (point-min))) 418 | 419 | (defun jib/org-refile-this-file () 420 | "Org refile to only headers in current file, 5 levels." 421 | (interactive) 422 | (let ((org-refile-targets '((nil . (:maxlevel . 5))))) 423 | (org-refile))) 424 | 425 | (defun jib/refresh-org-agenda-from-afar () 426 | "Refresh org agenda from anywhere." 427 | (interactive) 428 | (if (get-buffer "*Org Agenda*") 429 | (save-window-excursion 430 | (switch-to-buffer "*Org Agenda*") 431 | (org-agenda-redo)))) 432 | 433 | ;; Modified from https://stackoverflow.com/questions/25930097/emacs-org-mode-quickly-mark-todo-as-done?rq=1 434 | (defun jib/org-done-keep-todo () 435 | "Mark an org todo item as done while keeping its former keyword intact, and archive. 436 | 437 | For example, * TODO This item becomes * DONE TODO This item." 438 | (interactive) 439 | (let ((state (org-get-todo-state)) (tag (org-get-tags)) (todo (org-entry-get (point) "TODO")) 440 | post-command-hook) 441 | (if (not (eq state nil)) 442 | (progn (org-back-to-heading) 443 | (org-todo "DONE") 444 | (org-set-tags tag) 445 | (beginning-of-line) 446 | (forward-word) 447 | (insert (concat " " todo))) 448 | (user-error "Not a TODO.")) 449 | (run-hooks 'post-command-hook))) 450 | 451 | (defun jib/org-done-keep-todo-and-archive () 452 | "Same as `jib/org-done-keep-todo' but archives heading as well." 453 | (interactive) 454 | (let ((state (org-get-todo-state)) (tag (org-get-tags)) (todo (org-entry-get (point) "TODO")) 455 | post-command-hook) 456 | (if (not (eq state nil)) 457 | (progn (org-back-to-heading) 458 | (org-todo "DONE") 459 | (org-set-tags tag) 460 | (beginning-of-line) 461 | (forward-word) 462 | (insert (concat " " todo)) 463 | (org-archive-subtree-default)) 464 | (user-error "Not a TODO.")) 465 | (run-hooks 'post-command-hook))) 466 | 467 | (defun jib/org-archive-ql-search () 468 | "Input or select a tag to search in my archive files." 469 | (interactive) 470 | (let* ((choices '("bv" "sp" "ch" "cl" "es" "Robotics ec" "Weekly ec")) ;; TODO get these with org-current-tag-alist 471 | (tag (completing-read "Tag: " choices))) 472 | (org-ql-search 473 | ;; Recursively get all .org_archive files from my archive directory 474 | (directory-files-recursively 475 | (expand-file-name "org-archive" org-directory) ".org_archive") 476 | ;; Has the matching tags (can be a property or just a tag) and is a todo - done or not 477 | `(and (or (property "ARCHIVE_ITAGS" ,tag) (tags ,tag)) (or (todo) (done)))))) 478 | 479 | ;; (defun get-tags-from-these-buffers () 480 | ;; (let* ((files (directory-files-recursively (expand-file-name "org-archive" org-directory) ".org_archive"))) 481 | 482 | ;; (cl-loop for file in (files) 483 | ;; () 484 | ;; if (buffer-file-name buf) 485 | ;; collect buf) 486 | 487 | ;; ) 488 | 489 | ;; ) 490 | 491 | ;; WIP 492 | ;; (defun jib/tag-search-export () 493 | ;; (interactive) 494 | ;; (save-window-excursion 495 | ;; (let ((org-agenda-tags-column 0)) 496 | ;; (org-ql-search "~/Dropbox/org/cpb.org" '(tags "article") :super-groups '((:auto-outline-path)) :buffer "steve") 497 | ;; (switch-to-buffer "steve") 498 | ;; (read-only-mode 0) 499 | ;; (goto-char (point-min)) 500 | ;; (while (search-forward ":article:" nil t) (replace-match "")) 501 | ;; (org-agenda-write "~/Desktop/export.html" nil nil "steve") 502 | ;; (kill-buffer "steve"))) 503 | ;; ) 504 | 505 | (defun jib/org-occur-unchecked-boxes (&optional arg) 506 | "Show unchecked Org Mode checkboxes. Ignore items with a `†' at EOL unless run with C-u." 507 | (interactive "P") 508 | (if (equal '(4) arg) 509 | (occur "\\[ \\].*†$") 510 | (occur "\\[ \\].*[^†]$"))) 511 | 512 | (defmacro spacemacs|org-emphasize (fname char) 513 | "Make function for setting the emphasis in org mode" 514 | `(defun ,fname () (interactive) 515 | (org-emphasize ,char))) 516 | 517 | ;; https://www.reddit.com/r/emacs/comments/8qm1lb/new_orgcountwords_command/ 518 | (defun ap/org-forward-to-entry-content (&optional unsafe) 519 | "Skip headline, planning line, and all drawers in current entry. 520 | If UNSAFE is non-nil, assume point is on headline." 521 | (unless unsafe 522 | ;; To improve performance in loops (e.g. with `org-map-entries') 523 | (org-back-to-heading)) 524 | (cl-loop for element = (org-element-at-point) 525 | for pos = (pcase element 526 | (`(headline . ,_) (org-element-property :contents-begin element)) 527 | (`(,(or 'planning 'property-drawer 'drawer) . ,_) (org-element-property :end element))) 528 | while pos 529 | do (goto-char pos))) 530 | (defun ap/org-count-words () 531 | "If region is active, count words in it; otherwise count words in current subtree." 532 | (interactive) 533 | (if (use-region-p) 534 | (funcall-interactively #'count-words-region (region-beginning) (region-end)) 535 | (org-with-wide-buffer 536 | (cl-loop for (lines words characters) 537 | in (org-map-entries 538 | (lambda () 539 | (ap/org-forward-to-entry-content 'unsafe) 540 | (let ((end (org-entry-end-position))) 541 | (list (count-lines (point) end) 542 | (count-words (point) end) 543 | (- end (point))))) 544 | nil 'tree) 545 | sum lines into total-lines 546 | sum words into total-words 547 | sum characters into total-characters 548 | finally do (message "Subtree \"%s\" has %s lines, %s words, and %s characters." 549 | (org-get-heading t t) total-lines total-words total-characters))))) 550 | (defun xah-open-file-at-cursor () 551 | "Open the file path under cursor. 552 | If there is text selection, uses the text selection for path. 553 | If the path starts with “http://”, open the URL in browser. 554 | Input path can be {relative, full path, URL}. 555 | Path may have a trailing “:‹n›” that indicates line number, or “:‹n›:‹m›” with line and column number. If so, jump to that line number. 556 | If path does not have a file extension, automatically try with “.el” for elisp files. 557 | This command is similar to `find-file-at-point' but without prompting for confirmation. 558 | 559 | URL `http://xahlee.info/emacs/emacs/emacs_open_file_path_fast.html' 560 | Version 2020-10-17" 561 | (interactive) 562 | (let* ( 563 | ($inputStr 564 | (if (use-region-p) 565 | (buffer-substring-no-properties (region-beginning) (region-end)) 566 | (let ($p0 $p1 $p2 567 | ;; chars that are likely to be delimiters of file path or url, e.g. whitespace, comma. The colon is a problem. cuz it's in url, but not in file name. Don't want to use just space as delimiter because path or url are often in brackets or quotes as in markdown or html 568 | ($pathStops "^ \t\n\"`'‘’“”|[]{}「」<>〔〕〈〉《》【】〖〗«»‹›❮❯❬❭〘〙·。\\")) 569 | (setq $p0 (point)) 570 | (skip-chars-backward $pathStops) 571 | (setq $p1 (point)) 572 | (goto-char $p0) 573 | (skip-chars-forward $pathStops) 574 | (setq $p2 (point)) 575 | (goto-char $p0) 576 | (buffer-substring-no-properties $p1 $p2)))) 577 | ($path 578 | (replace-regexp-in-string 579 | "^file:///" "/" 580 | (replace-regexp-in-string 581 | ":\\'" "" $inputStr)))) 582 | (if (string-match-p "\\`https?://" $path) 583 | (if (fboundp 'xahsite-url-to-filepath) 584 | (let (($x (xahsite-url-to-filepath $path))) 585 | (if (string-match "^http" $x ) 586 | (browse-url $x) 587 | (find-file $x))) 588 | (progn (browse-url $path))) 589 | (progn ; not starting “http://” 590 | (if (string-match "#" $path ) 591 | (let ( 592 | ( $fpath (substring $path 0 (match-beginning 0))) 593 | ( $fractPart (substring $path (1+ (match-beginning 0))))) 594 | (if (file-exists-p $fpath) 595 | (progn 596 | (find-file $fpath) 597 | (goto-char (point-min)) 598 | (search-forward $fractPart )) 599 | (when (y-or-n-p (format "file no exist: 「%s」. Create?" $fpath)) 600 | (find-file $fpath)))) 601 | (if (string-match "^\\`\\(.+?\\):\\([0-9]+\\)\\(:[0-9]+\\)?\\'" $path) 602 | (let ( 603 | ($fpath (match-string 1 $path)) 604 | ($line-num (string-to-number (match-string 2 $path)))) 605 | (if (file-exists-p $fpath) 606 | (progn 607 | (find-file $fpath) 608 | (goto-char (point-min)) 609 | (forward-line (1- $line-num))) 610 | (when (y-or-n-p (format "file no exist: 「%s」. Create?" $fpath)) 611 | (find-file $fpath)))) 612 | (if (file-exists-p $path) 613 | (progn ; open f.ts instead of f.js 614 | (let (($ext (file-name-extension $path)) 615 | ($fnamecore (file-name-sans-extension $path))) 616 | (if (and (string-equal $ext "js") 617 | (file-exists-p (concat $fnamecore ".ts"))) 618 | (find-file (concat $fnamecore ".ts")) 619 | (find-file $path)))) 620 | (if (file-exists-p (concat $path ".el")) 621 | (find-file (concat $path ".el")) 622 | (when (y-or-n-p (format "file no exist: 「%s」. Create?" $path)) 623 | (find-file $path )))))))))) 624 | 625 | (defun jib/prettify-symbols-setup () 626 | ;; checkboxes 627 | (push '("[ ]" . "☐") prettify-symbols-alist) 628 | (push '("[X]" . "☑" ) prettify-symbols-alist) 629 | ;; (push '("[X]" . "☒" ) prettify-symbols-alist) 630 | (push '("[-]" . "❍" ) prettify-symbols-alist) 631 | 632 | ;; org-babel 633 | (push '("#+BEGIN_SRC" . ?≫) prettify-symbols-alist) 634 | (push '("#+END_SRC" . ?≫) prettify-symbols-alist) 635 | (push '("#+begin_src" . ?≫) prettify-symbols-alist) 636 | (push '("#+end_src" . ?≫) prettify-symbols-alist) 637 | 638 | (push '("#+BEGIN_QUOTE" . ?❝) prettify-symbols-alist) 639 | (push '("#+END_QUOTE" . ?❞) prettify-symbols-alist) 640 | 641 | ;; (push '("#+BEGIN_SRC python" . ) prettify-symbols-alist) ;; This is the Python symbol. Comes up weird for some reason 642 | (push '("#+RESULTS:" . ?≚ ) prettify-symbols-alist) 643 | 644 | ;; drawers 645 | (push '(":PROPERTIES:" . ?) prettify-symbols-alist) 646 | 647 | ;; tags 648 | ;; (push '(":Misc:" . "" ) prettify-symbols-alist) 649 | 650 | (prettify-symbols-mode)) 651 | 652 | 653 | ;;;;;;;;;;;; 654 | ;; Macros ;; 655 | ;;;;;;;;;;;; 656 | 657 | ;; Converts org mode from current line to bottom to HTML and copies it to the system clipboard 658 | ;; uses org-html-convert-region-to-html 659 | (fset 'jib|Brinkley-HTML 660 | (kmacro-lambda-form [?V ?G ?y ? ?f ?n ? ?h ?M ?O ?p ?V ?G ?, ?H ? ?x ?C ? ?b ?d] 0 "%d")) 661 | 662 | ;; OBSELETE 663 | ;; ;; Takes an org mode list and adds bullets one indent in under each item 664 | ;; (fset 'jib|Listify 665 | ;; (kmacro-lambda-form [?0 ?i ?+ ?\S- escape ?j] 0 "%d")) 666 | 667 | ;; Takes a single-leveled org mode list and adds a sub item under each item 668 | (fset 'jib|SubListify 669 | (kmacro-lambda-form [?A M-return tab S-right escape ?j ?0] 0 "%d")) 670 | 671 | (provide 'jib-funcs) 672 | ;;; jib-funcs.el ends here 673 | -------------------------------------------------------------------------------- /jake-emacs/jib-variables.el: -------------------------------------------------------------------------------- 1 | ;; jib-variables.el 2 | 3 | ;; File/directory locations -------- 4 | (defvar jib/home (concat (getenv "HOME") "/") "My home directory.") 5 | (defvar jib/dropbox (concat jib/home "Dropbox/") "The parent Dropbox folder.") 6 | ;; (defvar org-directory (concat jib/dropbox "org") "Directory with org files.") 7 | (setq org-directory (concat jib/dropbox "org")) 8 | (defvar jib/emacs-stuff (concat jib/dropbox "files/systems/emacs-stuff") "Directory where personal Emacs files are kept") 9 | 10 | ;; Internal use variables 11 | (defvar jib/computer 'laptop "Which computer I am on -- 'desktop or 'laptop.") 12 | (defvar jib-text-height nil "My preferred default text height.") 13 | (defvar jib-doom-modeline-text-height nil "My preferred modeline text height.") 14 | (defvar jib-default-line-spacing 0 "Baseline line spacing.") 15 | (setq-default jib-default-line-spacing 0) 16 | 17 | ;; Emacs variables 18 | (setq bookmark-default-file (concat jib/emacs-stuff "/bookmarks")) 19 | (setq custom-theme-directory (expand-file-name "themes" jib/emacs-stuff)) 20 | 21 | 22 | (provide 'jib-variables) 23 | ;;; jib-variables.el ends here 24 | -------------------------------------------------------------------------------- /org/setupfiles_html/bigblow.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+HTML_HEAD: 4 | #+HTML_HEAD: 5 | #+HTML_HEAD: 6 | 7 | #+HTML_HEAD: 8 | #+HTML_HEAD: 9 | 10 | #+HTML_HEAD: 11 | #+HTML_HEAD: 12 | #+HTML_HEAD: 13 | #+HTML_HEAD: 14 | #+HTML_HEAD: 15 | #+HTML_HEAD: 16 | -------------------------------------------------------------------------------- /org/setupfiles_html/latex_css.setup: -------------------------------------------------------------------------------- 1 | #+HTML_HEAD: 2 | -------------------------------------------------------------------------------- /org/setupfiles_html/org.min_css.setup: -------------------------------------------------------------------------------- 1 | #+HTML_HEAD: 2 | -------------------------------------------------------------------------------- /org/setupfiles_html/readtheorg.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+HTML_HEAD: 4 | #+HTML_HEAD: 5 | 6 | #+HTML_HEAD: 7 | #+HTML_HEAD: 8 | #+HTML_HEAD: 9 | #+HTML_HEAD: 10 | 11 | #+OPTIONS: toc:t 12 | -------------------------------------------------------------------------------- /org/setupfiles_latex/jake-beamer.setup: -------------------------------------------------------------------------------- 1 | #+startup: beamer 2 | #+LANGUAGE: en 3 | 4 | * Org export options 5 | #+OPTIONS: num:t toc:2 ::t |:t ^:{} -:t f:t *:t <:t 6 | #+OPTIONS: tex:t d:nil todo:t pri:nil tags:nil 7 | #+OPTIONS: timestamp:nil 8 | #+SELECT_TAGS: export 9 | #+EXCLUDE_TAGS: noexport 10 | #+PROPERTY: header-args :eval never-export 11 | 12 | * Beamer configuration 13 | #+LATEX_CLASS: beamer 14 | #+LATEX_CLASS_OPTIONS: [c,17pt, bigger, mathserif] 15 | #+OPTIONS: H:2 16 | 17 | End required configurations. 18 | 19 | If you want to use org-columns. 20 | #+COLUMNS: %20ITEM %13BEAMER_env(Env) %6BEAMER_envargs(Args) %4BEAMER_col(Col) %7BEAMER_extra(Extra) 21 | 22 | * Theme configuration 23 | #+BEAMER_THEME: Madrid 24 | #+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{} 25 | 26 | #+BEAMER_HEADER: \AtBeginSection[]{ 27 | #+BEAMER_HEADER: \begin{frame} 28 | #+BEAMER_HEADER: \vfill 29 | #+BEAMER_HEADER: \centering 30 | #+BEAMER_HEADER: \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title} 31 | #+BEAMER_HEADER: \usebeamerfont{title}\insertsectionhead\par% 32 | #+BEAMER_HEADER: \end{beamercolorbox} 33 | #+BEAMER_HEADER: \vfill 34 | #+BEAMER_HEADER: \end{frame} 35 | #+BEAMER_HEADER: } 36 | 37 | # #+BEAMER_HEADER: \hypersetup{colorlinks=true, linkcolor=blue} 38 | #+BEAMER: \setbeamercovered{transparent=30} 39 | #+BEAMER_HEADER: \setbeamertemplate{caption}[numbered] % Numbers figures 40 | 41 | #+BEAMER_HEADER: \setbeamertemplate{footline}{ 42 | #+BEAMER_HEADER: \hbox{% 43 | #+BEAMER_HEADER: \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}% 44 | #+BEAMER_HEADER: \usebeamerfont{title in head/foot}% 45 | #+BEAMER_HEADER: \insertshorttitle \hfill 46 | #+BEAMER_HEADER: \insertsection \hfill 47 | #+BEAMER_HEADER: \insertframenumber{} / \inserttotalframenumber 48 | #+BEAMER_HEADER: \end{beamercolorbox}}% 49 | #+BEAMER_HEADER: } 50 | -------------------------------------------------------------------------------- /snippets/c-mode/roland: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: drawRect 3 | # key: re 4 | # -- 5 | panel.drawRect( $1, $2, $3, $0, panel.RED, true); 6 | -------------------------------------------------------------------------------- /snippets/java-mode/java_main_class: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Java Main Class 3 | # key: jmain 4 | # -- 5 | public class ${1} { 6 | 7 | public static void main(String[] args) { 8 | 9 | $0 10 | 11 | } 12 | 13 | 14 | } -------------------------------------------------------------------------------- /snippets/java-mode/system.out.println: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: System.out.println 3 | # key: pr 4 | # -- 5 | System.out.println($0); -------------------------------------------------------------------------------- /snippets/org-mode/ctrtbl: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Center and Configure Org Table 3 | # key: 6 | ;; Created: May 30, 2021 7 | ;; Version: 1.0.0 8 | ;; Keywords: theme 9 | ;; Homepage: https://github.com/404cn/nano-theme.el 10 | ;; Package-Requires: ((emacs "28.0.50")) 11 | 12 | ;; 13 | ;; This file is not part of GNU Emacs. 14 | 15 | ;; This program is free software; you can redistribute it and/or 16 | ;; modify it under the terms of the GNU General Public License 17 | ;; as published by the Free Software Foundation; either version 3 18 | ;; of the License, or (at your option) any later version. 19 | 20 | ;; This program is distributed in the hope that it will be useful, 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | ;; GNU General Public License for more details. 24 | 25 | ;; You should have received a copy of the GNU General Public License 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 27 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 28 | ;; Boston, MA 02110-1301, USA. 29 | 30 | 31 | ;;; Commentary: 32 | 33 | ;;; A theme split from nano-emacs. 34 | 35 | ;;; Code: 36 | 37 | (deftheme nano "Theme split from nano-emacs") 38 | 39 | (defgroup nano-theme nil 40 | "Options of nano theme." 41 | :group 'faces) 42 | 43 | (defcustom nano-theme-light/dark 'light 44 | "Nano theme uses light theme or dark theme?" 45 | :type 'symbol 46 | :group 'nano-theme) 47 | 48 | (defcustom nano-theme-comment-italic nil 49 | "Enable italics for comments." 50 | :type 'boolean 51 | :group 'nano-theme) 52 | 53 | (defcustom nano-theme-keyword-italic nil 54 | "Enable italics for keywords." 55 | :type 'boolean 56 | :group 'nano-theme) 57 | 58 | (defun nano-theme--light?dark (light dark) 59 | "Determine using the LIGHT or the DARK color of nano-theme." 60 | (if (eq nano-theme-light/dark 'light) 61 | light 62 | dark)) 63 | (defalias '--l?d #'nano-theme--light?dark) 64 | 65 | (let ((foreground (--l?d "#37474F" "#ECEFF4")) 66 | (background (--l?d "#FFFFFF" "#2E3440")) 67 | (highlight (--l?d "#FAFAFA" "#3B4252")) 68 | (critical (--l?d "#FF6F00" "#EBCB8B")) 69 | (salient (--l?d "#673AB7" "#81A1C1")) 70 | (strong (--l?d "#000000" "#ECEFF4")) 71 | (popout (--l?d "#FFAB91" "#D08770")) 72 | (subtle (--l?d "#ECEFF1" "#434C5E")) 73 | (faded (--l?d "#B0BEC5" "#677691"))) 74 | (custom-theme-set-faces 75 | `nano 76 | ;; Basic 77 | `(default ((t (:foreground ,foreground :background ,background)))) 78 | `(cursor ((t (:background ,foreground)))) 79 | `(fringe ((t (:foreground ,faded)))) 80 | `(show-paren-match ((t (:foreground ,popout)))) 81 | `(hl-line ((t (:background ,highlight)))) 82 | `(highlight ((t (:background ,subtle)))) 83 | `(lazy-highlight ((t (:background ,subtle)))) 84 | `(region ((t (:background ,subtle)))) 85 | `(line-number ((t (:background nil :foreground ,faded)))) 86 | `(line-number-current-line ((t (:background nil :foreground ,strong)))) 87 | `(minibuffer-prompt ((t (:foreground ,popout)))) 88 | `(vertical-border ((t (:foreground ,subtle)))) 89 | `(window-divider ((t (:foreground ,subtle)))) 90 | `(window-divider-first-pixel ((t (:foreground ,subtle)))) 91 | `(window-divider-last-pixel ((t (:foreground ,subtle)))) 92 | `(fill-column-indicator ((t (:foreground ,strong)))) 93 | `(shadow ((t (:foreground ,faded)))) 94 | `(success ((t (:foreground ,faded)))) 95 | `(warning ((t (:foreground ,popout)))) 96 | `(error ((t (:foreground ,critical)))) 97 | `(match ((t (:foreground ,popout)))) 98 | `(link ((t (:foreground ,salient)))) 99 | `(trailing-whitespace ((t (:background ,subtle)))) 100 | `(completions-common-part ((t (:foreground ,faded)))) 101 | `(secondary-selection ((t (:background ,subtle)))) 102 | 103 | ;; Font Locks 104 | `(font-lock-comment-face ((t (:foreground ,faded :weight bold :slant ,(if nano-theme-comment-italic 'italic 'normal))))) 105 | `(font-lock-comment-delimiter-face ((t (:foreground ,faded :weight bold :slant ,(if nano-theme-comment-italic 'italic 'normal))))) 106 | `(font-lock-keyword-face ((t (:foreground ,salient :weight bold :slant ,(if nano-theme-keyword-italic 'italic 'normal))))) 107 | `(font-lock-string-face ((t (:foreground ,popout)))) 108 | `(font-lock-doc-face ((t (:foreground ,faded :extend t)))) 109 | `(font-lock-builtin-face ((t (:foreground ,salient)))) 110 | `(font-lock-type-face ((t (:foreground ,salient :weight bold)))) 111 | `(font-lock-variable-name-face ((t (:foreground ,strong)))) 112 | `(font-lock-constant-face ((t (:foreground ,salient :weight bold)))) 113 | `(font-lock-function-name-face ((t (:foreground ,strong)))) 114 | `(font-lock-warning-face ((t (:foreground ,popout :weight bold)))) 115 | 116 | ;; Eldoc 117 | `(eldoc-highlight-function-argument ((t (:foreground ,critical :bold t)))) 118 | 119 | ;; ISearch 120 | `(isearch ((t (:foreground ,strong)))) 121 | `(isearch-fail ((t (:foreground ,faded)))) 122 | 123 | ;; Info 124 | `(info-menu-header ((t (:foreground ,foreground :bold t)))) 125 | `(info-header-node ((t (:foreground ,foreground :background ,background)))) 126 | `(info-index-match ((t (:foreground ,salient)))) 127 | `(Info-quoted ((t (:foreground ,faded)))) 128 | `(info-title-1 ((t (:inhert info-menu-header)))) 129 | `(info-title-2 ((t (:inhert info-menu-header)))) 130 | `(info-title-3 ((t (:inhert info-menu-header)))) 131 | `(info-title-4 ((t (:inhert info-menu-header)))) 132 | 133 | ;; Speed Bar 134 | `(speedbar-button-face ((t (:foreground ,faded)))) 135 | `(speedbar-directory-face ((t (:foreground ,foreground :bold t)))) 136 | `(speedbar-file-face ((t (:foreground ,foreground :background ,background)))) 137 | `(speedbar-highlight-face ((t (:foreground ,highlight)))) 138 | `(speedbar-selected-face ((t (:background ,subtle)))) 139 | `(speedbar-separator-face ((t (:foreground ,faded)))) 140 | `(speedbar-tag-face ((t (:foreground ,faded)))) 141 | 142 | ;; Bookmark 143 | `(bookmark-menu-heading ((t (:foreground ,foreground :bold t)))) 144 | `(bookmark-menu-bookmark ((t (:foreground ,salient)))) 145 | 146 | ;; Outline 147 | `(outline-1 ((t (:foreground ,foreground :bold t)))) 148 | `(outline-2 ((t (:foreground ,foreground :bold t)))) 149 | `(outline-3 ((t (:foreground ,foreground :bold t)))) 150 | `(outline-4 ((t (:foreground ,foreground :bold t)))) 151 | `(outline-5 ((t (:foreground ,foreground :bold t)))) 152 | `(outline-6 ((t (:foreground ,foreground :bold t)))) 153 | `(outline-7 ((t (:foreground ,foreground :bold t)))) 154 | `(outline-8 ((t (:foreground ,foreground :bold t)))) 155 | 156 | ;; Message 157 | `(message-cited-text ((t (:foreground ,faded)))) 158 | `(message-header-cc ((t (:foreground ,foreground :background ,background)))) 159 | `(message-header-name ((t (:foreground ,foreground :bold t)))) 160 | `(message-header-newsgroups ((t (:foreground ,foreground :background ,background)))) 161 | `(message-header-other ((t (:foreground ,foreground :background ,background)))) 162 | `(message-header-subject ((t (:foreground ,salient)))) 163 | `(message-header-to ((t (:foreground ,salient)))) 164 | `(message-header-xheader ((t (:foreground ,foreground :background ,background)))) 165 | `(message-mml ((t (:foreground ,popout)))) 166 | `(message-separator ((t (:foreground ,faded)))) 167 | 168 | ;; Customize 169 | `(widget-field ((t (:background ,subtle)))) 170 | `(widget-button ((t (:foreground ,foreground :bold t)))) 171 | `(widget-single-line-field ((t (:background ,subtle)))) 172 | `(custom-group-subtitle ((t (:foreground ,foreground :bold t)))) 173 | `(custom-group-tag ((t (:foreground ,foreground :bold t)))) 174 | `(custom-group-tag-1 ((t (:foreground ,foreground :bold t)))) 175 | `(custom-comment ((t (:foreground ,faded)))) 176 | `(custom-comment-tag ((t (:foreground ,faded)))) 177 | `(custom-changed ((t (:foreground ,salient)))) 178 | `(custom-modified ((t (:foreground ,salient)))) 179 | `(custom-face-tag ((t (:foreground ,foreground :bold t)))) 180 | `(custom-variable-tag ((t (:foreground ,foreground :bold t)))) 181 | `(custom-invalid ((t (:foreground ,popout)))) 182 | `(custom-visibility ((t (:foreground ,salient)))) 183 | `(custom-state ((t (:foreground ,salient)))) 184 | `(custom-link ((t (:foreground ,salient)))) 185 | `(custom-button ((t (:foreground ,faded :background ,background :box `(:line-width 1 :color ,(face-foreground 'faded) :style nil))))) 186 | `(custom-button-mouse ((t (:foreground ,faded :background ,subtle :box `(:line-width 1 :color ,(face-foreground 'faded) :style nil))))) 187 | `(custom-button-pressed ((t (:foreground ,foreground :background ,salient :inverse-video nil :box `(:line-width 1 :color ,(face-foreground 'salient) :style nil))))) 188 | 189 | ;; Package 190 | `(package-description ((t (:foreground ,foreground :background ,background)))) 191 | `(package-help-section-name ((t (t (:foreground ,foreground :background ,background))))) 192 | `(package-name ((t (:foreground ,salient)))) 193 | `(package-status-avail-obso ((t (:foreground ,faded)))) 194 | `(package-status-available ((t (:foreground ,foreground :background ,background)))) 195 | `(package-status-built-in ((t (:foreground ,salient)))) 196 | `(package-status-dependency ((t (t (:foreground ,salient))))) 197 | `(package-status-disabled ((t (:foreground ,faded)))) 198 | `(package-status-external ((t (:foreground ,foreground :background ,background)))) 199 | `(package-status-held ((t (:foreground ,foreground :background ,background)))) 200 | `(package-status-incompat ((t (:foreground ,faded)))) 201 | `(package-status-installed ((t (:foreground ,salient)))) 202 | `(package-status-new ((t (:foreground ,foreground :background ,background)))) 203 | `(package-status-new ((t (:foreground ,foreground :background ,background)))) 204 | 205 | ;; Flyspell 206 | `(flyspell-duplicate ((t (:foreground ,popout)))) 207 | `(flyspell-incorrect ((t (:foreground ,popout)))) 208 | 209 | ;; Ido 210 | `(ido-first-match ((t (:foreground ,salient)))) 211 | `(ido-only-match ((t (:foreground ,faded)))) 212 | `(ido-subdir ((t (:foreground ,foreground :bold t)))) 213 | 214 | ;; Diff 215 | `(diff-header ((t (:foreground ,faded)))) 216 | `(diff-file-header ((t (:foreground ,foreground :bold t)))) 217 | `(diff-context ((t (:foreground ,foreground :background ,background)))) 218 | `(diff-removed ((t (:foreground ,faded)))) 219 | `(diff-changed ((t (:foreground ,popout)))) 220 | `(diff-added ((t (:foreground ,salient)))) 221 | `(diff-refine-added ((t (:foreground ,salient :bold t)))) 222 | `(diff-refine-changed ((t (:foreground ,popout)))) 223 | `(diff-refine-removed ((t (:foreground ,faded :strike-through t)))) 224 | 225 | ;; Agenda 226 | `(org-agenda-calendar-event ((t (:foreground ,foreground :background ,background)))) 227 | `(org-agenda-calendar-sexp ((t (:foreground ,salient)))) 228 | `(org-agenda-clocking ((t (:foreground ,faded)))) 229 | `(org-agenda-column-dateline ((t (:foreground ,faded)))) 230 | `(org-agenda-current-time ((t (:foreground ,foreground :bold t)))) 231 | `(org-agenda-date ((t (:foreground ,salient)))) 232 | `(org-agenda-date-today ((t (:foreground ,salient :bold t)))) 233 | `(org-agenda-date-weekend ((t (:foreground ,faded)))) 234 | `(org-agenda-diary ((t (:foreground ,faded)))) 235 | `(org-agenda-dimmed-todo-face ((t (:foreground ,faded)))) 236 | `(org-agenda-done ((t (:foreground ,faded)))) 237 | `(org-agenda-filter-category ((t (:foreground ,faded)))) 238 | `(org-agenda-filter-effort ((t (:foreground ,faded)))) 239 | `(org-agenda-filter-regexp ((t (:foreground ,faded)))) 240 | `(org-agenda-filter-tags ((t (:foreground ,faded)))) 241 | `(org-agenda-restriction-lock ((t (:foreground ,faded)))) 242 | `(org-agenda-structure ((t (:foreground ,foreground :bold t)))) 243 | 244 | ;; Org 245 | `(org-archived ((t (:foreground ,faded)))) 246 | `(org-block ((t (:background ,subtle)))) 247 | `(org-block-begin-line ((t (:foreground ,faded)))) 248 | `(org-block-end-line ((t (:foreground ,faded)))) 249 | `(org-checkbox ((t (:foreground ,faded)))) 250 | `(org-checkbox-statistics-done ((t (:foreground ,faded)))) 251 | `(org-checkbox-statistics-todo ((t (:foreground ,faded)))) 252 | `(org-clock-overlay ((t (:foreground ,faded)))) 253 | `(org-code ((t (:foreground ,faded)))) 254 | `(org-column ((t (:foreground ,faded)))) 255 | `(org-column-title ((t (:foreground ,faded)))) 256 | `(org-date ((t (:foreground ,faded)))) 257 | `(org-date-selected ((t (:foreground ,faded)))) 258 | `(org-default ((t (:foreground ,faded)))) 259 | `(org-document-info ((t (:foreground ,faded)))) 260 | `(org-document-info-keyword ((t (:foreground ,faded)))) 261 | `(org-document-title ((t (:foreground ,foreground :bold t)))) 262 | `(org-done ((t (:foreground ,foreground :background ,background)))) 263 | `(org-drawer ((t (:foreground ,faded)))) 264 | `(org-ellipsis ((t (:foreground ,faded)))) 265 | `(org-footnote ((t (:foreground ,faded)))) 266 | `(org-formula ((t (:foreground ,faded)))) 267 | `(org-headline-done ((t (:foreground ,faded)))) 268 | `(org-latex-and-related ((t (:foreground ,faded)))) 269 | `(org-level-1 ((t (:foreground ,foreground :bold t :height 1.1)))) 270 | `(org-level-2 ((t (:foreground ,foreground :bold t)))) 271 | `(org-level-3 ((t (:foreground ,foreground :bold nil)))) 272 | `(org-level-4 ((t (:foreground ,foreground :bold nil)))) 273 | `(org-level-5 ((t (:foreground ,foreground :bold nil)))) 274 | `(org-level-6 ((t (:foreground ,foreground :bold nil)))) 275 | `(org-level-7 ((t (:foreground ,foreground :bold nil)))) 276 | `(org-level-8 ((t (:foreground ,foreground :bold nil)))) 277 | `(org-link ((t (:foreground ,salient)))) 278 | `(org-list-dt ((t (:foreground ,faded)))) 279 | `(org-macro ((t (:foreground ,faded)))) 280 | `(org-meta-line ((t (:foreground ,faded)))) 281 | `(org-mode-line-clock ((t (:foreground ,faded)))) 282 | `(org-mode-line-clock-overrun ((t (:foreground ,faded)))) 283 | `(org-priority ((t (:foreground ,faded)))) 284 | `(org-property-value ((t (:foreground ,faded)))) 285 | `(org-quote ((t (:foreground ,faded)))) 286 | `(org-scheduled ((t (:foreground ,faded)))) 287 | `(org-scheduled-previously ((t (:foreground ,faded)))) 288 | `(org-scheduled-today ((t (:foreground ,faded)))) 289 | `(org-sexp-date ((t (:foreground ,faded)))) 290 | `(org-special-keyword ((t (:foreground ,faded)))) 291 | `(org-table ((t (:foreground ,faded)))) 292 | `(org-tag ((t (:foreground ,popout)))) 293 | `(org-tag-group ((t (:foreground ,faded)))) 294 | `(org-target ((t (:foreground ,faded)))) 295 | `(org-time-grid ((t (:foreground ,faded)))) 296 | `(org-todo ((t (:foreground ,salient)))) 297 | `(org-upcoming-deadline ((t (:foreground ,foreground :background ,background)))) 298 | `(org-verbatim ((t (:foreground ,popout)))) 299 | `(org-verse ((t (:foreground ,faded)))) 300 | `(org-warning ((t (:foreground ,popout)))) 301 | 302 | ;; Elfeed 303 | `(elfeed-log-date-face ((t (:foreground ,faded)))) 304 | `(elfeed-log-info-level-face ((t (:foreground ,foreground :background ,background)))) 305 | `(elfeed-log-debug-level-face ((t (:foreground ,foreground :background ,background)))) 306 | `(elfeed-log-warn-level-face ((t (:foreground ,popout)))) 307 | `(elfeed-log-error-level-face ((t (:foreground ,popout)))) 308 | `(elfeed-search-tag-face ((t (:foreground ,faded)))) 309 | `(elfeed-search-date-face ((t (:foreground ,faded)))) 310 | `(elfeed-search-feed-face ((t (:foreground ,salient)))) 311 | `(elfeed-search-filter-face ((t (:foreground ,faded)))) 312 | `(elfeed-search-last-update-face ((t (:foreground ,salient)))) 313 | `(elfeed-search-title-face ((t (:foreground ,foreground :background ,background)))) 314 | `(elfeed-search-tag-face ((t (:foreground ,faded)))) 315 | `(elfeed-search-unread-count-face ((t (:foreground ,foreground :bold t)))) 316 | `(elfeed-search-unread-title-face ((t (:foreground ,foreground :bold t)))) 317 | 318 | ;; Rst 319 | `(rst-adornment ((t (:foreground ,faded)))) 320 | `(rst-block ((t (:foreground ,foreground :background ,background)))) 321 | `(rst-comment ((t (:foreground ,faded)))) 322 | `(rst-definition ((t (:foreground ,salient)))) 323 | `(rst-directive ((t (:foreground ,salient)))) 324 | `(rst-emphasis1 ((t (:foreground ,faded)))) 325 | `(rst-emphasis2 ((t (:foreground ,foreground :bold t)))) 326 | `(rst-external ((t (:foreground ,salient)))) 327 | `(rst-level-1 ((t (:foreground ,foreground :bold t)))) 328 | `(rst-level-2 ((t (:foreground ,foreground :bold t)))) 329 | `(rst-level-3 ((t (:foreground ,foreground :bold t)))) 330 | `(rst-level-4 ((t (:foreground ,foreground :bold t)))) 331 | `(rst-level-5 ((t (:foreground ,foreground :bold t)))) 332 | `(rst-level-6 ((t (:foreground ,foreground :bold t)))) 333 | `(rst-literal ((t (:foreground ,salient)))) 334 | `(rst-reference ((t (:foreground ,salient)))) 335 | `(rst-transition ((t (:foreground ,foreground :background ,background)))) 336 | 337 | ;; Deft 338 | `(deft-filter-string-error-face ((t (:foreground ,popout)))) 339 | `(deft-filter-string-face ((t (:foreground ,foreground :background ,background)))) 340 | `(deft-header-face ((t (:foreground ,salient)))) 341 | `(deft-separator-face ((t (:foreground ,faded)))) 342 | `(deft-summary-face ((t (:foreground ,faded)))) 343 | `(deft-time-face ((t (:foreground ,salient)))) 344 | `(deft-title-face ((t (:foreground ,foreground :bold t)))) 345 | 346 | ;; Markdown 347 | `(markdown-blockquote-face ((t (:inhert default)))) 348 | `(markdown-bold-face ((t (:foreground ,foreground :bold t)))) 349 | `(markdown-code-face ((t (:inhert default)))) 350 | `(markdown-comment-face ((t (:foreground ,faded)))) 351 | `(markdown-footnote-marker-face ((t (:inhert default)))) 352 | `(markdown-footnote-text-face ((t (:inhert default)))) 353 | `(markdown-gfm-checkbox-face ((t (:inhert default)))) 354 | `(markdown-header-delimiter-face ((t (:foreground ,faded)))) 355 | `(markdown-header-face ((t (:foreground ,foreground :bold t)))) 356 | `(markdown-header-face-1 ((t (:foreground ,foreground :bold t)))) 357 | `(markdown-header-face-2 ((t (:foreground ,foreground :bold t)))) 358 | `(markdown-header-face-3 ((t (:foreground ,foreground :bold t)))) 359 | `(markdown-header-face-4 ((t (:foreground ,foreground :bold t)))) 360 | `(markdown-header-face-5 ((t (:foreground ,foreground :bold t)))) 361 | `(markdown-header-face-6 ((t (:foreground ,foreground :bold t)))) 362 | `(markdown-header-rule-face ((t (:inhert default)))) 363 | `(markdown-highlight-face ((t (:inhert default)))) 364 | `(markdown-hr-face ((t (:inhert default)))) 365 | `(markdown-html-attr-name-face ((t (:inhert default)))) 366 | `(markdown-html-attr-value-face ((t (:inhert default)))) 367 | `(markdown-html-entity-face ((t (:inhert default)))) 368 | `(markdown-html-tag-delimiter-face ((t (:inhert default)))) 369 | `(markdown-html-tag-name-face ((t (:inhert default)))) 370 | `(markdown-inline-code-face ((t (:foreground ,popout)))) 371 | `(markdown-italic-face ((t (:foreground ,faded)))) 372 | `(markdown-language-info-face ((t (:inhert default)))) 373 | `(markdown-language-keyword-face ((t (:inhert default)))) 374 | `(markdown-line-break-face ((t (:inhert default)))) 375 | `(markdown-link-face ((t (:foreground ,salient)))) 376 | `(markdown-link-title-face ((t (:inhert default)))) 377 | `(markdown-list-face ((t (:foreground ,faded)))) 378 | `(markdown-markup-face ((t (:foreground ,faded)))) 379 | `(markdown-math-face ((t (:inhert default)))) 380 | `(markdown-metadata-key-face ((t (:foreground ,faded)))) 381 | `(markdown-metadata-value-face ((t (:foreground ,faded)))) 382 | `(markdown-missing-link-face ((t (:inhert default)))) 383 | `(markdown-plain-url-face ((t (:inhert default)))) 384 | `(markdown-pre-face ((t (:inhert default)))) 385 | `(markdown-reference-face ((t (:foreground ,salient)))) 386 | `(markdown-strike-through-face ((t (:foreground ,faded)))) 387 | `(markdown-table-face ((t (:inhert default)))) 388 | `(markdown-url-face ((t (:foreground ,salient)))) 389 | 390 | ;; Mu4e 391 | `(mu4e-attach-number-face ((t (:foreground ,foreground :bold t)))) 392 | `(mu4e-cited-1-face ((t (:foreground ,faded)))) 393 | `(mu4e-cited-2-face ((t (:foreground ,faded)))) 394 | `(mu4e-cited-3-face ((t (:foreground ,faded)))) 395 | `(mu4e-cited-4-face ((t (:foreground ,faded)))) 396 | `(mu4e-cited-5-face ((t (:foreground ,faded)))) 397 | `(mu4e-cited-6-face ((t (:foreground ,faded)))) 398 | `(mu4e-cited-7-face ((t (:foreground ,faded)))) 399 | `(mu4e-compose-header-face ((t (:foreground ,faded)))) 400 | `(mu4e-compose-separator-face ((t (:foreground ,faded)))) 401 | `(mu4e-contact-face ((t (:foreground ,salient)))) 402 | `(mu4e-context-face ((t (:foreground ,faded)))) 403 | `(mu4e-draft-face ((t (:foreground ,faded)))) 404 | `(mu4e-flagged-face ((t (:foreground ,popout)))) 405 | `(mu4e-footer-face ((t (:foreground ,faded)))) 406 | `(mu4e-forwarded-face ((t (:inhert default)))) 407 | `(mu4e-header-face ((t (:inhert default)))) 408 | `(mu4e-header-highlight-face ((t (:inhert hl-line)))) 409 | `(mu4e-header-key-face ((t (:foreground ,foreground :bold t)))) 410 | `(mu4e-header-marks-face ((t (:foreground ,faded)))) 411 | `(mu4e-header-title-face ((t (:foreground ,foreground :bold t)))) 412 | `(mu4e-header-value-face ((t (:inhert default)))) 413 | `(mu4e-highlight-face ((t (:foreground ,popout)))) 414 | `(mu4e-link-face ((t (:foreground ,salient)))) 415 | `(mu4e-modeline-face ((t (:foreground ,faded)))) 416 | `(mu4e-moved-face ((t (:foreground ,faded)))) 417 | `(mu4e-ok-face ((t (:foreground ,faded)))) 418 | `(mu4e-region-code ((t (:foreground ,faded)))) 419 | `(mu4e-replied-face ((t (:inhert default)))) 420 | `(mu4e-special-header-value-face ((t (:inhert default)))) 421 | `(mu4e-system-face ((t (:foreground ,faded)))) 422 | `(mu4e-title-face ((t (:foreground ,foreground :bold t)))) 423 | `(mu4e-trashed-face ((t (:foreground ,faded)))) 424 | `(mu4e-unread-face ((t (:foreground ,foreground :bold t)))) 425 | `(mu4e-url-number-face ((t (:foreground ,faded)))) 426 | `(mu4e-view-body-face ((t (:inhert default)))) 427 | `(mu4e-warning-face ((t (:foreground ,popout)))) 428 | 429 | ;; Company 430 | `(company-tooltip ((t (:background ,subtle :foreground ,foreground)))) 431 | `(company-tooltip-selection ((t (:background ,popout)))) 432 | `(company-tooltip-annotation ((t (:foreground ,foreground)))) 433 | `(company-tooltip-annotation-selection ((t (:foreground ,strong :bold t)))) 434 | `(company-tooltip-common ((t (:foreground ,strong)))) 435 | `(company-tooltip-common-selection ((t (:foreground ,strong :bold t)))) 436 | `(company-scrollbar-bg ((t (:background ,faded)))) 437 | `(company-scrollbar-fg ((t (:background ,foreground)))) 438 | 439 | ;; Calendar 440 | `(calendar-today ((t (:foreground ,foreground :bold t)))) 441 | 442 | ;; Mode Line 443 | `(mode-line ((t (:background ,highlight)))) 444 | `(mode-line-inactive ((t (:background ,subtle)))) 445 | `(header-line ((t (:background ,highlight)))) 446 | `(header-line-inactive ((t (:background ,subtle)))) 447 | 448 | ;; Solaire Mode 449 | `(solaire-default-face ((t (:inherit default :background ,highlight)))) 450 | `(solaire-minibuffer-face ((t (:inherit default :background ,highlight)))) 451 | 452 | ;; Orderless 453 | `(orderless-match-face-0 ((t (:foreground ,popout :bold t)))) 454 | `(orderless-match-face-1 ((t (:foreground ,popout :bold t)))) 455 | `(orderless-match-face-2 ((t (:foreground ,popout :bold t)))) 456 | `(orderless-match-face-3 ((t (:foreground ,popout :bold t)))) 457 | 458 | ;;Eshell 459 | `(eshell-prompt ((t (:foreground ,popout :bold t)))) 460 | 461 | ;; Meow 462 | `(meow-keypad-indicator ((t (:foreground ,background :background ,salient)))) 463 | `(meow-insert-indicator ((t (:foreground ,background :background ,critical)))) 464 | `(meow-normal-indicator ((t (:foreground ,background :background ,faded)))) 465 | `(meow-motion-indicator ((t (:foreground ,background :background ,popout)))))) 466 | 467 | ;;;###autoload 468 | (and load-file-name 469 | (boundp 'custom-theme-load-path) 470 | (add-to-list 'custom-theme-load-path 471 | (file-name-as-directory 472 | (file-name-directory load-file-name)))) 473 | 474 | (provide-theme 'nano) 475 | 476 | ;;; nano-theme.el ends here 477 | --------------------------------------------------------------------------------