config.el (8665B)
1 ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- 2 3 ;; Place your private configuration here! Remember, you do not need to run 'doom 4 ;; sync' after modifying this file! 5 6 7 ;; Some functionality uses this to identify you, e.g. GPG configuration, email 8 ;; clients, file templates and snippets. 9 (setq user-full-name "Yohanes Bandung Bondowoso" 10 user-mail-address "hi@ybbond.dev") 11 12 ;; Doom exposes five (optional) variables for controlling fonts in Doom. Here 13 ;; are the three important ones: 14 ;; 15 ;; + `doom-font' 16 ;; + `doom-variable-pitch-font' 17 ;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for 18 ;; presentations or streaming. 19 ;; 20 ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd 21 ;; font string. You generally only need these two: 22 ;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) 23 ;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) 24 25 (setq doom-theme 'doom-gruvbox) 26 27 (setq display-line-numbers-type 'relative) 28 (setq whitespace-action '(auto-cleanup)) 29 (setq savehist-mode -1) 30 31 (setq company-idle-delay nil) 32 33 (setq org_dir "~/Dropbox/org/") 34 (setq org-adapt-indentation nil) 35 36 (global-set-key (kbd "s-b") 'ivy-switch-buffer) 37 (global-set-key (kbd "s-K") 'kill-buffer) 38 (global-set-key (kbd "s-l") 'org-roam-find-file) 39 40 ;; Better Copy-Paste and Clipboard Handling 41 ;; Disable Emacs' integration of killring with clipboard 42 (setq select-enable-clipboard nil) 43 ;; Remove hook for clipboard configurations from Emacs to command mode 44 (remove-hook 'tty-setup-hook 'doom-init-clipboard-in-tty-emacs-h) 45 ;; Enable ⌘+c and ⌘+v for clipboard handling 46 (defun rc-clipboard-yank () 47 "Copies the active region to the system clipboard." 48 (interactive) 49 (when (region-active-p) 50 (gui-set-selection 'CLIPBOARD 51 (buffer-substring (region-beginning) (region-end))))) 52 (defun rc-clipboard-paste () 53 "Pastes text from the system clipboard." 54 (interactive) 55 (let ((text (gui-get-selection 'CLIPBOARD))) 56 (when text (insert-for-yank text)))) 57 (map! :v "s-c" #'rc-clipboard-yank 58 :nvi "s-v" #'rc-clipboard-paste) 59 (define-key! :keymaps '(evil-ex-completion-map) "s-v" #'rc-clipboard-paste) 60 (define-key! :keymaps +default-minibuffer-maps "s-v" #'rc-clipboard-paste) 61 62 ;; General Configurations 63 ;; (use-package! general 64 ;; :config 65 ;; (general-evil-setup)) 66 67 ;; Evil 68 (use-package! evil 69 :init 70 (setq evil-move-cursor-back nil) 71 ;; (setq evil-respect-visual-line-mode t) 72 (setq evil-kill-on-visual-paste nil) 73 (setq evil-disable-insert-state-bindings t)) 74 ;; :general 75 ;; ([remap evil-emacs-state] 'evil-normal-state) 76 ;; (general-nmap "j" 'evil-next-visual-line) 77 ;; (general-nmap "k" 'evil-previous-visual-line) 78 ;; (general-nmap "gj" 'evil-next-line) 79 ;; (general-nmap "gk" 'evil-previous-line) 80 ;; (general-imap "C-f" 'delete-forward-char)) 81 (map! :after evil 82 :map evil-normal-state-map 83 "C-z" 'evil-normal-state 84 "j" 'evil-next-visual-line 85 "k" 'evil-previous-visual-line 86 "gj" 'evil-next-line 87 "gk" 'evil-previous-line 88 :map evil-insert-state-map 89 "C-f" 'delete-forward-char 90 "C-z" 'evil-normal-state) 91 92 ;; Snipe 93 (after! evil-snipe 94 (setq evil-snipe-smart-case t) 95 (setq evil-snipe-scope 'whole-buffer) 96 (setq evil-snipe-auto-scroll t) 97 (setq evil-snipe-repeat-keys t) 98 (setq evil-snipe-repeat-scope 'whole-buffer)) 99 100 ;; Ivy 101 (map! :after ivy 102 :map ivy-minibuffer-map 103 "S-SPC" nil 104 "C-SPC" 'ivy-restrict-to-matches) 105 106 ;; Dired 107 (after! dired 108 ;; (setq dired-listing-switches "-aBhl --group-directories-first" 109 (setq dired-listing-switches "-aBhl" 110 dired-dwim-target t 111 dired-recursive-copies (quote always) 112 dired-recursive-deletes (quote top))) 113 114 ;; Deft 115 (use-package! deft 116 :after org 117 :config 118 (setq deft-recursive t) 119 ;; (setq deft-use-filter-string-for-filename t) 120 (setq deft-default-extension "org") 121 (setq deft-incremental-search t) 122 (setq deft-directory org_dir) 123 (add-hook 'after-init-hook 'org-roam-db-build-cache) 124 :bind 125 ("s-d" . deft)) 126 127 ;; Org-roam 128 (use-package! org-roam 129 :hook 130 (after-init . org-roam-mode)) 131 (after! org-roam 132 (add-hook 'after-init-hook 'org-roam-mode) 133 :config 134 (setq org-roam-directory org_dir) 135 (setq org-roam-db-location "~/org/org-roam.db") 136 (setq org-roam-link-title-format "[[%s]]") 137 (set-company-backend! 'org-mode '(company-capf)) 138 139 (setq org-roam-dailies-capture-templates 140 '(("d" "daily" plain (function org-roam-capture--get-point) 141 "%?" 142 :file-name "%<%Y-%m-%d>" 143 :immediate-finish t 144 :head "#+title: %<%A>, %<%d> %<%B> %<%Y> 145 #+roam_tags: journals\n 146 \n 147 * %<%A>, %<%d> %<%B> %<%Y>" 148 :unnarrowed t))) 149 150 (setq org-roam-capture-templates 151 '(("d" "default" plain (function org-roam-capture--get-point) 152 "%?" 153 :file-name "%<%Y%m%d%H%M%S>-${slug}" 154 :head "#+title: ${title}\n" 155 :immediate-finish t 156 :unnarrowed t) 157 ("k" "kumparan" plain (function org-roam-capture--get-point) 158 "%?" 159 :file-name "%<%Y%m%d%H%M%S>-${slug}" 160 :head "#+title: ${title} 161 #+roam_tags: kumparan 162 - backlinks :: [[file:20200630143644-kumparan.org][kumparan]]" 163 :immediate-finish t 164 :unnarrowed t) 165 ("c" "companies" plain (function org-roam-capture--get-point) 166 "%?" 167 :file-name "%<%Y%m%d%H%M%S>-${slug}" 168 :head "#+title: ${title} 169 #+roam_tags: companies\n" 170 :immediate-finish t 171 :unnarrowed t) 172 ("m" "medias" plain (function org-roam-capture--get-point) 173 "%?" 174 :file-name "%<%Y%m%d%H%M%S>-${slug}" 175 :head "#+title: ${title} 176 #+roam_tags: medias\n" 177 :immediate-finish t 178 :unnarrowed t) 179 ("p" "products" plain (function org-roam-capture--get-point) 180 "%?" 181 :file-name "%<%Y%m%d%H%M%S>-${slug}" 182 :head "#+title: ${title} 183 #+roam_tags: products\n" 184 :immediate-finish t 185 :unnarrowed t) 186 ("i" "people" plain (function org-roam-capture--get-point) 187 "%?" 188 :file-name "%<%Y%m%d%H%M%S>-${slug}" 189 :head "#+title: ${title} 190 #+roam_tags: people\n" 191 :immediate-finish t 192 :unnarrowed t)))) 193 194 ;; Org-journal 195 (use-package! org-journal 196 :bind 197 ("C-c j" . org-journal-new-entry) 198 ("C-c b" . org-journal-previous-entry) 199 ("C-c f" . org-journal-next-entry) 200 :config 201 (setq org-journal-dir org_dir 202 org-journal-date-prefix "#+title: " 203 org-journal-file-format "%Y-%m-%d.org" 204 org-journal-date-format "%A, %d %B %Y\n")) 205 206 ;; Org-mode 207 (after! org 208 :init 209 (require 'find-lisp) 210 (setq org-agenda-files (find-lisp-find-files org_dir "tasks\.org$")) 211 (setq org-agenda-start-with-log-mode '(state)) 212 (setq org-agenda-start-day "-9d") 213 (map! :map org-mode-map 214 :n "gj" #'evil-next-line 215 :n "gk" #'evil-previous-line 216 :n "M-j" #'org-metadown 217 :n "M-k" #'org-metaup 218 :n "C-s-r" #'org-roam-insert 219 :i "C-s-r" #'org-roam-insert 220 :n "s-r" #'org-roam-buffer-toggle-display 221 :i "s-r" #'org-roam-buffer-toggle-display) 222 :config 223 (setq org-directory org_dir 224 org-ellipsis " ▼ " 225 org-id-link-to-org-use-id nil 226 org-pretty-entities t 227 org-log-done 'note 228 org-log-into-drawer t 229 org-log-refile t 230 org-src-fontify-natively t 231 org-hide-emphasis-markers t) 232 (setq org-todo-keywords 233 '((sequence "TODO(t!)" "INPROGRESS(p!)" "INTEST(i!)" "FEEDBACK(f!)" "HOLD(h!)" "|" "MERGED(m!)" "DONE(d@/!)" "CANCELLED(c!)") 234 (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))) 235 (setq org-todo-keyword-faces 236 '(("TODO" :foreground "ffff00" :weight normal :underline t) 237 ("INPROGRESS" :foreground "#e39ff6" :weight normal :underline t) 238 ("INTEST" :foreground "#0098dd" :weight normal :underline t) 239 ("FEEDBACK" :foreground "#0098ee" :weight normal :underline t) 240 ("HOLD" :foreground "#9f7efe" :weight normal :underline t) 241 ("MERGED" :foreground "#50a14f" :weight normal :underline t) 242 ("DONE" :foreground "#50a14f" :weight bold :underline t) 243 ("CANCELLED" :foreground "#ff6480" :weight normal :underline t) 244 ("[-]" :foreground "#e39ff6" :weight bold) 245 ("[?]" :foreground "#9f7efe" :weight bold))) 246 (setq org-roam-dailies-capture-templates 247 '(("d" "daily" plain (function org-roam-capture--get-point) 248 "%?" 249 :file-name "%<%Y-%m-%d>" 250 :immediate-finish t 251 :head "#+title: %<%A>, %<%d> %<%B> %<%Y> 252 #+roam_tags: journals\n 253 \n 254 * %<%A>, %<%d> %<%B> %<%Y>" 255 :unnarrowed t))))