diff --git a/README.org b/README.org index 51e8ba5..fdad9c5 100644 --- a/README.org +++ b/README.org @@ -208,31 +208,25 @@ Emacs' default user interface is horrendous, but with less than 10 lines of code #+begin_src emacs-lisp (use-package org - :hook - (org-mode . (lambda () - (org-indent-mode) - (visual-line-mode 1) - (variable-pitch-mode 1))) - :config - (setq org-ellipsis " ▾" - org-log-done 'time - org-log-into-drawer t - org-directory dotfiles/home - org-src-preserve-indentation t) - - (org-babel-do-load-languages - 'org-babel-load-languages - '((shell . t) - (python . t) - (emacs-lisp . t))) - - (require 'org-tempo) - (add-to-list 'org-structure-template-alist '("s" . "src")) - (add-to-list 'org-structure-template-alist '("q" . "quote")) - (add-to-list 'org-structure-template-alist '("e" . "example")) - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))) + :hook (org-mode . + (lambda () + (org-indent-mode) + (visual-line-mode 1) + (variable-pitch-mode 1))) + :custom (org-ellipsis " ▾") + (org-log-done 'time) + (org-log-into-drawer t) + (org-directory dotfiles/home) + (org-src-preserve-indentation t) + :config (require 'org-tempo) + (add-to-list 'org-structure-template-alist '("s" . "src")) + (add-to-list 'org-structure-template-alist '("q" . "quote")) + (add-to-list 'org-structure-template-alist '("e" . "example")) + (add-to-list 'org-structure-template-alist '("sh" . "src shell")) + (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) + (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) + (python . t) + (emacs-lisp . t)))) #+end_src #+begin_src emacs-lisp @@ -259,8 +253,8 @@ Download [[https://github.com/justbur/emacs-which-key][which-key]], a package th #+begin_src emacs-lisp (use-package which-key :diminish which-key-mode - :init (which-key-mode) - :config (setq which-key-idle-delay dotfiles/idle)) + :custom (which-key-idle-delay dotfiles/idle) + :config (which-key-mode)) #+end_src **** Leader @@ -289,8 +283,8 @@ After a few hour with =vim= I knew it was game over, I cannot even think of anot #+begin_src emacs-lisp (use-package evil - :init (setq evil-want-integration t - evil-want-keybinding nil) + :custom (evil-want-integration t) ;; Required for `evil-collection'. + (evil-want-keybinding nil) ;; Same as above :config (evil-mode 1)) #+end_src @@ -418,8 +412,8 @@ https://github.com/zwild/eshell-prompt-extras #+begin_src emacs-lisp (use-package eshell-prompt-extras - :config (setq eshell-highlight-prompt nil - eshell-prompt-function 'epe-theme-lambda)) + :custom (eshell-highlight-prompt nil) + (eshell-prompt-function 'epe-theme-lambda)) #+end_src Open an =eshell= buffer with =SPC e=. @@ -461,10 +455,9 @@ By default =dired= will create a new buffer everytime you press =RET= over a dir #+begin_src emacs-lisp (use-package dired-single - :config - (evil-collection-define-key 'normal 'dired-mode-map - "h" 'dired-single-up-directory - "l" 'dired-single-buffer)) + :config (evil-collection-define-key 'normal 'dired-mode-map + "h" 'dired-single-up-directory + "l" 'dired-single-buffer)) #+end_src Open a dired buffer with =SPC d=. @@ -569,26 +562,24 @@ Connect our custom hooks and configure the input keys, a custom layer for defini #+begin_src emacs-lisp (use-package exwm - :config - (require 'exwm-randr) - (exwm-randr-enable) - (add-hook 'exwm-init-hook #'dotfiles/init-hook) - (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display) - (dotfiles/update-display) - (setq exwm-input-prefix-keys - '(?\M-x - ?\C-g - ?\C-\ ) - exwm-input-global-keys - `(([?\s-r] . exwm-reset) - ([?\s-&] . dotfiles/run) - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () + :custom (exwm-input-prefix-keys + '(?\M-x + ?\C-g + ?\C-\ )) + (exwm-input-global-keys + `(([?\s-r] . exwm-reset) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () (interactive) (exwm-workspace-switch-create ,i)))) - (number-sequence 1 9)))) - (exwm-enable)) + (number-sequence 1 9)))) + :config (require 'exwm-randr) + (exwm-randr-enable) + (add-hook 'exwm-init-hook #'dotfiles/init-hook) + (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display) + (dotfiles/update-display) + (exwm-enable)) #+end_src ** Writing @@ -625,9 +616,8 @@ Download and install [[https://orgroam.com][org-roam]], a plain text knowledge m #+begin_src emacs-lisp (use-package org-roam :hook (after-init . org-roam-mode) - :custom - (org-roam-directory org-directory) - (org-roam-encrypt-files t)) + :custom (org-roam-directory org-directory) + (org-roam-encrypt-files t)) #+end_src Visualize the org-roam database with the server, available when the editor is running at http://localhost:8080 @@ -763,28 +753,25 @@ mu index --maildir="~/.cache/mail" Once the mail is being synchronized, and the mail has been indexed with =mu=, it's time to install the required packages for Emacs. ++ Update every 5 minutes ++ Scale text for all devices ++ Sign outbound mail with GPG key ++ Configure mail account(s) + #+begin_src emacs-lisp (use-package mu4e :load-path "/usr/share/emacs/site-lisp/mu4e" + :custom (mu4e-maildir "~/.cache/mail") + (mu4e-update-interval (* 5 60)) + (mu4e-get-mail-command "mbsync -a") + (mu4e-compose-format-flowed t) + (mu4e-change-filenames-when-moving t) + (message-send-mail-function 'smtpmail-send-it) + (mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F")) + (mu4e-compose-signature (concat "Chris Hayward\n" + "https://chrishayward.xyz\n")) :config - (setq mu4e-change-filenames-when-moving t - mu4e-update-interval (* 5 60) ;; Every 5 minutes. - mu4e-get-mail-command "mbsync -a" - mu4e-maildir "~/.cache/mail" - mu4e-compose-signature - (concat "Chris Hayward\n" - "https://chrishayward.xyz\n")) - - ;; Ensure plain text scales for all devices. - (setq mu4e-compose-format-flowed t) - - ;; GPG signing key for outbound mail. - (setq mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F")) (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime) - - (setq message-send-mail-function 'smtpmail-send-it) - - ;; Configure mail account(s). (setq mu4e-contexts (list ;; Main @@ -807,11 +794,9 @@ Use [[https://github.com/iqbalansari/mu4e-alert][mu4e-alert]] to give us desktop #+begin_src emacs-lisp (use-package mu4e-alert - :custom - (mu4e-alert-set-default-style 'libnotify) - :config - (mu4e-alert-enable-notifications) - (mu4e-alert-enable-mode-line-display)) + :custom (mu4e-alert-set-default-style 'libnotify) + :config (mu4e-alert-enable-notifications) + (mu4e-alert-enable-mode-line-display)) #+end_src Create a keybinding to open the mail dashboard with =SPC m=. @@ -858,8 +843,7 @@ It requires the installation of ~scrot~, ~gifsicle~, and ~convert~ from the =Ima #+begin_src emacs-lisp (use-package gif-screencast - :custom - (gif-screencast-output-directory (concat dotfiles/home "docs/images/"))) + :custom (gif-screencast-output-directory (concat dotfiles/home "docs/images/"))) #+end_src Screencast controls behind =SPC s=. @@ -905,9 +889,8 @@ Configure [[https://projectile.mx][projectile]], a project interaction library f #+begin_src emacs-lisp (use-package projectile - :config - (setq projectile-project-search-path '("~/.local/source")) - (projectile-mode)) + :custom (projectile-project-search-path '("~/.local/source")) + :config (projectile-mode)) #+end_src *** Passwords @@ -960,14 +943,17 @@ Support for individual languages are implemented here. **** C/C++ -Install the [[https://github.com/MaskRay/ccls][ccls]] language server. +Install the [[https://github.com/MaskRay/ccls][ccls]] language server, and allow us to create a new structure template for C/C++ with ~