├── core ├── sumibi-core.el ├── sumibi-modeline.el ├── sumibi-settings.el └── sumibi.el ├── early-init.el ├── init.el ├── license ├── packages ├── +buffer-move.el ├── +c.el ├── +cl.el ├── +clojure.el ├── +company.el ├── +ctrls.el ├── +elcord.el ├── +flycheck.el ├── +guile.el ├── +latex.el ├── +lua.el ├── +nix.el ├── +numbers.el ├── +parentheses.el ├── +parinfer.el ├── +screenshot.el └── +visuals.el ├── readme.org ├── user ├── sumibi-bindings.el ├── sumibi-command.el ├── sumibi-defaults.el ├── sumibi-layout.el ├── sumibi-splash.el └── sumibi-writer.el └── visuals ├── +sumibi-theme.el ├── custom.el ├── splash-img └── caet.jpg ├── sumibi-base-colors.el ├── sumibi-colors.el ├── sumibi-faces.el ├── sumibi-theme-dark.el ├── sumibi-theme-light.el └── sumibi-theme.el /core/sumibi-core.el: -------------------------------------------------------------------------------- 1 | ;;; sumibi-emacs core stuff -*- lexical-binding: t; -*- 2 | 3 | ;; Convert keyword to string without colon 4 | (defun keyword-to-name-str (keyword) 5 | "Return KEYWORD symbol without initial colon as string 6 | i.e. :keyword to \"keyword\"." 7 | (substring (symbol-name keyword) 1)) 8 | 9 | (defmacro lambda! (&rest body) 10 | "A shortcut for inline interactive lambdas." 11 | (declare (doc-string 1)) 12 | `(lambda () (interactive) ,@body)) 13 | 14 | (defun sumibi/upgrade () 15 | "Upgrade all installed packages using straight-x." 16 | (interactive) 17 | (progn 18 | (straight-x-fetch-all) 19 | (straight-rebuild-all))) 20 | 21 | ;; Detect system type 22 | (defconst *IS-LINUX* (eq system-type 'gnu/linux)) 23 | (defconst *IS-MAC* (eq system-type 'darwin)) 24 | (defconst *IS-WINDOWS* (memq system-type '(cygwin windows-nt ms-dos))) 25 | (defconst *IS-BSD* (or *IS-MAC* (eq system-type 'berkeley-unix))) 26 | 27 | (provide 'sumibi-core) 28 | 29 | ;;; sumibi-core.el ends here 30 | -------------------------------------------------------------------------------- /core/sumibi-modeline.el: -------------------------------------------------------------------------------- 1 | ;; sumibi-modeline -*- lexical-binding: t -*- 2 | ;; ------------------------------------------------------------------- 3 | ;; 4 | ;; mode line format: 5 | ;; 6 | ;; [ status | name (primary) secondary | item1 | item2 ] 7 | ;; 8 | ;; ------------------------------------------------------------------- 9 | (require 'subr-x) 10 | 11 | 12 | ;; ------------------------------------------------------------------- 13 | (defun vc-branch () 14 | (if vc-mode 15 | (let ((backend (vc-backend buffer-file-name))) 16 | (concat "#" (substring-no-properties vc-mode 17 | (+ (if (eq backend 'Hg) 2 3) 2)))) nil)) 18 | 19 | (defun sumibi-mode-name () 20 | (if (listp mode-name) (car mode-name) mode-name)) 21 | 22 | 23 | ;; From https://amitp.blogspot.com/2011/08/emacs-custom-mode-line.html 24 | ;; --------------------------------------------------------------------- 25 | (defun shorten-directory (dir max-length) 26 | "Show up to `max-length' characters of a directory name `dir'." 27 | (let ((path (reverse (split-string (abbreviate-file-name dir) "/"))) 28 | (output "")) 29 | (when (and path (equal "" (car path))) 30 | (setq path (cdr path))) 31 | (while (and path (< (length output) (- max-length 4))) 32 | (setq output (concat (car path) "/" output)) 33 | (setq path (cdr path))) 34 | (when path 35 | (setq output (concat "…/" output))) 36 | output)) 37 | 38 | ;; ------------------------------------------------------------------- 39 | (defun sumibi-modeline-compose (status name primary secondary) 40 | "Compose a string with provided information" 41 | (let* ((char-width (window-font-width nil 'header-line)) 42 | (window (get-buffer-window (current-buffer))) 43 | (space-up +0.15) 44 | (space-down -0.20) 45 | (prefix (cond ((string= status "RO") 46 | (propertize (if (window-dedicated-p)" -- " " RO ") 47 | 'face 'sumibi-face-header-popout)) 48 | ((string= status "OH") 49 | (propertize (if (window-dedicated-p)" -- " " OH ") 50 | 'face 'sumibi-face-header-critical)) 51 | ((string= status "OK") 52 | (propertize (if (window-dedicated-p)" -- " " OK ") 53 | 'face 'sumibi-face-header-faded)) 54 | (t (propertize status 'face 'sumibi-face-header-popout)))) 55 | (left (concat 56 | (propertize " " 'face 'sumibi-face-header-default 57 | 'display `(raise ,space-up)) 58 | (propertize name 'face 'sumibi-face-header-strong) 59 | (propertize " " 'face 'sumibi-face-header-default 60 | 'display `(raise ,space-down)) 61 | (propertize primary 'face 'sumibi-face-header-default))) 62 | (right (concat secondary " ")) 63 | (available-width (- (window-total-width) 64 | (length prefix) (length left) (length right) 65 | (/ (window-right-divider-width) char-width))) 66 | (available-width (max 1 available-width))) 67 | (concat prefix 68 | left 69 | (propertize (make-string available-width ?\ ) 70 | 'face 'sumibi-face-header-default) 71 | (propertize right 'face `(:inherit sumibi-face-header-default 72 | :foreground ,sumibi-color-faded))))) 73 | 74 | ;; --------------------------------------------------------------------- 75 | (defun sumibi-modeline-mu4e-dashboard-mode-p () 76 | (bound-and-true-p mu4e-dashboard-mode)) 77 | 78 | (defun sumibi-modeline-mu4e-dashboard-mode () 79 | (sumibi-modeline-compose (sumibi-modeline-status) 80 | "Mail" 81 | (sumibi-modeline-mu4e-context) 82 | (format "%d messages" (plist-get mu4e~server-props :doccount)) 83 | )) 84 | 85 | ;; --------------------------------------------------------------------- 86 | 87 | ;; since the EIN library itself is constantly re-rendering the notebook, and thus 88 | ;; re-setting the header-line-format, we cannot use the sumibi-modeline function to set 89 | ;; the header format in a notebook buffer. Fortunately, EIN exposes the 90 | ;; ein:header-line-format variable for just this purpose. 91 | 92 | (with-eval-after-load 'ein 93 | (defun sumibi-modeline-ein-notebook-mode () 94 | (let ((buffer-name (format-mode-line "%b"))) 95 | (sumibi-modeline-compose (if (ein:notebook-modified-p) "OH" "OK") 96 | buffer-name 97 | "" 98 | (ein:header-line)))) 99 | (setq ein:header-line-format '((:eval (sumibi-modeline-ein-notebook-mode))))) 100 | 101 | ;; --------------------------------------------------------------------- 102 | (defun sumibi-modeline-elfeed-search-mode-p () 103 | (derived-mode-p 'elfeed-search-mode)) 104 | 105 | (defun sumibi-modeline-elfeed-search-mode () 106 | (sumibi-modeline-compose (sumibi-modeline-status) 107 | "Elfeed" 108 | (concat "(" (elfeed-search--header) ")") 109 | "")) 110 | 111 | ;; Elfeed (regular header) 112 | (with-eval-after-load 'elfeed 113 | (defun elfeed-setup-header () 114 | (setq header-line-format (default-value 'header-line-format))) 115 | (setq elfeed-search-header-function #'elfeed-setup-header)) 116 | 117 | ;; --------------------------------------------------------------------- 118 | (defun sumibi-modeline-elfeed-show-mode-p () 119 | (derived-mode-p 'elfeed-show-mode)) 120 | 121 | (defun sumibi-modeline-elfeed-show-mode () 122 | (let* ((title (elfeed-entry-title elfeed-show-entry)) 123 | (tags (elfeed-entry-tags elfeed-show-entry)) 124 | (tags-str (mapconcat #'symbol-name tags ", ")) 125 | (date (seconds-to-time (elfeed-entry-date elfeed-show-entry))) 126 | (feed (elfeed-entry-feed elfeed-show-entry)) 127 | (feed-title (plist-get (elfeed-feed-meta feed) :title)) 128 | (entry-author (elfeed-meta elfeed-show-entry :author))) 129 | (sumibi-modeline-compose (sumibi-modeline-status) 130 | (s-truncate 40 title "…") 131 | (concat "(" tags-str ")") 132 | feed-title))) 133 | 134 | ;; --------------------------------------------------------------------- 135 | (defun sumibi-modeline-calendar-mode-p () 136 | (derived-mode-p 'calendar-mode)) 137 | 138 | (defun sumibi-modeline-calendar-mode () "") 139 | 140 | ;; Calendar (no header, only overline) 141 | (with-eval-after-load 'calendar 142 | (defun calendar-setup-header () 143 | (setq header-line-format "") 144 | (face-remap-add-relative 145 | 'header-line `(:overline ,(face-foreground 'default) 146 | :height 0.5 147 | :background ,(face-background 'default)))) 148 | (add-hook 'calendar-initial-window-hook #'calendar-setup-header) 149 | 150 | ;; From https://emacs.stackexchange.com/questions/45650 151 | (add-to-list 'display-buffer-alist 152 | `(,(rx string-start "*Calendar*" string-end) 153 | (display-buffer-below-selected)))) 154 | 155 | ;; --------------------------------------------------------------------- 156 | (defun sumibi-modeline-org-capture-mode-p () 157 | (bound-and-true-p org-capture-mode)) 158 | 159 | (defun sumibi-modeline-org-capture-mode () 160 | (sumibi-modeline-compose (sumibi-modeline-status) 161 | "Capture" 162 | "(org)" 163 | "")) 164 | 165 | (with-eval-after-load 'org-capture 166 | (defun org-capture-turn-off-header-line () 167 | (setq-local header-line-format (default-value 'header-line-format)) 168 | ;; (fit-window-to-buffer nil nil 8) 169 | ;; (face-remap-add-relative 'header-line '(:background "#ffffff")) 170 | (message nil)) 171 | (add-hook 'org-capture-mode-hook 172 | #'org-capture-turn-off-header-line)) 173 | 174 | ;; --------------------------------------------------------------------- 175 | (setq Info-use-header-line nil) 176 | (defun sumibi-modeline-info-breadcrumbs () 177 | (let ((nodes (Info-toc-nodes Info-current-file)) 178 | (cnode Info-current-node) 179 | (node Info-current-node) 180 | (crumbs ()) 181 | (depth Info-breadcrumbs-depth) 182 | line) 183 | (while (> depth 0) 184 | (setq node (nth 1 (assoc node nodes))) 185 | (if node (push node crumbs)) 186 | (setq depth (1- depth))) 187 | (setq crumbs (cons "Top" (if (member (pop crumbs) '(nil "Top")) 188 | crumbs (cons nil crumbs)))) 189 | (forward-line 1) 190 | (dolist (node crumbs) 191 | (let ((text 192 | (if (not (equal node "Top")) node 193 | (format "%s" 194 | (if (stringp Info-current-file) 195 | (file-name-sans-extension 196 | (file-name-nondirectory Info-current-file)) 197 | Info-current-file))))) 198 | (setq line (concat line (if (null line) "" " > ") 199 | (if (null node) "..." text))))) 200 | (if (and cnode (not (equal cnode "Top"))) 201 | (setq line (concat line (if (null line) "" " > ") cnode))) 202 | line)) 203 | 204 | (defun sumibi-modeline-info-mode-p () 205 | (derived-mode-p 'Info-mode)) 206 | 207 | (defun sumibi-modeline-info-mode () 208 | (sumibi-modeline-compose (sumibi-modeline-status) 209 | "Info" 210 | (concat "(" 211 | (sumibi-modeline-info-breadcrumbs) 212 | ")") 213 | "")) 214 | 215 | ;; --------------------------------------------------------------------- 216 | (defun sumibi-modeline-org-agenda-mode-p () 217 | (derived-mode-p 'org-agenda-mode)) 218 | 219 | (defun sumibi-modeline-org-agenda-mode () 220 | (sumibi-modeline-compose (sumibi-modeline-status) 221 | "Agenda" 222 | "" 223 | (format-time-string "%A %-e %B %Y"))) 224 | 225 | ;; --------------------------------------------------------------------- 226 | (defun sumibi-modeline-term-mode-p () 227 | (derived-mode-p 'term-mode)) 228 | 229 | (defun sumibi-modeline-vterm-mode-p () 230 | (derived-mode-p 'vterm-mode)) 231 | 232 | (defun sumibi-modeline-term-mode () 233 | (sumibi-modeline-compose " >_ " 234 | "Terminal" 235 | (concat "(" shell-file-name ")") 236 | (shorten-directory default-directory 32))) 237 | 238 | ;; --------------------------------------------------------------------- 239 | (defun sumibi-modeline-mu4e-main-mode-p () 240 | (derived-mode-p 'mu4e-main-mode)) 241 | 242 | (defun sumibi-modeline-mu4e-main-mode () 243 | (sumibi-modeline-compose (sumibi-modeline-status) 244 | "Mail" 245 | (sumibi-modeline-mu4e-context) 246 | (format-time-string "%A %d %B %Y, %H:%M"))) 247 | 248 | ;; --------------------------------------------------------------------- 249 | (defun sumibi-modeline-mu4e-headers-mode-p () 250 | (derived-mode-p 'mu4e-headers-mode)) 251 | 252 | (defun sumibi-modeline-mu4e-headers-mode () 253 | (sumibi-modeline-compose (sumibi-modeline-status) 254 | (mu4e~quote-for-modeline mu4e~headers-last-query) 255 | "" 256 | "")) 257 | 258 | (with-eval-after-load 'mu4e 259 | (defun mu4e~header-line-format () (sumibi-modeline))) 260 | 261 | ;; --------------------------------------------------------------------- 262 | (setq mu4e-modeline-max-width 72) 263 | 264 | (defun sumibi-modeline-mu4e-view-mode-p () 265 | (derived-mode-p 'mu4e-view-mode)) 266 | 267 | (defun sumibi-modeline-mu4e-view-mode () 268 | (let* ((msg (mu4e-message-at-point)) 269 | (subject (mu4e-message-field msg :subject)) 270 | (from (mu4e~headers-contact-str (mu4e-message-field msg :from))) 271 | (date (mu4e-message-field msg :date))) 272 | (sumibi-modeline-compose (sumibi-modeline-status) 273 | (s-truncate 40 subject "…") 274 | "" 275 | from))) 276 | 277 | (defun sumibi-modeline-mu4e-view-hook () 278 | (setq header-line-format "%-") 279 | (face-remap-add-relative 'header-line 280 | '(:background "#ffffff" 281 | :underline nil 282 | :box nil 283 | :height 1.0))) 284 | (add-hook 'mu4e-view-mode-hook #'sumibi-modeline-mu4e-view-hook) 285 | 286 | 287 | ;; --------------------------------------------------------------------- 288 | (defun sumibi-modeline-sumibi-help-mode-p () 289 | (derived-mode-p 'sumibi-help-mode)) 290 | 291 | (defun sumibi-modeline-sumibi-help-mode () 292 | (sumibi-modeline-compose (sumibi-modeline-status) 293 | "GNU Emacs / N Λ N O" 294 | "(help)" 295 | "")) 296 | 297 | ;; --------------------------------------------------------------------- 298 | (defun sumibi-modeline-message-mode-p () 299 | (derived-mode-p 'message-mode)) 300 | 301 | (defun sumibi-modeline-message-mode () 302 | (sumibi-modeline-compose (sumibi-modeline-status) 303 | "Message" "(draft)" "")) 304 | 305 | 306 | ;; --------------------------------------------------------------------- 307 | (setq org-mode-line-string nil) 308 | (with-eval-after-load 'org-clock 309 | (add-hook 'org-clock-out-hook 310 | '(lambda () (setq org-mode-line-string nil) 311 | (force-mode-line-update)))) 312 | 313 | (defun sumibi-modeline-org-clock-mode-p () 314 | org-mode-line-string) 315 | 316 | (defun sumibi-modeline-org-clock-mode () 317 | (let ((buffer-name (format-mode-line "%b")) 318 | (mode-name (sumibi-mode-name)) 319 | (branch (vc-branch)) 320 | (position (format-mode-line "%l:%c"))) 321 | (sumibi-modeline-compose (sumibi-modeline-status) 322 | buffer-name 323 | (concat "(" mode-name 324 | (if branch (concat ", " 325 | (propertize branch 'face 'italic))) 326 | ")" ) 327 | org-mode-line-string))) 328 | 329 | ;; --------------------------------------------------------------------- 330 | (defun sumibi-modeline-docview-mode-p () 331 | (derived-mode-p 'doc-view-mode)) 332 | 333 | (defun sumibi-modeline-docview-mode () 334 | (let ((buffer-name (format-mode-line "%b")) 335 | (mode-name (sumibi-mode-name)) 336 | (branch (vc-branch)) 337 | (page-number (concat 338 | (number-to-string (doc-view-current-page)) "/" 339 | (or (ignore-errors 340 | (number-to-string (doc-view-last-page-number))) 341 | "???")))) 342 | (sumibi-modeline-compose 343 | (sumibi-modeline-status) 344 | buffer-name 345 | (concat "(" mode-name 346 | (if branch (concat ", " 347 | (propertize branch 'face 'italic))) 348 | ")" ) 349 | page-number))) 350 | 351 | ;; --------------------------------------------------------------------- 352 | (defun sumibi-modeline-pdf-view-mode-p () 353 | (derived-mode-p 'pdf-view-mode)) 354 | 355 | (defun sumibi-modeline-pdf-view-mode () 356 | (let ((buffer-name (format-mode-line "%b")) 357 | (mode-name (sumibi-mode-name)) 358 | (branch (vc-branch)) 359 | (page-number (concat 360 | (number-to-string (pdf-view-current-page)) "/" 361 | (or (ignore-errors 362 | (number-to-string (pdf-cache-number-of-pages))) 363 | "???")))) 364 | (sumibi-modeline-compose 365 | "OK" 366 | buffer-name 367 | (concat "(" mode-name 368 | (if branch (concat ", " 369 | (propertize branch 'face 'italic))) 370 | ")" ) 371 | page-number))) 372 | 373 | ;; --------------------------------------------------------------------- 374 | (defun buffer-menu-mode-header-line () 375 | (face-remap-add-relative 376 | 'header-line `(:background ,(face-background 'sumibi-face-subtle)))) 377 | (add-hook 'Buffer-menu-mode-hook 378 | #'buffer-menu-mode-header-line) 379 | 380 | ;; --------------------------------------------------------------------- 381 | (defun sumibi-modeline-completion-list-mode-p () 382 | (derived-mode-p 'completion-list-mode)) 383 | 384 | (defun sumibi-modeline-completion-list-mode () 385 | (let ((buffer-name (format-mode-line "%b")) 386 | (mode-name (sumibi-mode-name)) 387 | (position (format-mode-line "%l:%c"))) 388 | 389 | (sumibi-modeline-compose (sumibi-modeline-status) 390 | buffer-name "" position))) 391 | ;; --------------------------------------------------------------------- 392 | (with-eval-after-load 'deft 393 | (defun deft-print-header () 394 | (force-mode-line-update) 395 | (widget-insert "\n"))) 396 | 397 | (defun sumibi-modeline-deft-mode-p () 398 | (derived-mode-p 'deft-mode)) 399 | 400 | (defun sumibi-modeline-deft-mode () 401 | (let ((prefix " DEFT ") 402 | (primary "Notes") 403 | (filter (if deft-filter-regexp 404 | (deft-whole-filter-regexp) "")) 405 | (matches (if deft-filter-regexp 406 | (format "%d matches" (length deft-current-files)) 407 | (format "%d notes" (length deft-all-files))))) 408 | (sumibi-modeline-compose " DEFT " 409 | primary filter matches))) 410 | 411 | ;; --------------------------------------------------------------------- 412 | (defun sumibi-modeline-prog-mode-p () 413 | (derived-mode-p 'prog-mode)) 414 | 415 | (defun sumibi-modeline-text-mode-p () 416 | (derived-mode-p 'text-mode)) 417 | 418 | ;; --------------------------------------------------------------------- 419 | (defun sumibi-modeline-flycheck-count-all () 420 | (let ((info 0) (warning 0) (error 0)) 421 | (mapc 422 | (lambda (item) 423 | (let ((count (cdr item))) 424 | (pcase (flycheck-error-level-compilation-level (car item)) 425 | (0 (cl-incf info count)) 426 | (1 (cl-incf warning count)) 427 | (2 (cl-incf error count))))) 428 | (flycheck-count-errors flycheck-current-errors)) 429 | `((info . ,info) (warning . ,warning) (error . ,error)))) 430 | 431 | (defun sumibi-modeline-flycheck-print-counts () 432 | (let-alist (sumibi-modeline-flycheck-count-all) 433 | (format "ERR %s | WARN %s | INFO %s" 434 | (number-to-string .error) 435 | (number-to-string .warning) 436 | (number-to-string .info)))) 437 | 438 | ;; --------------------------------------------------------------------- 439 | (defun sumibi-modeline-default-mode () 440 | (let ((buffer-name (format-mode-line "%b")) 441 | (mode-name (sumibi-mode-name)) 442 | (branch (vc-branch)) 443 | (position (format-mode-line "%l:%c"))) 444 | (sumibi-modeline-compose (sumibi-modeline-status) 445 | buffer-name 446 | (concat "(" mode-name 447 | (if branch (concat ", " 448 | (propertize branch 'face 'italic))) 449 | ")" ) 450 | (concat (sumibi-modeline-flycheck-print-counts) " | " position)))) 451 | 452 | ;; --------------------------------------------------------------------- 453 | (defun sumibi-modeline-status () 454 | "Return buffer status: read-only (RO), modified (OH) or read-write (OK)" 455 | 456 | (let ((read-only buffer-read-only) 457 | (modified (and buffer-file-name (buffer-modified-p)))) 458 | (cond (modified "OH") (read-only "RO") (t "OK")))) 459 | 460 | ;; --------------------------------------------------------------------- 461 | (defun sumibi-modeline-mu4e-context () 462 | "Return the current mu4e context as a non propertized string." 463 | 464 | (if (> (length (mu4e-context-label)) 0) 465 | (concat "(" (substring-no-properties (mu4e-context-label) 1 -1) ")") 466 | "(none)")) 467 | 468 | 469 | ;; --------------------------------------------------------------------- 470 | (defun sumibi-modeline () 471 | "Install a header line whose content is dependend on the major mode" 472 | (interactive) 473 | (setq-default header-line-format 474 | '((:eval 475 | (cond ((sumibi-modeline-prog-mode-p) (sumibi-modeline-default-mode)) 476 | ((sumibi-modeline-message-mode-p) (sumibi-modeline-message-mode)) 477 | ((sumibi-modeline-elfeed-search-mode-p) (sumibi-modeline-elfeed-search-mode)) 478 | ((sumibi-modeline-elfeed-show-mode-p) (sumibi-modeline-elfeed-show-mode)) 479 | ((sumibi-modeline-deft-mode-p) (sumibi-modeline-deft-mode)) 480 | ((sumibi-modeline-info-mode-p) (sumibi-modeline-info-mode)) 481 | ((sumibi-modeline-calendar-mode-p) (sumibi-modeline-calendar-mode)) 482 | ((sumibi-modeline-org-capture-mode-p) (sumibi-modeline-org-capture-mode)) 483 | ((sumibi-modeline-org-agenda-mode-p) (sumibi-modeline-org-agenda-mode)) 484 | ((sumibi-modeline-org-clock-mode-p) (sumibi-modeline-org-clock-mode)) 485 | ((sumibi-modeline-term-mode-p) (sumibi-modeline-term-mode)) 486 | ((sumibi-modeline-vterm-mode-p) (sumibi-modeline-term-mode)) 487 | ((sumibi-modeline-mu4e-dashboard-mode-p) (sumibi-modeline-mu4e-dashboard-mode)) 488 | ((sumibi-modeline-mu4e-main-mode-p) (sumibi-modeline-mu4e-main-mode)) 489 | ((sumibi-modeline-mu4e-headers-mode-p) (sumibi-modeline-mu4e-headers-mode)) 490 | ;; ((sumibi-modeline-mu4e-view-mode-p) (sumibi-modeline-mu4e-view-mode)) 491 | ((sumibi-modeline-text-mode-p) (sumibi-modeline-default-mode)) 492 | ((sumibi-modeline-pdf-view-mode-p) (sumibi-modeline-pdf-view-mode)) 493 | ((sumibi-modeline-docview-mode-p) (sumibi-modeline-docview-mode)) 494 | ((sumibi-modeline-completion-list-mode-p) (sumibi-modeline-completion-list-mode)) 495 | ((sumibi-modeline-sumibi-help-mode-p) (sumibi-modeline-sumibi-help-mode)) 496 | (t (sumibi-modeline-default-mode))))))) 497 | 498 | ;; --------------------------------------------------------------------- 499 | (defun sumibi-modeline-update-windows () 500 | "Modify the mode line depending on the presence of a window 501 | below or a buffer local variable 'no-mode-line'." 502 | (dolist (window (window-list)) 503 | (with-selected-window window 504 | (with-current-buffer (window-buffer window) 505 | (if (or (not (boundp 'no-mode-line)) (not no-mode-line)) 506 | (setq mode-line-format 507 | (cond ((one-window-p t) (list "")) 508 | ((eq (window-in-direction 'below) (minibuffer-window)) (list "")) 509 | ((not (window-in-direction 'below)) (list "")) 510 | (t nil)))))))) 511 | 512 | (add-hook 'window-configuration-change-hook 'sumibi-modeline-update-windows) 513 | 514 | (setq eshell-status-in-modeline nil) 515 | ;; (setq-default mode-line-format (list "%-")) 516 | (setq-default mode-line-format "") 517 | (sumibi-modeline) 518 | 519 | (provide 'sumibi-modeline) 520 | -------------------------------------------------------------------------------- /core/sumibi-settings.el: -------------------------------------------------------------------------------- 1 | ;;; sumibi-settings.el -*- lexical-binding: t; -*- 2 | 3 | ;; sumibi setting options 4 | 5 | (defgroup sumibi nil 6 | "sumibi-emacs custom options." 7 | :group 'emacs) 8 | 9 | (set-language-environment "UTF-8") 10 | 11 | ;; Replace the region while insert 12 | (use-package delsel 13 | :straight nil 14 | :hook (after-init . delete-selection-mode)) 15 | 16 | ;; simple.el 17 | (use-package simple 18 | :straight nil 19 | :config 20 | (setq-default yank-pop-change-selection t 21 | ;; Disable key bindging suggeestions 22 | suggest-key-bindings t 23 | kill-whole-line t ; Kill line including '\n' 24 | eval-expression-print-level nil 25 | set-mark-command-repeat-pop t 26 | 27 | async-shell-command-buffer 'new-buffer 28 | backward-delete-char-untabify-method 'hungry 29 | 30 | track-eol t ; Keep cursor at end of lines. 31 | line-move-visual nil ; To be required by track-eol 32 | 33 | ;; Update UI less frequently 34 | idle-update-delay 1.0 35 | ;; TODO: move to jit-lock 36 | jit-lock-defer-time 0 37 | ) 38 | ) 39 | 40 | ;; Auto reload buffer if file was changed 41 | (use-package autorevert 42 | :straight nil 43 | :hook (after-init . global-auto-revert-mode) 44 | :config 45 | (setq auto-revert-interval 10 46 | auto-revert-check-vc-info nil 47 | auto-revert-use-notify nil 48 | 49 | auto-revert-verbose nil)) 50 | 51 | ;; Suppress ad-handle-definition warnings 52 | (setq ad-redefinition-action 'accept) 53 | 54 | ;; Save last position in buffer 55 | (use-package saveplace 56 | :straight nil 57 | :hook (after-init . save-place-mode)) 58 | 59 | ;; File-related settings 60 | (use-package files 61 | :straight nil 62 | :config 63 | (setq make-backup-files nil 64 | backup-by-copying t ; don't clobber symlinks 65 | backup-by-copying-when-linked t 66 | delete-old-versions t 67 | kept-new-versions 6 68 | kept-old-versions 2 69 | version-control t ; use versioned backups 70 | auto-save-default t 71 | 72 | large-file-warning-threshold nil ; Disable warning about large files 73 | require-final-newline t 74 | find-file-visit-truename t 75 | 76 | ;; Don’t bother confirming killing processes 77 | confirm-kill-processes nil 78 | 79 | ;; y/n instead of yes/no when quitting 80 | confirm-kill-emacs nil 81 | 82 | ;; No second pass of case-insensitive search over auto-mode-alist. 83 | auto-mode-case-fold nil 84 | )) 85 | 86 | ;; Allow commands 87 | (put 'narrow-to-region 'disabled nil) 88 | (put 'narrow-to-page 'disabled nil) 89 | (put 'upcase-region 'disabled nil) 90 | (put 'downcase-region 'disabled nil) 91 | (put 'erase-buffer 'disabled nil) 92 | (put 'scroll-left 'disabled nil) 93 | (put 'dired-find-alternate-file 'disabled nil) 94 | 95 | (provide 'sumibi-settings) 96 | -------------------------------------------------------------------------------- /core/sumibi.el: -------------------------------------------------------------------------------- 1 | ;;; sumibi -*- lexical-binding: t -*- 2 | 3 | ; Setup debug mode 4 | (eval-and-compile 5 | (defvar sumibi-debug-mode 6 | (or (getenv "DEBUG") init-file-debug) 7 | "Debug mode, enable through DEBUG=1 or use --debug-init.") 8 | (setq debug-on-error (and (not noninteractive) sumibi-debug-mode) 9 | jka-compr-verbose sumibi-debug-mode)) 10 | 11 | (defvar sumibi-verbose-byte-compile-warnings nil) 12 | 13 | ;; Disable certain byte compiler warnings to cut down on the noise. 14 | (if (or sumibi-debug-mode sumibi-verbose-byte-compile-warnings) 15 | (setq byte-compile-warnings t) 16 | (setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))) 17 | 18 | ;; Startup & package manager 19 | (defvar file-name-handler-alist-old file-name-handler-alist) 20 | 21 | (setq file-name-handler-alist nil 22 | byte-compile--use-old-handlers nil 23 | load-prefer-newer t 24 | ;; Don't load site packages 25 | site-run-file nil) 26 | 27 | ;; Advanced logging 28 | ;; (setq-default message-log-max 16384) 29 | 30 | 31 | ;; Ensure `sumibi' is in `load-path' 32 | (add-to-list 'load-path (file-name-directory load-file-name)) 33 | 34 | (autoload #'straight-x-pull-all "straight-x" "" t) 35 | (autoload #'straight-x-fetch-all "straight-x" "" t) 36 | (autoload #'straight-x-freeze-versions "straight-x" "" t) 37 | 38 | ;; Require necessary sumibi things 39 | (require 'sumibi-core) 40 | 41 | ;; Straight.el 42 | (defvar bootstrap-version) 43 | (let ((bootstrap-file 44 | (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) 45 | (bootstrap-version 5)) 46 | (unless (file-exists-p bootstrap-file) 47 | (with-current-buffer 48 | (url-retrieve-synchronously 49 | "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 50 | 'silent 'inhibit-cookies) 51 | (goto-char (point-max)) 52 | (eval-print-last-sexp))) 53 | (load bootstrap-file nil 'nomessage)) 54 | 55 | ;; Straight settings 56 | (setq straight-check-for-modifications nil 57 | ;; Don't clone the whole repo 58 | straight-vc-git-default-clone-depth 1 59 | straight-recipes-emacsmirror-use-mirror t 60 | 61 | ;; Configure build directory considering Emacs version 62 | ;; straight-build-dir (format "build-%s" emacs-version) 63 | 64 | ;; We have it in early-init.el 65 | straight-enable-package-integration nil 66 | ) 67 | 68 | ;; Security settings 69 | ;; Emacs is essentially one huge security vulnerability, what with all the 70 | ;; dependencies it pulls in from all corners of the globe. Let's try to be at 71 | ;; least a little more discerning. 72 | (setq gnutls-verify-error (not (getenv-internal "INSECURE")) 73 | gnutls-algorithm-priority 74 | (when (boundp 'libgnutls-version) 75 | (concat "SECURE128:+SECURE192:-VERS-ALL" 76 | (if (and (not (version< emacs-version "26.3")) 77 | (>= libgnutls-version 30605)) 78 | ":+VERS-TLS1.3") 79 | ":+VERS-TLS1.2")) 80 | ;; `gnutls-min-prime-bits' is set based on recommendations from 81 | ;; https://www.keylength.com/en/4/ 82 | gnutls-min-prime-bits 3072 83 | tls-checktrust gnutls-verify-error 84 | ;; Emacs is built with `gnutls' by default, so `tls-program' would not be 85 | ;; used in that case. Otherwise, people have reasons to not go with 86 | ;; `gnutls', we use `openssl' instead. For more details, see 87 | ;; https://redd.it/8sykl1 88 | tls-program '("openssl s_client -connect %h:%p -CAfile %t -nbio -no_ssl3 -no_tls1 -no_tls1_1 -ign_eof" 89 | "gnutls-cli -p %p --dh-bits=3072 --ocsp --x509cafile=%t \ 90 | --strict-tofu --priority='SECURE192:+SECURE128:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3' %h" 91 | ;; compatibility fallbacks 92 | "gnutls-cli -p %p %h")) 93 | 94 | (straight-use-package 'use-package) 95 | (setq straight-use-package-by-default t 96 | use-package-enable-imenu-support t) 97 | 98 | ;; Display use-package debug stuff when debug-on-error is t 99 | (if sumibi-debug-mode 100 | (setq use-package-expand-minimally nil 101 | use-package-verbose t 102 | use-package-compute-statistics t 103 | message-log-max t) 104 | (setq use-package-expand-minimally t 105 | use-package-verbose nil)) 106 | 107 | 108 | (use-package gcmh 109 | :hook (after-init . gcmh-mode) 110 | :config 111 | (setq gcmh-verbose nil 112 | gcmh-idle-delay 5 ;; old is 300 113 | ;; Don’t compact font caches during GC. 114 | inhibit-compacting-font-caches t 115 | gc-cons-percentage 0.1)) 116 | 117 | (use-package subr-x 118 | :straight nil 119 | :defer t) 120 | 121 | ;; Define directories 122 | (eval-and-compile 123 | (defvar home-directory (getenv "HOME") 124 | "User $HOME.") 125 | 126 | (defvar sumibi-root (file-truename user-emacs-directory) 127 | "Root of the sumibi.") 128 | 129 | (defvar sumibi-dir (concat sumibi-root "core/") 130 | "The main directory of sumibi-emacs configuration.")) 131 | 132 | ;; Don't load any other files besides this config 133 | (setq inhibit-default-init t 134 | ;; Set initial mode to text-mode instead of elisp 135 | initial-major-mode 'fundamental-mode) 136 | 137 | ;; Use Common Lisp library 138 | (use-package cl-lib :defer t) 139 | 140 | ;; Add configuration directories to `load-path' 141 | (setq load-path (append '("~/.emacs.d/core/" 142 | "~/.emacs.d/visuals/" 143 | "~/.emacs.d/packages" 144 | "~/.emacs.d/user") 145 | load-path)) 146 | 147 | ;; Remove command line options that aren't relevant to our current OS; means 148 | ;; slightly less to process at startup. 149 | (unless *IS-MAC* (setq command-line-ns-option-alist nil)) 150 | (unless *IS-LINUX* (setq command-line-x-option-alist nil)) 151 | 152 | ;; Custom file 153 | (setq custom-file (concat user-emacs-directory "/visuals/custom.el")) 154 | (when (file-exists-p custom-file) 155 | (load custom-file t t)) 156 | 157 | ;; Here we go 158 | (defmacro sumibi/init (&rest body) 159 | (declare (indent defun)) 160 | (let ((gc-cons-threshold most-positive-fixnum)) 161 | (add-to-list 'body 'env-fun t) 162 | (dolist (pkg body) 163 | (require pkg nil t)))) 164 | 165 | (require 'sumibi-settings) 166 | 167 | (provide 'sumibi) 168 | -------------------------------------------------------------------------------- /early-init.el: -------------------------------------------------------------------------------- 1 | ;;; early-init.el -*- lexical-binding: t; -*- 2 | 3 | ;;; Garbage Collector 4 | (setq gc-cons-threshold most-positive-fixnum 5 | gc-cons-percentage 0.6) 6 | 7 | (add-hook 'emacs-startup-hook 8 | (lambda () 9 | (setq gc-cons-threshold 100000000 10 | gc-cons-percentage 0.1))) 11 | 12 | (setq read-process-output-max (* 1024 1024)) 13 | 14 | ;; In Emacs 27+, package initialization occurs before `user-init-file' is 15 | ;; loaded, but after `early-init-file'. But sumibi always load it! 16 | (setq package-enable-at-startup nil) 17 | 18 | (setq tool-bar-mode nil 19 | menu-bar-mode nil) 20 | (when (fboundp 'set-scroll-bar-mode) 21 | (set-scroll-bar-mode nil)) 22 | 23 | ;; Resizing the Emacs frame can be a terribly expensive part of changing the 24 | ;; font. By inhibiting this, we easily halve startup times with fonts that are 25 | ;; larger than the system default. 26 | (setq frame-inhibit-implied-resize t) 27 | 28 | ;; Stop emacs beeps 29 | (setq ring-bell-function 'ignore) 30 | 31 | ;; Stop creating annoying ## files 32 | (setq auto-save-default nil) 33 | 34 | 35 | -------------------------------------------------------------------------------- /init.el: -------------------------------------------------------------------------------- 1 | ;; sumibi -*- lexical-binding: t; -*- 2 | (require 'sumibi 3 | (concat user-emacs-directory "core/sumibi")) 4 | 5 | 6 | ;; packages 7 | (sumibi/init 8 | +sumibi-theme 9 | +numbers 10 | +parentheses 11 | +company 12 | +buffer-move 13 | +screenshot 14 | +ctrls 15 | +elcord 16 | +clojure 17 | +nix 18 | +lua 19 | +flycheck 20 | +latex 21 | +c 22 | ;;+guile 23 | ;;+cl 24 | ;;+parinfer 25 | ) 26 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | 663 | NOTE: This license also applies for: previus, current and future commits. 664 | -------------------------------------------------------------------------------- /packages/+buffer-move.el: -------------------------------------------------------------------------------- 1 | (use-package buffer-move 2 | :config 3 | (setq buffer-move-stay-after-swap t) 4 | (setq buffer-move-behavior 'move) 5 | :bind 6 | (("" . buf-move-up) 7 | ("" . buf-move-down) 8 | ("" . buf-move-left) 9 | ("" . buf-move-right))) 10 | 11 | (use-package windmove 12 | :bind 13 | (("M-" . windmove-up) 14 | ("M-" . windmove-down) 15 | ("M-" . windmove-left) 16 | ("M-" . windmove-right))) 17 | 18 | (provide '+buffer-move) 19 | -------------------------------------------------------------------------------- /packages/+c.el: -------------------------------------------------------------------------------- 1 | ;; c/c++ -*- lexical-binding: t; -*- 2 | 3 | ; --- C and C++ 4 | (straight-use-package 5 | '(cmake-mode 6 | :host github 7 | :repo "emacsmirror/cmake-mode" 8 | :files (:defaults "*"))) 9 | 10 | (use-package cuda-mode) 11 | (use-package demangle-mode) 12 | (use-package disaster) 13 | (use-package glsl-mode) 14 | (use-package modern-cpp-font-lock) 15 | (use-package opencl-mode) 16 | 17 | (provide '+c) 18 | -------------------------------------------------------------------------------- /packages/+cl.el: -------------------------------------------------------------------------------- 1 | ;; common-lisp.el -*- lexical-binding: t; -*- 2 | ; 3 | -- SLY specifics 4 | (use-package sly 5 | :hook (lisp-mode-local-vars . sly-editing-mode) 6 | :custom 7 | (inferior-lisp-program "sbcl") ; SBCL Rocks 8 | (sly-command-switch-to-existing-lisp 'always) 9 | (sly-ignore-protocol-mismatches t) 10 | (sly-kill-without-query-p t) 11 | (sly-mrepl-history-file-name 12 | (expand-file-name ".sly-mrepl-history" (expand-file-name ".cache" user-emacs-directory))) 13 | (sly-net-coding-system 'utf-8-unix) 14 | :config 15 | (setq sly-kill-without-query-p t 16 | sly-net-coding-system 'utf-8-unix 17 | sly-complete-symbol-function 'sly-simple-completions) 18 | 19 | ;; From: https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/common-lisp 20 | (defun +common-lisp--cleanup-sly-maybe-h () 21 | "Kill processes and leftover buffers when killing the last sly buffer." 22 | (unless (cl-loop for buf in (delq (current-buffer) (buffer-list)) 23 | if (and (buffer-local-value 'sly-mode buf) 24 | (get-buffer-window buf)) 25 | return t) 26 | (dolist (conn (sly--purge-connections)) 27 | (sly-quit-lisp-internal conn 'sly-quit-sentinel t)) 28 | (let (kill-buffer-hook kill-buffer-query-functions) 29 | (mapc #'kill-buffer 30 | (cl-loop for buf in (delq (current-buffer) (buffer-list)) 31 | if (buffer-local-value 'sly-mode buf) 32 | collect buf))))) 33 | (add-hook 'sly-mode-hook 34 | (lambda () 35 | (unless (sly-connected-p) 36 | (save-excursion (sly))) 37 | (add-hook 'kill-buffer-hook #'+common-lisp--cleanup-sly-maybe-h nil t))) 38 | 39 | (defun kill-sly-buffers () 40 | (interactive) 41 | (dolist (buffer (buffer-list)) 42 | (when (or (eql (string-match "\\*sly" (buffer-name buffer)) 0) 43 | (eql (string-match " \\*sly" (buffer-name buffer)) 0)) 44 | (kill-buffer buffer))) 45 | t) 46 | 47 | (defun kill-sly-buffers-on-close (process) 48 | (my/kill-sly-buffers))) 49 | 50 | (eval-after-load 'sly 51 | `(define-key sly-prefix-map (kbd "M-h") 'sly-documentation-lookup)) 52 | 53 | (use-package sly-asdf 54 | :after (sly) 55 | :bind (:map sly-mode-map 56 | ("C-c L" . my/load-current-system-or-ask)) 57 | :defer nil 58 | :config 59 | (defun my/load-current-system-or-ask () 60 | (interactive) 61 | (if (sly-connected-p) 62 | (sly-asdf-load-system (or (sly-asdf-find-current-system) (sly-asdf-read-system-name))) 63 | (message "Not connected."))) 64 | 65 | (define-advice sly-asdf-read-system-name (:around (orig-function &optional prompt default-value) 66 | my/sly-asdf-read-system-name-prefer-history) 67 | (funcall orig-function prompt (or default-value (car sly-asdf-system-history) (sly-asdf-find-current-system))))) 68 | 69 | (use-package sly-macrostep 70 | :after (sly)) 71 | 72 | (use-package sly-named-readtables 73 | :after (sly)) 74 | 75 | (use-package sly-repl-ansi-color ; Colors in the SLY REPL 76 | :defer t 77 | :init 78 | (add-to-list 'sly-contribs 'sly-repl-ansi-color)) 79 | 80 | (provide '+cl) 81 | -------------------------------------------------------------------------------- /packages/+clojure.el: -------------------------------------------------------------------------------- 1 | ;;; clojure.el -*- lexical-binding: t; -*- 2 | 3 | ;; -- Clojure - a dialect of Lisp 4 | (use-package flycheck-clj-kondo) 5 | (use-package clojure-mode 6 | :config 7 | (require 'flycheck-clj-kondo)) 8 | (use-package clojure-mode-extra-font-locking) 9 | (use-package cider) 10 | 11 | ;; Use clojure mode for other extensions 12 | (add-to-list 'auto-mode-alist '("\\.edn$" . clojure-mode)) 13 | (add-to-list 'auto-mode-alist '("\\.boot$" . clojure-mode)) 14 | (add-to-list 'auto-mode-alist '("\\.cljs.*$" . clojure-mode)) 15 | (add-to-list 'auto-mode-alist '("lein-env" . enh-ruby-mode)) 16 | 17 | ;; -- `CIDER' specifics 18 | (add-hook 'cider-mode-hook 'eldoc-mode) ; Minibuffer documentation for the code you're typing into the repl 19 | (setq cider-repl-pop-to-buffer-on-connect t) ; Go right to the REPL buffer when it's finished connecting 20 | (setq cider-show-error-buffer nil) ; When there's a cider error, show its buffer and switch to it 21 | (setq cider-repl-display-help-banner nil) ; Help banner 22 | 23 | (eval-after-load 'cider 24 | '(progn 25 | (define-key clojure-mode-map (kbd "C-c C-v") 'cider-start-http-server) 26 | (define-key clojure-mode-map (kbd "C-M-r") 'cider-refresh) 27 | (define-key clojure-mode-map (kbd "C-c u") 'cider-user-ns) 28 | (define-key cider-mode-map (kbd "C-c u") 'cider-user-ns))) 29 | 30 | (defun cider-start-http-server () 31 | (interactive) 32 | (cider-load-current-buffer) 33 | (let ((ns (cider-current-ns))) 34 | (cider-repl-set-ns ns) 35 | (cider-interactive-eval (format "(println '(def server (%s/start))) (println 'server)" ns)) 36 | (cider-interactive-eval (format "(def server (%s/start)) (println server)" ns)))) 37 | 38 | (defun cider-refresh () 39 | (interactive) 40 | (cider-interactive-eval (format "(user/reset)"))) 41 | 42 | (defun cider-user-ns () 43 | (interactive) 44 | (cider-repl-set-ns "user")) 45 | 46 | (provide '+clojure) 47 | -------------------------------------------------------------------------------- /packages/+company.el: -------------------------------------------------------------------------------- 1 | ;; company.el -*- lexical-binding: t; -*- 2 | 3 | (use-package company 4 | :hook 5 | (prog-mode . company-mode) 6 | :custom 7 | (company-idle-delay 0.2) 8 | (company-tooltip-limit 14) 9 | (company-tooltip-align-annotations t) 10 | (company-minimum-prefix-length 1) 11 | (company-selection-wrap-around t) 12 | (company-backends '(company-capf)) 13 | (company-format-margin-function nil)) 14 | 15 | (use-package prescient 16 | :defer 1 17 | :config 18 | (prescient-persist-mode 1)) 19 | 20 | (provide '+company) 21 | -------------------------------------------------------------------------------- /packages/+ctrls.el: -------------------------------------------------------------------------------- 1 | ;;; ctrls.el -*- lexical-binding: t; -*- 2 | 3 | (straight-use-package 'ctrlf) 4 | (ctrlf-mode +1) 5 | 6 | (provide '+ctrls) 7 | -------------------------------------------------------------------------------- /packages/+elcord.el: -------------------------------------------------------------------------------- 1 | ;; Elcord -*- lexical-binding: t; -*- 2 | 3 | (defun sumibi/elcord-buffer-details-format () 4 | "Return the buffer details string shown on discord." 5 | (format "%s" (buffer-name))) 6 | 7 | (use-package elcord 8 | :config 9 | (setq elcord-mode-icon-alist '((dashboard-mode . "elisp-mode_icon") 10 | (fundamental-mode . "elisp-mode_icon") 11 | (c-mode . "c-mode_icon") 12 | (c++-mode . "c_-mode_icon") 13 | (crystal-mode . "crystal-mode_icon") 14 | (clojure-mode . "clojure-mode_icon") 15 | (css-mode . "css-mode_icon") 16 | (dired-mode . "elisp-mode_icon") 17 | (emacs-lisp-mode . "elisp-mode_icon") 18 | (eshell-mode . "elisp-mode_icon") 19 | (haskell-mode . "haskell-mode_icon") 20 | (haxe-mode . "haxe-mode_icon") 21 | (haskell-interactive-mode . "haskell-mode_icon") 22 | (js-mode . "javascript-mode_icon") 23 | (magit-mode . "magit-mode_icon") 24 | (markdown-mode . "markdown-mode_icon") 25 | (nixos-mode . "nixos-mode_icon") 26 | (latex-mode . "latex-mode_icon") 27 | (text-mode . "elisp-mode_icon") 28 | (org-mode . "org-mode_icon") 29 | ("^slime-.*" . "lisp-mode_icon") 30 | ("^sly-.*$" . "lisp-mode_icon") 31 | (typescript-mode . "typescript-mode_icon") 32 | (writer-mode . "org-mode_icon") 33 | (term-mode . "x-mode_icon") 34 | (shell-mode . "x-mode_icon") 35 | (vterm-mode . "x-mode_icon"))) 36 | (setq elcord-client-id "930189119437549648") 37 | (setq elcord-quiet nil 38 | elcord-editor-icon "elisp-mode_icon" 39 | elcord-buffer-details-format-function 'sumibi/elcord-buffer-details-format 40 | elcord-display-buffer-details t 41 | elcord-display-elapsed nil 42 | elcord-show-small-icon nil 43 | elcord-use-major-mode-as-main-icon t 44 | elcord-refresh-rate 0.25)) 45 | 46 | (elcord-mode) 47 | 48 | (provide '+elcord) 49 | -------------------------------------------------------------------------------- /packages/+flycheck.el: -------------------------------------------------------------------------------- 1 | ;; Flycheck -*- lexical-binding: t; -*- 2 | 3 | (use-package flycheck 4 | :hook (prog-mode . global-flycheck-mode) 5 | :config 6 | (setq flycheck-global-modes '(not LaTeX-mode latex-mode lisp-mode emacs-lisp-mode))) 7 | 8 | (provide '+flycheck) 9 | -------------------------------------------------------------------------------- /packages/+guile.el: -------------------------------------------------------------------------------- 1 | ;; guile -*- lexical-binding: t; -*- 2 | 3 | (use-package geiser-guile) 4 | 5 | (provide '+guile) 6 | -------------------------------------------------------------------------------- /packages/+latex.el: -------------------------------------------------------------------------------- 1 | ;; -- Latex -*- lexical-binding: t; -*- 2 | 3 | (use-package auctex 4 | :defer t 5 | :ensure auctex 6 | :config 7 | (setq TeX-auto-save t)) 8 | 9 | ;; Utils for LaTeX 10 | (use-package adaptive-wrap) 11 | (use-package latex-preview-pane) 12 | 13 | (defun sumibi/toggle-latex-preview-pane-mode () 14 | "Toggle the panel when using LaTeX" 15 | (interactive) 16 | (latex-preview-pane-mode 'toggle)) 17 | 18 | (global-set-key (kbd "C-q") 'sumibi/toggle-latex-preview-pane-mode) 19 | 20 | (setq doc-view-continuous t) ; To have continuous scrolling in the preview-pane 21 | 22 | (provide '+latex) 23 | -------------------------------------------------------------------------------- /packages/+lua.el: -------------------------------------------------------------------------------- 1 | ;; lua -*- lexical-binding: t; -*- 2 | 3 | ; --- LUA - roblox moment (just kidding) 4 | (straight-use-package 5 | '(lua-mode 6 | :host github 7 | :repo "immerrr/lua-mode")) 8 | 9 | (provide '+lua) 10 | -------------------------------------------------------------------------------- /packages/+nix.el: -------------------------------------------------------------------------------- 1 | ;;; nix.el -*- lexical-binding: t; -*- 2 | 3 | ;; -- Just for nixos 4 | (use-package nix-mode 5 | :mode "\\.nix\\'") 6 | 7 | (provide '+nix) 8 | -------------------------------------------------------------------------------- /packages/+numbers.el: -------------------------------------------------------------------------------- 1 | ;;; numbers.el -*- lexical-binding: t; -*- 2 | 3 | (use-package highlight-numbers 4 | :hook (prog-mode . highlight-numbers-mode)) 5 | 6 | (provide '+numbers) 7 | -------------------------------------------------------------------------------- /packages/+parentheses.el: -------------------------------------------------------------------------------- 1 | ;; visuals.el -*- lexical-binding: t; -*- 2 | 3 | (straight-use-package 4 | '(ct 5 | :host github 6 | :repo "neeasade/ct.el" 7 | :branch "master")) 8 | 9 | (use-package rainbow-mode) 10 | 11 | (use-package rainbow-delimiters 12 | :hook (prog-mode . rainbow-delimiters-mode)) 13 | 14 | (straight-use-package 15 | '(ws-butler 16 | :hook (after-init . ws-butler-global-mode) 17 | :host github 18 | :repo "hlissner/ws-butler" 19 | :branch "master" 20 | :config 21 | (setq ws-butler-keep-whitespace-before-point nil))) 22 | 23 | (provide '+parentheses) 24 | -------------------------------------------------------------------------------- /packages/+parinfer.el: -------------------------------------------------------------------------------- 1 | ;; Parinfer -*- lexical-binding: t; -*- 2 | 3 | (use-package parinfer-rust-mode 4 | :hook (prog-mode . parinfer-rust-mode) 5 | :config 6 | (setq parinfer-rust-auto-download t) 7 | (electric-indent-mode +1)) 8 | 9 | (provide '+parinfer) 10 | -------------------------------------------------------------------------------- /packages/+screenshot.el: -------------------------------------------------------------------------------- 1 | ;; screenshot -*- lexical-binding: t; -*- 2 | 3 | (straight-use-package 4 | '(screenshot 5 | :host github 6 | :repo "Jimmysit0/screenshot" 7 | :branch "master")) 8 | 9 | (use-package transient) 10 | (use-package posframe) 11 | 12 | (provide '+screenshot) 13 | -------------------------------------------------------------------------------- /packages/+visuals.el: -------------------------------------------------------------------------------- 1 | ;; visuals.el -*- lexical-binding: t; -*- 2 | 3 | (straight-use-package 4 | '(ct 5 | :host github 6 | :repo "neeasade/ct.el" 7 | :branch "master")) 8 | 9 | (use-package rainbow-mode) 10 | 11 | (use-package rainbow-delimiters 12 | :hook (prog-mode . rainbow-delimiters-mode)) 13 | 14 | (straight-use-package 15 | '(ws-butler 16 | :hook (after-init . ws-butler-global-mode) 17 | :host github 18 | :repo "hlissner/ws-butler" 19 | :branch "master" 20 | :config 21 | (setq ws-butler-keep-whitespace-before-point nil))) 22 | 23 | (provide '+visuals) 24 | -------------------------------------------------------------------------------- /readme.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Sumibi 2 | 3 | * Preview [[https://i.ibb.co/rpSPY8h/emcas.png]] 4 | 5 | * What's this? 6 | This is my personal Emacs config based on [[https://github.com/ogdenwebb/snug-emacs][snug-emacs]] and [[https://github.com/rougier/nano-emacs][nano-emacs]]. 7 | 8 | * Dependencies 9 | You need the Codelia & Fira Code fonts. 10 | 11 | You also need [[https://www.gnu.org/software/emacs/][Emacs]] (Both 27.x and 28.x work.), but that's pretty obvious isn't it? 12 | 13 | * Install 14 | Move all the files to an entirely clean ~/.emacs.d 15 | 16 | * Shortcuts 17 | 18 | #+BEGIN_SRC 19 | [M-w] Copy 20 | [C-y] Paste 21 | [C-/] Undo 22 | [C-s] Search 23 | [M-x] Command 24 | [C-g] Cancel 25 | [C-x C-c] Quit 26 | 27 | [C-x d] Dired 28 | [C-x C-f] Search files 29 | [C-x s] Save Buffer 30 | [C-x w] Write Buffer 31 | [C-x <-] Move between buffers (left) 32 | [C-x ->] Move between buffers (right) 33 | [C-x 1] Unfocus the other buffers 34 | [C-x 2] Split Window below 35 | [C-x 3] Split Window Right 36 | 37 | [M-:] Eval 38 | 39 | [C-q] LaTeX toogle panel 40 | 41 | [C-c C-k] Eval buffer (Clojure) 42 | #+END_SRC 43 | -------------------------------------------------------------------------------- /user/sumibi-bindings.el: -------------------------------------------------------------------------------- 1 | ;;; bindings -*- lexical-binding: t; -*- 2 | 3 | ;; Kill current buffer (instead of asking first buffer name) 4 | (global-set-key (kbd "C-x k") 'kill-current-buffer) 5 | 6 | ;; M-n for new frame (M-n is unbound in vanilla emacs) 7 | (defun new-frame () 8 | (interactive) 9 | (select-frame (make-frame)) 10 | (switch-to-buffer "*scratch*")) 11 | (global-set-key (kbd "M-n") 'new-frame) 12 | (global-set-key (kbd "M-`") 'other-frame) 13 | 14 | ;; M-return for frame maximization toggle 15 | (global-set-key (kbd "") 'toggle-frame-maximized) 16 | (with-eval-after-load 'org 17 | (define-key org-mode-map (kbd "") 'toggle-frame-maximized)) 18 | 19 | ;; Close frame if not the last, kill emacs else 20 | (defun sumibi--delete-frame-or-kill-emacs () 21 | "Delete frame or kill Emacs if there is only one frame." 22 | (interactive) 23 | (if (> (length (frame-list)) 1) 24 | (delete-frame) 25 | (save-buffers-kill-terminal))) 26 | (global-set-key (kbd "C-x C-c") 'sumibi--delete-frame-or-kill-emacs) 27 | 28 | (provide 'sumibi-bindings) 29 | 30 | -------------------------------------------------------------------------------- /user/sumibi-command.el: -------------------------------------------------------------------------------- 1 | ;;; mnml command interface -*- lexical-binding: t; -*- 2 | 3 | (define-minor-mode sumibi-command-mode 4 | "sumibi command mode" 5 | :keymap (make-sparse-keymap)) 6 | 7 | (defface sumibi-face-command nil 8 | "Face for the whole header line command" 9 | :group 'sumibi) 10 | 11 | (defface sumibi-face-command-prompt nil 12 | "Face for header line command prompt" 13 | :group 'sumibi) 14 | 15 | (defface sumibi-face-command-cursor nil 16 | "Face for header line command cursor" 17 | :group 'sumibi) 18 | 19 | (set-face-attribute 'sumibi-face-command nil 20 | :foreground sumibi-color-foreground 21 | :background sumibi-color-subtle 22 | :box `(:line-width 1 23 | :color ,sumibi-color-foreground 24 | :style nil) 25 | :inherit nil) 26 | 27 | (set-face-attribute 'sumibi-face-command-prompt nil 28 | :inherit 'sumibi-face-strong 29 | :foreground sumibi-color-background 30 | :background sumibi-color-foreground 31 | :box `(:line-width 1 32 | :color ,sumibi-color-foreground 33 | :style nil)) 34 | 35 | (set-face-attribute 'sumibi-face-command-cursor nil 36 | :foreground sumibi-color-background 37 | :background sumibi-color-foreground) 38 | 39 | (defvar sumibi-command--slave nil 40 | "Slave buffer displaying the command.") 41 | 42 | (defvar sumibi-command--master "*sumibi-command*" 43 | "Master buffer recording keystrokes.") 44 | 45 | (defvar sumibi-command--cookie nil 46 | "Cookie returned by face-remap-add-relative.") 47 | 48 | (defun sumibi-command--update () 49 | "This function makes sure the content of the master buffer is copied 50 | to the slave buffer header line and cursor stays on first line." 51 | 52 | ;; Makes sure cursor stays on first line 53 | (with-current-buffer sumibi-command--master 54 | (let ((eol (save-excursion (goto-char (point-min)) (point-at-eol)))) 55 | (if (> (point) eol) (goto-char eol)))) 56 | 57 | ;; Update slave header line 58 | (with-current-buffer sumibi-command--slave 59 | (force-mode-line-update nil))) 60 | 61 | 62 | (defun sumibi-command--check-focus (&rest args) 63 | "This function check if the maste buffer has focus. 64 | If not, it closes sumibi command." 65 | 66 | (if (not (eq (selected-window) 67 | (get-buffer-window sumibi-command--master))) 68 | (sumibi-command--close))) 69 | 70 | (defun sumibi-command--close () 71 | "Close sumibi command" 72 | 73 | (interactive) 74 | 75 | ;; Remove advice 76 | (advice-remove #'select-window #'sumibi-command--check-focus) 77 | 78 | ;; Close master window 79 | (when (window-live-p (get-buffer-window sumibi-command--master)) 80 | (delete-window (get-buffer-window sumibi-command--master))) 81 | 82 | ;; Kill master buffer 83 | (when (get-buffer sumibi-command--master) 84 | (kill-buffer sumibi-command--master)) 85 | 86 | ;; Restore slave to normal state 87 | (with-selected-window (get-buffer-window sumibi-command--slave) 88 | (kill-local-variable 'header-line-format) 89 | (face-remap-remove-relative sumibi-command--cookie)) 90 | 91 | ;; Update mode lines 92 | (force-mode-line-update t)) 93 | 94 | 95 | (defun sumibi-command (&optional prompt callback content information) 96 | 97 | ;; Cannot open sumibi command while in minibuffer 98 | (when (minibufferp) 99 | (error "Cannot open sumibi command while in minibuffer")) 100 | 101 | ;; Cannot open sumibi command while in sumibi command 102 | (when (eq (current-buffer) (get-buffer sumibi-command--master)) 103 | (error "Cannot open sumibi command while in mini command")) 104 | 105 | ;; Kill the master buffer & window if openened (not strictly necessary) 106 | (when (window-live-p (get-buffer-window sumibi-command--master)) 107 | (delete-window (get-buffer-window sumibi-command--master)) 108 | (kill-buffer sumibi-command--master)) 109 | 110 | ;; Save the slave buffer 111 | (setq sumibi-command--slave (current-buffer)) 112 | 113 | ;; Install sumibi face command in the slave buffer 114 | (setq sumibi-command--cookie 115 | (face-remap-add-relative 'header-line 'sumibi-face-command)) 116 | 117 | ;; Create master buffer by splitting slave buffer 118 | (let ((window-min-height 1) 119 | (window-safe-min-height 1) 120 | (window-resize-pixelwise t) 121 | (split-window-keep-point t)) 122 | (with-selected-window (split-window-vertically -2) 123 | (switch-to-buffer (get-buffer-create sumibi-command--master)) 124 | (erase-buffer) 125 | (org-mode) 126 | (sumibi-command-mode) 127 | (if content (insert content)) 128 | (insert "\n") 129 | (insert "-") 130 | 131 | ;; This tries to hide most of the master window 132 | (goto-char (point-min)) 133 | (overlay-put (make-overlay (point-at-bol) (+ (point-at-eol) 1)) 134 | 'face '(:height 10)) 135 | (setq cursor-type nil) 136 | 137 | (setq header-line-format nil) 138 | (setq mode-line-format nil) 139 | (face-remap-add-relative 'default `(:foreground ,sumibi-color-background)) 140 | (face-remap-add-relative 'region `(:background ,sumibi-color-background)) 141 | (fit-window-to-buffer) 142 | (setq window-size-fixed t) 143 | 144 | ;; History 145 | ;; (goto-char (point-max)) 146 | ;; (insert "history-item-1 history-item-2 history-item-3") 147 | ;; (goto-char (point-min)) 148 | )) 149 | 150 | 151 | ;; Install header line in master buffer 152 | (setq header-line-format 153 | (list 154 | 155 | ;; Prompt + one space 156 | (propertize " " 'face 'sumibi-face-command-prompt 157 | 'display `(raise -0.20)) 158 | (propertize (or prompt "M-x") 'face 'sumibi-face-command-prompt) 159 | (propertize " " 'face 'sumibi-face-command-prompt 160 | 'display `(raise +0.15)) 161 | (propertize " " ) 162 | 163 | ;; Input (copied from master). we need to add a space at end 164 | ;; of content to be able to show cursor when it is at the end 165 | ;; of the line. 166 | `(:eval 167 | (let* ((content (with-current-buffer sumibi-command--master 168 | (save-excursion (goto-char (point-min)) 169 | (buffer-substring (point-at-bol) (point-at-eol))))) 170 | (content (cond ((> (length content) 0) 171 | (concat content " ")) 172 | ((> (length ,information) 0) 173 | (propertize ,information 'face 'sumibi-face-faded)) 174 | (t " "))) 175 | (point (with-current-buffer sumibi-command--master (point))) 176 | (region (with-current-buffer sumibi-command--master (region-active-p)))) 177 | 178 | ;; Cursor 179 | (put-text-property (- point 1) point 180 | 'face 'sumibi-face-command-cursor content) 181 | ;; Region 182 | (if region 183 | (let ((beg (with-current-buffer sumibi-command--master (region-beginning))) 184 | (end (with-current-buffer sumibi-command--master (region-end)))) 185 | (put-text-property (- beg 1) (- end 1) 186 | 'face `(:foreground ,sumibi-color-background 187 | :background ,sumibi-color-faded) content))) 188 | content)))) 189 | 190 | ;; Install key bindings 191 | (with-current-buffer sumibi-command--master 192 | (add-hook 'post-command-hook 'sumibi-command--update nil t) 193 | (define-key sumibi-command-mode-map (kbd "C-g") #'sumibi-command--close) 194 | (define-key sumibi-command-mode-map (kbd "") 195 | #'(lambda() (interactive) (dabbrev-expand nil))) 196 | 197 | (define-key sumibi-command-mode-map (kbd "") 198 | (lambda () 199 | (interactive) 200 | (let* ((content (with-current-buffer sumibi-command--master 201 | (save-excursion (goto-char (point-min)) 202 | (buffer-substring (point-at-bol) (point-at-eol)))))) 203 | (sumibi-command--close) 204 | (if callback (funcall callback content) 205 | (message content)))))) 206 | 207 | ;; Update mode lines and swicch to master buffer 208 | (sumibi-command--update) 209 | (select-window (get-buffer-window sumibi-command--master) t) 210 | (redisplay) 211 | 212 | ;; Advice after select window to check for focus 213 | (advice-add #'select-window :after #'sumibi-command--check-focus)) 214 | 215 | 216 | (defun sumibi-command-x () 217 | (interactive) 218 | (sumibi-command "M-x" #'sumibi-command-x-finalize "" "Enter command")) 219 | 220 | (defun sumibi-command-x-finalize (command) 221 | (interactive) 222 | (command-execute (intern command))) 223 | 224 | 225 | (defun sumibi-command-shell () 226 | (interactive) 227 | (sumibi-command ">_" #'sumibi-command-shell-finalize 228 | "" "Enter shell command")) 229 | 230 | (defun sumibi-command-shell-finalize (command) 231 | (interactive) 232 | (shell-command command) 233 | (switch-to-buffer "*Shell Command Output*")) 234 | 235 | (define-key global-map (kbd "M-x") #'sumibi-command-x) 236 | (define-key global-map (kbd "M-s") #'sumibi-command-shell) 237 | 238 | (provide 'sumibi-command) 239 | -------------------------------------------------------------------------------- /user/sumibi-defaults.el: -------------------------------------------------------------------------------- 1 | ;;; sumibi-defaults.el -*- lexical-binding: t; -*- 2 | 3 | ;; No startup screen 4 | (setq inhibit-startup-screen t) 5 | 6 | ;; No startup message 7 | (setq inhibit-startup-message t) 8 | (setq inhibit-startup-echo-area-message t) 9 | 10 | ;; No message in scratch buffer 11 | (setq initial-scratch-message nil) 12 | 13 | ;; No dialog box 14 | (setq use-dialog-box nil) 15 | 16 | ;; Highlight line 17 | (global-hl-line-mode +0) 18 | 19 | ;; Highlight matchin paren 20 | (show-paren-mode 1) 21 | (setq show-paren-delay 0) 22 | 23 | ;; Smooth-scrolling 24 | (setq redisplay-dont-pause t 25 | scroll-step 1 26 | scroll-conservatively 10000 27 | scroll-preserve-screen-position t 28 | mouse-wheel-scroll-amount '(1 ((shift) . 1)) 29 | mouse-wheel-progressive-speed nil 30 | jit-lock-defer-time 0) 31 | 32 | (setq undo-limit 80000000 ; Raise undo-limit to 80Mb 33 | auto-save-default t ; Nobody likes to loose work, I certainly don't 34 | inhibit-compacting-font-caches t ; When there are lots of glyphs, keep them in memory 35 | truncate-string-ellipsis "…") ; Unicode ellispis are nicer than "..." 36 | 37 | ;; No gui elements 38 | (menu-bar-mode 0) 39 | (tool-bar-mode 0) 40 | (blink-cursor-mode 0) 41 | 42 | (customize-set-variable 'scroll-bar-mode nil) 43 | (customize-set-variable 'horizontal-scroll-bar-mode nil) 44 | 45 | ;; No popup windows 46 | (setq pop-up-windows nil) 47 | 48 | ;; User name 49 | (setq user-full-name "Iz") 50 | 51 | ;; No empty line indicators 52 | (setq indicate-empty-lines nil) 53 | 54 | ;; No cursor in inactive windows 55 | (setq cursor-in-non-selected-windows nil) 56 | 57 | ;; No line break space points 58 | (setq auto-fill-mode nil) 59 | 60 | ;; Fill column at 80 61 | (setq fill-column 80) 62 | 63 | ;; No confirmation for visiting non-existent files 64 | (setq confirm-nonexistent-file-or-buffer nil) 65 | 66 | ;; Completion style, see 67 | ;; gnu.org/software/emacs/manual/html_node/emacs/Completion-Styles.html 68 | (setq completion-styles '(basic substring)) 69 | 70 | ;; Use RET to open org-mode links 71 | (setq org-return-follows-link t) 72 | 73 | ;; Pixel scroll (as opposed to char scrool) 74 | (pixel-scroll-mode t) 75 | 76 | ;; y/n for answering yes/no questions 77 | (fset 'yes-or-no-p 'y-or-n-p) 78 | 79 | ;; No tabs 80 | (setq-default indent-tabs-mode nil) 81 | 82 | ;; Tab.space equivalence 83 | (setq-default tab-width 4) 84 | 85 | ;; Size of temporary buffers 86 | (temp-buffer-resize-mode) 87 | (setq temp-buffer-max-height 8) 88 | 89 | ;; Minimum window height 90 | (setq window-min-height 1) 91 | 92 | ;; Kill term buffer when exiting 93 | (defadvice term-sentinel (around my-advice-term-sentinel (proc msg)) 94 | (if (memq (process-status proc) '(signal exit)) 95 | (let ((buffer (process-buffer proc))) 96 | ad-do-it 97 | (kill-buffer buffer)) 98 | ad-do-it)) 99 | (ad-activate 'term-sentinel) 100 | 101 | ;; Switch cursor to new window 102 | (defun split-and-follow-horizontally () 103 | (interactive) 104 | (split-window-below) 105 | (balance-windows) 106 | (other-window 1)) 107 | (global-set-key (kbd "C-x 2") 'split-and-follow-horizontally) 108 | 109 | (defun split-and-follow-vertically () 110 | (interactive) 111 | (split-window-right) 112 | (balance-windows) 113 | (other-window 1)) 114 | (global-set-key (kbd "C-x 3") 'split-and-follow-vertically) 115 | 116 | ;; ... 117 | (setq x-underline-at-descent-line t) 118 | 119 | ;; Vertical window divider 120 | (setq window-divider-default-right-width 24) 121 | (setq window-divider-default-places 'right-only) 122 | (window-divider-mode 1) 123 | 124 | ;; No ugly button for checkboxes 125 | (setq widget-image-enable nil) 126 | 127 | ;; Hide org markup for README 128 | (setq org-hide-emphasis-markers t) 129 | 130 | ;; Load splash screen 131 | (load-file (expand-file-name "./user/sumibi-splash.el" user-emacs-directory)) 132 | (show-splash) 133 | (setq initial-buffer-choice (lambda () (get-buffer-create "*splash*"))) 134 | 135 | (provide 'sumibi-defaults) 136 | -------------------------------------------------------------------------------- /user/sumibi-layout.el: -------------------------------------------------------------------------------- 1 | ;; sumibi-layout -*- lexical-binding: t; -*- 2 | 3 | (require 'disp-table) 4 | 5 | (setq default-frame-alist 6 | (append (list 7 | '(min-height . 1) 8 | '(height . 45) 9 | '(min-width . 1) 10 | '(width . 81) 11 | '(vertical-scroll-bars . nil) 12 | '(internal-border-width . 24) 13 | '(left-fringe . 1) 14 | '(right-fringe . 1) 15 | '(tool-bar-lines . 0) 16 | '(menu-bar-lines . 0)))) 17 | 18 | ;; Fall back font for glyph missing 19 | (defface fallback '((t :family "Fira Code" 20 | :inherit 'sumibi-face-faded)) "Fallback") 21 | (set-display-table-slot standard-display-table 'truncation 22 | (make-glyph-code ?… 'fallback)) 23 | (set-display-table-slot standard-display-table 'wrap 24 | (make-glyph-code ?↩ 'fallback)) 25 | 26 | (provide 'sumibi-layout) 27 | -------------------------------------------------------------------------------- /user/sumibi-splash.el: -------------------------------------------------------------------------------- 1 | ;; sumibi Splash -*- lexical-binding: t; -*- 2 | 3 | (defun show-splash () 4 | (get-buffer-create "*splash*") 5 | (interactive) 6 | (with-current-buffer "*splash*" 7 | (erase-buffer) 8 | (setq header-line-format nil) 9 | (setq mode-line-format nil) 10 | (setq cursor-type nil) 11 | (setq line-spacing 0) 12 | (setq vertical-scroll-bar nil) 13 | (setq horizontal-scroll-bar nil) 14 | (face-remap-add-relative 'link :underline nil) 15 | (let* ((selected-img (choose-image (expand-file-name "visuals/splash-img" user-emacs-directory)))) 16 | 17 | ;; top padding 18 | (insert-char ?\n 5) 19 | 20 | ;; center image horizontally with spaces 21 | (insert (propertize " " 'display 22 | `(space :align-to (+ center (-0.5 . ,(create-image selected-img)))))) 23 | (insert-image (create-image selected-img))) 24 | (insert-char ?\n 3) 25 | 26 | (let* ((splash-text (show-text))) 27 | (insert (propertize " " 'display 28 | `(space :align-to (+ center (-0.5 . ,(length splash-text)))))) 29 | (insert splash-text)) 30 | (insert "\n") 31 | ;;set read only mode 32 | (read-only-mode t) 33 | ;; jump to beginning of buffer 34 | (beginning-of-buffer) 35 | (goto-char 0) 36 | (local-set-key [t] 'sumibi-splash-kill))) 37 | 38 | (defun choose-image (img-dir) 39 | (let* ((files (directory-files img-dir t "^\\([^.]\\|\\.[^.]\\|\\.\\..\\)"))) 40 | (elt files (random (length files))))) 41 | 42 | (defun show-text () 43 | (propertize (format-message "!!!" 'face 'sumibi-face-faded))) 44 | 45 | (defun sumibi-splash-kill () 46 | "Kill the splash screen buffer (immediately)." 47 | (interactive) 48 | (if (get-buffer "*splash*") 49 | (progn (message nil) 50 | (kill-buffer "*splash*")))) 51 | 52 | (provide 'sumibi-splash) 53 | -------------------------------------------------------------------------------- /user/sumibi-writer.el: -------------------------------------------------------------------------------- 1 | ;; sumibi-writer -*- lexical-binding: t; -*- 2 | 3 | (require 'org) 4 | (require 'sumibi-base-colors) 5 | (require 'sumibi-faces) 6 | 7 | ;; 8 | ;; prefix 9 | ;; |<------>| 10 | 11 | ;; border -> |<------>| * Headline level 1 # Unnumbered 12 | ;; |<------>| 1 Headline level 1 # Numbered 13 | ;; 14 | ;; |<----->| ** Headline level 2 # Unnumbered 15 | ;; |<---->| 1.1 Headline level 2 # Numbered 16 | ;; 17 | ;; |<---->| *** Headline level 3 # Unumbered 18 | ;; |<-->| 1.1.1 Headline level 3 # Numbered 19 | ;; etc. 20 | ;; 21 | ;; This works if the number of sections at a given level is < 10. 22 | 23 | (defun writer-mode--num-format (numbering) 24 | "Alternative numbering format for org-num. 25 | First level: 1 | xxx 26 | Second level: 1.1 — xxx 27 | Third level: 1.1.1 - xxx 28 | etc. 29 | """ 30 | (if (= (length numbering) 1) 31 | (propertize (concat (mapconcat 32 | #'number-to-string 33 | numbering ".") " | " ) 34 | 'face `(:family "Codelia" 35 | :height 250 36 | :foreground ,sumibi-color-faded)) 37 | (propertize (concat (mapconcat 38 | #'number-to-string 39 | numbering ".") " — " ) 40 | 'face `(:family "Comic Code" 41 | :foreground ,sumibi-color-faded)))) 42 | 43 | ;; Specific face for headline stars 44 | (font-lock-add-keywords 'writer-mode 45 | '(("^*+ " 0 `(:family "Codelia" 46 | :height 140 47 | :foreground ,sumibi-color-faded) prepend) 48 | ) 'append) 49 | 50 | (defun writer-mode--compute-prefixes () 51 | "Compute prefix strings for regular text and headlines." 52 | 53 | (setq org-indent--heading-line-prefixes 54 | (make-vector org-indent--deepest-level nil)) 55 | (setq org-indent--inlinetask-line-prefixes 56 | (make-vector org-indent--deepest-level nil)) 57 | (setq org-indent--text-line-prefixes 58 | (make-vector org-indent--deepest-level nil)) 59 | 60 | (let* ((min-indent 5) 61 | (indent (+ 1 (seq-max 62 | (org-element-map 63 | (org-element-parse-buffer) 'headline 64 | #'(lambda (item) 65 | (org-element-property :level item)))))) 66 | (indent (max indent min-indent))) 67 | 68 | (dotimes (n org-indent--deepest-level) 69 | (aset org-indent--heading-line-prefixes n 70 | (make-string 71 | (min indent (max 0 (- indent 1 n))) ?\s)) 72 | (aset org-indent--inlinetask-line-prefixes n 73 | (make-string indent ?\s)) 74 | (aset org-indent--text-line-prefixes n 75 | (make-string indent ?\s))))) 76 | 77 | 78 | 79 | (define-derived-mode writer-mode org-mode "sumibi writer" 80 | 81 | ;; Faces 82 | (face-remap-add-relative 'org-level-1 83 | :overline sumibi-color-subtle 84 | :family "Comic Code" :height 180) 85 | (face-remap-add-relative 'org-level-2 86 | :family "Comic Code" :height 160) 87 | (face-remap-add-relative 'org-level-3 88 | :family "Comic Code" :height 150) 89 | (face-remap-add-relative 'org-document-info 90 | :inherit 'sumibi-face-faded) 91 | (face-remap-add-relative 'org-document-title 92 | :foreground sumibi-color-foreground 93 | :family "Captain Comic" 94 | :height 200 95 | :weight 'medium) 96 | ;; hide title / author ... keywords 97 | (setq-local org-hidden-keywords '(title author date startup)) 98 | 99 | ;; Header line 100 | (setq header-line-format nil) 101 | 102 | ;; Layout 103 | (setq fill-column 72) 104 | (setq-default line-spacing 1) 105 | 106 | ;; Indentation 107 | (setq org-startup-folded nil) 108 | (org-indent-mode) 109 | (setq org-level-color-stars-only nil) 110 | (setq org-hide-leading-stars nil) 111 | (advice-add 'org-indent--compute-prefixes :override 112 | #'writer-mode--compute-prefixes) 113 | 114 | ;; Numbering 115 | (setq org-num-skip-unnumbered t) 116 | (setq org-num-skip-footnotes t) 117 | (setq org-num-max-level 2) 118 | (setq org-num-face nil) 119 | (org-num-mode) 120 | (setq org-num-format-function 'writer-mode--num-format)) 121 | 122 | (provide 'sumibi-writer) 123 | -------------------------------------------------------------------------------- /visuals/+sumibi-theme.el: -------------------------------------------------------------------------------- 1 | ;; load-theme -*- lexical-binding: t; -*- 2 | 3 | (require 'sumibi-layout) 4 | 5 | (setq sumibi-font-family-monospaced "Codelia" 6 | sumibi-font-size 13) 7 | 8 | (add-to-list 'command-switch-alist '("--dark" . (lambda (args)))) 9 | (add-to-list 'command-switch-alist '("--light" . (lambda (args)))) 10 | 11 | (cond 12 | ((member "--default" command-line-args) t) 13 | ((member "--dark" command-line-args) (require 'sumibi-theme-dark)) 14 | (t (require 'sumibi-theme-light))) 15 | 16 | (require 'sumibi-faces) 17 | (sumibi-faces) 18 | 19 | (require 'sumibi-theme) 20 | (sumibi-theme) 21 | 22 | (require 'sumibi-modeline) 23 | (require 'sumibi-bindings) 24 | (require 'sumibi-defaults) 25 | (require 'sumibi-command) 26 | (require 'sumibi-writer) 27 | 28 | (provide '+sumibi-theme) 29 | -------------------------------------------------------------------------------- /visuals/custom.el: -------------------------------------------------------------------------------- 1 | ;;; custom.el -*- lexical-binding: t; -*- 2 | (custom-set-variables 3 | '(geiser-guile-binary "guile2.2") 4 | '(flycheck-check-syntax-automatically '(save mode-enabled))) 5 | -------------------------------------------------------------------------------- /visuals/splash-img/caet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jimmysit0/sumibi/009f0dc9cdae9ec2dcefd6b78ea35472274dc663/visuals/splash-img/caet.jpg -------------------------------------------------------------------------------- /visuals/sumibi-base-colors.el: -------------------------------------------------------------------------------- 1 | ;;; base-colors -*- lexical-binding: t; -*- 2 | 3 | (defgroup sumibi '() 4 | "Faces and colors for the sumibi emacs theme") 5 | 6 | ;; Derive our default color set from classic Emacs faces. 7 | ;; This allows dropping sumibi components into already themed Emacsen with varying 8 | ;; degrees of visual appeal. 9 | ;; 10 | ;; We memorize the default colorset in this var in order not to confuse 11 | ;; customize: the STANDARD argument of defcustom gets re-evaluated by customize 12 | ;; to determine if the current value is default or not. 13 | (defvar sumibi-base-colors--defaults 14 | `((foreground . ,(face-foreground 'default nil t)) 15 | (background . ,(face-background 'default nil t)) 16 | (highlight . ,(face-background 'fringe nil t)) 17 | (critical . ,(face-foreground 'error nil t)) 18 | (salient . ,(face-foreground 'font-lock-keyword-face nil t)) 19 | (strong . ,(face-foreground 'default nil t)) 20 | (popout . ,(face-foreground 'font-lock-string-face nil t)) 21 | (subtle . ,(face-background 'mode-line-inactive nil t)) 22 | (faded . ,(face-foreground 'shadow nil t)))) 23 | 24 | (defun sumibi-base-colors--get (name) 25 | "Get default color associated with symbol NAME." 26 | (cdr (assoc name sumibi-base-colors--defaults))) 27 | 28 | (defcustom sumibi-color-foreground (sumibi-base-colors--get 'foreground) 29 | "" 30 | :type 'color 31 | :group 'sumibi) 32 | 33 | (defcustom sumibi-color-background (sumibi-base-colors--get 'background) 34 | "" 35 | :type 'color 36 | :group 'sumibi) 37 | 38 | (defcustom sumibi-color-highlight (sumibi-base-colors--get 'highlight) 39 | "" 40 | :type 'color 41 | :group 'sumibi) 42 | 43 | (defcustom sumibi-color-critical (sumibi-base-colors--get 'critical) 44 | "" 45 | :type 'color 46 | :group 'sumibi) 47 | 48 | (defcustom sumibi-color-salient (sumibi-base-colors--get 'salient) 49 | "" 50 | :type 'color 51 | :group 'sumibi) 52 | 53 | (defcustom sumibi-color-strong (sumibi-base-colors--get 'strong) 54 | "" 55 | :type 'color 56 | :group 'sumibi) 57 | 58 | (defcustom sumibi-color-popout (sumibi-base-colors--get 'popout) 59 | "" 60 | :type 'color 61 | :group 'sumibi) 62 | 63 | (defcustom sumibi-color-subtle (sumibi-base-colors--get 'subtle) 64 | "" 65 | :type 'color 66 | :group 'sumibi) 67 | 68 | (defcustom sumibi-color-faded (sumibi-base-colors--get 'faded) 69 | "" 70 | :type 'color 71 | :group 'sumibi) 72 | 73 | (provide 'sumibi-base-colors) 74 | -------------------------------------------------------------------------------- /visuals/sumibi-colors.el: -------------------------------------------------------------------------------- 1 | ;; sumibi-colors -*- lexical-binding: t; -*- 2 | 3 | ;; See https://yeun.github.io/open-color/ 4 | (defconst open-colors 5 | '(("gray" . (list "#F8F9FA" "#F1F3F5" "#E9ECEF" "#DEE2E6" "#CED4DA" 6 | "#ADB5BD" "#868E96" "#495057" "#343A40" "#212529")) 7 | ("red" . (list "#FFF5F5" "#FFE3E3" "#FFC9C9" "#FFA8A8" "#FF8787" 8 | "#FF6B6B" "#FA5252" "#F03E3E" "#E03131" "#C92A2A")) 9 | ("pink" . (list "#FFF0F6" "#FFDEEB" "#FCC2D7" "#FAA2C1" "#F783AC" 10 | "#F06595" "#E64980" "#D6336C" "#C2255C" "#A61E4D")) 11 | ("grape" . (list "#F8F0FC" "#F3D9FA" "#EEBEFA" "#E599F7" "#DA77F2" 12 | "#CC5DE8" "#BE4BDB" "#AE3EC9" "#9C36B5" "#862E9C")) 13 | ("violet" . (list "#F3F0FF" "#E5DBFF" "#D0BFFF" "#B197FC" "#9775FA" 14 | "#845EF7" "#7950F2" "#7048E8" "#6741D9" "#5F3DC4")) 15 | ("indigo" . (list "#EDF2FF" "#DBE4FF" "#BAC8FF" "#91A7FF" "#748FFC" 16 | "#5C7CFA" "#4C6EF5" "#4263EB" "#3B5BDB" "#364FC7")) 17 | ("blue" . (list "#E7F5FF" "#D0EBFF" "#A5D8FF" "#74C0FC" "#4DABF7" 18 | "#339AF0" "#228BE6" "#1C7ED6" "#1971C2" "#1864AB")) 19 | ("cyan" . (list "#E3FAFC" "#C5F6FA" "#99E9F2" "#66D9E8" "#3BC9DB" 20 | "#22B8CF" "#15AABF" "#1098AD" "#0C8599" "#0B7285")) 21 | ("teal" . (list "#E6FCF5" "#C3FAE8" "#96F2D7" "#63E6BE" "#38D9A9" 22 | "#20C997" "#12B886" "#0CA678" "#099268" "#087F5B")) 23 | ("green" . (list "#EBFBEE" "#D3F9D8" "#B2F2BB" "#8CE99A" "#69DB7C" 24 | "#51CF66" "#40C057" "#37B24D" "#2F9E44" "#2B8A3E")) 25 | ("lime" . (list "#F4FCE3" "#E9FAC8" "#D8F5A2" "#C0EB75" "#A9E34B" 26 | "#94D82D" "#82C91E" "#74B816" "#66A80F" "#5C940D")) 27 | ("yellow" . (list "#FFF9DB" "#FFF3BF" "#FFEC99" "#FFE066" "#FFD43B" 28 | "#FCC419" "#FAB005" "#F59F00" "#F08C00" "#E67700")) 29 | ("orange" . (list "#FFF4E6" "#FFE8CC" "#FFD8A8" "#FFC078" "#FFA94D" 30 | "#FF922B" "#FD7E14" "#F76707" "#E8590C" "#D9480F" )))) 31 | 32 | (defun open-color (color) 33 | (interactive) 34 | (let ((hue (substring color 0 -2)) 35 | (level (string-to-number (substring color -1)))) 36 | (nth (+ 1 level) (cdr (assoc hue open-colors))))) 37 | 38 | 39 | 40 | ;; See https://material.io/design/color/the-color-system.html 41 | (defconst material-colors 42 | '(("red" . (list "#FFEBEE" "#FFCDD2" "#EF9A9A" "#E57373" "#EF5350" 43 | "#F44336" "#E53935" "#D32F2F" "#C62828" "#B71C1C")) 44 | ("pink" . (list "#FCE4EC" "#F8BBD0" "#F48FB1" "#F06292" "#EC407A" 45 | "#E91E63" "#D81B60" "#C2185B" "#AD1457" "#880E4F")) 46 | ("purple" . (list "#F3E5F5" "#E1BEE7" "#CE93D8" "#BA68C8" "#AB47BC" 47 | "#9C27B0" "#8E24AA" "#7B1FA2" "#6A1B9A" "#4A148C")) 48 | ("deep-purple" . (list "#EDE7F6" "#D1C4E9" "#B39DDB" "#9575CD" "#7E57C2" 49 | "#673AB7" "#5E35B1" "#512DA8" "#4527A0" "#311B92")) 50 | ("indigo" . (list "#E8EAF6" "#C5CAE9" "#9FA8DA" "#7986CB" "#5C6BC0" 51 | "#3F51B5" "#3949AB" "#303F9F" "#283593" "#1A237E")) 52 | ("blue" . (list "#E3F2FD" "#BBDEFB" "#90CAF9" "#64B5F6" "#42A5F5" 53 | "#2196F3" "#1E88E5" "#1976D2" "#1565C0" "#0D47A1")) 54 | ("light-blue" . (list "#E1F5FE" "#B3E5FC" "#81D4FA" "#4FC3F7" "#29B6F6" 55 | "#03A9F4" "#039BE5" "#0288D1" "#0277BD" "#01579B")) 56 | ("cyan" . (list "#E0F7FA" "#B2EBF2" "#80DEEA" "#4DD0E1" "#26C6DA" 57 | "#00BCD4" "#00ACC1" "#0097A7" "#00838F" "#006064")) 58 | ("teal" . (list "#E0F2F1" "#B2DFDB" "#80CBC4" "#4DB6AC" "#26A69A" 59 | "#009688" "#00897B" "#00796B" "#00695C" "#004D40")) 60 | ("green" . (list "#E8F5E9" "#C8E6C9" "#A5D6A7" "#81C784" "#66BB6A" 61 | "#4CAF50" "#43A047" "#388E3C" "#2E7D32" "#1B5E20")) 62 | ("light-green" . (list "#F1F8E9" "#DCEDC8" "#C5E1A5" "#AED581" "#9CCC65" 63 | "#8BC34A" "#7CB342" "#689F38" "#558B2F" "#33691E")) 64 | ("lime" . (list "#F9FBE7" "#F0F4C3" "#E6EE9C" "#DCE775" "#D4E157" 65 | "#CDDC39" "#C0CA33" "#AFB42B" "#9E9D24" "#827717")) 66 | ("yellow" . (list "#FFFDE7" "#FFF9C4" "#FFF59D" "#FFF176" "#FFEE58" 67 | "#FFEB3B" "#FDD835" "#FBC02D" "#F9A825" "#F57F17")) 68 | ("amber" . (list "#FFF8E1" "#FFECB3" "#FFE082" "#FFD54F" "#FFCA28" 69 | "#FFC107" "#FFB300" "#FFA000" "#FF8F00" "#FF6F00")) 70 | ("orange" . (list "#FFF3E0" "#FFE0B2" "#FFCC80" "#FFB74D" "#FFA726" 71 | "#FF9800" "#FB8C00" "#F57C00" "#EF6C00" "#E65100")) 72 | ("deep-orange" . (list "#FBE9E7" "#FFCCBC" "#FFAB91" "#FF8A65" "#FF7043" 73 | "#FF5722" "#F4511E" "#E64A19" "#D84315" "#BF360C")) 74 | ("brown" . (list "#EFEBE9" "#D7CCC8" "#BCAAA4" "#A1887F" "#8D6E63" 75 | "#795548" "#6D4C41" "#5D4037" "#4E342E" "#3E2723")) 76 | ("grey" . (list "#FAFAFA" "#F5F5F5" "#EEEEEE" "#E0E0E0" "#BDBDBD" 77 | "#9E9E9E" "#757575" "#616161" "#424242" "#212121")) 78 | ("blue-grey" . (list "#ECEFF1" "#CFD8DC" "#B0BEC5" "#90A4AE" "#78909C" 79 | "#607D8B" "#546E7A" "#455A64" "#37474F" "#263238")))) 80 | 81 | (defun material-color (color) 82 | (interactive) 83 | (let ((hue (substring color 0 -2)) 84 | (level (string-to-number (substring color -1)))) 85 | (nth (+ 1 level) (cdr (assoc hue material-colors))))) 86 | 87 | 88 | 89 | ;; See https://www.nordtheme.com/ 90 | (defconst nord-colors 91 | '( ("polar-night" . (list "#2E3440" "#3B4252" "#434C5E" "#4C566A")) 92 | ("snow-storm" . (list "#D8DEE9" "#E5E9F0" "#ECEFF4")) 93 | ("frost" . (list "#8FBCBB" "#88C0D0" "#81A1C1" "#5E81AC")) 94 | ("aurora" . (list "#BF616A" "#D08770" "#EBCB8B" "#A3BE8C" "#B48EAD")) 95 | ("nord" . (list "#2E3440" "#3B4252" "#434C5E" "#4C566A" 96 | "#D8DEE9" "#E5E9F0" "#ECEFF4" "#8FBCBB" 97 | "#88C0D0" "#81A1C1" "#5E81AC" "#BF616A" 98 | "#D08770" "#EBCB8B" "#A3BE8C" "#B48EAD")))) 99 | 100 | (defun nord-color (color) 101 | (interactive) 102 | (let ((hue (substring color 0 -2)) 103 | (level (string-to-number (substring color -1)))) 104 | (nth (+ 1 level) (cdr (assoc hue nord-colors))))) 105 | 106 | (provide 'sumibi-colors) 107 | 108 | -------------------------------------------------------------------------------- /visuals/sumibi-faces.el: -------------------------------------------------------------------------------- 1 | ;;; sumibi-faces --- Face settings for sumibi-emacs -*- lexical-binding: t; -*- 2 | 3 | (require 'sumibi-base-colors) 4 | 5 | (defcustom sumibi-font-family-monospaced "Roboto Mono" 6 | "Name of the font-family to use for sumibi. 7 | Defaults to Roboto Mono. Customizing this might lead to conflicts 8 | if the family does not have sufficient bold/light etc faces." 9 | :group 'sumibi 10 | :type 'string) 11 | 12 | (defcustom sumibi-font-family-proportional nil 13 | "Font to use for variable pitch faces. 14 | Setting this allows sumibi to display variable pitch faces when, 15 | for instance, 'variable-pitch-mode' or 'mixed-pitch-mode' is active in a buffer. 16 | Defaults to nil." 17 | :group 'sumibi 18 | :type 'string) 19 | 20 | (defcustom sumibi-font-size 14 21 | "Default value for the font size of sumibi-theme in pt units. 22 | Note: to change this after startup, call 23 | \(sumibi-faces\) and \(sumibi-themes\)." 24 | :group 'sumibi 25 | :type 'integer) 26 | 27 | ;; A theme is fully defined by these seven faces 28 | 29 | (defface sumibi-face-default nil 30 | "Default face is used for regular information." 31 | :group 'sumibi) 32 | 33 | (defface sumibi-face-variable-pitch nil 34 | "Default variable-pitch face is used for variable pitch mode." 35 | :group 'sumibi) 36 | 37 | (defface sumibi-face-critical nil 38 | "Critical face is for information that requires immediate action. 39 | It should be of high constrast when compared to other faces. This 40 | can be realized (for example) by setting an intense background 41 | color, typically a shade of red. It must be used scarcely." 42 | :group 'sumibi) 43 | 44 | (defface sumibi-face-popout nil 45 | "Popout face is used for information that needs attention. 46 | To achieve such effect, the hue of the face has to be 47 | sufficiently different from other faces such that it attracts 48 | attention through the popout effect." 49 | :group 'sumibi) 50 | 51 | (defface sumibi-face-strong nil 52 | "Strong face is used for information of a structural nature. 53 | It has to be the same color as the default color and only the 54 | weight differs by one level (e.g., light/regular or 55 | regular/bold). IT is generally used for titles, keywords, 56 | directory, etc." 57 | :group 'sumibi) 58 | 59 | (defface sumibi-face-salient nil 60 | "Salient face is used for information that are important. 61 | To suggest the information is of the same nature but important, 62 | the face uses a different hue with approximately the same 63 | intensity as the default face. This is typically used for links." 64 | :group 'sumibi) 65 | 66 | (defface sumibi-face-faded nil 67 | "Faded face is for information that are less important. 68 | It is made by using the same hue as the default but with a lesser 69 | intensity than the default. It can be used for comments, 70 | secondary information and also replace italic (which is generally 71 | abused anyway)." 72 | :group 'sumibi) 73 | 74 | (defface sumibi-face-subtle nil 75 | "Subtle face is used to suggest a physical area on the screen. 76 | It is important to not disturb too strongly the reading of 77 | information and this can be made by setting a very light 78 | background color that is barely perceptible." 79 | :group 'sumibi) 80 | 81 | (defface sumibi-face-region nil 82 | "Region face, used when we select something." 83 | :group 'sumibi) 84 | 85 | (defface sumibi-face-function nil 86 | "Highlight that functions receive." 87 | :group 'sumibi) 88 | 89 | (defface sumibi-face-comment nil 90 | "Highlight that comments receive." 91 | :group 'sumibi) 92 | 93 | (defface sumibi-face-header-default nil 94 | "Default face for ther header line." 95 | :group 'sumibi) 96 | 97 | (defface sumibi-face-header-critical nil 98 | "Critical face for ther header line." 99 | :group 'sumibi) 100 | 101 | (defface sumibi-face-header-popout nil 102 | "Popout face for ther header line." 103 | :group 'sumibi) 104 | 105 | (defface sumibi-face-header-strong nil 106 | "Strong face for ther header line." 107 | :group 'sumibi) 108 | 109 | (defface sumibi-face-header-salient nil 110 | "Salient face for ther header line." 111 | :group 'sumibi) 112 | 113 | (defface sumibi-face-header-faded nil 114 | "Faded face for ther header line." 115 | :group 'sumibi) 116 | 117 | (defface sumibi-face-header-subtle nil 118 | "Subtle face for ther header line." 119 | :group 'sumibi) 120 | 121 | (defface sumibi-face-header-highlight nil 122 | "Highlight face for ther header line." 123 | :group 'sumibi) 124 | 125 | (defface sumibi-face-header-separator nil 126 | "Face for separating item in the header line (internal use)" 127 | :group 'sumibi) 128 | 129 | (defface sumibi-face-header-filler nil 130 | "Face compsenting spaces in the header line (internal use) " 131 | :group 'sumibi) 132 | 133 | (defface sumibi-face-tag-default nil 134 | "Default face for tags" 135 | :group 'sumibi) 136 | 137 | (defface sumibi-face-tag-faded nil 138 | "Faded face for tags" 139 | :group 'sumibi) 140 | 141 | (defface sumibi-face-tag-strong nil 142 | "Strong face for tags" 143 | :group 'sumibi) 144 | 145 | (defface sumibi-face-tag-salient nil 146 | "Salient face for tags" 147 | :group 'sumibi) 148 | 149 | (defface sumibi-face-tag-popout nil 150 | "Popout face for tags" 151 | :group 'sumibi) 152 | 153 | (defface sumibi-face-tag-critical nil 154 | "Critical face for tags" 155 | :group 'sumibi) 156 | 157 | (defun sumibi-what-faces (pos) 158 | "Get the font faces at POS." 159 | (interactive "d") 160 | (let ((faces (remq nil 161 | (list 162 | (get-char-property pos 'read-face-name) 163 | (get-char-property pos 'face) 164 | (plist-get (text-properties-at pos) 'face))))) 165 | (message "Faces: %s" faces))) 166 | 167 | (defun sumibi-faces () 168 | "Derive face attributes for sumibi-faces using sumibi-theme values." 169 | (set-face-attribute 'sumibi-face-default nil 170 | :foreground sumibi-color-foreground 171 | :background sumibi-color-background 172 | :family sumibi-font-family-monospaced 173 | :height (* sumibi-font-size 10)) 174 | (set-face-attribute 'sumibi-face-critical nil 175 | :foreground sumibi-color-foreground 176 | :background sumibi-color-critical) 177 | (set-face-attribute 'sumibi-face-popout nil 178 | :foreground sumibi-color-popout) 179 | 180 | (set-face-attribute 'sumibi-face-variable-pitch nil 181 | :foreground (face-foreground 'sumibi-face-default) 182 | :background (face-background 'sumibi-face-default) 183 | :family sumibi-font-family-proportional 184 | :height (* sumibi-font-size 10)) 185 | (if (display-graphic-p) 186 | (set-face-attribute 'sumibi-face-strong nil 187 | :foreground (face-foreground 'sumibi-face-default) 188 | :weight 'bold) 189 | (set-face-attribute 'sumibi-face-strong nil 190 | :foreground (face-foreground 'sumibi-face-default) 191 | :weight 'bold)) 192 | 193 | (set-face-attribute 'sumibi-face-salient nil 194 | :foreground sumibi-color-salient 195 | :weight 'light) 196 | 197 | (set-face-attribute 'sumibi-face-faded nil 198 | :foreground sumibi-color-faded 199 | :weight 'light) 200 | 201 | (set-face-attribute 'sumibi-face-subtle nil 202 | :background sumibi-color-subtle) 203 | 204 | (set-face-attribute 'sumibi-face-region nil 205 | :background sumibi-color-region) 206 | 207 | (set-face-attribute 'sumibi-face-function nil 208 | :background sumibi-color-function) 209 | 210 | (set-face-attribute 'sumibi-face-comment nil 211 | :background sumibi-color-comment) 212 | 213 | (set-face-attribute 'sumibi-face-header-default nil 214 | :foreground sumibi-color-foreground 215 | :background sumibi-color-subtle 216 | :box `(:line-width 1 217 | :color ,sumibi-color-background 218 | :style nil)) 219 | 220 | (set-face-attribute 'sumibi-face-tag-default nil 221 | :foreground sumibi-color-foreground 222 | :background sumibi-color-background 223 | :weight 'regular 224 | :height (if (display-graphic-p) 225 | (round 226 | (* 0.85 (* 10 sumibi-font-size))) 227 | 1) 228 | :box `(:line-width 1 229 | :color ,sumibi-color-foreground 230 | :style nil)) 231 | 232 | (set-face-attribute 'sumibi-face-header-strong nil 233 | :foreground sumibi-color-strong 234 | :background sumibi-color-subtle 235 | :inherit 'sumibi-face-strong 236 | :box `(:line-width 1 237 | :color ,sumibi-color-background 238 | :style nil)) 239 | 240 | (set-face-attribute 'sumibi-face-tag-strong nil 241 | :foreground sumibi-color-strong 242 | :background sumibi-color-subtle 243 | :weight 'regular 244 | :height (if (display-graphic-p) 245 | (round 246 | (* 0.85 (* 10 sumibi-font-size))) 247 | 1) 248 | :box `(:line-width 1 249 | :color ,sumibi-color-strong 250 | :style nil)) 251 | 252 | (set-face-attribute 'sumibi-face-header-salient nil 253 | :foreground sumibi-color-background 254 | :background sumibi-color-salient 255 | :box `(:line-width 1 256 | :color ,sumibi-color-background 257 | :style nil)) 258 | 259 | (set-face-attribute 'sumibi-face-tag-salient nil 260 | :foreground sumibi-color-background 261 | :background sumibi-color-salient 262 | :weight 'regular 263 | :height (if (display-graphic-p) 264 | (round 265 | (* 0.85 (* 10 sumibi-font-size))) 266 | 1) 267 | :box `(:line-width 1 268 | :color ,sumibi-color-salient 269 | :style nil)) 270 | 271 | (set-face-attribute 'sumibi-face-header-popout nil 272 | :foreground sumibi-color-background 273 | :background sumibi-color-popout 274 | :box `(:line-width 1 275 | :color ,sumibi-color-background 276 | :style nil)) 277 | 278 | (set-face-attribute 'sumibi-face-tag-popout nil 279 | :foreground sumibi-color-background 280 | :background sumibi-color-popout 281 | :weight 'regular 282 | :height (if (display-graphic-p) 283 | (round 284 | (* 0.85 (* 10 sumibi-font-size))) 285 | 1) 286 | :box `(:line-width 1 287 | :color ,sumibi-color-popout 288 | :style nil)) 289 | 290 | (set-face-attribute 'sumibi-face-header-faded nil 291 | :foreground sumibi-color-background 292 | :background sumibi-color-faded 293 | :box `(:line-width 1 294 | :color ,sumibi-color-background 295 | :style nil)) 296 | 297 | (set-face-attribute 'sumibi-face-tag-faded nil 298 | :foreground sumibi-color-background 299 | :background sumibi-color-faded 300 | :weight 'regular 301 | :height (if (display-graphic-p) 302 | (round 303 | (* 0.85 (* 10 sumibi-font-size))) 304 | 1) 305 | :box `(:line-width 1 306 | :color ,sumibi-color-faded 307 | :style nil)) 308 | 309 | (set-face-attribute 'sumibi-face-header-subtle nil) 310 | 311 | (set-face-attribute 'sumibi-face-header-critical nil 312 | :foreground sumibi-color-background 313 | :background sumibi-color-critical 314 | :box `(:line-width 1 315 | :color ,sumibi-color-background 316 | :style nil)) 317 | (set-face-attribute 'sumibi-face-tag-critical nil 318 | :foreground sumibi-color-background 319 | :background sumibi-color-critical 320 | :weight 'regular 321 | :height (if (display-graphic-p) 322 | (round 323 | (* 0.85 (* 10 sumibi-font-size))) 324 | 1) 325 | :box `(:line-width 1 326 | :color ,sumibi-color-critical 327 | :style nil)) 328 | 329 | (set-face-attribute 'sumibi-face-header-separator nil 330 | :inherit 'sumibi-face-default 331 | :height 0.1) 332 | (set-face-attribute 'sumibi-face-header-filler nil 333 | :inherit 'sumibi-face-header-default 334 | :height 0.1) 335 | (set-face-attribute 'sumibi-face-header-highlight nil 336 | :inherit 'sumibi-face-header-faded 337 | :box nil)) 338 | 339 | (defun sumibi-theme--flyspell () 340 | "Derive flyspell faces from sumibi faces." 341 | (with-eval-after-load 'flyspell 342 | (set-face 'flyspell-duplicate 'sumibi-face-default) 343 | (set-face-attribute 'flyspell-incorrect nil 344 | :inherit 'sumibi-face-critical))) 345 | 346 | (defun sumibi-theme--flycheck () 347 | "Derive flycheck faces from sumibi faces." 348 | (with-eval-after-load 'flycheck 349 | (set-face-attribute 'flycheck-error nil 350 | :underline `(:style wave :color ,sumibi-color-critical) :background sumibi-color-background) 351 | (set-face-attribute 'flycheck-warning nil 352 | :underline `(:style wave :color ,sumibi-color-critical) 353 | :background sumibi-color-background) 354 | (set-face-attribute 'flycheck-info nil 355 | :underline `(:style wave :color ,sumibi-color-faded) 356 | :background sumibi-color-background))) 357 | 358 | (defun sumibi-theme--company () 359 | "Derive company faces from sumibi faces." 360 | (with-eval-after-load 'company 361 | (set-face 'company-echo-common 'sumibi-face-faded) 362 | (set-face 'company-preview-common 'sumibi-face-default) 363 | (set-face 'company-preview-search 'sumibi-face-faded) 364 | (set-face 'company-scrollbar-bg 'sumibi-face-default) 365 | (set-face 'company-scrollbar-fg 'sumibi-face-default) 366 | (set-face 'company-tooltip-annotation 'sumibi-face-faded) 367 | (set-face 'company-tooltip-common 'sumibi-face-faded) 368 | (set-face-attribute 'company-tooltip-common-selection nil 369 | :background sumibi-color-background 370 | :foreground sumibi-color-critical :weight 'bold) 371 | (set-face-attribute 'company-tooltip-selection nil 372 | :background sumibi-color-background 373 | :foreground sumibi-color-critical) 374 | (set-face-attribute 'company-preview nil 375 | :background sumibi-color-background 376 | :foreground sumibi-color-foreground) 377 | (set-face-attribute 'company-tooltip nil 378 | :background sumibi-color-background 379 | :foreground sumibi-color-foreground))) 380 | 381 | (defun sumibi-theme--ctrlf () 382 | "Derive ctrlf faces from sumibi faces." 383 | (with-eval-after-load 'ctrlf 384 | (set-face 'ctrlf-highlight-active 'sumibi-face-strong) 385 | (set-face 'ctrlf-highlight-line 'sumibi-face-highlight))) 386 | 387 | (defun sumibi-theme--rainbow-delimiters () 388 | "Derive rainbow-delimiters faces from sumibi faces." 389 | (with-eval-after-load 'rainbow-delimiters 390 | (set-face-attribute 'rainbow-delimiters-depth-1-face nil 391 | :foreground sumibi-color-critical) 392 | (set-face-attribute 'rainbow-delimiters-depth-2-face nil 393 | :foreground sumibi-color-foreground) 394 | (set-face-attribute 'rainbow-delimiters-depth-3-face nil 395 | :foreground sumibi-color-foreground) 396 | (set-face-attribute 'rainbow-delimiters-depth-4-face nil 397 | :foreground sumibi-color-foreground) 398 | (set-face-attribute 'rainbow-delimiters-depth-5-face nil 399 | :foreground sumibi-color-foreground) 400 | (set-face-attribute 'rainbow-delimiters-depth-6-face nil 401 | :foreground sumibi-color-foreground) 402 | (set-face-attribute 'rainbow-delimiters-depth-7-face nil 403 | :foreground sumibi-color-foreground) 404 | (set-face-attribute 'rainbow-delimiters-depth-8-face nil 405 | :foreground sumibi-color-foreground) 406 | (set-face-attribute 'rainbow-delimiters-depth-9-face nil 407 | :foreground sumibi-color-foreground) 408 | (set-face-attribute 'rainbow-delimiters-base-error-face nil 409 | :foreground sumibi-color-critical 410 | :background sumibi-color-background :weight 'bold))) 411 | 412 | 413 | (provide 'sumibi-faces) 414 | ;;; sumibi-faces.el ends here 415 | -------------------------------------------------------------------------------- /visuals/sumibi-theme-dark.el: -------------------------------------------------------------------------------- 1 | ;;; dark-theme -*- lexical-binding: t; -*- 2 | 3 | (require 'sumibi-base-colors) 4 | 5 | (defun sumibi-theme-set-dark () 6 | (setq frame-background-mode 'dark) 7 | (setq sumibi-color-foreground "#fdf4c1") 8 | (setq sumibi-color-strong "#fdf4c1") 9 | (setq sumibi-color-background "#1d2021") 10 | (setq sumibi-color-highlight "#1d2021") 11 | (setq sumibi-color-critical "#fb4933") 12 | (setq sumibi-color-salient "#fb4933") 13 | (setq sumibi-color-popout "#b8bb26") 14 | (setq sumibi-color-subtle "#333637") 15 | (setq sumibi-color-faded "#777979") 16 | (setq sumibi-color-region "#333637") 17 | 18 | ;; programming 19 | (setq sumibi-color-numbers "#f0f1d3") 20 | (setq sumibi-color-function "#211e1d") 21 | (setq sumibi-color-comment "#17191a")) 22 | 23 | 24 | 25 | (sumibi-theme-set-dark) 26 | 27 | (provide 'sumibi-theme-dark) 28 | -------------------------------------------------------------------------------- /visuals/sumibi-theme-light.el: -------------------------------------------------------------------------------- 1 | ;;; -*- lexical-binding: t; -*- 2 | 3 | (require 'sumibi-base-colors) 4 | 5 | (defun sumibi-theme-set-light () 6 | (setq frame-background-mode 'light) 7 | 8 | ;; basic colors 9 | (setq sumibi-color-background "#f4f4f4") 10 | (setq sumibi-color-foreground "#161616") 11 | (setq sumibi-color-highlight "#f4f4f4") 12 | (setq sumibi-color-strong "#525252") 13 | (setq sumibi-color-critical "#da1e28") 14 | (setq sumibi-color-salient "#0f62fe") 15 | (setq sumibi-color-popout "#0f62fe") 16 | (setq sumibi-color-subtle "#e0e0e0") 17 | (setq sumibi-color-faded "#8d8d8d") 18 | (setq sumibi-color-region "#ffd6e8") 19 | 20 | ;; programming 21 | (setq sumibi-color-numbers "#491d8b") 22 | (setq sumibi-color-function "#d0e2ff") 23 | (setq sumibi-color-comment "#fdf0ca")) 24 | 25 | (sumibi-theme-set-light) 26 | 27 | (provide 'sumibi-theme-light) 28 | 29 | ;;; sumibi-theme-light.el ends here 30 | -------------------------------------------------------------------------------- /visuals/sumibi-theme.el: -------------------------------------------------------------------------------- 1 | ;;; -*- lexical-binding: t; -*- 2 | 3 | (require 'sumibi-faces) 4 | 5 | ;; When we set a face, we take care of removing any previous settings 6 | (defun set-face (face style) 7 | "Reset FACE and make it inherit STYLE." 8 | (set-face-attribute face nil 9 | :foreground 'unspecified :background 'unspecified 10 | :family 'unspecified :slant 'unspecified 11 | :weight 'unspecified :height 'unspecified 12 | :underline 'unspecified :overline 'unspecified 13 | :box 'unspecified :inherit style)) 14 | 15 | (defun sumibi-theme--basics () 16 | "Derive basic Emacs faces from sumibi-faces and sumibi-color-theme." 17 | (set-foreground-color sumibi-color-foreground) 18 | (set-background-color sumibi-color-background) 19 | 20 | ;; THIS 21 | (set-face-attribute 'default nil 22 | :foreground (face-foreground 'default) 23 | :background (face-background 'default) 24 | :weight 'regular 25 | :family (face-attribute 'sumibi-face-default :family) 26 | :height (face-attribute 'sumibi-face-default :height)) 27 | (if (display-graphic-p) 28 | (set-face-attribute 'bold nil :weight 'regular) 29 | (set-face-attribute 'bold nil :weight 'bold)) 30 | 31 | ;; Structural 32 | (set-face 'bold 'sumibi-face-strong) 33 | (set-face 'italic 'sumibi-face-faded) 34 | (set-face 'bold-italic 'sumibi-face-strong) 35 | (set-face-attribute 'region nil 36 | :background sumibi-color-region 37 | :foreground sumibi-color-foreground) 38 | (set-face 'highlight 'sumibi-face-subtle) 39 | (set-face 'fixed-pitch-serif 'sumibi-face-default) 40 | (set-face 'cursor 'sumibi-face-default) 41 | (if 'sumibi-font-family-proportional 42 | (set-face-attribute 'variable-pitch nil ;; to work with mixed-pitch 43 | :foreground (face-foreground 'default) 44 | :background (face-background 'default) 45 | :family (face-attribute 'sumibi-face-variable-pitch :family) 46 | :height (face-attribute 'sumibi-face-variable-pitch :height) 47 | :weight 'light) 48 | (set-face 'variable-pitch 'sumibi-face-default)) 49 | 50 | (set-face-attribute 'cursor nil 51 | :background sumibi-color-popout) 52 | (set-face-attribute 'window-divider nil 53 | :foreground (face-background 'sumibi-face-default)) 54 | (set-face-attribute 'window-divider-first-pixel nil 55 | :foreground sumibi-color-background) 56 | (set-face-attribute 'window-divider-last-pixel nil 57 | :foreground sumibi-color-background) 58 | (set-face-foreground 'vertical-border sumibi-color-subtle) 59 | 60 | ;; Semantic 61 | (set-face 'shadow 'sumibi-face-faded) 62 | (set-face 'success 'sumibi-face-salient) 63 | (set-face 'warning 'sumibi-face-popout) 64 | (set-face 'error 'sumibi-face-critical) 65 | (set-face 'match 'sumibi-face-popout) 66 | 67 | ;; General 68 | (set-face 'buffer-menu-buffer 'sumibi-face-strong) 69 | (set-face 'minibuffer-prompt 'sumibi-face-strong) 70 | (set-face 'link 'sumibi-face-salient) 71 | (set-face 'fringe 'sumibi-face-faded) 72 | (set-face-attribute 'fringe nil 73 | :foreground (face-background 'sumibi-face-subtle) 74 | :background (face-background 'default)) 75 | (set-face 'isearch 'sumibi-face-strong) 76 | (set-face 'isearch-fail 'sumibi-face-faded) 77 | (set-face 'lazy-highlight 'sumibi-face-subtle) 78 | (set-face 'trailing-whitespace 'sumibi-face-subtle) 79 | (set-face-attribute 'show-paren-match nil 80 | :foreground sumibi-color-salient 81 | :background sumibi-color-background 82 | :underline t) 83 | (set-face 'show-paren-mismatch 'face-normal) 84 | (set-face-attribute 'tooltip nil :height 0.85) 85 | (set-face 'secondary-selection 'sumibi-face-subtle) 86 | (set-face 'completions-common-part 'sumibi-face-faded) 87 | (set-face 'completions-first-difference 'sumibi-face-default)) 88 | 89 | (defun sumibi-theme--font-lock () 90 | "Derive font-lock faces from sumibi-faces." 91 | (set-face-attribute 'font-lock-comment-face nil 92 | :background sumibi-color-comment 93 | :foreground sumibi-color-foreground) 94 | (set-face-attribute 'font-lock-doc-face nil 95 | :background sumibi-color-comment 96 | :foreground sumibi-color-foreground 97 | :bold 'nil) 98 | (set-face-attribute 'font-lock-string-face nil 99 | :background sumibi-color-subtle 100 | :foreground sumibi-color-foreground) 101 | (set-face-attribute 'font-lock-constant-face nil 102 | :background sumibi-color-subtle 103 | :foreground sumibi-color-foreground) 104 | (set-face-attribute 'font-lock-warning-face nil 105 | :background sumibi-color-background 106 | :foreground sumibi-color-critical) 107 | (set-face-attribute 'font-lock-function-name-face nil 108 | :background sumibi-color-function 109 | :foreground sumibi-color-foreground) 110 | (set-face-attribute 'font-lock-variable-name-face nil 111 | :background sumibi-color-subtle 112 | :foreground sumibi-color-foreground) 113 | (set-face-attribute 'font-lock-builtin-face nil 114 | :background sumibi-color-subtle 115 | :foreground sumibi-color-foreground) 116 | (set-face-attribute 'font-lock-type-face nil 117 | :background sumibi-color-subtle 118 | :foreground sumibi-color-foreground) 119 | (set-face-attribute 'font-lock-keyword-face nil 120 | :background sumibi-color-subtle 121 | :foreground sumibi-color-foreground)) 122 | 123 | (defun sumibi-theme--mode-line () 124 | "Derive mode-line and header-line faces from sumibi-faces." 125 | (set-face-attribute 'mode-line nil 126 | :foreground sumibi-color-faded 127 | :background sumibi-color-background 128 | :weight 'bold 129 | :box `(:line-width 1 130 | :color ,(face-background 'sumibi-face-default) 131 | :style nil)) 132 | (set-face-attribute 'mode-line-inactive nil 133 | :foreground sumibi-color-strong 134 | :background sumibi-color-background 135 | :box `(:line-width 1 136 | :color ,(face-background 'sumibi-face-default) 137 | :style nil)) 138 | (set-face-attribute 'mode-line-buffer-id nil 139 | :foreground sumibi-color-strong 140 | :bold t) 141 | (set-face-attribute 'mode-line-emphasis nil 142 | :foreground sumibi-color-strong 143 | :bold t) 144 | (set-face-attribute 'mode-line-highlight nil 145 | :foreground sumibi-color-strong) 146 | (set-face-attribute 'header-line nil 147 | :foreground (face-foreground 'sumibi-face-faded) 148 | :background (face-background 'sumibi-face-default) 149 | :weight 'bold 150 | :overline nil 151 | :underline nil 152 | :box `(:line-width 1 153 | :color ,(face-background 'sumibi-face-default) 154 | :style nil) 155 | :inherit nil) 156 | (set-face-attribute 'internal-border nil 157 | :background (face-background 'sumibi-face-default))) 158 | 159 | 160 | (defun sumibi-theme--minibuffer () 161 | "Derive minibuffer / echo area faces from sumibi faces." 162 | ;; Minibuffer / echo area 163 | (dolist (buffer (list " *Minibuf-0*" " *Echo Area 0*" 164 | " *Minibuf-1*" " *Echo Area 1*")) 165 | (when (get-buffer buffer) 166 | (with-current-buffer buffer 167 | (face-remap-add-relative 'default 'sumibi-face-faded))))) 168 | 169 | 170 | (defun sumibi-theme--hl-line () 171 | "Derive hl-line faces from sumibi faces." 172 | (with-eval-after-load 'hl-line 173 | (set-face-attribute 'hl-line nil 174 | :background sumibi-color-highlight))) 175 | 176 | (defun sumibi-theme--buttons () 177 | "Derive button faces from sumibi faces." 178 | ;; Buttons 179 | (with-eval-after-load 'cus-edit 180 | (set-face-attribute 'custom-button nil 181 | :foreground (face-foreground 'sumibi-face-faded) 182 | :background (face-background 'sumibi-face-default) 183 | :box `(:line-width 1 184 | :color ,(face-foreground 'sumibi-face-faded) 185 | :style nil)) 186 | (set-face-attribute 'custom-button-mouse nil 187 | ;; :inherit 'custom-button 188 | :foreground (face-foreground 'sumibi-face-faded) 189 | :background (face-background 'sumibi-face-subtle) 190 | :box `(:line-width 1 191 | :color ,(face-foreground 'sumibi-face-faded) 192 | :style nil)) 193 | (set-face-attribute 'custom-button-pressed nil 194 | :foreground (face-background 'default) 195 | :background (face-foreground 'sumibi-face-salient) 196 | :inherit 'sumibi-face-salient 197 | :box `(:line-width 1 198 | :color ,(face-foreground 'sumibi-face-salient) 199 | :style nil) 200 | :inverse-video nil))) 201 | 202 | (defun sumibi-theme--info () 203 | "Derive info faces from sumibi faces." 204 | (with-eval-after-load 'info 205 | (set-face 'info-menu-header 'sumibi-face-strong) 206 | (set-face 'info-header-node 'sumibi-face-default) 207 | (set-face 'info-index-match 'sumibi-face-salient) 208 | (set-face 'Info-quoted 'sumibi-face-faded) 209 | (set-face 'info-title-1 'sumibi-face-strong) 210 | (set-face 'info-title-2 'sumibi-face-strong) 211 | (set-face 'info-title-3 'sumibi-face-strong) 212 | (set-face 'info-title-4 'sumibi-face-strong))) 213 | 214 | 215 | (defun sumibi-theme--speedbar () 216 | "Derive speedbar faces from sumibi faces " 217 | (with-eval-after-load 'speedbar 218 | (set-face 'speedbar-button-face 'sumibi-face-faded) 219 | (set-face 'speedbar-directory-face 'sumibi-face-strong) 220 | (set-face 'speedbar-file-face 'sumibi-face-default) 221 | (set-face 'speedbar-highlight-face 'sumibi-face-highlight) 222 | (set-face 'speedbar-selected-face 'sumibi-face-subtle) 223 | (set-face 'speedbar-separator-face 'sumibi-face-faded) 224 | (set-face 'speedbar-tag-face 'sumibi-face-faded))) 225 | 226 | 227 | (defun sumibi-theme--bookmark () 228 | "Derive bookmark faces from sumibi faces." 229 | (with-eval-after-load 'bookmark 230 | (set-face 'bookmark-menu-heading 'sumibi-face-strong) 231 | (set-face 'bookmark-menu-bookmark 'sumibi-face-salient))) 232 | 233 | 234 | (defun sumibi-theme--message () 235 | "Derive message faces from sumibi faces." 236 | (with-eval-after-load 'message 237 | (unless (version< emacs-version "27.0") 238 | (set-face 'message-cited-text-1 'sumibi-face-faded) 239 | (set-face 'message-cited-text-2 'sumibi-face-faded) 240 | (set-face 'message-cited-text-3 'sumibi-face-faded) 241 | (set-face 'message-cited-text-4 'sumibi-face-faded)) 242 | (set-face 'message-cited-text 'sumibi-face-faded) 243 | (set-face 'message-header-cc 'sumibi-face-default) 244 | (set-face 'message-header-name 'sumibi-face-strong) 245 | (set-face 'message-header-newsgroups 'sumibi-face-default) 246 | (set-face 'message-header-other 'sumibi-face-default) 247 | (set-face 'message-header-subject 'sumibi-face-salient) 248 | (set-face 'message-header-to 'sumibi-face-salient) 249 | (set-face 'message-header-xheader 'sumibi-face-default) 250 | (set-face 'message-mml 'sumibi-face-popout) 251 | (set-face 'message-separator 'sumibi-face-faded))) 252 | 253 | 254 | (defun sumibi-theme--outline () 255 | "Derive outline faces from sumibi faces." 256 | (with-eval-after-load 'outline 257 | (set-face 'outline-1 'sumibi-face-strong) 258 | (set-face 'outline-2 'sumibi-face-strong) 259 | (set-face 'outline-3 'sumibi-face-strong) 260 | (set-face 'outline-4 'sumibi-face-strong) 261 | (set-face 'outline-5 'sumibi-face-strong) 262 | (set-face 'outline-6 'sumibi-face-strong) 263 | (set-face 'outline-7 'sumibi-face-strong) 264 | (set-face 'outline-8 'sumibi-face-strong))) 265 | 266 | 267 | (defun sumibi-theme--customize () 268 | "Derive customize faces from sumibi faces." 269 | (with-eval-after-load 'cus-edit 270 | (set-face 'widget-field 'sumibi-face-subtle) 271 | (set-face 'widget-button 'sumibi-face-strong) 272 | (set-face 'widget-single-line-field 'sumibi-face-subtle) 273 | (set-face 'custom-group-subtitle 'sumibi-face-strong) 274 | (set-face 'custom-group-tag 'sumibi-face-strong) 275 | (set-face 'custom-group-tag-1 'sumibi-face-strong) 276 | (set-face 'custom-comment 'sumibi-face-faded) 277 | (set-face 'custom-comment-tag 'sumibi-face-faded) 278 | (set-face 'custom-changed 'sumibi-face-salient) 279 | (set-face 'custom-modified 'sumibi-face-salient) 280 | (set-face 'custom-face-tag 'sumibi-face-strong) 281 | (set-face 'custom-variable-tag 'sumibi-face-strong) 282 | (set-face 'custom-invalid 'sumibi-face-popout) 283 | (set-face 'custom-visibility 'sumibi-face-salient) 284 | (set-face 'custom-state 'sumibi-face-salient) 285 | (set-face 'custom-link 'sumibi-face-salient))) 286 | 287 | (defun sumibi-theme--package () 288 | "Derive package faces from sumibi faces." 289 | (with-eval-after-load 'package 290 | (set-face 'package-description 'sumibi-face-default) 291 | (set-face 'package-help-section-name 'sumibi-face-default) 292 | (set-face 'package-name 'sumibi-face-salient) 293 | (set-face 'package-status-avail-obso 'sumibi-face-faded) 294 | (set-face 'package-status-available 'sumibi-face-default) 295 | (set-face 'package-status-built-in 'sumibi-face-salient) 296 | (set-face 'package-status-dependency 'sumibi-face-salient) 297 | (set-face 'package-status-disabled 'sumibi-face-faded) 298 | (set-face 'package-status-external 'sumibi-face-default) 299 | (set-face 'package-status-held 'sumibi-face-default) 300 | (set-face 'package-status-incompat 'sumibi-face-faded) 301 | (set-face 'package-status-installed 'sumibi-face-salient) 302 | (set-face 'package-status-new 'sumibi-face-default) 303 | (set-face 'package-status-unsigned 'sumibi-face-default)) 304 | 305 | ;; Button face is hardcoded, we have to redefine the relevant 306 | ;; function 307 | (defun package-make-button (text &rest properties) 308 | "Insert button labeled TEXT with button PROPERTIES at point. 309 | PROPERTIES are passed to `insert-text-button', for which this 310 | function is a convenience wrapper used by `describe-package-1'." 311 | (let ((button-text (if (display-graphic-p) 312 | text (concat "[" text "]"))) 313 | (button-face (if (display-graphic-p) 314 | `(:box `(:line-width 1 315 | :color ,sumibi-color-subtle 316 | :style nil) 317 | :foreground ,sumibi-color-faded 318 | :background ,sumibi-color-subtle) 319 | 'link))) 320 | (apply #'insert-text-button button-text 321 | 'face button-face 'follow-link t properties)))) 322 | 323 | (defun sumibi-theme--hydra () 324 | "Derive hydra faces from sumibi faces." 325 | (with-eval-after-load 'hydra 326 | (set-face 'hydra-face-amaranth 'sumibi-face-strong) 327 | (set-face 'hydra-face-blue 'sumibi-face-strong) 328 | (set-face 'hydra-face-pink 'sumibi-face-strong) 329 | (set-face 'hydra-face-red 'sumibi-face-strong) 330 | (set-face 'hydra-face-teal 'sumibi-face-strong))) 331 | 332 | (defun sumibi-theme--flyspell () 333 | "Derive flyspell faces from sumibi faces." 334 | (with-eval-after-load 'flyspell 335 | (set-face 'flyspell-duplicate 'sumibi-face-default) 336 | (set-face-attribute 'flyspell-incorrect nil 337 | :underline `(:style wave :color ,sumibi-color-critical) 338 | :background sumibi-color-background))) 339 | 340 | (defun sumibi-theme--parinfer-rust () 341 | "Derive parinfer-rust faces from sumibi-faces" 342 | (with-eval-after-load 'parinfer-rust 343 | (set-face-attribute 'parinfer-rust-dim-parens nil 344 | :background sumibi-color-background 345 | :foreground sumibi-color-foreground))) 346 | 347 | 348 | (defun sumibi-theme--rainbow-delimiters () 349 | "Derive rainbow-delimiters faces from sumibi faces." 350 | (with-eval-after-load 'rainbow-delimiters 351 | (set-face-attribute 'rainbow-delimiters-depth-1-face nil 352 | :foreground sumibi-color-strong 353 | :weight 'bold) 354 | (set-face-attribute 'rainbow-delimiters-depth-2-face nil 355 | :foreground sumibi-color-faded) 356 | (set-face-attribute 'rainbow-delimiters-depth-3-face nil 357 | :foreground sumibi-color-numbers) 358 | (set-face-attribute 'rainbow-delimiters-depth-4-face nil 359 | :foreground sumibi-color-critical) 360 | (set-face-attribute 'rainbow-delimiters-depth-5-face nil 361 | :foreground sumibi-color-salient) 362 | (set-face-attribute 'rainbow-delimiters-depth-6-face nil 363 | :foreground sumibi-color-strong) 364 | (set-face-attribute 'rainbow-delimiters-base-error-face nil 365 | :foreground sumibi-color-critical 366 | :background sumibi-color-background 367 | :weight 'bold))) 368 | 369 | 370 | (defun sumibi-theme--cider-overlay () 371 | "Derive cider-overlay face from sumibi faces" 372 | (with-eval-after-load 'cider 373 | (set-face-attribute 'cider-result-overlay-face nil 374 | :background "#defbe6" 375 | :foreground "#198038" 376 | :weight 'bold 377 | :box nil))) 378 | 379 | 380 | (defun sumibi-theme--flycheck () 381 | "Derive flycheck faces from sumibi faces." 382 | (with-eval-after-load 'flycheck 383 | (set-face-attribute 'flycheck-error nil 384 | :underline `(:style wave :color ,sumibi-color-critical) 385 | :background sumibi-color-background) 386 | (set-face-attribute 'flycheck-warning nil 387 | :underline `(:style wave :color ,sumibi-color-critical) 388 | :background sumibi-color-background) 389 | (set-face-attribute 'flycheck-info nil 390 | :underline `(:style wave :color ,sumibi-color-faded) 391 | :background sumibi-color-background) 392 | (set-face-attribute 'flycheck-error-list-error nil 393 | :background sumibi-color-background 394 | :foreground sumibi-color-critical))) 395 | 396 | (defun sumibi-theme--company () 397 | "Derive company faces from sumibi faces." 398 | (with-eval-after-load 'company 399 | (set-face 'company-echo-common 'sumibi-face-faded) 400 | (set-face-attribute 'company-preview-common nil 401 | :background "#ffffff") 402 | (set-face 'company-preview-search 'sumibi-face-faded) 403 | (set-face-attribute 'company-scrollbar-bg nil 404 | :background "#ffffff") 405 | (set-face-attribute 'company-scrollbar-fg nil 406 | :background "#ffffff") 407 | (set-face 'company-tooltip-annotation 'sumibi-face-faded) 408 | (set-face 'company-tooltip-common 'sumibi-face-faded) 409 | (set-face-attribute 'company-tooltip-common-selection nil 410 | :background "#ffffff" 411 | :foreground sumibi-color-popout 412 | :weight 'bold) 413 | (set-face-attribute 'company-tooltip-selection nil 414 | :background "#ffffff" 415 | :foreground sumibi-color-popout) 416 | (set-face-attribute 'company-preview nil 417 | :background "#ffffff" 418 | :foreground sumibi-color-foreground) 419 | (set-face-attribute 'company-tooltip nil 420 | :background "#ffffff" 421 | :foreground sumibi-color-foreground))) 422 | 423 | (defun sumibi-theme--ctrlf () 424 | "Derive ctrlf faces from sumibi faces." 425 | (with-eval-after-load 'ctrlf 426 | (set-face-attribute 'ctrlf-highlight-active nil 427 | :background sumibi-color-function 428 | :foreground sumibi-color-foreground 429 | :box `(:line-width 1 430 | :color ,sumibi-color-popout 431 | :style nil)) 432 | (set-face-attribute 'ctrlf-highlight-line nil 433 | :background sumibi-color-highlight) 434 | (set-face-attribute 'ctrlf-highlight-passive nil 435 | :background sumibi-color-background 436 | :foreground sumibi-color-foreground 437 | :box `(:line-width 1 438 | :color ,sumibi-color-comment 439 | :style nil)))) 440 | 441 | (defun sumibi-theme--numbers-mode () 442 | "Derive highlight-numbers-mode faces from sumibi face." 443 | (with-eval-after-load 'highlight-numbers 444 | (set-face-attribute 'highlight-numbers-number nil 445 | :background sumibi-color-background 446 | :foreground sumibi-color-numbers))) 447 | 448 | 449 | (defun sumibi-theme--ido () 450 | "Derive ido faces from sumibi faces." 451 | (with-eval-after-load 'ido 452 | (set-face 'ido-first-match 'sumibi-face-salient) 453 | (set-face 'ido-only-match 'sumibi-face-faded) 454 | (set-face 'ido-subdir 'sumibi-face-strong))) 455 | 456 | (defun sumibi-theme--diff () 457 | "Derive diff faces from sumibi faces." 458 | (with-eval-after-load 'diff-mode 459 | (set-face 'diff-header 'sumibi-face-faded) 460 | (set-face 'diff-file-header 'sumibi-face-strong) 461 | (set-face 'diff-context 'sumibi-face-default) 462 | (set-face 'diff-removed 'sumibi-face-faded) 463 | (set-face 'diff-changed 'sumibi-face-popout) 464 | (set-face 'diff-added 'sumibi-face-salient) 465 | (set-face 'diff-refine-added '(sumibi-face-salient 466 | sumibi-face-strong)) 467 | (set-face 'diff-refine-changed 'sumibi-face-popout) 468 | (set-face 'diff-refine-removed 'sumibi-face-faded) 469 | (set-face-attribute 'diff-refine-removed nil :strike-through t))) 470 | 471 | 472 | (defun sumibi-theme--term () 473 | "Derive term faces from sumibi faces, and material theme colors." 474 | (with-eval-after-load 'term 475 | ;; (setq eterm-256color-disable-bold nil) 476 | (set-face 'term-bold 'sumibi-face-strong) 477 | (set-face-attribute 'term-color-black nil 478 | :foreground (face-foreground 'sumibi-face-default) 479 | :background (face-foreground 'sumibi-face-default)) 480 | (set-face-attribute 'term-color-white nil 481 | :foreground (face-background 'sumibi-face-default) 482 | :background (face-background 'sumibi-face-default)) 483 | (set-face-attribute 'term-color-blue nil 484 | :foreground sumibi-color-foreground 485 | :background sumibi-color-foreground) 486 | (set-face-attribute 'term-color-cyan nil 487 | :foreground sumibi-color-foreground 488 | :background sumibi-color-foreground) 489 | (set-face-attribute 'term-color-green nil 490 | :foreground sumibi-color-salient 491 | :background sumibi-color-salient) 492 | (set-face-attribute 'term-color-magenta nil 493 | :foreground sumibi-color-salient 494 | :background sumibi-color-salient) 495 | (set-face-attribute 'term-color-red nil 496 | :foreground sumibi-color-critical 497 | :background sumibi-color-critical) 498 | (set-face-attribute 'term-color-yellow nil 499 | :foreground sumibi-color-critical 500 | :background sumibi-color-critical))) 501 | 502 | (defun sumibi-theme--calendar () 503 | "Derive calendar faces from sumibi faces." 504 | (with-eval-after-load 'calendar 505 | (set-face 'calendar-today 'sumibi-face-strong))) 506 | 507 | 508 | (defun sumibi-theme--agenda () 509 | "Derive agenda faces from sumibi faces." 510 | (with-eval-after-load 'org-agenda 511 | (set-face 'org-agenda-calendar-event 'sumibi-face-default) 512 | (set-face 'org-agenda-calendar-sexp 'sumibi-face-salient) 513 | (set-face 'org-agenda-clocking 'sumibi-face-faded) 514 | (set-face 'org-agenda-column-dateline 'sumibi-face-faded) 515 | (set-face 'org-agenda-current-time 'sumibi-face-strong) 516 | (set-face 'org-agenda-date 'sumibi-face-salient) 517 | (set-face 'org-agenda-date-today '(sumibi-face-salient 518 | sumibi-face-strong)) 519 | (set-face 'org-agenda-date-weekend 'sumibi-face-faded) 520 | (set-face 'org-agenda-diary 'sumibi-face-faded) 521 | (set-face 'org-agenda-dimmed-todo-face 'sumibi-face-faded) 522 | (set-face 'org-agenda-done 'sumibi-face-faded) 523 | (set-face 'org-agenda-filter-category 'sumibi-face-faded) 524 | (set-face 'org-agenda-filter-effort 'sumibi-face-faded) 525 | (set-face 'org-agenda-filter-regexp 'sumibi-face-faded) 526 | (set-face 'org-agenda-filter-tags 'sumibi-face-faded) 527 | ;; (set-face 'org-agenda-property-face 'sumibi-face-faded) 528 | (set-face 'org-agenda-restriction-lock 'sumibi-face-faded) 529 | (set-face 'org-agenda-structure 'sumibi-face-strong))) 530 | 531 | 532 | (defun sumibi-theme--org () 533 | "Derive org faces from sumibi faces." 534 | (with-eval-after-load 'org 535 | (set-face 'org-archived 'sumibi-face-faded) 536 | (set-face 'org-block 'hl-line) 537 | (set-face 'org-block-begin-line 'sumibi-face-faded) 538 | (set-face 'org-block-end-line 'sumibi-face-faded) 539 | (unless (version< emacs-version "27.0") 540 | (set-face-attribute 'org-block nil :extend t) 541 | (set-face-attribute 'org-block-begin-line nil :extend t) 542 | (set-face-attribute 'org-block-end-line nil :extend t)) 543 | (set-face 'org-checkbox 'sumibi-face-faded) 544 | (set-face 'org-checkbox-statistics-done 'sumibi-face-faded) 545 | (set-face 'org-checkbox-statistics-todo 'sumibi-face-faded) 546 | (set-face 'org-clock-overlay 'sumibi-face-faded) 547 | (set-face 'org-code 'sumibi-face-faded) 548 | (set-face 'org-column 'sumibi-face-faded) 549 | (set-face 'org-column-title 'sumibi-face-faded) 550 | (set-face 'org-date 'sumibi-face-faded) 551 | (set-face 'org-date-selected 'sumibi-face-faded) 552 | (set-face 'org-default 'sumibi-face-faded) 553 | (set-face 'org-document-info 'sumibi-face-faded) 554 | (set-face 'org-document-info-keyword 'sumibi-face-faded) 555 | (set-face 'org-document-title 'sumibi-face-faded) 556 | (set-face 'org-done 'sumibi-face-default) 557 | (set-face 'org-drawer 'sumibi-face-faded) 558 | (set-face 'org-ellipsis 'sumibi-face-faded) 559 | (set-face 'org-footnote 'sumibi-face-faded) 560 | (set-face 'org-formula 'sumibi-face-faded) 561 | (set-face 'org-headline-done 'sumibi-face-faded) 562 | (set-face 'org-latex-and-related 'sumibi-face-faded) 563 | (set-face 'org-level-1 'sumibi-face-strong) 564 | (set-face 'org-level-2 'sumibi-face-strong) 565 | (set-face 'org-level-3 'sumibi-face-strong) 566 | (set-face 'org-level-4 'sumibi-face-strong) 567 | (set-face 'org-level-5 'sumibi-face-strong) 568 | (set-face 'org-level-6 'sumibi-face-strong) 569 | (set-face 'org-level-7 'sumibi-face-strong) 570 | (set-face 'org-level-8 'sumibi-face-strong) 571 | (set-face 'org-link 'sumibi-face-salient) 572 | (set-face 'org-list-dt 'sumibi-face-faded) 573 | (set-face 'org-macro 'sumibi-face-faded) 574 | (set-face 'org-meta-line 'sumibi-face-faded) 575 | (set-face 'org-mode-line-clock 'sumibi-face-faded) 576 | (set-face 'org-mode-line-clock-overrun 'sumibi-face-faded) 577 | (set-face 'org-priority 'sumibi-face-faded) 578 | (set-face 'org-property-value 'sumibi-face-faded) 579 | (set-face 'org-quote 'sumibi-face-faded) 580 | (set-face 'org-scheduled 'sumibi-face-faded) 581 | (set-face 'org-scheduled-previously 'sumibi-face-faded) 582 | (set-face 'org-scheduled-today 'sumibi-face-faded) 583 | (set-face 'org-sexp-date 'sumibi-face-faded) 584 | (set-face 'org-special-keyword 'sumibi-face-faded) 585 | (set-face 'org-table 'sumibi-face-faded) 586 | (set-face 'org-tag 'sumibi-face-popout) 587 | (set-face 'org-tag-group 'sumibi-face-faded) 588 | (set-face 'org-target 'sumibi-face-faded) 589 | (set-face 'org-time-grid 'sumibi-face-faded) 590 | (set-face 'org-todo 'sumibi-face-salient) 591 | (set-face 'org-upcoming-deadline 'sumibi-face-default) 592 | (set-face 'org-verbatim 'sumibi-face-popout) 593 | (set-face 'org-verse 'sumibi-face-faded) 594 | (set-face 'org-warning 'sumibi-face-popout))) 595 | 596 | (defun sumibi-theme--dired () 597 | "Derive dired faces from sumibi faces" 598 | (with-eval-after-load 'dired 599 | (set-face-attribute 'dired-header nil 600 | :background sumibi-color-background 601 | :foreground sumibi-color-foreground 602 | :weight 'bold) 603 | (set-face-attribute 'dired-flagged nil 604 | :background sumibi-color-background 605 | :foreground sumibi-color-critical 606 | :weight 'bold) 607 | (set-face-attribute 'dired-warning nil 608 | :background sumibi-color-background 609 | :foreground sumibi-color-critical 610 | :weight 'bold) 611 | (set-face-attribute 'dired-set-id nil 612 | :background sumibi-color-background 613 | :foreground sumibi-color-critical 614 | :weight 'bold))) 615 | 616 | 617 | (defun sumibi-theme--rst () 618 | "Derive rst faces from sumibi faces." 619 | (with-eval-after-load 'rst 620 | (set-face 'rst-adornment 'sumibi-face-faded) 621 | (set-face 'rst-block 'sumibi-face-default) 622 | (set-face 'rst-comment 'sumibi-face-faded) 623 | (set-face 'rst-definition 'sumibi-face-salient) 624 | (set-face 'rst-directive 'sumibi-face-salient) 625 | (set-face 'rst-emphasis1 'sumibi-face-faded) 626 | (set-face 'rst-emphasis2 'sumibi-face-strong) 627 | (set-face 'rst-external 'sumibi-face-salient) 628 | (set-face 'rst-level-1 'sumibi-face-strong) 629 | (set-face 'rst-level-2 'sumibi-face-strong) 630 | (set-face 'rst-level-3 'sumibi-face-strong) 631 | (set-face 'rst-level-4 'sumibi-face-strong) 632 | (set-face 'rst-level-5 'sumibi-face-strong) 633 | (set-face 'rst-level-6 'sumibi-face-strong) 634 | (set-face 'rst-literal 'sumibi-face-salient) 635 | (set-face 'rst-reference 'sumibi-face-salient) 636 | (set-face 'rst-transition 'sumibi-face-default))) 637 | 638 | 639 | (defun sumibi-theme--markdown () 640 | "Derive markdown faces from sumibi faces." 641 | (with-eval-after-load 'markdown-mode 642 | (set-face 'markdown-blockquote-face 'sumibi-face-default) 643 | (set-face 'markdown-bold-face 'sumibi-face-strong) 644 | (set-face 'markdown-code-face 'sumibi-face-default) 645 | (set-face 'markdown-comment-face 'sumibi-face-faded) 646 | (set-face 'markdown-footnote-marker-face 'sumibi-face-default) 647 | (set-face 'markdown-footnote-text-face 'sumibi-face-default) 648 | (set-face 'markdown-gfm-checkbox-face 'sumibi-face-default) 649 | (set-face 'markdown-header-delimiter-face 'sumibi-face-faded) 650 | (set-face 'markdown-header-face 'sumibi-face-strong) 651 | (set-face 'markdown-header-face-1 'sumibi-face-strong) 652 | (set-face 'markdown-header-face-2 'sumibi-face-strong) 653 | (set-face 'markdown-header-face-3 'sumibi-face-strong) 654 | (set-face 'markdown-header-face-4 'sumibi-face-strong) 655 | (set-face 'markdown-header-face-5 'sumibi-face-strong) 656 | (set-face 'markdown-header-face-6 'sumibi-face-strong) 657 | (set-face 'markdown-header-rule-face 'sumibi-face-default) 658 | (set-face 'markdown-highlight-face 'sumibi-face-default) 659 | (set-face 'markdown-hr-face 'sumibi-face-default) 660 | (set-face 'markdown-html-attr-name-face 'sumibi-face-default) 661 | (set-face 'markdown-html-attr-value-face 'sumibi-face-default) 662 | (set-face 'markdown-html-entity-face 'sumibi-face-default) 663 | (set-face 'markdown-html-tag-delimiter-face 'sumibi-face-default) 664 | (set-face 'markdown-html-tag-name-face 'sumibi-face-default) 665 | (set-face 'markdown-inline-code-face 'sumibi-face-popout) 666 | (set-face 'markdown-italic-face 'sumibi-face-faded) 667 | (set-face 'markdown-language-info-face 'sumibi-face-default) 668 | (set-face 'markdown-language-keyword-face 'sumibi-face-default) 669 | (set-face 'markdown-line-break-face 'sumibi-face-default) 670 | (set-face 'markdown-link-face 'sumibi-face-salient) 671 | (set-face 'markdown-link-title-face 'sumibi-face-default) 672 | (set-face 'markdown-list-face 'sumibi-face-faded) 673 | (set-face 'markdown-markup-face 'sumibi-face-faded) 674 | (set-face 'markdown-math-face 'sumibi-face-default) 675 | (set-face 'markdown-metadata-key-face 'sumibi-face-faded) 676 | (set-face 'markdown-metadata-value-face 'sumibi-face-faded) 677 | (set-face 'markdown-missing-link-face 'sumibi-face-default) 678 | (set-face 'markdown-plain-url-face 'sumibi-face-default) 679 | (set-face 'markdown-pre-face 'sumibi-face-default) 680 | (set-face 'markdown-reference-face 'sumibi-face-salient) 681 | (set-face 'markdown-strike-through-face 'sumibi-face-faded) 682 | (set-face 'markdown-table-face 'sumibi-face-default) 683 | (set-face 'markdown-url-face 'sumibi-face-salient))) 684 | 685 | 686 | (defun sumibi-theme--ivy () 687 | "Derive ivy faces from sumibi faces." 688 | (with-eval-after-load 'ivy 689 | (set-face 'ivy-action 'sumibi-face-faded) 690 | (set-face 'ivy-completions-annotations 'sumibi-face-faded) 691 | (set-face 'ivy-confirm-face 'sumibi-face-faded) 692 | (set-face 'ivy-current-match '(sumibi-face-strong sumibi-face-subtle)) 693 | (set-face 'ivy-cursor 'sumibi-face-strong) 694 | (set-face 'ivy-grep-info 'sumibi-face-strong) 695 | (set-face 'ivy-grep-line-number 'sumibi-face-faded) 696 | (set-face 'ivy-highlight-face 'sumibi-face-strong) 697 | (set-face 'ivy-match-required-face 'sumibi-face-faded) 698 | (set-face 'ivy-minibuffer-match-face-1 'sumibi-face-faded) 699 | (set-face 'ivy-minibuffer-match-face-2 'sumibi-face-faded) 700 | (set-face 'ivy-minibuffer-match-face-3 'sumibi-face-faded) 701 | (set-face 'ivy-minibuffer-match-face-4 'sumibi-face-faded) 702 | (set-face 'ivy-minibuffer-match-highlight 'sumibi-face-strong) 703 | (set-face 'ivy-modified-buffer 'sumibi-face-popout) 704 | (set-face 'ivy-modified-outside-buffer 'sumibi-face-strong) 705 | (set-face 'ivy-org 'sumibi-face-faded) 706 | (set-face 'ivy-prompt-match 'sumibi-face-faded) 707 | (set-face 'ivy-remote 'sumibi-face-default) 708 | (set-face 'ivy-separator 'sumibi-face-faded) 709 | (set-face 'ivy-subdir 'sumibi-face-faded) 710 | (set-face 'ivy-virtual 'sumibi-face-faded) 711 | (set-face 'ivy-yanked-word 'sumibi-face-faded))) 712 | 713 | (defun sumibi-theme--helm () 714 | "Derive helm faces from sumibi faces." 715 | (with-eval-after-load 'helm 716 | (set-face 'helm-selection '(sumibi-face-strong sumibi-face-subtle)) 717 | (set-face 'helm-match 'sumibi-face-strong) 718 | (set-face 'helm-source-header 'sumibi-face-salient) 719 | (set-face 'helm-visible-mark 'sumibi-face-strong))) 720 | 721 | (defun sumibi-theme--helm-swoop () 722 | "Derive helm faces from sumibi faces." 723 | (with-eval-after-load 'helm-swoop 724 | (set-face 'helm-swoop-target-line-face '(sumibi-face-strong sumibi-face-subtle)))) 725 | 726 | (defun sumibi-theme--helm-occur () 727 | "Derive helm faces from sumibi faces." 728 | (with-eval-after-load 'helm-occur 729 | (set-face 'helm-moccur-buffer 'sumibi-face-strong))) 730 | 731 | (defun sumibi-theme--helm-ff () 732 | "Derive helm faces from sumibi faces." 733 | (with-eval-after-load 'helm-ff 734 | (set-face 'helm-ff-file 'sumibi-face-faded) 735 | (set-face 'helm-ff-prefix 'sumibi-face-strong) 736 | (set-face 'helm-ff-dotted-directory 'sumibi-face-faded) 737 | (set-face 'helm-ff-directory 'sumibi-face-strong) 738 | (set-face 'helm-ff-executable 'sumibi-face-popout))) 739 | 740 | (defun sumibi-theme--helm-grep () 741 | "Derive helm faces from sumibi faces." 742 | (with-eval-after-load 'helm-grep 743 | (set-face 'helm-grep-match 'sumibi-face-strong) 744 | (set-face 'helm-grep-file 'sumibi-face-faded) 745 | (set-face 'helm-grep-lineno 'sumibi-face-faded) 746 | (set-face 'helm-grep-finish 'sumibi-face-default))) 747 | 748 | (defun sumibi-theme () 749 | "Derive many, many faces from the core sumibi faces." 750 | (sumibi-theme--agenda) 751 | (sumibi-theme--basics) 752 | (sumibi-theme--bookmark) 753 | (sumibi-theme--buttons) 754 | (sumibi-theme--calendar) 755 | (sumibi-theme--company) 756 | (sumibi-theme--ctrlf) 757 | (sumibi-theme--customize) 758 | (sumibi-theme--diff) 759 | (sumibi-theme--flycheck) 760 | (sumibi-theme--flyspell) 761 | (sumibi-theme--font-lock) 762 | (sumibi-theme--helm) 763 | (sumibi-theme--helm-ff) 764 | (sumibi-theme--helm-grep) 765 | (sumibi-theme--helm-occur) 766 | (sumibi-theme--helm-swoop) 767 | (sumibi-theme--rainbow-delimiters) 768 | (sumibi-theme--hl-line) 769 | (sumibi-theme--ido) 770 | (sumibi-theme--info) 771 | (sumibi-theme--ivy) 772 | (sumibi-theme--markdown) 773 | (sumibi-theme--message) 774 | (sumibi-theme--minibuffer) 775 | (sumibi-theme--parinfer-rust) 776 | (sumibi-theme--dired) 777 | (sumibi-theme--mode-line) 778 | (sumibi-theme--org) 779 | (sumibi-theme--outline) 780 | (sumibi-theme--package) 781 | (sumibi-theme--cider-overlay) 782 | (sumibi-theme--hydra) 783 | (sumibi-theme--numbers-mode) 784 | (sumibi-theme--rst) 785 | (sumibi-theme--speedbar) 786 | (sumibi-theme--term)) 787 | 788 | (provide 'sumibi-theme) 789 | 790 | ;;; sumibi-theme.el ends here 791 | --------------------------------------------------------------------------------