chore: updated emacs config
41798715
3 file(s) · +95 −0
| 33 | 33 | "," '(switch-to-buffer :wk "switch buffer") |
|
| 34 | 34 | "/" '(project-find-regexp :wk "project grep") |
|
| 35 | 35 | ||
| 36 | + | "X" '(org-capture :wk "org capture") |
|
| 37 | + | ||
| 36 | 38 | "b" '(:ignore t :wk "buffer") |
|
| 37 | 39 | "bb" '(switch-to-buffer :wk "switch") |
|
| 38 | 40 | "bi" '(ibuffer :wk "ibuffer") |
| 11 | 11 | (setq rmh-elfeed-org-files (list "~/org/elfeed.org")) |
|
| 12 | 12 | (elfeed-org)) |
|
| 13 | 13 | ||
| 14 | + | ;; ob-go isn't bundled with org; must load before org-babel-do-load-languages |
|
| 15 | + | (use-package ob-go) |
|
| 16 | + | ||
| 17 | + | (use-package org |
|
| 18 | + | :ensure nil |
|
| 19 | + | :config |
|
| 20 | + | (org-babel-do-load-languages |
|
| 21 | + | 'org-babel-load-languages |
|
| 22 | + | '((js . t) |
|
| 23 | + | (shell . t) |
|
| 24 | + | (go . t))) |
|
| 25 | + | ||
| 26 | + | (setq org-directory "~/org/" |
|
| 27 | + | org-default-notes-file (expand-file-name "inbox.org" org-directory) |
|
| 28 | + | org-capture-templates |
|
| 29 | + | '(("t" "Todo" entry (file+headline "inbox.org" "Tasks") |
|
| 30 | + | "* TODO %?\n%i\n%a" :empty-lines 1) |
|
| 31 | + | ("n" "Note" entry (file+headline "inbox.org" "Notes") |
|
| 32 | + | "* %?\n%U\n%i" :empty-lines 1) |
|
| 33 | + | ("j" "Journal" entry (file+olp+datetree "journal.org") |
|
| 34 | + | "* %U %?\n%i" :empty-lines 1) |
|
| 35 | + | ("b" "Bookmark" entry (file "bookmarks.org") |
|
| 36 | + | "* [[%^{URL}][%^{Title}]] %^g\n:PROPERTIES:\n:ADDED: %U\n:END:\n%?" |
|
| 37 | + | :empty-lines 1)))) |
|
| 38 | + | ||
| 14 | 39 | (provide 'init-tools) |
| 7 | 7 | ||
| 8 | 8 | (load-theme 'darkmatter t) |
|
| 9 | 9 | ||
| 10 | + | ;;; Mode line |
|
| 11 | + | ;; Evil's own indicator is dropped; the state is drawn by hand as a colored |
|
| 12 | + | ;; square with the state letter. Icons are Nerd Font glyphs. |
|
| 13 | + | (setq evil-mode-line-format nil |
|
| 14 | + | evil-echo-state nil) ; no "-- INSERT --" in the echo area |
|
| 15 | + | (column-number-mode 1) |
|
| 16 | + | ||
| 17 | + | (defvar my/ml-states |
|
| 18 | + | `((normal "N" ,(alist-get 'base08 darkmatter-palette)) |
|
| 19 | + | (insert "I" ,(alist-get 'base0A darkmatter-palette)) |
|
| 20 | + | (visual "V" ,(alist-get 'base0B darkmatter-palette)) |
|
| 21 | + | (replace "R" ,(alist-get 'red darkmatter-palette)) |
|
| 22 | + | (operator "O" ,(alist-get 'base0D darkmatter-palette)) |
|
| 23 | + | (motion "M" ,(alist-get 'base0D darkmatter-palette)) |
|
| 24 | + | (emacs "E" ,(alist-get 'base09 darkmatter-palette))) |
|
| 25 | + | "Evil state -> (letter color) for the mode line.") |
|
| 26 | + | ||
| 27 | + | (defun my/ml-evil-state () |
|
| 28 | + | "Colored square with the current evil state letter." |
|
| 29 | + | (when (bound-and-true-p evil-local-mode) |
|
| 30 | + | (pcase-let ((`(,letter ,color) (or (alist-get evil-state my/ml-states) |
|
| 31 | + | '("?" "#666666")))) |
|
| 32 | + | (propertize (format " %s " letter) |
|
| 33 | + | 'face `(:background ,color |
|
| 34 | + | :foreground ,(alist-get 'base00 darkmatter-palette) |
|
| 35 | + | :weight bold))))) |
|
| 36 | + | ||
| 37 | + | (setq-default |
|
| 38 | + | mode-line-format |
|
| 39 | + | '("%e" |
|
| 40 | + | (:eval (my/ml-evil-state)) |
|
| 41 | + | " " |
|
| 42 | + | (:eval (when (and buffer-file-name (buffer-modified-p)) |
|
| 43 | + | (propertize "\uf111 " 'face '(:foreground "#e78a53")))) ; nf-fa-circle |
|
| 44 | + | (:propertize "%b" face mode-line-buffer-id) |
|
| 45 | + | (:eval (when buffer-read-only " \uf023")) ; nf-fa-lock |
|
| 46 | + | " " |
|
| 47 | + | mode-name |
|
| 48 | + | (:eval (when vc-mode |
|
| 49 | + | (concat " \ue0a0 " ; branch |
|
| 50 | + | (string-trim (replace-regexp-in-string "^ *Git[-:]" "" vc-mode))))) |
|
| 51 | + | mode-line-format-right-align |
|
| 52 | + | ;; ERC / jabber activity ([#chan,...]) lives here |
|
| 53 | + | (:eval (when (string-match-p "[^ ]" (format-mode-line global-mode-string)) |
|
| 54 | + | global-mode-string)) |
|
| 55 | + | " %l:%c %p ")) |
|
| 56 | + | ||
| 57 | + | (setq initial-scratch-message |
|
| 58 | + | " . + . . . . . . |
|
| 59 | + | . . . * |
|
| 60 | + | . * . . . . . . + . |
|
| 61 | + | \"You Are Here\" . . + . . . |
|
| 62 | + | . | . . . . . . |
|
| 63 | + | | . . . +. + . |
|
| 64 | + | \\|/ . . . . |
|
| 65 | + | . . V . * . . . . + . |
|
| 66 | + | + . . . + |
|
| 67 | + | . . + .+. . |
|
| 68 | + | . . . + . . . . . |
|
| 69 | + | . . . . . . . . ! / |
|
| 70 | + | * . . . + . . - O - |
|
| 71 | + | . . . + . . * . . / | |
|
| 72 | + | . + . . . .. + . |
|
| 73 | + | . . . . * . * . +.. . * |
|
| 74 | + | . . . . . . . . + . . + |
|
| 75 | + | ||
| 76 | + | ") |
|
| 77 | + | ||
| 10 | 78 | (provide 'init-ui) |