├── .gitignore ├── README.org ├── static ├── orgmode.jpg └── progmode.jpg ├── .editorconfig ├── init.el ├── early-init.el └── custom-init.org /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | \#* -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | custom-init.org -------------------------------------------------------------------------------- /static/orgmode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoliky/dotemacs-archived/HEAD/static/orgmode.jpg -------------------------------------------------------------------------------- /static/progmode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoliky/dotemacs-archived/HEAD/static/progmode.jpg -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # More information at https://editorconfig.org 3 | 4 | [*.{el,org}] 5 | indent_style = space 6 | indent_size = 2 -------------------------------------------------------------------------------- /init.el: -------------------------------------------------------------------------------- 1 | ;;; init.el --- Initialization file -*- lexical-binding: t; -*- 2 | 3 | ;; Author: Zoltán Király 4 | ;; Created: November 10, 2020 5 | 6 | ;;; Commentary: 7 | 8 | ;; This file specifies how to initialize Emacs 9 | ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html 10 | 11 | ;;; Code: 12 | 13 | ;; Check to see if the minimum version requirement of Emacs is met 14 | (let ((minver "28.2")) 15 | (when (version< emacs-version minver) 16 | (error "This configuration requires Emacs %s or higher." minver))) 17 | 18 | ;; Load the Emacs Lisp code blocks embedded in the literate Org file 19 | (org-babel-load-file (expand-file-name "~/.emacs.d/custom-init.org")) 20 | 21 | ;;; init.el ends here -------------------------------------------------------------------------------- /early-init.el: -------------------------------------------------------------------------------- 1 | ;;; early-init.el --- Early initialization file -*- lexical-binding: t; -*- 2 | 3 | ;; Author: Zoltán Király 4 | ;; Created: November 10, 2020 5 | 6 | ;;; Commentary: 7 | 8 | ;; This file is loaded before the package system and GUI is initialized 9 | ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html 10 | 11 | ;;; Code: 12 | 13 | ;; Maximize the Emacs frame on startup 14 | (push '(fullscreen . maximized) default-frame-alist) 15 | 16 | ;; Set default frame size to 1920x1080 pixels 17 | (push '(width . (text-pixels . 1920)) default-frame-alist) 18 | (push '(height . (text-pixels . 1080)) default-frame-alist) 19 | 20 | ;; Set background color to prevent startup glare 21 | (push '(background-color . "#fff2f3") default-frame-alist) 22 | 23 | ;; Remove host name from titlebar information 24 | (setq frame-title-format '(multiple-frames "%b" ("" "%b - GNU Emacs"))) 25 | 26 | ;; Turn off mouse interface early in startup to avoid momentary display 27 | (push '(menu-bar-lines . 0) default-frame-alist) 28 | (push '(tool-bar-lines . 0) default-frame-alist) 29 | (push '(vertical-scroll-bars) default-frame-alist) 30 | 31 | ;; Suppress the "package cl is deprecated" warning 32 | (setq byte-compile-warnings '(cl-functions)) 33 | 34 | ;; Suppress warnings and errors during asynchronous native compilation 35 | (when (native-comp-available-p) 36 | (setq native-comp-async-report-warnings-errors nil)) 37 | 38 | ;;; early-init.el ends here -------------------------------------------------------------------------------- /custom-init.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Zoltán Király's GNU Emacs Configuration 2 | #+AUTHOR: Zoltán Király 3 | #+EMAIL: zoliky@gmail.com 4 | #+DATE: <2020-11-10 Tue> 5 | 6 | * About 7 | 8 | Emacs is an extensible computing environment that I use mainly for its text editing and scheduling features. 9 | 10 | [[./static/orgmode.jpg]] 11 | 12 | * Table of Contents :TOC: 13 | - [[#about][About]] 14 | - [[#package-management][Package management]] 15 | - [[#general-configuration][General configuration]] 16 | - [[#better-defaults][Better defaults]] 17 | - [[#spell-checking][Spell checking]] 18 | - [[#packages][Packages]] 19 | - [[#color-schemes][Color schemes]] 20 | - [[#ef][Ef]] 21 | - [[#modus][Modus]] 22 | - [[#general-enhancements][General enhancements]] 23 | - [[#avy][Avy]] 24 | - [[#consult][Consult]] 25 | - [[#corfu][Corfu]] 26 | - [[#dashboard][Dashboard]] 27 | - [[#dired][Dired]] 28 | - [[#doom-modeline][Doom modeline]] 29 | - [[#editorconfig][Editorconfig]] 30 | - [[#exec-path][Exec path]] 31 | - [[#helpful][Helpful]] 32 | - [[#ibuffer][Ibuffer]] 33 | - [[#icons][Icons]] 34 | - [[#indent-guides][Indent guides]] 35 | - [[#magit][Magit]] 36 | - [[#move-text][Move text]] 37 | - [[#olivetti][Olivetti]] 38 | - [[#rainbow-delimiters][Rainbow delimiters]] 39 | - [[#try][Try]] 40 | - [[#vertico][Vertico]] 41 | - [[#web-mode][Web mode]] 42 | - [[#which-key][Which key]] 43 | - [[#languages][Languages]] 44 | - [[#html][HTML]] 45 | - [[#lua][Lua]] 46 | - [[#markdown][Markdown]] 47 | - [[#toml][TOML]] 48 | - [[#yaml][YAML]] 49 | - [[#applications][Applications]] 50 | - [[#email][Email]] 51 | - [[#mu4e][Mu4e]] 52 | - [[#mu4e-alert][Mu4e alert]] 53 | - [[#elfeed][Elfeed]] 54 | - [[#emms][Emms]] 55 | - [[#custom-key-bindings][Custom key bindings]] 56 | - [[#custom-functions][Custom functions]] 57 | - [[#custom-input-methods][Custom input methods]] 58 | - [[#org-mode][Org mode]] 59 | - [[#agenda][Agenda]] 60 | - [[#appear][Appear]] 61 | - [[#bullets][Bullets]] 62 | - [[#calendar][Calendar]] 63 | - [[#capture][Capture]] 64 | - [[#contacts][Contacts]] 65 | - [[#crypt][Crypt]] 66 | - [[#denote][Denote]] 67 | - [[#export][Export]] 68 | - [[#toc][Toc]] 69 | 70 | * Package management 71 | 72 | Initialize the package system. 73 | 74 | #+begin_src emacs-lisp 75 | (require 'package) 76 | (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) 77 | (setq package-archive-priorities '(("melpa" . 100) 78 | ("gnu" . 50) 79 | ("nongnu" . 25))) 80 | #+end_src 81 | 82 | Ensure that ~use-package~ is installed. 83 | 84 | #+begin_src emacs-lisp 85 | (unless (package-installed-p 'use-package) 86 | (package-refresh-contents) 87 | (package-install 'use-package)) 88 | 89 | (use-package use-package 90 | :init 91 | (setq use-package-always-ensure t) 92 | (use-package use-package-ensure-system-package 93 | :ensure t)) 94 | #+end_src 95 | 96 | * General configuration 97 | ** Better defaults 98 | 99 | Override some of the defaults. 100 | 101 | #+begin_src emacs-lisp 102 | (setq-default 103 | inhibit-startup-screen t ; Disable the startup screen 104 | initial-scratch-message nil ; Empty the initial *scratch* buffer 105 | indent-tabs-mode nil ; Insert space characters instead of tabs 106 | tab-width 2 ; The number of spaces a tab is equal to 107 | fill-column 78 ; Line length above which to break a line 108 | cursor-type 'bar ; Display the cursor as a vertical bar 109 | column-number-mode t ; Display the column number in the mode line 110 | vc-follow-symlinks t ; Follow symlinks without requesting confirmation 111 | major-mode 'text-mode ; Set the default major mode to text-mode 112 | ring-bell-function 'ignore ; Disable the error beep sound 113 | cursor-in-non-selected-windows nil ; Hide the cursor in non-selected windows 114 | inhibit-compacting-font-caches nil) ; Prevent compacting font caches during garbage collection 115 | (savehist-mode t) ; Save the minibuffer history 116 | (show-paren-mode t) ; Enable visualization of matching parens 117 | (save-place-mode t) ; Jump to the last known position when reopening a file 118 | (electric-pair-mode t) ; Enable automatic brackets pairing 119 | (global-hl-line-mode t) ; Enable line highlighting in all buffers 120 | (delete-selection-mode t) ; Replace selected text when typing 121 | (global-auto-revert-mode t) ; Automatically reload externally modified files 122 | (fset 'yes-or-no-p 'y-or-n-p) ; Replace "yes/no" prompts with "y/n" 123 | (prefer-coding-system 'utf-8) ; Set default encoding to UTF-8 124 | (set-language-environment 'utf-8) ; Set default language environment to UTF-8 125 | #+end_src 126 | 127 | File-related customizations. 128 | 129 | #+begin_src emacs-lisp 130 | (use-package files 131 | :ensure nil 132 | :custom 133 | (backup-directory-alist `(("." . ,(concat user-emacs-directory "backup")))) 134 | (backup-by-copying t) ; Always use copying to create backup files 135 | (delete-old-versions t) ; Delete excess backup versions 136 | (kept-new-versions 6) ; Number of newest versions to keep when a new backup is made 137 | (kept-old-versions 2) ; Number of oldest versions to keep when a new backup is made 138 | (version-control t) ; Make numeric backup versions unconditionally 139 | (auto-save-default nil) ; Stop creating #autosave# files 140 | (delete-by-moving-to-trash t) ; Move deleted files to the trash 141 | (mode-require-final-newline nil) ; Don't add newlines at the end of files 142 | (large-file-warning-threshold nil)) ; Open large files without requesting confirmation 143 | #+end_src 144 | 145 | Enable line numbering. 146 | 147 | #+begin_src emacs-lisp 148 | (use-package display-line-numbers 149 | :ensure nil 150 | :hook ((text-mode prog-mode conf-mode) . display-line-numbers-mode)) 151 | #+end_src 152 | 153 | Improve the default scrolling behavior. 154 | 155 | #+begin_src emacs-lisp 156 | (use-package mwheel 157 | :ensure nil 158 | :custom 159 | (mouse-wheel-scroll-amount '(1 ((shift) . 1))) 160 | (mouse-wheel-progressive-speed nil) 161 | (mouse-wheel-follow-mouse 't) 162 | :config 163 | (setq scroll-step 1) 164 | (setq scroll-conservatively 1000)) 165 | #+end_src 166 | 167 | Fonts and text size. 168 | 169 | #+begin_src emacs-lisp 170 | ;; Default 171 | (set-face-attribute 'default nil :family "Hack" :height 180) 172 | 173 | ;; Variable-pitch 174 | (set-face-attribute 'variable-pitch nil :family "Hack" :height 180) 175 | 176 | ;; Fixed-pitch 177 | (set-face-attribute 'fixed-pitch nil :family "Hack") 178 | 179 | ;; International Phonetic Alphabet 180 | (set-fontset-font t 'phonetic (font-spec :family "DejaVu Sans Mono")) 181 | (dolist (char (string-to-list "æθðŋʷʸˈˌ")) 182 | (set-fontset-font nil char (font-spec :family "DejaVu Sans Mono"))) 183 | #+end_src 184 | 185 | ** Spell checking 186 | 187 | Configure the spell checker for multiple languages. 188 | 189 | Dependencies: 190 | 191 | - ~sudo dnf install hunspell~ 192 | - ~sudo dnf install hunspell-en-US hunspell-hu hunspell-ro~ 193 | 194 | #+begin_src emacs-lisp 195 | (use-package ispell 196 | :ensure nil 197 | :custom 198 | (ispell-program-name "hunspell") 199 | ;; English (US), Hungarian, and Romanian 200 | (ispell-dictionary "en_US,hu_HU,ro_RO") 201 | :config 202 | (ispell-set-spellchecker-params) 203 | (ispell-hunspell-add-multi-dic "en_US,hu_HU,ro_RO")) 204 | #+end_src 205 | 206 | Enable automatic spell checking and offer suggestions for misspelled words. 207 | 208 | #+begin_src emacs-lisp 209 | (use-package flyspell 210 | :ensure nil 211 | :after ispell 212 | :bind ("C-c s" . flyspell-mode)) 213 | 214 | (use-package flyspell-correct 215 | :after flyspell 216 | :bind (:map flyspell-mode-map 217 | ("C-;" . flyspell-correct-wrapper))) 218 | #+end_src 219 | 220 | * Packages 221 | ** Color schemes 222 | *** Ef 223 | 224 | #+begin_src emacs-lisp 225 | (use-package ef-themes 226 | :init 227 | (load-theme 'ef-summer t) 228 | :bind ("" . ef-themes-select)) 229 | #+end_src 230 | 231 | *** Modus 232 | 233 | #+begin_src emacs-lisp 234 | (use-package modus-themes 235 | :defer t) 236 | #+end_src 237 | 238 | ** General enhancements 239 | *** Avy 240 | 241 | Avy provides an interface to quickly jump to any visible position in a buffer. 242 | 243 | #+begin_src emacs-lisp 244 | (use-package avy 245 | :bind ("M-s" . avy-goto-char)) 246 | #+end_src 247 | 248 | *** Consult 249 | 250 | Consult enhances the built-in completion and search features of Emacs. 251 | 252 | #+begin_src emacs-lisp 253 | (use-package consult 254 | :bind (("C-s" . consult-line) 255 | ("C-x b" . consult-buffer))) 256 | 257 | (use-package consult-notes 258 | :bind ("" . consult-notes) 259 | :custom 260 | (consult-notes-denote-files-function (function denote-directory-text-only-files)) 261 | :config 262 | (consult-notes-denote-mode)) 263 | #+end_src 264 | 265 | *** Corfu 266 | 267 | Corfu is a completion UI for Emacs. 268 | 269 | #+begin_src emacs-lisp 270 | (use-package corfu 271 | :init 272 | (global-corfu-mode) 273 | :custom 274 | (corfu-auto t) 275 | (corfu-cycle t) 276 | (corfu-auto-prefix 1) 277 | (corfu-auto-delay 0.1) 278 | (corfu-quit-no-match 'separator) 279 | (corfu-exclude-modes '(org-mode mu4e-compose-mode))) 280 | 281 | (use-package cape 282 | :init 283 | (add-to-list 'completion-at-point-functions #'cape-dabbrev) 284 | (add-to-list 'completion-at-point-functions #'cape-file)) 285 | #+end_src 286 | 287 | *** Dashboard 288 | 289 | Dashboard is an extensible Emacs startup screen. 290 | 291 | #+begin_src emacs-lisp 292 | (use-package dashboard 293 | :after nerd-icons 294 | :custom 295 | (dashboard-items '((recents . 5) 296 | (projects . 5) 297 | (agenda . 10))) 298 | (dashboard-set-footer nil) 299 | (dashboard-set-init-info t) 300 | (dashboard-center-content t) 301 | (dashboard-set-file-icons t) 302 | (dashboard-set-heading-icons t) 303 | (dashboard-startup-banner 'logo) 304 | (dashboard-projects-backend 'project-el) 305 | :config 306 | (dashboard-setup-startup-hook) 307 | (setq initial-buffer-choice (lambda () 308 | (get-buffer-create "*dashboard*") 309 | (dashboard-refresh-buffer)))) 310 | #+end_src 311 | 312 | *** Dired 313 | 314 | Dired provides a convenient way to manage files and directories inside Emacs. 315 | 316 | #+begin_src emacs-lisp 317 | (use-package dired 318 | :ensure nil 319 | :after nerd-icons-dired 320 | :bind ("C-x C-j" . dired-jump) 321 | :hook (dired-mode . (lambda () 322 | (nerd-icons-dired-mode) 323 | (dired-hide-details-mode))) 324 | :custom 325 | (dired-auto-revert-buffer t) 326 | (dired-recursive-copies 'always) 327 | (dired-recursive-deletes 'always) 328 | (dired-hide-details-hide-symlink-targets nil) 329 | (dired-hide-details-hide-information-lines nil) 330 | (dired-listing-switches "-agho --group-directories-first")) 331 | 332 | (use-package dired-narrow 333 | :after dired 334 | :bind (:map dired-mode-map 335 | ("/" . dired-narrow))) 336 | 337 | (use-package dired-subtree 338 | :after dired 339 | :bind (:map dired-mode-map 340 | ("" . dired-subtree-cycle) 341 | ("" . dired-subtree-toggle))) 342 | 343 | (use-package dired-hide-dotfiles 344 | :hook (dired-mode . dired-hide-dotfiles-mode) 345 | :bind (:map dired-mode-map 346 | ("." . dired-hide-dotfiles-mode)) 347 | :custom 348 | (dired-hide-dotfiles-verbose nil)) 349 | 350 | (use-package nerd-icons-dired 351 | :after nerd-icons) 352 | #+end_src 353 | 354 | *** Doom modeline 355 | 356 | Doom modeline is a modeline for GNU Emacs inspired by the Doom theme collection. 357 | 358 | #+begin_src emacs-lisp 359 | (use-package doom-modeline 360 | :after nerd-icons 361 | :init 362 | (doom-modeline-mode) 363 | :custom 364 | (doom-modeline-mu4e t) 365 | (doom-modeline-height 38)) 366 | #+end_src 367 | 368 | *** Editorconfig 369 | 370 | EditorConfig helps developers define consistent coding styles across various editors and IDEs. 371 | 372 | #+begin_src emacs-lisp 373 | (use-package editorconfig 374 | :defer t 375 | :init 376 | (editorconfig-mode)) 377 | #+end_src 378 | 379 | *** Exec path 380 | 381 | Exec path helps ensure that environment variables inside Emacs look the same as in the user's shell. 382 | 383 | #+begin_src emacs-lisp 384 | (use-package exec-path-from-shell 385 | :init 386 | (setq exec-path-from-shell-arguments nil) 387 | :config 388 | (exec-path-from-shell-initialize)) 389 | #+end_src 390 | 391 | *** Helpful 392 | 393 | Helpful improves the built-in Emacs help system by providing more contextual information. 394 | 395 | #+begin_src emacs-lisp 396 | (use-package helpful 397 | :bind 398 | ([remap describe-key] . helpful-key) 399 | ([remap describe-command] . helpful-command) 400 | ([remap describe-variable] . helpful-variable) 401 | ([remap describe-function] . helpful-callable)) 402 | #+end_src 403 | 404 | *** Ibuffer 405 | 406 | Ibuffer is a built-in replacement for ~list-buffers~. 407 | 408 | #+begin_src emacs-lisp 409 | (use-package ibuffer 410 | :ensure nil 411 | :bind ("C-x C-b" . ibuffer)) 412 | 413 | (use-package nerd-icons-ibuffer 414 | :after (nerd-icons ibuffer) 415 | :hook (ibuffer-mode . nerd-icons-ibuffer-mode)) 416 | #+end_src 417 | 418 | *** Icons 419 | 420 | A library for inserting developer icons. 421 | 422 | #+begin_src emacs-lisp 423 | (use-package nerd-icons) 424 | #+end_src 425 | 426 | *** Indent guides 427 | 428 | Highlight the indentation level in Emacs buffers. 429 | 430 | #+begin_src emacs-lisp 431 | (use-package highlight-indent-guides 432 | :hook (prog-mode . highlight-indent-guides-mode) 433 | :custom 434 | (highlight-indent-guides-responsive 'top) 435 | (highlight-indent-guides-method 'character)) 436 | #+end_src 437 | 438 | *** Magit 439 | 440 | Magit is a Git interface for Emacs. 441 | 442 | #+begin_src emacs-lisp 443 | (use-package magit 444 | :bind ("C-c g" . magit-status)) 445 | #+end_src 446 | 447 | *** Move text 448 | 449 | A package to move current line or region. 450 | 451 | #+begin_src emacs-lisp 452 | (use-package move-text 453 | :bind (("M-p" . move-text-up) 454 | ("M-n" . move-text-down)) 455 | :config 456 | (move-text-default-bindings)) 457 | #+end_src 458 | 459 | *** Olivetti 460 | 461 | Olivetti is a package designed to create a distraction-free writing environment. 462 | 463 | #+begin_src emacs-lisp 464 | (use-package olivetti 465 | :hook ((org-mode . olivetti-mode) 466 | (markdown-mode . olivetti-mode) 467 | (mu4e-view-mode . olivetti-mode) 468 | (elfeed-show-mode . olivetti-mode) 469 | (mu4e-compose-mode . olivetti-mode)) 470 | :custom 471 | (olivetti-body-width 80)) 472 | #+end_src 473 | 474 | *** Rainbow delimiters 475 | 476 | Rainbow delimiters highlights delimiters such as parentheses, brackets or braces according to their depth. 477 | 478 | #+begin_src emacs-lisp 479 | (use-package rainbow-delimiters 480 | :hook (prog-mode . rainbow-delimiters-mode)) 481 | #+end_src 482 | 483 | *** Try 484 | 485 | Try is a package that allows to try out Emacs packages without installing them. 486 | 487 | #+begin_src emacs-lisp 488 | (use-package try 489 | :defer t) 490 | #+end_src 491 | 492 | *** Vertico 493 | 494 | Vertico helps to rapidly complete file names, buffer names, or any other Emacs interactions requiring selecting an item from a list of possible choices. 495 | 496 | #+begin_src emacs-lisp 497 | (use-package vertico 498 | :init 499 | (vertico-mode) 500 | :custom 501 | (vertico-cycle t)) 502 | 503 | (use-package vertico-directory 504 | :ensure nil 505 | :after vertico 506 | :bind (:map vertico-map 507 | ("RET" . vertico-directory-enter) 508 | ("DEL" . vertico-directory-delete-char) 509 | ("M-DEL" . vertico-directory-delete-word)) 510 | :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) 511 | 512 | (use-package orderless 513 | :custom 514 | (completion-styles '(orderless basic)) 515 | (completion-category-overrides '((file (styles basic partial-completion))))) 516 | 517 | (use-package marginalia 518 | :init 519 | (marginalia-mode) 520 | :custom 521 | (marginalia-align 'right)) 522 | 523 | (use-package nerd-icons-completion 524 | :after nerd-icons 525 | :config 526 | (nerd-icons-completion-mode)) 527 | #+end_src 528 | 529 | *** Web mode 530 | 531 | Major mode for editing web templates. 532 | 533 | #+begin_src emacs-lisp 534 | (use-package web-mode 535 | :mode "\\.html\\'" 536 | :custom 537 | (web-mode-attr-indent-offset 2) 538 | (web-mode-enable-css-colorization t) 539 | (web-mode-enable-auto-closing t) 540 | (web-mode-markup-indent-offset 2) 541 | (web-mode-css-indent-offset 2) 542 | (web-mode-code-indent-offset 2) 543 | (web-mode-enable-current-element-highlight t)) 544 | #+end_src 545 | 546 | *** Which key 547 | 548 | An Emacs package that displays available keybindings in a panel. For example, if you enter ~CTRL-x~ and wait for a second, the panel will expand with all of the available key bindings that follow ~CTRL-x~. 549 | 550 | #+begin_src emacs-lisp 551 | (use-package which-key 552 | :defer t 553 | :init 554 | (which-key-mode) 555 | :custom 556 | (which-key-idle-delay 1)) 557 | #+end_src 558 | 559 | ** Languages 560 | *** HTML 561 | 562 | Automatically rename paired HTML/XML tag. 563 | 564 | #+begin_src emacs-lisp 565 | (use-package auto-rename-tag 566 | :hook (web-mode . auto-rename-tag-mode)) 567 | #+end_src 568 | 569 | *** Lua 570 | 571 | Major mode for editing Lua files. 572 | 573 | #+begin_src emacs-lisp 574 | (use-package lua-mode 575 | :mode "\\.lua\\'") 576 | #+end_src 577 | 578 | *** Markdown 579 | 580 | Major mode for editing Markdown files. 581 | 582 | #+begin_src emacs-lisp 583 | (use-package markdown-mode 584 | :init 585 | (setq markdown-command "multimarkdown") 586 | :hook (markdown-mode . (lambda () (display-line-numbers-mode -1))) 587 | :mode (("README\\.md\\'" . gfm-mode) 588 | ("\\.md\\'" . markdown-mode) 589 | ("\\.markdown\\'" . markdown-mode))) 590 | #+end_src 591 | 592 | *** TOML 593 | 594 | Major mode for editing TOML files. 595 | 596 | #+begin_src emacs-lisp 597 | (use-package toml-mode 598 | :mode "\\.toml\\'") 599 | #+end_src 600 | 601 | *** YAML 602 | 603 | Major mode for editing YAML files. 604 | 605 | #+begin_src emacs-lisp 606 | (use-package yaml-mode 607 | :mode "\\.yml\\'") 608 | #+end_src 609 | 610 | * Applications 611 | ** Email 612 | *** Mu4e 613 | 614 | Mu4e is an e-mail client that runs inside Emacs. 615 | 616 | Dependencies: 617 | 618 | - ~sudo dnf install isync maildir-utils~ 619 | 620 | #+begin_src emacs-lisp 621 | (use-package mu4e 622 | :ensure nil 623 | :ensure-system-package mu 624 | :load-path "/usr/share/emacs/site-lisp/mu4e" 625 | :bind (("C-c m" . mu4e) 626 | :map mu4e-view-mode-map 627 | ("n" . next-line) 628 | ("p" . previous-line) 629 | ("" . org-next-link) 630 | ("" . org-previous-link) 631 | ("" . mu4e~view-browse-url-from-binding)) 632 | :hook (mu4e-compose-mode 633 | . (lambda () 634 | (flyspell-mode) 635 | (auto-fill-mode -1) 636 | (display-line-numbers-mode -1))) 637 | :custom 638 | (mail-user-agent 'mu4e-user-agent) 639 | (mu4e-get-mail-command "mbsync -c ~/.mbsyncrc -a") 640 | (mu4e-update-interval 600) 641 | (mu4e-split-view nil) 642 | (mu4e-confirm-quit nil) 643 | (mu4e-use-fancy-chars t) 644 | (mu4e-view-show-images t) 645 | (mu4e-view-prefer-html t) 646 | (mu4e-view-show-addresses t) 647 | (mu4e-hide-index-messages t) 648 | (mu4e-attachment-dir "~/Downloads") 649 | (mu4e-compose-dont-reply-to-self t) 650 | (mu4e-change-filenames-when-moving t) 651 | (mu4e-sent-messages-behavior 'delete) 652 | (mu4e-index-update-error-warning nil) 653 | (mu4e-html2text-command "w3m -dump -I utf-8 -O utf-8 -T text/html")) 654 | 655 | (use-package mu4e-headers 656 | :ensure nil 657 | :hook (mu4e-headers-mode . (lambda () (eldoc-mode -1))) 658 | :custom 659 | (mu4e-headers-auto-update t) 660 | (mu4e-headers-fields `((:human-date . 12) 661 | (:flags . 6) 662 | (:from . 22) 663 | (:subject . ,(- (window-body-width) 50)))) 664 | :config 665 | (setq mu4e-headers-attach-mark '("a" . "📎"))) 666 | 667 | (use-package message 668 | :ensure nil 669 | :custom 670 | (message-kill-buffer-on-exit t) 671 | (message-send-mail-function 'smtpmail-send-it)) 672 | 673 | (use-package smtpmail 674 | :ensure nil 675 | :custom 676 | (smtpmail-smtp-service 587) 677 | (smtpmail-smtp-server "smtp.gmail.com") 678 | (smtpmail-auth-credentials "~/.authinfo.gpg") 679 | (smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))) 680 | 681 | (use-package org-mime 682 | :defer t 683 | :config 684 | (setq org-mime-export-options '(:section-numbers nil 685 | :with-author nil 686 | :with-toc nil))) 687 | 688 | (use-package mu4e-context 689 | :ensure nil 690 | :custom 691 | (mu4e-context-policy 'pick-first) 692 | (mu4e-compose-context-policy 'always-ask) 693 | :config 694 | (setq mu4e-contexts 695 | (list 696 | (make-mu4e-context 697 | ;; Personal context 698 | :name "personal" 699 | :enter-func (lambda () (mu4e-message "Entering personal context")) 700 | :match-func (lambda (msg) 701 | (when msg 702 | (mu4e-message-contact-field-matches 703 | msg '(:from :to :cc :bcc) "zoliky@gmail.com"))) 704 | :vars '((user-mail-address . "zoliky@gmail.com") 705 | (user-full-name . "Zoltan Kiraly") 706 | (mu4e-sent-folder . "/gmail-zoliky/[Gmail].Sent Mail") 707 | (mu4e-drafts-folder . "/gmail-zoliky/[Gmail].Drafts") 708 | (mu4e-trash-folder . "/gmail-zoliky/[Gmail].Trash") 709 | (smtpmail-queue-dir . "~/Maildir/gmail-zoliky/queue/cur") 710 | (smtpmail-smtp-user . "zoliky") 711 | (mu4e-maildir-shortcuts 712 | . ((:maildir "/gmail-zoliky/INBOX" :key ?i) 713 | (:maildir "/gmail-zoliky/[Gmail].Starred" :key ?r) 714 | (:maildir "/gmail-zoliky/[Gmail].Sent Mail" :key ?s) 715 | (:maildir "/gmail-zoliky/[Gmail].Drafts" :key ?d) 716 | (:maildir "/gmail-zoliky/[Gmail].Trash" :key ?t))))) 717 | (make-mu4e-context 718 | ;; Work context 719 | :name "work" 720 | :enter-func (lambda () (mu4e-message "Entering work context")) 721 | :match-func (lambda (msg) 722 | (when msg 723 | (mu4e-message-contact-field-matches 724 | msg '(:from :to :cc :bcc) "zolikydev@gmail.com"))) 725 | :vars '((user-mail-address . "zolikydev@gmail.com") 726 | (user-full-name . "Zoltan Kiraly") 727 | (mu4e-sent-folder . "/gmail-zolikydev/[Gmail].Sent Mail") 728 | (mu4e-drafts-folder . "/gmail-zolikydev/[Gmail].Drafts") 729 | (mu4e-trash-folder . "/gmail-zolikydev/[Gmail].Trash") 730 | (smtpmail-queue-dir . "~/Maildir/gmail-zolikydev/queue/cur") 731 | (smtpmail-smtp-user . "zolikydev") 732 | (mu4e-maildir-shortcuts 733 | . ((:maildir "/gmail-zolikydev/INBOX" :key ?i) 734 | (:maildir "/gmail-zolikydev/[Gmail].Starred" :key ?r) 735 | (:maildir "/gmail-zolikydev/[Gmail].Sent Mail" :key ?s) 736 | (:maildir "/gmail-zolikydev/[Gmail].Drafts" :key ?d) 737 | (:maildir "/gmail-zolikydev/[Gmail].Trash" :key ?t)))))))) 738 | #+end_src 739 | 740 | *** Mu4e alert 741 | 742 | Desktop notifications and mode line display for mu4e. 743 | 744 | #+begin_src emacs-lisp 745 | (use-package mu4e-alert 746 | :hook ((after-init . mu4e-alert-enable-mode-line-display)) 747 | :custom 748 | ;; Notify only of unread emails in the inbox 749 | (mu4e-alert-interesting-mail-query "flag:unread maildir:/INBOX/") 750 | :config 751 | (mu4e-alert-set-default-style 'libnotify)) 752 | #+end_src 753 | 754 | ** Elfeed 755 | 756 | Elfeed is a news reader for Emacs. 757 | 758 | Dependencies: 759 | 760 | - ~sudo dnf install youtube-dl mpv~ 761 | 762 | #+begin_src emacs-lisp 763 | (use-package elfeed 764 | :preface 765 | ;; Mark all feeds as read 766 | (defun king/elfeed-search-mark-all-read () 767 | (interactive) 768 | (mark-whole-buffer) 769 | (elfeed-search-untag-all-unread)) 770 | 771 | ;; Open selected feeds in a browser 772 | (defun king/elfeed-search-browse-url (&optional use-generic-p) 773 | (interactive "P") 774 | (let ((entries (elfeed-search-selected))) 775 | (cl-loop for entry in entries 776 | when (elfeed-entry-link entry) 777 | do (if use-generic-p 778 | (browse-url-generic (elfeed-entry-link entry)) 779 | (browse-url (elfeed-entry-link entry)))) 780 | (mapc #'elfeed-search-update-entry entries) 781 | (unless (or elfeed-search-remain-on-entry (use-region-p))))) 782 | 783 | ;; Play podcasts and YouTube videos 784 | (defun king/elfeed-search-open-enclosure (&optional use-generic-p) 785 | (interactive "P") 786 | (let ((entries (elfeed-search-selected))) 787 | (cl-loop for entry in entries 788 | when (elfeed-entry-link entry) 789 | do (call-process-shell-command 790 | (format "mpv --force-window '%s'" (elfeed-entry-link entry)) nil 0)) 791 | (mapc #'elfeed-search-update-entry entries) 792 | (unless (or elfeed-search-remain-on-entry (use-region-p)))) 793 | (message "Loading...") 794 | (add-hook 'focus-out-hook (lambda () (message nil)))) 795 | :bind (("C-c e" . elfeed) 796 | :map elfeed-search-mode-map 797 | ("M" . elfeed-toggle-starred) 798 | ("b" . king/elfeed-search-browse-url) 799 | ("R" . king/elfeed-search-mark-all-read) 800 | ("P" . king/elfeed-search-open-enclosure)) 801 | :custom 802 | (elfeed-db-directory "~/.emacs.d/elfeed/") 803 | :config 804 | (setq shr-width 80)) 805 | 806 | (use-package elfeed-search 807 | :ensure nil 808 | :custom 809 | (elfeed-search-title-max-width 100) 810 | (elfeed-search-filter "@3-months-ago +unread ") 811 | :config 812 | ;; Star and unstar feeds 813 | (defalias 'elfeed-toggle-starred 814 | (elfeed-expose #'elfeed-search-toggle-all 'starred)) 815 | ;; Custom tag faces 816 | (defface elfeed-search-starred-title-face nil "Starred feeds") 817 | (push '(starred elfeed-search-starred-title-face) elfeed-search-face-alist) 818 | (defface elfeed-search-podcast-title-face nil "Podcast entries") 819 | (push '(podcast elfeed-search-podcast-title-face) elfeed-search-face-alist) 820 | (defface elfeed-search-youtube-title-face nil "YouTube entries") 821 | (push '(youtube elfeed-search-youtube-title-face) elfeed-search-face-alist)) 822 | 823 | (use-package elfeed-org 824 | :after elfeed 825 | :init 826 | (elfeed-org) 827 | :custom 828 | (rmh-elfeed-org-files '("~/orgfiles/elfeed.org"))) 829 | #+end_src 830 | 831 | ** Emms 832 | 833 | Emms (Emacs Multimedia System) is an interactive media browser and music player for Emacs. 834 | 835 | Dependencies: 836 | 837 | - ~pip install tinytag~ 838 | - ~sudo dnf install mpv~ 839 | 840 | #+begin_src emacs-lisp 841 | (use-package emms 842 | :bind (("C-c u" . emms) 843 | ("C-c U" . emms-browser) 844 | ("" . emms-show) 845 | ("" . emms-volume-lower) 846 | ("" . emms-volume-raise) 847 | ("" . emms-previous) 848 | ("" . emms-next) 849 | ("" . emms-pause) 850 | ("" . emms-stop) 851 | :map emms-playlist-mode-map 852 | ("p" . previous-line) 853 | ("n" . next-line)) 854 | :custom 855 | (emms-info-asynchronously t) 856 | (emms-volume-amixer-card 1) 857 | (emms-volume-amixer-control "PCM") 858 | (emms-playlist-buffer-name "*Music*") 859 | (emms-player-list '(emms-player-mpv)) 860 | (emms-info-functions '(emms-info-tinytag)) 861 | (emms-source-file-default-directory "/run/media/zoliky/Lara/Music") 862 | (emms-source-file-directory-tree-function 863 | 'emms-source-file-directory-tree-find) 864 | :config 865 | (require 'emms-setup) 866 | (require 'emms-history) 867 | (require 'emms-volume) 868 | (require 'emms-volume-amixer) 869 | (require 'emms-mode-line) 870 | (emms-all) 871 | (emms-history-load) 872 | (emms-mode-line nil)) 873 | #+end_src 874 | 875 | * Custom key bindings 876 | 877 | #+begin_src emacs-lisp 878 | (keymap-global-unset "C-z") ; Disable C-z 879 | (keymap-global-set "M-o" 'other-window) ; Bind M-o to other-window 880 | (keymap-global-set "M-z" 'zap-up-to-char) ; Bind M-z to zap-up-to-char 881 | (keymap-global-set "C-S-d" 'duplicate-line) ; Bind C-S-d to duplicate-line 882 | 883 | ;; Disable secondary selection commands 884 | (keymap-global-unset "M-") 885 | (keymap-global-unset "M-") 886 | (keymap-global-unset "M-") 887 | (keymap-global-unset "M-") 888 | (keymap-global-unset "M-") 889 | #+end_src 890 | 891 | * Custom functions 892 | 893 | Move the cursor to the first non-whitespace character of the line. If the cursor is already there, then move it to the beginning of the line. 894 | 895 | #+begin_src emacs-lisp 896 | (defun king/smarter-beginning-of-line () 897 | (interactive) 898 | (if (= (point) (progn (back-to-indentation) (point))) 899 | (beginning-of-line))) 900 | 901 | (keymap-global-set "C-a" 'king/smarter-beginning-of-line) 902 | #+end_src 903 | 904 | When splitting a window, switch to the new window. 905 | 906 | #+begin_src emacs-lisp 907 | (defun king/split-window-below-and-switch () 908 | (interactive) 909 | (split-window-below) 910 | (balance-windows) 911 | (other-window 1)) 912 | 913 | (defun king/split-window-right-and-switch () 914 | (interactive) 915 | (split-window-right) 916 | (balance-windows) 917 | (other-window 1)) 918 | 919 | (keymap-global-set "C-x 2" 'king/split-window-below-and-switch) 920 | (keymap-global-set "C-x 3" 'king/split-window-right-and-switch) 921 | #+end_src 922 | 923 | Mark deleted e-mail messages as read. 924 | 925 | #+begin_src emacs-lisp 926 | (defun king/mu4e-mark-gmail-trash-as-read (&optional _) 927 | (let* ((cmd "mu find maildir:/trash/ flag:unread --format=sexp 2>/dev/null") 928 | (res (concat "(list" (shell-command-to-string cmd) ")")) 929 | (msgs (car (read-from-string res)))) 930 | (unless (equal '(list) msgs) 931 | (dolist (msg msgs) 932 | (when-let ((docid (mu4e-message-field msg :docid))) 933 | (unless (= docid 0) 934 | (mu4e~proc-move docid nil "+S-u-N"))))))) 935 | 936 | (advice-add 'mu4e :before #'king/mu4e-mark-gmail-trash-as-read) 937 | #+end_src 938 | 939 | Resize large images in e-mail messages to fit the window. 940 | 941 | #+begin_src emacs-lisp 942 | (defun mu4e-display-image (imgpath &optional maxwidth maxheight) 943 | (let ((img (create-image imgpath nil nil 944 | :max-width maxwidth :max-height maxheight))) 945 | (save-excursion 946 | (insert "\n") 947 | (let ((size (image-size img))) 948 | (insert-char ?\n (max 0 (round (- (window-height) (or maxheight (cdr size)) 1) 2))) 949 | (insert-char ?\. (max 0 (round (- (window-width) (or maxwidth (car size))) 2))) 950 | (insert-image img))))) 951 | #+end_src 952 | 953 | Use colors from the active theme palette. 954 | 955 | #+begin_src emacs-lisp 956 | (defun king/colors-active-theme () 957 | (let ((next "violetred") 958 | (repeat "violetred") 959 | (waiting "slateblue") 960 | (postponed "chocolate") 961 | (someday "chocolate") 962 | (delegated "slateblue") 963 | (project "royalblue") 964 | (failed "slategray") 965 | (cancelled "slategray") 966 | (starred "violetred") 967 | (podcast "darkcyan") 968 | (youtube "chocolate")) 969 | (when (and (featurep 'ef-themes) (ef-themes--list-enabled-themes)) 970 | (ef-themes-with-colors 971 | (setq next magenta-warmer 972 | repeat magenta-warmer 973 | waiting magenta-cooler 974 | postponed yellow-warmer 975 | someday yellow-warmer 976 | delegated magenta-cooler 977 | project blue 978 | failed fg-dim 979 | cancelled fg-dim 980 | starred magenta-warmer 981 | podcast cyan-cooler 982 | youtube yellow-warmer))) 983 | (setq org-todo-keyword-faces 984 | `(("NEXT" . (:foreground ,next :weight bold)) 985 | ("REPEAT" . (:foreground ,repeat :weight bold)) 986 | ("WAITING" . (:foreground ,waiting :weight bold)) 987 | ("POSTPONED" . (:foreground ,postponed :weight bold)) 988 | ("SOMEDAY" . (:foreground ,someday :weight bold)) 989 | ("DELEGATED" . (:foreground ,delegated :weight bold)) 990 | ("PROJECT" . (:foreground ,project :weight bold)) 991 | ("FAILED" . (:foreground ,failed :weight bold)) 992 | ("CANCELLED" . (:foreground ,cancelled :weight bold)))) 993 | 994 | ;; Elfeed 995 | (set-face-attribute 'elfeed-search-starred-title-face nil :foreground starred) 996 | (set-face-attribute 'elfeed-search-podcast-title-face nil :foreground podcast) 997 | (set-face-attribute 'elfeed-search-youtube-title-face nil :foreground youtube) 998 | 999 | ;; Restart Org mode 1000 | (when (derived-mode-p 'org-mode) 1001 | (org-mode-restart)))) 1002 | 1003 | (king/colors-active-theme) 1004 | (add-hook 'ef-themes-post-load-hook 'king/colors-active-theme) 1005 | #+end_src 1006 | 1007 | * Custom input methods 1008 | 1009 | Input methods provide convenient ways of entering non-ASCII characters from the keyboard. 1010 | 1011 | #+begin_src emacs-lisp 1012 | (quail-define-package 1013 | "custom-input-method" "" "" t 1014 | "Custom input method 1015 | 1016 | Documentation goes here." 1017 | nil t nil nil nil nil nil nil nil nil t) 1018 | 1019 | (quail-define-rules 1020 | ;; Phonetic symbols 1021 | ("\\uh" ?ə) ; UNSTRESSED SCHWA VOWEL 1022 | ("\\uH" ?ʌ) ; STRESSED SCHWA VOWEL 1023 | ("\\ii" ?ɪ) ; NEAR-CLOSE NEAR-FRONT UNROUNDED VOWEL 1024 | ("\\uu" ?ʊ) ; NEAR-CLOSE NEAR-BACK ROUNDED VOWEL 1025 | ("\\ee" ?ɛ) ; OPEN-MID FRONT UNROUNDED VOWEL 1026 | ("\\er" ?ɜ) ; OPEN-MID CENTRAL UNROUNDED VOWEL 1027 | ("\\oh" ?ɔ) ; OPEN-MID BACK ROUNDED VOWEL 1028 | ("\\ae" ?æ) ; NEAR-OPEN FRONT UNROUNDED VOWEL 1029 | ("\\ah" ?ɑ) ; OPEN BACK UNROUNDED VOWEL 1030 | ("\\th" ?θ) ; VOICELESS DENTAL FRICATIVE 1031 | ("\\tH" ?ð) ; VOICED DENTAL FRICATIVE 1032 | ("\\sh" ?ʃ) ; VOICELESS POSTALVEOLAR FRICATIVE 1033 | ("\\zs" ?ʒ) ; VOICED POSTALVEOLAR FRICATIVE 1034 | ("\\be" ?β) ; VOICED BILABIAL FRICATIVE 1035 | ("\\vv" ?ɣ) ; VOICED VELAR FRICATIVE 1036 | ("\\hh" ?ɥ) ; VOICED LABIAL-PALATAL APPROXIMANT 1037 | ("\\la" ?ʎ) ; VOICED PALATAL LATERAL APPROXIMANT 1038 | ("\\jj" ?ʝ) ; VOICED PALATAL FRICATIVE 1039 | ("\\mm" ?ɱ) ; VOICED LABIODENTAL NASAL 1040 | ("\\ts" ?ʧ) ; VOICELESS POSTALVEOLAR AFFRICATE 1041 | ("\\dz" ?ʤ) ; VOICED POSTALVEOLAR AFFRICATE 1042 | ("\\ny" ?ɲ) ; VOICED PALATAL NASAL 1043 | ("\\ng" ?ŋ) ; VOICED VELAR NASAL 1044 | ("\\rr" ?ɹ) ; VOICED ALVEOLAR APPROXIMANT 1045 | ("\\ta" ?ɾ) ; VOICED ALVEOLAR TAP 1046 | ("\\ir" ?ʁ) ; VOICED UVULAR FRICATIVE 1047 | ("\\dl" ?ɫ) ; VELARIZED ALVEOLAR LATERAL APPROXIMANT 1048 | ("\\as" ?ʰ) ; ASPIRATED 1049 | ("\\ps" ?ˈ) ; PRIMARY STRESS 1050 | ("\\ss" ?ˌ) ; SECONDARY STRESS 1051 | ("\\li" ?‿) ; LIAISON 1052 | ("\\ri" ?↗) ; RISING INFLECTION 1053 | ("\\fi" ?↘) ; FALLING INFLECTION 1054 | ("\\lw" ?ʷ) ; LABIAL HIGH ROUNDED 1055 | ("\\ly" ?ʸ) ; PALATAL HIGH UNROUNDED 1056 | ("\\st" ?̚) ; NO AUDIBLE RELEASE 1057 | 1058 | ;; Common symbols 1059 | ("\\copy" ?©) ; COPYRIGHT 1060 | ("\\tm" ?™) ; TRADEMARK 1061 | ("\\mdot" ?·) ; INTERPUNCT 1062 | ("\\ha" ?á) ; A-ACUTE 1063 | ("\\endash" ?–) ; EN DASH 1064 | ("\\emdash" ?—) ; EM DASH 1065 | ("\\female" ?♀) ; FEMALE 1066 | ("\\male" ?♂) ; MALE 1067 | ("\\eur" ?€)) ; EURO 1068 | #+end_src 1069 | 1070 | * Org mode 1071 | 1072 | #+begin_quote 1073 | Org mode is a a to-do, agenda, project planner, literate programming, note-taking (and more!) application. It is widely considered the best text-based organizer ever — a feat only surpassed by the fact that people switch to Emacs just to use it. 1074 | 1075 | — Mickey Petersen, author of "Mastering Emacs" 1076 | #+end_quote 1077 | 1078 | #+begin_src emacs-lisp 1079 | (use-package org 1080 | :ensure nil 1081 | :hook (org-mode . (lambda () 1082 | (org-indent-mode) 1083 | (variable-pitch-mode -1) 1084 | (display-line-numbers-mode -1) 1085 | (set-input-method "custom-input-method"))) 1086 | :bind ("C-c l" . org-store-link) 1087 | :custom 1088 | (org-ellipsis " ▾") 1089 | (org-tags-column 0) 1090 | (org-log-done 'time) 1091 | (org-startup-folded t) 1092 | (org-log-into-drawer t) 1093 | (org-clock-into-drawer t) 1094 | (org-log-reschedule 'time) 1095 | (org-image-actual-width nil) 1096 | (org-src-fontify-natively t) 1097 | (org-src-tab-acts-natively t) 1098 | (org-hide-emphasis-markers t) 1099 | (org-directory "~/orgfiles") 1100 | (org-export-with-tags nil) 1101 | (org-export-headline-levels 5) 1102 | (org-export-backends '(html latex)) 1103 | (org-startup-with-inline-images t) 1104 | (org-modules '(org-crypt org-habit)) 1105 | (org-tag-alist '(("crypt" . ?c) 1106 | ("temp" . ?t) 1107 | ("home" . ?h) 1108 | ("work" . ?w) 1109 | ("urgent" . ?u) 1110 | ("export" . ?e) 1111 | ("noexport" . ?n) 1112 | ("expired" . ?x) 1113 | ("TOC" . ?T))) 1114 | (org-tags-sort-function 'org-string-collate-lessp) 1115 | (org-tags-exclude-from-inheritance '("crypt")) 1116 | (org-todo-keywords '((sequence "TODO(t)" 1117 | "NEXT(n)" 1118 | "REPEAT(r)" 1119 | "WAITING(w)" 1120 | "POSTPONED(e)" 1121 | "SOMEDAY(s)" 1122 | "DELEGATED(o)" 1123 | "PROJECT(p)" "|" 1124 | "DONE(d)" 1125 | "FORWARDED(f)" 1126 | "CANCELLED(c)") 1127 | (sequence "GOAL(g)" "|" 1128 | "ACHIEVED(a)" 1129 | "FAILED(x)"))) 1130 | (org-todo-repeat-to-state "REPEAT") 1131 | (org-refile-allow-creating-parent-nodes 'confirm) 1132 | (org-refile-targets '((org-agenda-files . (:maxlevel . 4))))) 1133 | 1134 | (use-package org-faces 1135 | :ensure nil 1136 | :custom-face 1137 | (org-todo ((nil (:weight bold)))) 1138 | (org-done ((nil (:weight bold)))) 1139 | (org-table ((nil (:inherit fixed-pitch)))) 1140 | (org-block ((nil (:inherit fixed-pitch)))) 1141 | (org-code ((nil (:inherit (shadow fixed-pitch)))))) 1142 | 1143 | ;; Replace list hyphens with bullets 1144 | (font-lock-add-keywords 1145 | 'org-mode 1146 | '(("^ *\\([-]\\) " 1147 | (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) 1148 | #+end_src 1149 | 1150 | ** Agenda 1151 | 1152 | #+begin_src emacs-lisp 1153 | (use-package org-agenda 1154 | :ensure nil 1155 | :bind ("C-c a" . org-agenda) 1156 | :custom 1157 | (org-agenda-files 1158 | (seq-filter #'file-exists-p 1159 | (mapcar #'(lambda (file) (file-name-concat org-directory file)) 1160 | '("bookmarks.org" 1161 | "calendar.org" 1162 | "contacts.org" 1163 | "personal.org" 1164 | "work.org" 1165 | "misc.org" 1166 | "notes.org" 1167 | "people.org" 1168 | "refile.org" 1169 | "elfeed.org" 1170 | "english.org" 1171 | "spanish.org" 1172 | "private.org")))) 1173 | (org-agenda-include-diary t) 1174 | (org-habit-graph-column 80) 1175 | (org-habit-today-glyph ?⧖) 1176 | (org-habit-completed-glyph ?✓) 1177 | (org-agenda-window-setup 'current-window)) 1178 | #+end_src 1179 | 1180 | ** Appear 1181 | 1182 | A package to toggle visibility of hidden Org elements. 1183 | 1184 | #+begin_src emacs-lisp 1185 | (use-package org-appear 1186 | :after org 1187 | :hook (org-mode . org-appear-mode)) 1188 | #+end_src 1189 | 1190 | ** Bullets 1191 | 1192 | Prettify Org headings by replacing leading stars with UTF-8 bullets. 1193 | 1194 | #+begin_src emacs-lisp 1195 | (use-package org-superstar 1196 | :hook (org-mode . org-superstar-mode) 1197 | :config 1198 | (org-superstar-configure-like-org-bullets)) 1199 | #+end_src 1200 | 1201 | ** Calendar 1202 | 1203 | #+begin_src emacs-lisp 1204 | (use-package calendar 1205 | :ensure nil 1206 | :custom 1207 | (calendar-mark-holidays-flag t)) 1208 | 1209 | (use-package holidays 1210 | :ensure nil 1211 | :custom 1212 | (holiday-bahai-holidays nil) 1213 | (holiday-christian-holidays 1214 | '((holiday-fixed 1 6 "Epiphany (Vízkereszt)") 1215 | (holiday-easter-etc -46 "Ash Wednesday (Hamvazószerda)") 1216 | (holiday-easter-etc -7 "Palm Sunday (Virágvasárnap)") 1217 | (holiday-easter-etc -2 "Holy Friday (Nagypéntek)") 1218 | (holiday-easter-etc 0 "Easter Sunday (Húsvétvasárnap)") 1219 | (holiday-easter-etc 1 "Easter Monday (Húsvéthétfő)") 1220 | (holiday-easter-etc 39 "Ascension (Áldozócsütörtök)") 1221 | (holiday-easter-etc 49 "Pentecost (Pünkösd)") 1222 | (holiday-easter-etc 56 "Trinity Sunday (Szentháromság Vasárnapja)") 1223 | (holiday-easter-etc 60 "Corpus Christi (Úrnapja)") 1224 | (holiday-greek-orthodox-easter) 1225 | (holiday-fixed 8 15 "Assumption (Nagyboldogasszony)") 1226 | (holiday-fixed 11 1 "All Saints' Day (Mindenszentek Napja)") 1227 | (holiday-fixed 11 2 "Day of the Dead (Hallotak Napja)") 1228 | (holiday-fixed 12 25 "Christmas Day (Karácsony Napja)"))) 1229 | (holiday-general-holidays 1230 | '((holiday-fixed 1 1 "New Year's Day (Újév)") 1231 | (holiday-fixed 2 14 "Valentine's Day (Valentin Nap)") 1232 | (holiday-fixed 3 8 "International Women's Day (Nemzetközi Nőnap)") 1233 | (holiday-fixed 10 31 "Halloween (Észak-Amerikai Ünnep)") 1234 | (holiday-float 11 4 4 "Thanksgiving (Észak-Amerikai Ünnep)"))) 1235 | (holiday-local-holidays 1236 | '((holiday-fixed 5 1 "Labor Day (A Munka Ünnepe)") 1237 | (holiday-float 5 0 1 "Mother's Day (Anyák Napja)"))) 1238 | (holiday-hebrew-holidays nil) 1239 | (holiday-islamic-holidays nil) 1240 | (holiday-oriental-holidays nil)) 1241 | #+end_src 1242 | 1243 | ** Capture 1244 | 1245 | Templates to quickly record tasks, notes, and other semi-structured information. 1246 | 1247 | #+begin_src emacs-lisp 1248 | (use-package org-capture 1249 | :ensure nil 1250 | :after org 1251 | :bind ("C-c c" . org-capture) 1252 | :preface 1253 | (defvar king/capture-template-bookmark 1254 | (concat "* [[%^{Link}][%^{Description}]]\n" 1255 | ":PROPERTIES:\n" 1256 | ":Created: %U\n" 1257 | ":END:\n") "Bookmark") 1258 | (defvar king/capture-template-contact 1259 | (concat "* %?\n" 1260 | ":PROPERTIES:\n" 1261 | ":Created: %U\n" 1262 | ":Birthday: yyyy-mm-dd\n" 1263 | ":Email:\n" 1264 | ":Mobile:\n" 1265 | ":Skype:\n" 1266 | ":Address:\n" 1267 | ":City:\n" 1268 | ":State:\n" 1269 | ":Country:\n" 1270 | ":PostalCode:\n" 1271 | ":Website:\n" 1272 | ":Note:\n" 1273 | ":END:\n") "Contact") 1274 | :custom 1275 | (org-capture-templates 1276 | `( 1277 | ;; Bookmark 1278 | ("b" "Bookmark" 1279 | entry (file+headline ,(concat org-directory "/refile.org") "Bookmarks"), 1280 | king/capture-template-bookmark) 1281 | 1282 | ;; Contact 1283 | ("c" "Contact" 1284 | entry (file+headline ,(concat org-directory "/refile.org") "Contacts"), 1285 | king/capture-template-contact) 1286 | 1287 | ;; Note 1288 | ("n" "Note" 1289 | entry (file+headline ,(concat org-directory "/refile.org") "Notes") 1290 | "* %?\n:PROPERTIES:\n:Created: %U\n:END:\n") 1291 | 1292 | ;; Task 1293 | ("t" "Task" 1294 | entry (file+headline ,(concat org-directory "/refile.org") "Tasks") 1295 | "* %?\n:PROPERTIES:\n:Created: %U\n:END:\n")))) 1296 | #+end_src 1297 | 1298 | ** Contacts 1299 | 1300 | A contact manager for Org mode. 1301 | 1302 | #+begin_src emacs-lisp 1303 | (use-package org-contacts 1304 | :after org 1305 | :custom 1306 | (org-contacts-files (list (concat org-directory "/contacts.org")))) 1307 | #+end_src 1308 | 1309 | ** Crypt 1310 | 1311 | Encrypt and decrypt entries in Org mode. 1312 | 1313 | #+begin_src emacs-lisp 1314 | (use-package org-crypt 1315 | :ensure nil 1316 | :after org 1317 | :custom 1318 | ;; Public key 1319 | (org-crypt-key "182BC820D271E36BE128AD05D1F775A0A21D3351") 1320 | :config 1321 | (org-crypt-use-before-save-magic)) 1322 | #+end_src 1323 | 1324 | ** Denote 1325 | 1326 | A simple note-taking tool, based on the idea that notes should follow a predictable and descriptive file-naming scheme. 1327 | 1328 | #+begin_src emacs-lisp 1329 | (use-package denote 1330 | :after org 1331 | :bind ("C-c d" . denote) 1332 | :hook (dired-mode . denote-dired-mode) 1333 | :custom 1334 | (denote-sort-keywords t) 1335 | (denote-directory "~/notes/") 1336 | (denote-allow-multi-word-keywords nil)) 1337 | #+end_src 1338 | 1339 | ** Export 1340 | 1341 | A LaTeX back-end for the Org export engine. 1342 | 1343 | Dependencies: 1344 | 1345 | - ~sudo dnf install sil-charis-fonts~ 1346 | - ~sudo dnf install texlive-scheme-basic~ 1347 | - ~sudo dnf install tex-wrapfig tex-ulem tex-capt-of tex-nopageno~ 1348 | 1349 | #+begin_src emacs-lisp 1350 | (use-package ox-latex 1351 | :ensure nil 1352 | :after org 1353 | :custom 1354 | (org-latex-compiler "xelatex") 1355 | :config 1356 | (add-to-list 1357 | 'org-latex-classes 1358 | '("org-plain-latex" 1359 | "\\documentclass{article} 1360 | [NO-DEFAULT-PACKAGES] 1361 | [PACKAGES] 1362 | [EXTRA]" 1363 | ("\\section{%s}" . "\\section*{%s}") 1364 | ("\\subsection{%s}" . "\\subsection*{%s}") 1365 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 1366 | ("\\paragraph{%s}" . "\\paragraph*{%s}") 1367 | ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) 1368 | #+end_src 1369 | 1370 | ** Toc 1371 | 1372 | A package to automatically generate a table of contents based on the structure of the document. 1373 | 1374 | #+begin_src emacs-lisp 1375 | (use-package toc-org 1376 | :after org 1377 | :hook (org-mode . toc-org-enable) 1378 | :custom 1379 | (toc-org-max-depth 3)) 1380 | #+end_src --------------------------------------------------------------------------------