diff options
22 files changed, 1355 insertions, 1270 deletions
diff --git a/Emacs/.config/emacs/.config/elfeed/feeds.org b/Emacs/.config/emacs/.config/elfeed/feeds.org deleted file mode 100644 index 80921e7..0000000 --- a/Emacs/.config/emacs/.config/elfeed/feeds.org +++ /dev/null @@ -1,36 +0,0 @@ -#+title: RSS Feeds -#+author: Aryadev Chavali -#+date: 2025-02-17 - -* News :news: -** [[https://www.archlinux.org/feeds/news/][Arch Linux]] -** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCEDEqT7DeUJyVNc5QpwSTgQ][Barely Informed]] -* Social :social: -** [[https://news.ycombinator.com/rss][Hacker News]] :tech: -** [[https://www.theonion.com/rss][The Onion]] -** [[https://www.hackerfactor.com/blog/index.php?/feeds/index.rss2][Hacker Factor]] :tech: -* YouTube :youtube: -** Educational :educational: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC0uTPqBCFIpZxlz_Lv1tk_g][Protesilaos Stavrou]] :tech: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCrqM0Ym_NbK1fqeQG2VIohg][Tsoding Daily]] :tech: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCrqM0Ym_NbK1fqeQG2VIohg][Tsoding]] :tech: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCaTznQhurW5AaiYPbhEA-KA][Molly Rocket]] :tech: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCYO_jab_esuFRV4b17AJtAw][3B1B]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC6_J0wZdqcoRVs0Mck922SQ][Sheafification of G]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCr_Q-bPpcw5fJ-Oow1BW1NQ][Kraut]] :news: -** Tech :tech: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCfJRkBBiPtKZyZn_3PxWaiQ][Internet of Bugs]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA][Mental Outlaw]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCgBVkKoOAr3ajSdFFLp13_A][KRAZAM]] -** Stories :stories: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCbWcXB0PoqOsAvAdfzWMf0w][Fredrik Knusden]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC9PIn6-XuRKZ5HmYeu46AIw][Barely Sociable]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCn8OYopT9e8tng-CGEWzfmw][Atrocity Guide]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC7dHBh9QmYF1L0TOeGIzZgw][Lazy Masquerade]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCjDQKxiTVpXutZc2Ra9wCAg][Oki's Weird Stories]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCyNtlmLB73-7gtlBz00XOQQ][Folding Ideas]] -** Misc :misc: -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCZ1q3ZqXAFCvym4jrGozdRg][The Elephant Graveyard]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC3cpN6gcJQqcCM6mxRUo_dA][Wendigoon]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCm22FAXZMw1BaWeFszZxUKw][Kitboga]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCxSwqqnJp9HsW0hBrHcp1FQ][Flesh Simulator]] diff --git a/Emacs/.config/emacs/.var/gamegrid-user-score/tetris-scores b/Emacs/.config/emacs/.var/gamegrid-user-score/tetris-scores index a85dc51..9184e6e 100644 --- a/Emacs/.config/emacs/.var/gamegrid-user-score/tetris-scores +++ b/Emacs/.config/emacs/.var/gamegrid-user-score/tetris-scores @@ -1,5 +1,6 @@ 00458 Tue Oct 1 18:22:44 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00424 Tue Oct 1 14:20:22 2024 Aryadev Chavali <aryadev@aryadevchavali.com> +00288 Sun Jun 1 14:24:57 2025 Aryadev Chavali <aryadev@aryadevchavali.com> 00281 Thu Jul 13 03:07:51 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00267 Fri Aug 16 10:54:52 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00253 Fri Dec 2 14:00:06 2022 Aryadev Chavali <aryadev@aryadevchavali.com> @@ -9,8 +10,8 @@ 00204 Wed Dec 28 14:50:42 2022 Aryadev Chavali <aryadev@aryadevchavali.com> 00187 Thu Jan 12 01:30:09 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00172 Mon Jan 9 12:59:13 2023 Aryadev Chavali <aryadev@aryadevchavali.com> -00166 Fri Aug 16 11:05:23 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00166 Mon May 6 02:40:23 2024 Aryadev Chavali <aryadev@aryadevchavali.com> +00166 Fri Aug 16 11:05:23 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00120 Thu Aug 29 18:45:32 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00114 Fri Jul 21 11:58:31 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00096 Sat Dec 3 16:21:40 2022 Aryadev Chavali <aryadev@aryadevchavali.com> @@ -26,12 +27,12 @@ 00048 Sun May 5 19:34:16 2024 Aryadev Chavali <aryadev@aryadevchavali.com> 00046 Wed Oct 12 11:27:19 2022 Aryadev Chavali <aryadev@aryadevchavali.com> 00042 Tue Aug 1 19:58:49 2023 Aryadev Chavali <aryadev@aryadevchavali.com> -00038 Tue Oct 11 16:47:44 2022 Aryadev Chavali <aryadev@aryadevchavali.com> 00038 Fri Oct 14 13:05:44 2022 Aryadev Chavali <aryadev@aryadevchavali.com> +00038 Tue Oct 11 16:47:44 2022 Aryadev Chavali <aryadev@aryadevchavali.com> 00037 Thu Aug 17 18:11:59 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00027 Thu Jan 12 01:14:32 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00024 Thu Jan 12 01:14:54 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00012 Tue Jan 17 13:58:01 2023 Aryadev Chavali <aryadev@aryadevchavali.com> -00006 Thu Jun 22 23:16:42 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00006 Mon Jan 9 11:04:43 2023 Aryadev Chavali <aryadev@aryadevchavali.com> +00006 Thu Jun 22 23:16:42 2023 Aryadev Chavali <aryadev@aryadevchavali.com> 00000 Fri Dec 2 13:58:02 2022 Aryadev Chavali <aryadev@aryadevchavali.com> diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index b1c2763..9bf5a92 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -15,6 +15,7 @@ Welcome to my Emacs configuration. You may be confused by the fact it's a readable document with prose; this file serves as both documentation *and* code. Here's an example of some Emacs Lisp code: + #+begin_src emacs-lisp ;;; config.el --- Compiled configuration from config.org -*- lexical-binding: t; -*- @@ -83,28 +84,27 @@ Let's setup a few absolute essentials: :demand t :init (setq auth-sources '("~/.authinfo.gpg") + auto-revert-stop-on-user-input nil auto-revert-use-notify nil auto-revert-verbose nil backup-directory-alist `(("." . ,(no-littering-expand-var-file-name "saves/"))) buffer-file-coding-system 'utf-8-unix delete-by-moving-to-trash t global-auto-revert-non-file-buffers t + read-answer-short t + read-extended-command-predicate #'command-completion-default-include-p remote-file-name-inhibit-delete-by-moving-to-trash t + revert-without-query '(".") save-buffer-coding-system 'utf-8-unix select-enable-clipboard t use-dialog-box nil use-file-dialog nil + use-short-answers t user-full-name "Aryadev Chavali" user-mail-address "aryadev@aryadevchavali.com" warning-minimum-level :error) :config - (fset 'yes-or-no-p 'y-or-n-p) - (global-auto-revert-mode) - (let ((font-size (pcase (system-name) - ("rhmaiden" 150) - (_ 120)))) - (set-face-attribute 'default nil :height font-size) - (set-face-attribute 'mode-line nil :height font-size))) + (global-auto-revert-mode)) #+end_src * Custom functionality and libraries This is custom Lisp that I or someone else has written which I really @@ -264,17 +264,17 @@ forcefully adjust the font size. #+begin_src emacs-lisp (defun +oreo/font-reset (&optional theme) - (let ((font-size (thread-first - (pcase (system-name) - ("rhmaiden" 140) - (_ 120)) - (* - (pcase (display-pixel-width) - ((pred (>= 1920)) 0.90) - ((pred (>= 2560)) 1.24))) - floor))) - (set-face-attribute 'default nil :height font-size) - (set-face-attribute 'mode-line nil :height font-size))) + (--> + (* (pcase (system-name) ; get a fixed base value based on the machine + ("rhmaiden" 140) + (_ 120)) + (pcase (display-pixel-width) ; get a multiplier based on resolution + ((pred (>= 1920)) 0.9) + ((pred (>= 2560)) 1.24))) + floor + (progn + (set-face-attribute 'default nil :height it) + (set-face-attribute 'mode-line nil :height it)))) (add-to-list 'enable-theme-functions #'+oreo/font-reset) #+end_src @@ -401,6 +401,11 @@ global scope, namely: :keymaps 'override :prefix "SPC d") + (general-create-definer org-leader + :states '(normal motion) + :keymaps 'override + :prefix "SPC o") + (general-create-definer general-nmmap :states '(normal motion)) @@ -545,6 +550,12 @@ Setup the evil package, with some opinionated settings: evil-respect-visual-line-mode nil) :config (evil-mode) + (defun +evil/select-pasted () + (interactive) + (evil-goto-mark 91) + (evil-visual-char) + (evil-goto-mark 93)) + :general (leader "w" #'evil-window-map @@ -568,6 +579,7 @@ Setup the evil package, with some opinionated settings: :keymaps 'override "gu" #'evil-upcase "gU" #'evil-downcase + "g C-v" #'+evil/select-pasted "M-y" #'yank-pop "T" 'nil) @@ -633,6 +645,8 @@ in it. completion-category-overrides '((file (styles flex partial-completion substring))) completion-ignore-case t + minibuffer-prompt-properties + '(read-only t intangible t cursor-intangible t face minibuffer-prompt) read-file-name-completion-ignore-case t read-buffer-completion-ignore-case t) :general @@ -731,8 +745,8 @@ vertico for specific forms. *** Embark I'm very late to the party here - mostly because I didn't see much point in this. However, after seeing that [[*empv][empv]] had some -embark bindings for cool behaviours (such as altering playlists) I had -to try it out - and I was not disappointed. +embark bindings for cool behaviours (such as moving tracks around on +the live playlist) I had to try it out - and I was not disappointed. ~embark-act~ is the entry point to using embark, and you can use it basically anywhere to great effect. Searching a buffer via @@ -752,7 +766,7 @@ embark act more like how you wish, which I've barely touch on here. :straight t :general (:keymaps 'override - "M-m" #'embark-act) + "M-/" #'embark-act) :display ("\\*Embark Collect \\(Live\\|Completions\\)\\*" nil @@ -763,7 +777,7 @@ embark act more like how you wish, which I've barely touch on here. (side . bottom) (window-height . 0.25) (window-parameters (mode-line-format . none))) - embark-prompter 'embark-completing-read-prompter + embark-prompter 'embark-keymap-prompter embark-indicators '(embark-highlight-indicator) embark-help-key "?" embark-keymap-prompter-key "#" @@ -786,15 +800,24 @@ search system. :init (setq consult-preview-excluded-buffers nil consult-preview-excluded-files '("\\`/[^/|:]+:") - consult-preview-key "M-'") + consult-preview-key 'any + consult-ripgrep-args "rg --null --line-buffered --color=never \ + --max-columns=1000 --path-separator / \ + --smart-case --no-heading \ + --with-filename --line-number \ + --search-zip --hidden" + consult-fd-args "fd --full-path --color=never -H") :general ([remap imenu] #'consult-imenu [remap switch-to-buffer] #'consult-buffer [remap info] #'consult-info) - (leader - "'" #'consult-register) (search-leader - "s" #'consult-line) + "s" #'consult-line + "r" #'consult-ripgrep + "f" #'consult-fd + "o" #'consult-org-agenda + "e" #'consult-compile-error + "m" #'consult-register) :config (with-eval-after-load "vertico-multiform" (add-multiple-to-list vertico-multiform-commands @@ -842,7 +865,7 @@ setup some evil binds for company. :defer t :straight t :hook - ((prog-mode-hook eshell-mode-hook) . company-mode) + (prog-mode-hook . company-mode) :init (setq company-idle-delay nil company-minimum-prefix-length 3 @@ -884,6 +907,49 @@ the keyword ~:hydra~ in use-package declarations. :general (leader "wr" #'evil-window-resize-hydra/body)) #+end_src +** Project.el +An out of the box system for managing projects. Where possible we +should try to use Emacs defaults, so when setting up on a new computer +it takes a bit less time. + +Here I: ++ Bind ~project-prefix-map~ to "<leader>p" ++ Bind a tags generation command to "<leader>pr" + + mimics projectile's one, so I can quickly generate them. + + mimicking + +#+begin_src emacs-lisp +(use-package project + :straight t + :defer t + :general + (:keymaps 'project-prefix-map + "r" #'+project/generate-tags) + (leader + "p" project-prefix-map) + :config + (setq project-vc-extra-root-markers '(".project")) + (defun +project/command (folder) + (format "ctags -Re -f %sTAGS %s*" + folder folder)) + + (defun +project/root () + (if (project-current) + (project-root (project-current)) + default-directory)) + + (defun +project/generate-tags () + (interactive) + (set-process-sentinel + (start-process-shell-command + "PROJECT-GENERATE-TAGS" + "*tags*" + (+project/command (+project/root))) + (lambda (p event) + (when (string= event "finished\n") + (message "Finished generating tags!") + (visit-tags-table (format "%sTAGS" (+project/root)))))))) +#+end_src * Aesthetics General look and feel of Emacs, perhaps the most important of all the sections here. @@ -904,25 +970,20 @@ other themes in a list. :hook (after-init-hook . +oreo/load-theme) :init (setq custom-theme-directory (concat user-emacs-directory "elisp/")) - (defvar +oreo/theme-list `(personal-solarized tsdh-light)) + (defvar +oreo/theme-list `(personal-solarized leuven)) (defvar +oreo/theme 0) :config (defun +oreo/load-theme () "Load `+oreo/theme', disabling all other themes to reduce conflict." (mapc #'disable-theme custom-enabled-themes) - (cl-loop - for theme in +oreo/theme-list - for i from 0 - if (not (= i +oreo/theme)) - do (disable-theme theme)) (load-theme (nth +oreo/theme +oreo/theme-list) t)) (defun +oreo/switch-theme () "Flip between different themes set in `+oreo/theme-alist'." - (setq +oreo/theme (mod (+ 1 +oreo/theme) (length +oreo/theme-list))) - (+oreo/load-theme)) - - (+oreo/load-theme)) + (thread-last (length +oreo/theme-list) + (mod (+ 1 +oreo/theme)) + (setq +oreo/theme)) + (+oreo/load-theme))) #+end_src ** Startup screen The default startup screen is quite bad in all honesty. While for a @@ -957,12 +1018,12 @@ fundamental mode and call it a day. (proc (with-current-buffer "*scratch*" (goto-char (point-max)) - (--> - (emacs-init-time) - (format "Emacs v%s - %s\n" emacs-version it) - (insert it)))))) + (thread-last + (emacs-init-time) + (format "Emacs v%s - %s\n" emacs-version) + (insert)))))) #+end_src -** Blinking cursor +** Cursor and the highlighted line Configure the blinking cursor. #+begin_src emacs-lisp @@ -971,9 +1032,10 @@ Configure the blinking cursor. :init (setq blink-cursor-delay 0.2) :config - (blink-cursor-mode)) + (blink-cursor-mode -1) + (global-hl-line-mode)) #+end_src -** Mode line +** Better Mode line The mode line is the little bar at the bottom of the buffer, just above the minibuffer. It can store essentially any text, but generally details about the current buffer (such as name, major mode, @@ -1085,10 +1147,16 @@ I also setup the ~pixel-scroll-mode~ to make scrolling nicer looking. (pixel-scroll-precision-mode t)) #+end_src ** Display line numbers -I don't really like line numbers, I find them similar to -[[*Fringes][fringes]] (useless space), but at least it provides some -information. Sometimes it can help with doing repeated commands so a -toggle option is necessary. +Line numbers are nice - not for referencing specific lines by hand +(why not use [[*compile-mode][compile-mode]] or ~M-x goto-line~?) but +for relative vim motions: for example, d3j deletes 3 lines down and +having the number of lines directly in front of you can be invaluable. + +2025-06-02: there's a specific option, +~display-line-numbers-width-start~, which when set to ~t~ +automatically calculates the maximum width required to display all +line numbers. This solves all the weird artifacting issues I was +having with really large documents (such as this one). #+begin_src emacs-lisp (use-package display-line-numbers @@ -1099,7 +1167,8 @@ toggle option is necessary. (mode-leader "l" #'display-line-numbers-mode) :init - (setq-default display-line-numbers-type 'relative)) + (setq-default display-line-numbers-type 'relative + display-line-numbers-width-start t)) #+end_src ** Pulsar Similar to how [[*Evil goggles][Evil goggles]] highlights Evil @@ -1267,882 +1336,6 @@ any prog language of choice. Mostly for reference and copying. ("<=" . "≤") (">=" . "≥") #+end_example -* Text packages -Standard packages and configurations for dealing with text, usually -prose. -** Flyspell -Flyspell allows me to spell check text documents. I use it primarily -in org mode, as that is my preferred prose writing software, but I -also need it in commit messages and so on, thus it should really hook -into text-mode. - -#+begin_src emacs-lisp -(use-package flyspell - :defer t - :hook ((org-mode-hook text-mode-hook) . flyspell-mode) - :general - (nmmap - :keymaps 'text-mode-map - "M-C" #'flyspell-correct-word-before-point - "M-c" #'flyspell-auto-correct-word) - (mode-leader - "s" #'flyspell-mode)) -#+end_src -** Whitespace -I hate inconsistencies in whitespace. If I'm using tabs, I better be -using them everywhere, and if I'm using whitespace, it better be well -formed. Furthermore, hard character limits are important (enforced by -[[*Filling and displaying fills][auto-fill-mode]]) which is why I like -to have some kind of highlighting option. - -I don't want to highlight whitespace for general mode categories (Lisp -shouldn't really have an 80 character limit), so set it for specific -modes that need the help. - -#+begin_src emacs-lisp -(use-package whitespace - :defer t - :general - (nmmap - "M--" #'whitespace-cleanup) - (mode-leader - "w" #'whitespace-mode) - :hook - (before-save-hook . whitespace-cleanup) - ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook - org-mode-hook text-mode-hook js-mode-hook - nasm-mode-hook) - . whitespace-mode) - :init - (setq whitespace-line-column nil - whitespace-style '(face empty spaces tabs newline trailing - lines-char tab-mark))) -#+end_src -** Filling and displaying fills -The fill-column is the number of characters that should be in a single -line of text before doing a hard wrap. The default case is 80 -characters for that l33t Unix hard terminal character limit. I like -different fill-columns for different modes: text modes should really -use 70 fill columns while code should stick to 80. - -#+begin_src emacs-lisp -(use-package emacs - :hook - (text-mode-hook . auto-fill-mode) - ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook - org-mode-hook text-mode-hook js-mode-hook) - . display-fill-column-indicator-mode) - :init - (setq-default fill-column 80) - (add-hook 'text-mode-hook (proc (setq-local fill-column 70)))) -#+end_src -** Visual line mode -When dealing with really long lines I have a specific taste. I don't -want text to just go off the screen, such that I have to move the -cursor forward in the line to see later content - I want line -wrapping. Emacs provides ~truncate-lines~ for line wrapping but it -cuts words, which isn't very nice as that cut word spans two lines. -Instead I want Emacs to cut by word, which is where visual-line-mode -comes in. Since I may experience really long lines anywhere, it -should be enabled globally. - -#+begin_src emacs-lisp -(use-package emacs - :demand t - :config - (global-visual-line-mode t)) -#+end_src -** Show-paren-mode -When the cursor is over a parenthesis, highlight the other member of -the pair. - -#+begin_src emacs-lisp -(use-package paren - :hook (prog-mode-hook . show-paren-mode)) -#+end_src -** Smartparens -Smartparens is a smarter electric-parens, it's much more aware of -context and easier to use. - -#+begin_src emacs-lisp -(use-package smartparens - :straight t - :defer t - :hook - (prog-mode-hook . smartparens-mode) - (text-mode-hook . smartparens-mode) - :config - (setq sp-highlight-pair-overlay nil - sp-highlight-wrap-overlay t - sp-highlight-wrap-tag-overlay t) - - (let ((unless-list '(sp-point-before-word-p - sp-point-after-word-p - sp-point-before-same-p))) - (sp-pair "'" nil :unless unless-list) - (sp-pair "\"" nil :unless unless-list)) - (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p)) - (require 'smartparens-config)) -#+end_src -** Powerthesaurus -Modern package for thesaurus in Emacs with a transient + hydra. -#+begin_src emacs-lisp -(use-package powerthesaurus - :defer t - :straight t - :general - (search-leader - "w" #'powerthesaurus-transient)) -#+end_src -** lorem ipsum -Sometimes you need placeholder text for some UI or document. Pretty -easy to guess what text I'd use. - -#+begin_src emacs-lisp -(use-package lorem-ipsum - :straight t - :general - (insert-leader - "p" #'lorem-ipsum-insert-paragraphs)) -#+end_src -** Auto insert -Allows inserting text immediately upon creating a new buffer with a -given name, similar to template. Supports skeletons for inserting -text. To make it easier for later systems to define their own auto -inserts, I define a ~use-package~ keyword (~:auto-insert~) which -allows one to define an entry for ~auto-insert-alist~. - -#+begin_src emacs-lisp -(use-package autoinsert - :demand t - :hook (after-init-hook . auto-insert-mode) - :config - (with-eval-after-load "use-package-core" - (add-to-list 'use-package-keywords ':auto-insert) - (defun use-package-normalize/:auto-insert (_name-symbol _keyword args) - args) - (defun use-package-handler/:auto-insert (name _keyword args rest state) - (use-package-concat - (use-package-process-keywords name rest state) - (mapcar - #'(lambda (arg) - `(add-to-list - 'auto-insert-alist - ',arg)) - args))))) -#+end_src -* Programming packages -Packages that help with programming. -** Eldoc -Eldoc presents documentation to the user upon placing ones cursor upon -any symbol. This is very useful when programming as it: -- presents the arguments of functions while writing calls for them -- presents typing and documentation of variables - -Eldoc box makes the help buffer a hovering box instead of printing it -in the minibuffer. A lot cleaner. - -2024-05-31: Eldoc box is a bit useless now that I'm not using frames. -I prefer the use of the minibuffer for printing documentation now. - -#+begin_src emacs-lisp -(use-package eldoc - :defer t - :hook (prog-mode-hook . eldoc-mode) - :init - (global-eldoc-mode 1) - :general - (leader - "h>" #'eldoc-doc-buffer)) -#+end_src -** Flycheck -Flycheck is the checking system for Emacs. I don't necessarily like -having all my code checked all the time, so I haven't added a hook to -prog-mode as it would be better for me to decide when I want checking -and when I don't. Many times Flycheck is annoying when checking a -program, particularly one which isn't finished yet. - -#+begin_src emacs-lisp -(use-package flycheck - :straight t - :defer t - :commands (flycheck-mode flycheck-list-errors) - :general - (mode-leader - "f" #'flycheck-mode) - (code-leader - "x" #'flycheck-list-errors - "j" #'flycheck-next-error - "k" #'flycheck-previous-error) - :display - ("\\*Flycheck.*" - (display-buffer-at-bottom) - (window-height . 0.25)) - :init - (setq-default flycheck-check-syntax-automatically - '(save idle-change mode-enabled) - flycheck-idle-change-delay 1.0 - flycheck-buffer-switch-check-intermediate-buffers t - flycheck-display-errors-delay 0.25) - :config - (with-eval-after-load "evil-collection" - (evil-collection-flycheck-setup))) -#+end_src -** Eglot -Eglot is package to communicate with LSP servers for better -programming capabilities. Interactions with a server provide results -to the client, done through JSON. - -NOTE: Emacs 28.1 comes with better JSON parsing, which makes Eglot -much faster. - -2023-03-26: I've found Eglot to be useful sometimes, but many of the -projects I work on don't require a heavy server setup to efficiently -edit and check for errors; Emacs provides a lot of functionality. So -by default I've disabled it, using =M-x eglot= to startup the LSP -server when I need it. - -2024-06-27: In projects where I do use eglot and I know I will need it -regardless of file choice, I prefer setting it at the dir-local level -via an eval form. So I add to the safe values for the eval variable -to be set. - -#+begin_src emacs-lisp -(use-package eglot - :defer t - :general - (code-leader - :keymaps 'eglot-mode-map - "f" #'eglot-format - "a" #'eglot-code-actions - "R" #'eglot-reconnect) - :init - (setq eglot-auto-shutdown t - eglot-stay-out-of '(flymake) - eglot-ignored-server-capabilities '(:documentHighlightProvider - :documentOnTypeFormattingProvider - :inlayHintProvider)) - (add-to-list 'safe-local-variable-values '(eval eglot-ensure))) -#+end_src -** Indentation -By default, turn off tabs and set the tab width to two. - -#+begin_src emacs-lisp -(setq-default indent-tabs-mode nil - tab-width 2) -#+end_src - -However, if necessary later, define a function that may activate tabs locally. -#+begin_src emacs-lisp -(defun +oreo/use-tabs () - (interactive) - (setq-local indent-tabs-mode t)) -#+end_src -** Highlight todo items -TODO items are highlighted in org-mode, but not necessarily in every -mode. This minor mode highlights all TODO like items via a list of -strings to match. It also configures faces to use when highlighting. -I hook it to prog-mode. - -#+begin_src emacs-lisp -(use-package hl-todo - :straight t - :after prog-mode - :hook (prog-mode-hook . hl-todo-mode) - :init - (setq hl-todo-keyword-faces - '(("TODO" . "#E50000") - ("WIP" . "#ffa500") - ("NOTE" . "#00CC00") - ("FIXME" . "#d02090")))) -#+end_src -** Hide-show mode -Turn on ~hs-minor-mode~ for all prog-mode. This provides folds for -free. - -#+begin_src emacs-lisp -(use-package hideshow - :defer t - :hook (prog-mode-hook . hs-minor-mode)) -#+end_src -** Aggressive indenting -Essentially my dream editing experience: when I type stuff in, try and -indent it for me on the fly. Just checkout the -[[https://github.com/Malabarba/aggressive-indent-mode][page]], any -description I give won't do it justice. - -#+begin_src emacs-lisp -(use-package aggressive-indent - :straight t - :hook (emacs-lisp-mode-hook . aggressive-indent-mode) - :hook (scheme-mode-hook . aggressive-indent-mode) - :hook (lisp-mode-hook . aggressive-indent-mode)) -#+end_src -** Compilation -Compilation mode is an incredibly useful subsystem of Emacs which -allows one to run arbitrary commands. If those commands produce -errors (particularly errors that have a filename, column and line) -compilation-mode can colourise these errors and help you navigate to -them. - -Here I add some bindings and a filter which colourises the output of -compilation mode for ANSI escape sequences; the eyecandy is certainly -nice but it's very useful when dealing with tools that use those codes -so you can actually read the text. - -#+begin_src emacs-lisp -(use-package compile - :defer t - :display - ("\\*compilation\\*" - (display-buffer-reuse-window display-buffer-at-bottom) - (window-height . 0.3) - (reusable-frames . t)) - :hydra - (move-error-hydra - (:hint nil) "Hydra for moving between errors" - ("j" #'next-error) - ("k" #'previous-error)) - :general - (leader - "j" #'move-error-hydra/next-error - "k" #'move-error-hydra/previous-error) - (code-leader - "c" #'compile - "r" #'recompile) - (nmap - "M-r" #'recompile) - (:keymaps 'compilation-mode-map - "g" nil ;; by default this is recompile - "M-j" #'compilation-next-error - "M-k" #'compilation-previous-error) - (nmmap - :keymaps 'compilation-mode-map - "c" #'recompile) - :init - (setq compilation-scroll-output 'first-error - compilation-context-lines nil - next-error-highlight 'fringe-arrow) - :config - (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)) -#+end_src -** xref -Find definitions, references and general objects using tags without -external packages. Provided out of the box with Emacs, but requires a -way of generating a =TAGS= file for your project (look at -[[*Project.el][Project.el]] for my way of doing so). A critical -component in a minimal setup for programming without heavier systems -like [[*Eglot][Eglot]]. - -#+begin_src emacs-lisp -(use-package xref - :defer t - :display - ("\\*xref\\*" - (display-buffer-at-bottom) - (inhibit-duplicate-buffer . t) - (window-height . 0.3)) - :general - (code-leader - "t" #'nil) - (code-leader - :infix "t" - "t" #'xref-find-apropos - "d" #'xref-find-definitions - "r" #'xref-find-references) - (nmmap - :keymaps 'xref--xref-buffer-mode-map - "RET" #'xref-goto-xref - "J" #'xref-next-line - "K" #'xref-prev-line - "r" #'xref-query-replace-in-results - "gr" #'xref-revert-buffer - "q" #'quit-window)) -#+end_src -** Project.el -An out of the box system for managing projects. Where possible we -should try to use Emacs defaults, so when setting up on a new computer -it takes a bit less time. - -Here I: -+ Bind ~project-prefix-map~ to "<leader>p" -+ Bind a tags generation command to "<leader>pr" - + mimics projectile's one, so I can quickly generate them. - + mimicking - -#+begin_src emacs-lisp -(use-package project - :defer t - :general - (:keymaps 'project-prefix-map - "r" #'+project/generate-tags) - (leader - "p" project-prefix-map) - :config - (setq project-vc-extra-root-markers '(".project")) - (defun +project/command (folder) - (format "ctags -Re -f %sTAGS %s*" - folder folder)) - - (defun +project/root () - (if (project-current) - (project-root (project-current)) - default-directory)) - - (defun +project/generate-tags () - (interactive) - (set-process-sentinel - (start-process-shell-command - "PROJECT-GENERATE-TAGS" - "*tags*" - (+project/command (+project/root))) - (lambda (p event) - (when (string= event "finished\n") - (message "Finished generating tags!") - (visit-tags-table (format "%sTAGS" (+project/root)))))))) -#+end_src -** devdocs -When man pages aren't enough, you need some documentation lookup -system (basically whenever your using anything but C/C++/Bash). -[[https://devdocs.io][Devdocs]] is a great little website that -provides a ton of documentation sets. There's an Emacs package for it -which works well and downloads documentation sets to my machine, which -is nice. - -#+begin_src emacs-lisp -(use-package devdocs - :straight t - :defer t - :general - (file-leader - "d" #'devdocs-lookup)) -#+end_src -** rainbow-delimiters -Makes colours delimiters (parentheses) based on their depth in an -expression. Rainbow flag in your Lisp source code. - -#+begin_src emacs-lisp -(use-package rainbow-delimiters - :defer t - :straight t - :general - (mode-leader "r" #'rainbow-delimiters-mode) - :hook - ((lisp-mode-hook emacs-lisp-mode-hook racket-mode-hook) . rainbow-delimiters-mode)) -#+end_src -** Licensing -Loads [[file:elisp/license.el][license.el]] for inserting licenses. -Licenses are important for distribution and attribution to be defined -clearly. - -#+begin_src emacs-lisp -(use-package license - :demand t - :load-path "elisp/" - :general - (insert-leader - "l" #'+license/insert-copyright-notice - "L" #'+license/insert-complete-license)) -#+end_src -** diff mode -Good diff management is essentially mandatory in development. Emacs -comes with functionality out of the box to generate, manipulate, and -apply diffs - here I configure a small subset. -#+begin_src emacs-lisp -(use-package diff-mode - :general - (nmmap - :keymaps 'diff-mode-map - "J" #'diff-hunk-next - "K" #'diff-hunk-prev - "M-RET" #'diff-apply-hunk - "RET" #'diff-goto-source)) -#+end_src -* Org mode -Org is, at its most basic, a markup language. =org-mode= is a major -mode for Emacs to interpret org buffers. org-mode provides a lot of -capabilities, some are: -+ A complete table based spreadsheet system, with formulas (including - [[*Calculator][calc-mode]] integration) -+ Code blocks with proper syntax highlighting and editing experience - + Evaluation - + Export of code blocks to a variety of formats - + Export of code blocks to a code file (so called "tangling", which - is what occurs in this document) -+ Feature complete scheduling system with [[*Calendar][calendar]] - integration - + A clock-in system to time tasks -+ TODO system -+ Export to a variety of formats or make your own export engine using - the org AST. -+ Inline $\LaTeX$, with the ability to render the fragments on - demand within the buffer -+ Links to a variety of formats: - + Websites (via http or https) - + FTP - + SSH - + Files (even to a specific line) - + Info pages - -I'd argue this is a bit more than a markup language. Like -[[*Magit][Magit]], some use Emacs just for this system. -** Org Essentials -Org has a ton of settings to tweak, which change your experience quite -a bit. Here are mine, but this took a lot of just reading other -people's configurations and testing. I don't do a good job of -explaining how this works in all honesty, but it works well for me so -I'm not very bothered. - -+ By default =~/Text= is my directory for text files. I actually have - a repository that manages this directory for agenda files and other - documents -+ Indentation in file should not be allowed, i.e. text indentation, as - that forces other editors to read it a certain way as well. It's - obtrusive hence it's off. -+ Org startup indented is on by default as most documents do benefit - from the indentation, but I do turn it off for some files via - ~#+startup:noindent~ -+ When opening an org document there can be a lot of headings, so I - set folding to just content -+ Org documents can also have a lot of latex previews, which make - opening some after a while a massive hassle. If I want to see the - preview, I'll do it myself, so turn it off. -+ Org manages windowing itself, to some extent, so I set those options - to be as unobtrusive as possible -+ Load languages I use in =src= blocks in org-mode (Emacs-lisp for - this configuration, C and Python) - -#+begin_src emacs-lisp -(use-package org - :defer t - :init - (setq org-directory "~/Text/" - org-adapt-indentation nil - org-indent-mode nil - org-startup-indented nil - org-startup-folded 'showeverything - org-startup-with-latex-preview nil - org-imenu-depth 10 - org-src-window-setup 'current-window - org-indirect-buffer-display 'current-window - org-link-frame-setup '((vm . vm-visit-folder-other-frame) - (vm-imap . vm-visit-imap-folder-other-frame) - (file . find-file)) - org-babel-load-languages '((emacs-lisp . t) - (lisp . t) - (shell . t)))) -#+end_src -** Org Latex -Org mode has deep integration with latex, can export to PDF and even -display latex fragments in the document directly. I setup the -pdf-process, code listing options via minted and the format options -for latex fragments. - -#+begin_src emacs-lisp -(use-package org - :defer t - :init - (setq org-format-latex-options - '(:foreground default :background "Transparent" :scale 2 - :html-foreground "Black" :html-background "Transparent" - :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) - org-latex-src-block-backend 'minted - org-latex-minted-langs '((emacs-lisp "common-lisp") - (ledger "text") - (cc "c++") - (cperl "perl") - (shell-script "bash") - (caml "ocaml")) - org-latex-packages-alist '(("" "minted")) - org-latex-pdf-process - (list (concat "latexmk -f -bibtex -pdf " - "-shell-escape -%latex -interaction=nonstopmode " - "-output-directory=%o %f")) - org-latex-minted-options - '(("style" "colorful") - ("linenos") - ("frame" "single") - ("mathescape") - ("fontfamily" "courier") - ("samepage" "false") - ("breaklines" "true") - ("breakanywhere" "true")))) -#+end_src -** Org Core Variables -Tons of variables for org-mode, including a ton of latex ones. Can't -really explain because it sets up quite a lot of local stuff. Also I -copy pasted the majority of this, tweaking it till it felt good. Doom -Emacs was very helpful here. - -#+begin_src emacs-lisp -(use-package org - :defer t - :init - (setq org-edit-src-content-indentation 0 - org-bookmark-names-plist nil - org-eldoc-breadcrumb-separator " → " - org-enforce-todo-dependencies t - org-export-backends '(ascii html latex odt icalendar) - org-fontify-quote-and-verse-blocks t - org-fontify-whole-heading-line t - org-footnote-auto-label t - org-hide-emphasis-markers nil - org-hide-leading-stars t - org-image-actual-width nil - org-imenu-depth 10 - org-link-descriptive nil - org-priority-faces '((?A . error) (?B . warning) (?C . success)) - org-refile-targets '((nil . (:maxlevel . 2))) - org-tags-column 0 - org-todo-keywords '((sequence "TODO" "WIP" "DONE") - (sequence "PROJ" "WAIT" "COMPLETE")) - org-use-sub-superscripts '{})) -#+end_src -** Org Core Functionality -Hooks, prettify-symbols and records for auto insertion. - -#+begin_src emacs-lisp -(use-package org - :defer t - :hook - (org-mode-hook . prettify-symbols-mode) - :display - ("\\*Org Src.*" - (display-buffer-same-window)) - :auto-insert - (("\\.org\\'" . "Org skeleton") - "Enter title: " - "#+title: " str | (buffer-file-name) "\n" - "#+author: " (read-string "Enter author: ") | user-full-name "\n" - "#+description: " (read-string "Enter description: ") | "Description" "\n" - "#+date: " (format-time-string "%Y-%m-%d" (current-time)) "\n" - "* " _)) -#+end_src -** Org Core Bindings -A load of bindings for org-mode which binds together a lot of -functionality. It's best to read it yourself; to describe it is to -write the code. - -#+begin_src emacs-lisp -(use-package org - :defer t - :init - (with-eval-after-load "consult" - (general-def - :keymaps 'org-mode-map - [remap imenu] #'consult-outline)) - :general - (nmmap - "M-F" #'org-open-at-point) - (nmmap - :keymaps 'org-mode-map - "TAB" #'org-cycle) - (file-leader - "l" #'org-store-link) - (insert-leader - "o" #'org-insert-last-stored-link) - (code-leader - :keymaps 'emacs-lisp-mode-map - "D" #'org-babel-detangle) - (local-leader - :states '(normal motion) - :keymaps 'org-mode-map - "r" #'org-list-repair - "d" #'org-date-from-calendar - "t" #'org-todo - "," #'org-priority - "T" #'org-babel-tangle - "i" #'org-insert-structure-template - "p" #'org-latex-preview - "s" #'org-property-action - "e" #'org-export-dispatch - "o" #'org-edit-special - "R" #'org-refile - "O" #'org-open-at-point) - (local-leader - :keymaps 'org-mode-map - :infix "l" - "i" #'org-insert-link - "l" #'org-open-at-point - "f" #'org-footnote-action) - (local-leader - :keymaps 'org-mode-map - :infix "'" - "a" #'org-table-align - "c" #'org-table-create - "f" #'org-table-edit-formulas - "t" #'org-table-toggle-coordinate-overlays - "s" #'org-table-sum - "e" #'org-table-calc-current-TBLFM - "E" #'org-table-eval-formula) - (local-leader - :keymaps 'org-src-mode-map - "o" #'org-edit-src-exit)) -#+end_src -** Org Agenda -Org agenda provides a nice viewing for schedules. With org mode it's -a very tidy way to manage your time. - -#+begin_src emacs-lisp -(use-package org-agenda - :defer t - :init - (defconst +org/agenda-root "~/Text/" - "Root directory for all agenda files") - (setq org-agenda-files (list (expand-file-name +org/agenda-root)) - org-agenda-window-setup 'current-window - org-agenda-skip-deadline-prewarning-if-scheduled t - org-agenda-skip-scheduled-if-done t - org-agenda-skip-deadline-if-done t - org-agenda-start-with-entry-text-mode nil) - :config - (evil-set-initial-state 'org-agenda-mode 'normal) - :general - (file-leader - "a" (proc-int - (--> (directory-files (car org-agenda-files)) - (mapcar #'(lambda (x) (concat (car org-agenda-files) x)) it) - (completing-read "Enter directory: " it nil t) - (find-file it)))) - (app-leader - "a" #'org-agenda) - (nmmap - :keymaps 'org-agenda-mode-map - "zd" #'org-agenda-day-view - "zw" #'org-agenda-week-view - "zm" #'org-agenda-month-view - "gd" #'org-agenda-goto-date - "RET" #'org-agenda-switch-to - "J" #'org-agenda-later - "K" #'org-agenda-earlier - "t" #'org-agenda-todo - "." #'org-agenda-goto-today - "," #'org-agenda-goto-date - "q" #'org-agenda-quit - "r" #'org-agenda-redo)) -#+end_src -** Org capture -Org capture provides a system for quickly "capturing" some information -into an org file. A classic example is creating a new TODO in a -todo file, where the bare minimum to record one is: -+ where was it recorded? -+ when was it recorded? -+ what is it? -Org capture provides a way to do that seamlessly without opening the -todo file directly. - -#+begin_src emacs-lisp -(use-package org-capture - :defer t - :init - (setq - org-default-notes-file (concat org-directory "todo.org") - org-capture-templates - '(("t" "Todo" entry - (file "") - "* TODO %? -%T -%a") - ("q" "Quote" entry - (file "quotes.org") - "* %^{Title} -,#+caption: %^{Origin} %t -,#+begin_quote -%? -,#+end_quote"))) - :general - (leader - "C" #'org-capture) - (nmmap - :keymaps 'org-capture-mode-map - "ZZ" #'org-capture-finalize - "ZR" #'org-capture-refile - "ZQ" #'org-capture-kill)) -#+end_src -** WAIT Org clock-in -:PROPERTIES: -:header-args:emacs-lisp: :tangle no :results none -:END: -2025-02-15: I haven't found much use for this yet but the system is -quite expressive. If I needed time-keeping somewhere, I know where to -go. - -Org provides a nice timekeeping system that allows for managing how -much time is taken per task. It even has an extensive reporting -system to see how much time you spend on specific tasks or overall. - -#+begin_src emacs-lisp -(use-package org-clock - :after org - :general - (local-leader - :keymaps 'org-mode-map - :infix "c" - "d" #'org-clock-display - "c" #'org-clock-in - "o" #'org-clock-out - "r" #'org-clock-report)) -#+end_src -** WAIT Org ref -:PROPERTIES: -:header-args:emacs-lisp: :tangle no :results none -:END: -For bibliographic stuff in $\LaTeX$ export. - -#+begin_src emacs-lisp -(use-package org-ref - :straight t - :defer t - :init - (setq bibtex-files '("~/Text/bibliography.bib") - bibtex-completion-bibliography '("~/Text/bibliography.bib") - bibtex-completion-additional-search-fields '(keywords))) -#+end_src -*** Org ref ivy integration -Org ref requires ivy-bibtex to work properly with ivy, so we need to -set that up as well - -#+begin_src emacs-lisp -(use-package ivy-bibtex - :straight t - :after org-ref - :config - (require 'org-ref-ivy)) -#+end_src -** Org message -Org message allows for the use of org mode when composing mails, -generating HTML multipart emails. This integrates the WYSIWYG -experience with mail in Emacs while also providing powerful text -features with basically no learning curve (as long as you've already -learnt the basics of org). - -#+begin_src emacs-lisp -(use-package org-msg - :straight t - :hook - (message-mode-hook . org-msg-mode) - (notmuch-message-mode-hook . org-msg-mode) - :config - (setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t tex:dvipng" - org-msg-greeting-name-limit 3) - - (add-to-list - 'org-msg-enforce-css - '(img latex-fragment-inline - ((transform . ,(format "translateY(-1px) scale(%.3f)" - (/ 1.0 (if (boundp 'preview-scale) - preview-scale 1.4)))) - (margin . "0 -0.35em"))))) -#+end_src -** Org for evil -Evil org for some nice bindings. - -#+begin_src emacs-lisp -(use-package evil-org - :straight t - :defer t - :hook (org-mode-hook . evil-org-mode)) -#+end_src * Applications Emacs is an operating system, now with a good text editor through [[*Evil - Vim emulation][Evil]]. Let's configure some apps for it. @@ -2160,7 +1353,6 @@ In this case I just need to setup the bindings for it. :straight t) (use-package magit - :after transient :straight t :defer t :display @@ -2179,9 +1371,10 @@ In this case I just need to setup the bindings for it. "g" #'magit-dispatch) (code-leader "b" #'magit-blame) - (nmap :keymaps 'magit-status-mode-map - "}" #'magit-section-forward-sibling - "{" #'magit-section-backward-sibling) + (nmap + :keymaps 'magit-status-mode-map + "M-j" #'magit-section-forward-sibling + "M-k" #'magit-section-backward-sibling) :init (setq vc-follow-symlinks t magit-blame-echo-style 'lines @@ -2200,6 +1393,8 @@ need to imagine any more, with Magit Forge. (use-package forge :after magit :straight t + :init + (setq forge-add-default-bindings nil) :config (with-eval-after-load "evil-collection" (evil-collection-forge-setup))) @@ -2218,7 +1413,10 @@ engine, which makes sense as it's primarily a text interface. (nmmap :keymaps 'eww-mode-map "w" #'evil-forward-word-begin - "Y" #'eww-copy-page-url)) + "Y" #'eww-copy-page-url) + :config + (with-eval-after-load "evil-collection" + (evil-collection-eww-setup))) #+end_src ** Calendar Calendar is a simple inbuilt application that helps with date @@ -2249,7 +1447,10 @@ to the kill ring and bind it to "Y". (let ((date (calendar-cursor-to-date))) (when date (setq date (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))) - (kill-new (format-time-string "%Y-%m-%d" date))))))) + (kill-new (format-time-string "%Y-%m-%d" date)))))) + + (with-eval-after-load "evil-collection" + (evil-collection-calendar-setup))) #+end_src ** Mail Mail is a funny thing; most people use it just for business or @@ -2277,6 +1478,9 @@ from the remote server. (nmap :keymaps 'notmuch-search-mode-map "f" #'+mail/flag-thread) + (nmmap + :keymaps 'notmuch-hello-mode-map + "t" #'notmuch-search-by-tag) :init (defconst +mail/local-dir (no-littering-expand-var-file-name "mail/")) (setq notmuch-show-logo nil @@ -2293,7 +1497,10 @@ from the remote server. (notmuch-search-tag (notmuch-tag-change-list '("-inbox" "+flagged") unflag) beg end) (when (eq beg end) - (notmuch-search-next-thread)))) + (notmuch-search-next-thread))) + + (with-eval-after-load "evil-collection" + (evil-collection-notmuch-setup))) #+end_src *** Smtpmail Setup the smtpmail package, which is used when sending mail. Mostly @@ -2365,7 +1572,10 @@ Here I setup dired with a few niceties dired-omit-files "^\\." ; dotfiles dired-omit-verbose nil dired-dwim-target t - dired-kill-when-opening-new-dired-buffer t) + dired-recursive-copies 'always + dired-kill-when-opening-new-dired-buffer t + dired-deletion-confirmer 'y-or-n-p + dired-auto-revert-buffer t) :general (nmmap :keymaps 'dired-mode-map @@ -2486,7 +1696,7 @@ Here I setup dired with a few niceties (dired-mark-directories nil) (let* ((subdirs-inserted (mapcar #'car dired-subdir-alist)) (subdirs-available (mapcar #'(lambda (x) (concat x "/")) - (dired-get-marked-files)))) + (dired-get-marked-files)))) (dired-unmark-all-marks) (cl-remove-if #'(lambda (f) (member f subdirs-inserted)) subdirs-available))) @@ -2634,6 +1844,8 @@ them. ("\\*eshell\\*" (display-buffer-same-window) (reusable-frames . t)) + :hook + (eshell-mode-hook . completion-preview-mode) :init (defun +eshell/banner-message () (concat (shell-command-to-string "fortune") "\n")) @@ -2664,14 +1876,14 @@ them. (local-leader :keymaps 'eshell-mode-map "g" (proc-int - (let ((buffer (current-buffer))) - (eshell/goto) - (with-current-buffer buffer - (eshell-send-input)))) + (let ((buffer (current-buffer))) + (eshell/goto) + (with-current-buffer buffer + (eshell-send-input)))) "l" (proc-int - (eshell-return-to-prompt) - (insert "ls") - (eshell-send-input)) + (eshell-return-to-prompt) + (insert "ls") + (eshell-send-input)) "c" #'+eshell/good-clear "k" #'eshell-kill-process)))) #+end_src @@ -2692,7 +1904,7 @@ internals without autoloading. (use-package eshell-prompt :load-path "elisp/" :config - (setq eshell-prompt-function #'+eshell-prompt/make-prompt)) + (setq eshell-prompt-function #'eshell-prompt/make-prompt)) #+end_src *** EShell additions Using my external library @@ -2785,7 +1997,6 @@ most distribution nowadays. :general (search-leader "g" #'grep-this-file - "c" #'grep-config-file "d" #'rgrep) (nmmap :keymaps 'grep-mode-map @@ -2802,23 +2013,18 @@ most distribution nowadays. ;; Without this wgrep doesn't work properly (evil-set-initial-state 'grep-mode 'normal) - (defun grep-file (query filename) - (grep (format "grep --color=auto -nIiHZEe \"%s\" -- %s" - query filename))) + (defmacro grep-file (query filename) + `(grep (format "grep --color=auto -nIiHE --null -e \"%s\" %s" + ,query ,filename))) (defun grep-this-file () (interactive) - (let ((query (read-string "Search for: "))) - (if (buffer-file-name (current-buffer)) - (grep-file query (buffer-file-name (current-buffer))) - (let ((temp-file (make-temp-file "temp-grep"))) - (write-region (point-min) (point-max) temp-file) - (grep-file query temp-file))))) - - (defun grep-config-file () - (interactive) - (let ((query (read-string "Search for: " "^[*]+ .*"))) - (grep-file query (concat user-emacs-directory "config.org"))))) + (let ((query (read-string "Search for: ")) + (filename (or (buffer-file-name (current-buffer)) + (let ((temp-file (make-temp-file "temp-grep"))) + (write-region (point-min) (point-max) temp-file) + temp-file)))) + (grep-file query filename)))) #+end_src *** rg #+begin_src emacs-lisp @@ -2832,7 +2038,7 @@ most distribution nowadays. (window-height . 0.35)) :general (search-leader - "r" #'rg) + "R" #'rg-menu) (:keymaps 'project-prefix-map "t" #'+rg/project-todo) (nmmap @@ -2913,14 +2119,14 @@ to elfeed for loading the system. (funcall option url))))) #+end_src *** Elfeed-org +A small self-written package to load an org file as a set of elfeed +feeds. #+begin_src emacs-lisp (use-package elfeed-org :load-path "elisp/" :after elfeed :init - (thread-last "elfeed/feeds.org" - no-littering-expand-etc-file-name - (setq elfeed-org/file)) + (setq elfeed-org/file (concat org-directory "feeds.org")) :config (elfeed-org)) #+end_src @@ -2932,7 +2138,17 @@ IBuffer is the dired of buffers. Nothing much else to be said. :defer t :general (buffer-leader - "i" #'ibuffer)) + "i" #'ibuffer) + :init + (setq ibuffer-formats + '((mark modified read-only locked + " " (name 40 40 :left :elide) + " " (size 8 -1 :right) + " " (mode 18 18 :left :elide) " " filename-and-process) + (mark " " (name 16 -1) " " filename))) + :config + (with-eval-after-load "evil-collection" + (evil-collection-ibuffer-setup))) #+end_src ** Proced Emacs has two systems for process management: @@ -2957,7 +2173,10 @@ Core Proced config, just a few bindings and evil collection setup. (display-buffer-at-bottom) (window-height . 0.25)) :init - (setq proced-auto-update-interval 5)) + (setq proced-auto-update-interval 5) + :config + (with-eval-after-load "evil-collection" + (evil-collection-proced-setup))) #+end_src ** Calculator ~calc-mode~ is a calculator system within Emacs that provides a @@ -2988,7 +2207,10 @@ current buffer to perform some quick mathematics in it. (app-leader "c" #'calc-dispatch) :init - (setq calc-algebraic-mode t)) + (setq calc-algebraic-mode t) + :config + (with-eval-after-load "evil-collection" + (evil-collection-calc-setup))) #+end_src ** Zone Emacs' out of the box screensaver software. @@ -3128,6 +2350,9 @@ playing. (use-package empv :straight t :defer t + :general + (app-leader + "e" #'empv-hydra/body) :init (setq empv-audio-dir (list (expand-file-name "~/Media/audio") ;; "/sshx:oldboy:/media/hdd/content/Audio" @@ -3146,12 +2371,6 @@ playing. ("SomaFM - Vaporwaves" . "http://www.somafm.com/vaporwaves.pls") ("SomaFM - DEFCON" . "http://www.somafm.com/defcon.pls") ("SomaFM - The Trip" . "http://www.somafm.com/thetrip.pls")))) - -(use-package empv-hydra - :after hydra - :general - (app-leader - "e" #'empv-hydra/body)) #+end_src ** Grand Unified Debugger (GUD) GUD is a system for debugging, hooking into processes and @@ -3205,17 +2424,832 @@ in an Emacs-only map. :straight (:host github :repo "unmonoqueteclea/jira.el") :init (setq jira-base-url "https://reframe.atlassian.net") + (with-eval-after-load "evil" + (evil-set-initial-state 'jira-detail-mode 'motion) + (evil-set-initial-state 'jira-issues-mode 'motion)) :general (app-leader "j" #'jira-issues) - (nmmap + (mmap :keymaps 'jira-issues-mode-map - "M-RET" #'jira-issues-actions-menu)) + "@" #'jira-issues-actions-menu)) +#+end_src +* Text packages +Standard packages and configurations for dealing with text, usually +prose. +** Flyspell +Flyspell allows me to spell check text documents. I use it primarily +in org mode, as that is my preferred prose writing software, but I +also need it in commit messages and so on, thus it should really hook +into text-mode. + +#+begin_src emacs-lisp +(use-package flyspell + :defer t + :hook ((org-mode-hook text-mode-hook) . flyspell-mode) + :init + (setq flyspell-issue-message-flag nil + flyspell-issue-welcome-flag nil) + :general + (nmmap + :keymaps 'text-mode-map + "M-C" #'flyspell-correct-word-before-point + "M-c" #'flyspell-auto-correct-word) + (mode-leader + "s" #'flyspell-mode)) +#+end_src +** Whitespace +I hate inconsistencies in whitespace. If I'm using tabs, I better be +using them everywhere, and if I'm using whitespace, it better be well +formed. Furthermore, hard character limits are important (enforced by +[[*Filling and displaying fills][auto-fill-mode]]) which is why I like +to have some kind of highlighting option. + +I don't want to highlight whitespace for general mode categories (Lisp +shouldn't really have an 80 character limit), so set it for specific +modes that need the help. + +#+begin_src emacs-lisp +(use-package whitespace + :defer t + :general + (nmmap + "M--" #'whitespace-cleanup) + (mode-leader + "w" #'whitespace-mode) + :hook + (before-save-hook . whitespace-cleanup) + ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook + org-mode-hook text-mode-hook js-mode-hook + nasm-mode-hook) + . whitespace-mode) + :init + (setq whitespace-line-column nil + whitespace-style '(face empty spaces tabs newline trailing + lines-char tab-mark))) +#+end_src +** Filling and displaying fills +The fill-column is the number of characters that should be in a single +line of text before doing a hard wrap. The default case is 80 +characters for that l33t Unix hard terminal character limit. I like +different fill-columns for different modes: text modes should really +use 70 fill columns while code should stick to 80. + +#+begin_src emacs-lisp +(use-package emacs + :hook + (text-mode-hook . auto-fill-mode) + ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook + org-mode-hook text-mode-hook js-mode-hook) + . display-fill-column-indicator-mode) + :init + (setq-default fill-column 80) + (add-hook 'text-mode-hook (proc (setq-local fill-column 70)))) +#+end_src +** Visual line mode +When dealing with really long lines I have a specific taste. I don't +want text to just go off the screen, such that I have to move the +cursor forward in the line to see later content - I want line +wrapping. Emacs provides ~truncate-lines~ for line wrapping but it +cuts words, which isn't very nice as that cut word spans two lines. +Instead I want Emacs to cut by word, which is where visual-line-mode +comes in. Since I may experience really long lines anywhere, it +should be enabled globally. + +#+begin_src emacs-lisp +(use-package emacs + :demand t + :config + (global-visual-line-mode t)) +#+end_src +** Show-paren-mode +When the cursor is over a parenthesis, highlight the other member of +the pair. + +#+begin_src emacs-lisp +(use-package paren + :hook (prog-mode-hook . show-paren-mode)) +#+end_src +** Smartparens +Smartparens is a smarter electric-parens, it's much more aware of +context and easier to use. + +#+begin_src emacs-lisp +(use-package smartparens + :straight t + :defer t + :hook + (prog-mode-hook . smartparens-mode) + (text-mode-hook . smartparens-mode) + :config + (setq sp-highlight-pair-overlay nil + sp-highlight-wrap-overlay t + sp-highlight-wrap-tag-overlay t) + + (let ((unless-list '(sp-point-before-word-p + sp-point-after-word-p + sp-point-before-same-p))) + (sp-pair "'" nil :unless unless-list) + (sp-pair "\"" nil :unless unless-list)) + (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p)) + (require 'smartparens-config)) +#+end_src +** Powerthesaurus +Modern package for thesaurus in Emacs with a transient + hydra. +#+begin_src emacs-lisp +(use-package powerthesaurus + :defer t + :straight t + :general + (search-leader + "w" #'powerthesaurus-transient)) +#+end_src +** lorem ipsum +Sometimes you need placeholder text for some UI or document. Pretty +easy to guess what text I'd use. + +#+begin_src emacs-lisp +(use-package lorem-ipsum + :straight t + :general + (insert-leader + "p" #'lorem-ipsum-insert-paragraphs)) +#+end_src +** Auto insert +Allows inserting text immediately upon creating a new buffer with a +given name, similar to template. Supports skeletons for inserting +text. To make it easier for later systems to define their own auto +inserts, I define a ~use-package~ keyword (~:auto-insert~) which +allows one to define an entry for ~auto-insert-alist~. + +#+begin_src emacs-lisp +(use-package autoinsert + :demand t + :hook (after-init-hook . auto-insert-mode) + :config + (with-eval-after-load "use-package-core" + (add-to-list 'use-package-keywords ':auto-insert) + (defun use-package-normalize/:auto-insert (_name-symbol _keyword args) + args) + (defun use-package-handler/:auto-insert (name _keyword args rest state) + (use-package-concat + (use-package-process-keywords name rest state) + (mapcar + #'(lambda (arg) + `(add-to-list + 'auto-insert-alist + ',arg)) + args))))) +#+end_src +* Programming packages +Packages that help with programming. +** Eldoc +Eldoc presents documentation to the user upon placing ones cursor upon +any symbol. This is very useful when programming as it: +- presents the arguments of functions while writing calls for them +- presents typing and documentation of variables + +Eldoc box makes the help buffer a hovering box instead of printing it +in the minibuffer. A lot cleaner. + +2024-05-31: Eldoc box is a bit useless now that I'm not using frames. +I prefer the use of the minibuffer for printing documentation now. + +#+begin_src emacs-lisp +(use-package eldoc + :defer t + :hook (prog-mode-hook . eldoc-mode) + :init + (global-eldoc-mode 1) + :general + (leader + "h>" #'eldoc-doc-buffer)) +#+end_src +** Flycheck +Flycheck is the checking system for Emacs. I don't necessarily like +having all my code checked all the time, so I haven't added a hook to +prog-mode as it would be better for me to decide when I want checking +and when I don't. Many times Flycheck is annoying when checking a +program, particularly one which isn't finished yet. + +#+begin_src emacs-lisp +(use-package flycheck + :straight t + :defer t + :commands (flycheck-mode flycheck-list-errors) + :general + (mode-leader + "f" #'flycheck-mode) + (code-leader + "x" #'flycheck-list-errors + "j" #'flycheck-next-error + "k" #'flycheck-previous-error) + :display + ("\\*Flycheck.*" + (display-buffer-at-bottom) + (window-height . 0.25)) + :init + (setq-default flycheck-check-syntax-automatically + '(save idle-change mode-enabled) + flycheck-idle-change-delay 1.0 + flycheck-buffer-switch-check-intermediate-buffers t + flycheck-display-errors-delay 0.25) + :config + (with-eval-after-load "evil-collection" + (evil-collection-flycheck-setup))) +#+end_src +** Eglot +Eglot is package to communicate with LSP servers for better +programming capabilities. Interactions with a server provide results +to the client, done through JSON. + +NOTE: Emacs 28.1 comes with better JSON parsing, which makes Eglot +much faster. + +2023-03-26: I've found Eglot to be useful sometimes, but many of the +projects I work on don't require a heavy server setup to efficiently +edit and check for errors; Emacs provides a lot of functionality. So +by default I've disabled it, using =M-x eglot= to startup the LSP +server when I need it. + +2024-06-27: In projects where I do use eglot and I know I will need it +regardless of file choice, I prefer setting it at the dir-local level +via an eval form. So I add to the safe values for the eval variable +to be set. + +#+begin_src emacs-lisp +(use-package eglot + :defer t + :general + (code-leader + :keymaps 'eglot-mode-map + "f" #'eglot-format + "a" #'eglot-code-actions + "R" #'eglot-reconnect) + :init + (setq eglot-auto-shutdown t + eglot-stay-out-of '(flymake) + eglot-ignored-server-capabilities '(:documentHighlightProvider + :documentOnTypeFormattingProvider + :inlayHintProvider)) + (add-to-list 'safe-local-variable-values '(eval eglot-ensure))) +#+end_src +** Indentation +By default, turn off tabs and set the tab width to two. + +#+begin_src emacs-lisp +(setq-default indent-tabs-mode nil + tab-width 2) +#+end_src + +However, if necessary later, define a function that may activate tabs locally. +#+begin_src emacs-lisp +(defun +oreo/use-tabs () + (interactive) + (setq-local indent-tabs-mode t)) +#+end_src +** Highlight todo items +TODO items are highlighted in org-mode, but not necessarily in every +mode. This minor mode highlights all TODO like items via a list of +strings to match. It also configures faces to use when highlighting. +I hook it to prog-mode. + +#+begin_src emacs-lisp +(use-package hl-todo + :straight t + :after prog-mode + :hook (prog-mode-hook . hl-todo-mode) + :init + (setq hl-todo-keyword-faces + '(("TODO" . "#E50000") + ("WIP" . "#ffa500") + ("NOTE" . "#00CC00") + ("FIXME" . "#d02090")))) +#+end_src +** Hide-show mode +Turn on ~hs-minor-mode~ for all prog-mode. This provides folds for +free. + +#+begin_src emacs-lisp +(use-package hideshow + :defer t + :hook (prog-mode-hook . hs-minor-mode)) +#+end_src +** Aggressive indenting +Essentially my dream editing experience: when I type stuff in, try and +indent it for me on the fly. Just checkout the +[[https://github.com/Malabarba/aggressive-indent-mode][page]], any +description I give won't do it justice. + +#+begin_src emacs-lisp +(use-package aggressive-indent + :straight t + :hook ((scheme-mode-hook lisp-mode-hook emacs-lisp-mode-hook) + . aggressive-indent-mode)) +#+end_src +** Compilation +Compilation mode is an incredibly useful subsystem of Emacs which +allows one to run arbitrary commands. If those commands produce +errors (particularly errors that have a filename, column and line) +compilation-mode can colourise these errors and help you navigate to +them. + +Here I add some bindings and a filter which colourises the output of +compilation mode for ANSI escape sequences; the eyecandy is certainly +nice but it's very useful when dealing with tools that use those codes +so you can actually read the text. + +#+begin_src emacs-lisp +(use-package compile + :defer t + :display + ("\\*compilation\\*" + (display-buffer-reuse-window display-buffer-at-bottom) + (window-height . 0.3) + (reusable-frames . t)) + :hydra + (move-error-hydra + (:hint nil) "Hydra for moving between errors" + ("j" #'next-error) + ("k" #'previous-error)) + :general + (leader + "j" #'move-error-hydra/next-error + "k" #'move-error-hydra/previous-error) + (code-leader + "c" #'compile + "r" #'recompile) + (nmap + "M-r" #'recompile) + (:keymaps 'compilation-mode-map + "g" nil ;; by default this is recompile + "M-j" #'compilation-next-error + "M-k" #'compilation-previous-error) + (nmmap + :keymaps 'compilation-mode-map + "c" #'recompile) + :init + (setq compilation-scroll-output 'first-error + compilation-context-lines nil + compilation-always-kill t + compilation-ask-about-save nil + next-error-recenter '(4) + next-error-highlight 'fringe-arrow) + :config + (require 'notifications) + (defun +compilation/notify (buffer str) + (with-current-buffer buffer + (let ((cwd default-directory) + (command compile-command)) + (notifications-notify + :title (format "%s\n%s" command cwd) + :body str)))) + + (add-to-list 'compilation-finish-functions #'+compilation/notify) + (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)) +#+end_src +** xref +Find definitions, references, and general objects using TAGS without +external packages. Provided out of the box with Emacs, but requires a +way of generating a =TAGS= file for your project (look at +[[*Project.el][Project.el]] for my way of doing so). The heaviest +lifter in a minimal setup for programming without more extensive +systems like [[*Eglot][Eglot]]. + +#+begin_src emacs-lisp +(use-package xref + :defer t + :display + ("\\*xref\\*" + (display-buffer-at-bottom) + (inhibit-duplicate-buffer . t) + (window-height . 0.3)) + :general + (code-leader + "t" #'nil) + (code-leader + :infix "t" + "t" #'xref-find-apropos + "d" #'xref-find-definitions + "r" #'xref-find-references) + (nmmap + :keymaps 'xref--xref-buffer-mode-map + "RET" #'xref-goto-xref + "J" #'xref-next-line + "K" #'xref-prev-line + "r" #'xref-query-replace-in-results + "gr" #'xref-revert-buffer + "q" #'quit-window)) +#+end_src +** devdocs +When man pages aren't enough, you need some documentation lookup +system. [[https://devdocs.io][Devdocs]] is a great little website +that provides a ton of documentation sets. There's an Emacs package +for it which works well and downloads documentation sets to my +machine, which is nice. + +#+begin_src emacs-lisp +(use-package devdocs + :straight t + :defer t + :general + (file-leader + "d" #'devdocs-lookup)) +#+end_src +** rainbow-delimiters +Makes colours delimiters (parentheses) based on their depth in an +expression. LGBTQIA+ flag in your Lisp source code. + +#+begin_src emacs-lisp +(use-package rainbow-delimiters + :defer t + :straight t + :general + (mode-leader "r" #'rainbow-delimiters-mode) + :hook + ((lisp-mode-hook emacs-lisp-mode-hook racket-mode-hook) + . rainbow-delimiters-mode)) +#+end_src +** Licensing +Loads [[file:elisp/license.el][license.el]] for inserting licenses. +Licenses are important for distribution and attribution to be defined +clearly. + +#+begin_src emacs-lisp +(use-package license + :demand t + :load-path "elisp/" + :general + (insert-leader + "l" #'+license/insert-copyright-notice + "L" #'+license/insert-complete-license)) +#+end_src +** diff mode +Good diff management is essentially mandatory in development. Emacs +comes with functionality out of the box to generate, manipulate, and +apply diffs - here I configure a small subset. +#+begin_src emacs-lisp +(use-package diff-mode + :general + (nmmap + :keymaps 'diff-mode-map + "J" #'diff-hunk-next + "K" #'diff-hunk-prev + "M-RET" #'diff-apply-hunk + "RET" #'diff-goto-source)) #+end_src * Languages For a variety of (programming) languages Emacs comes with default modes but this configures them as well as pulls any modes Emacs doesn't come with. +** Org mode +Org is, at its most basic, a markup language. =org-mode= is a major +mode for Emacs to interpret org buffers. org-mode provides a lot of +capabilities, some are: ++ A complete table based spreadsheet system, with formulas (including + [[*Calculator][calc-mode]] integration) ++ Code blocks with proper syntax highlighting and editing experience + + Evaluation + + Export of code blocks to a variety of formats + + Export of code blocks to a code file (so called "tangling", which + is what occurs in this document) ++ Feature complete scheduling system with [[*Calendar][calendar]] + integration + + A clock-in system to time tasks ++ TODO system ++ Export to a variety of formats or make your own export engine using + the org AST. ++ Inline $\LaTeX$, with the ability to render the fragments on + demand within the buffer ++ Links to a variety of formats: + + Websites (via http or https) + + FTP + + SSH + + Files (even to a specific line) + + Info pages + +I'd argue this is a bit more than a markup language. Like +[[*Magit][Magit]], some use Emacs just for this system. +*** Org Latex +Org mode has deep integration with latex, can export to PDF and even +display latex fragments in the document directly. I setup the +pdf-process, code listing options via minted and the format options +for latex fragments. + +#+begin_src emacs-lisp +(use-package org + :defer t + :init + (setq org-format-latex-options + '(:foreground default :background "Transparent" :scale 2 + :html-foreground "Black" :html-background "Transparent" + :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) + org-latex-src-block-backend 'minted + org-latex-minted-langs '((emacs-lisp "common-lisp") + (ledger "text") + (cc "c++") + (cperl "perl") + (shell-script "bash") + (caml "ocaml")) + org-latex-packages-alist '(("" "minted")) + org-latex-pdf-process + (list (concat "latexmk -f -bibtex -pdf " + "-shell-escape -%latex -interaction=nonstopmode " + "-output-directory=%o %f")) + org-latex-minted-options + '(("style" "colorful") + ("linenos") + ("frame" "single") + ("mathescape") + ("fontfamily" "courier") + ("samepage" "false") + ("breaklines" "true") + ("breakanywhere" "true")))) +#+end_src +*** Org Variables +Tons of variables for org-mode, including a ton of latex ones. Can't +really explain because it sets up quite a lot of local stuff. Look at +the [[info:org#Top][org Info]] document for information regarding +this. + +Also I copy pasted the majority of this, tweaking it till it +felt good. Doom Emacs was very helpful here. + +#+begin_src emacs-lisp +(use-package org + :defer t + :init + (setq org-adapt-indentation nil + org-babel-load-languages '((emacs-lisp . t) + (lisp . t) + (shell . t)) + org-bookmark-names-plist nil + org-directory "~/Text/" + org-edit-src-content-indentation 0 + org-eldoc-breadcrumb-separator " → " + org-enforce-todo-dependencies t + org-export-backends '(ascii html latex odt icalendar) + org-fontify-quote-and-verse-blocks t + org-fontify-whole-heading-line t + org-footnote-auto-label t + org-hide-emphasis-markers nil + org-hide-leading-stars t + org-image-actual-width nil + org-imenu-depth 10 + org-imenu-depth 10 + org-indent-mode nil + org-indirect-buffer-display 'current-window + org-link-descriptive nil + org-link-frame-setup '((vm . vm-visit-folder-other-frame) + (vm-imap . vm-visit-imap-folder-other-frame) + (file . find-file)) + org-priority-faces '((?A . error) (?B . warning) (?C . success)) + org-refile-targets '((nil . (:maxlevel . 2))) + org-src-window-setup 'current-window + org-startup-folded 'showeverything + org-startup-indented nil + org-startup-with-latex-preview nil + org-tags-column 0 + org-todo-keywords '((sequence "TODO" "WIP" "DONE") + (sequence "PROJ" "WAIT" "COMPLETE")) + org-use-sub-superscripts '{})) +#+end_src +*** Org Functionality +Hooks, prettify-symbols and records for auto insertion. + +#+begin_src emacs-lisp +(use-package org + :defer t + :hook + (org-mode-hook . prettify-symbols-mode) + :display + ("\\*Org Src.*" + (display-buffer-same-window)) + :auto-insert + (("\\.org\\'" . "Org skeleton") + "Enter title: " + "#+title: " str | (buffer-file-name) "\n" + "#+author: " (read-string "Enter author: ") | user-full-name "\n" + "#+description: " (read-string "Enter description: ") | "Description" "\n" + "#+date: " (format-time-string "%Y-%m-%d" (current-time)) "\n" + "* " _)) +#+end_src +*** Org Bindings +A load of bindings for org-mode which binds together a lot of +functionality. It's best to read it yourself; to describe it is to +write the code. + +#+begin_src emacs-lisp +(use-package org + :defer t + :init + (with-eval-after-load "consult" + (general-def + :keymaps 'org-mode-map + [remap imenu] #'consult-outline)) + :general + (leader + ";" #'org-agenda) + + (org-leader + "l" #'org-store-link + "a" #'org-agenda + "d" #'org-babel-detangle + "i" #'org-insert-last-stored-link + "o" #'org-open-at-point) + + (nmmap + :keymaps 'org-mode-map + "TAB" #'org-cycle) + + (local-leader + :keymaps 'org-mode-map + "d" #'org-deadline + "s" #'org-schedule + "t" #'org-todo + "r" #'org-list-repair + "," #'org-priority + "i" #'org-insert-structure-template + "p" #'org-latex-preview + "e" #'org-export-dispatch + "o" #'org-edit-special + "T" #'org-babel-tangle + "S" #'org-property-action + "R" #'org-refile + "O" #'org-open-at-point) + + (local-leader + :keymaps 'org-mode-map + :infix "l" + "i" #'org-insert-link + "l" #'org-open-at-point + "f" #'org-footnote-action) + + (local-leader + :keymaps 'org-mode-map + :infix "'" + "a" #'org-table-align + "c" #'org-table-create + "f" #'org-table-edit-formulas + "t" #'org-table-toggle-coordinate-overlays + "s" #'org-table-sum + "e" #'org-table-calc-current-TBLFM + "E" #'org-table-eval-formula) + + (local-leader + :keymaps 'org-src-mode-map + "o" #'org-edit-src-exit)) +#+end_src +*** Org Agenda +Org agenda provides a nice viewing for schedules. With org mode it's +a very tidy way to manage your time. + +#+begin_src emacs-lisp +(use-package org-agenda + :defer t + :init + (setq org-agenda-window-setup 'current-window + org-agenda-skip-deadline-prewarning-if-scheduled t + org-agenda-skip-scheduled-if-done t + org-agenda-skip-deadline-if-done t + org-agenda-start-with-entry-text-mode nil + org-agenda-span 'day) + :config + (evil-set-initial-state 'org-agenda-mode 'normal) + :general + (file-leader + "a" (proc-int + (--> org-agenda-files + (completing-read "Enter file: " it nil t) + (find-file it)))) + (nmmap + :keymaps 'org-agenda-mode-map + "," #'org-agenda-goto-date + "." #'org-agenda-goto-today + "J" #'org-agenda-later + "K" #'org-agenda-earlier + "RET" #'org-agenda-switch-to + "d" #'org-agenda-deadline + "gd" #'org-agenda-goto-date + "q" #'org-agenda-quit + "r" #'org-agenda-redo + "s" #'org-agenda-schedule + "t" #'org-agenda-todo + "zd" #'org-agenda-day-view + "zm" #'org-agenda-month-view + "zw" #'org-agenda-week-view + "f" #'org-agenda-filter-by-tag)) +#+end_src +*** Org Capture +Org capture provides a system for quickly "capturing" some information +into an org file. A classic example is creating a new TODO in a +todo file, where the bare minimum to record one is: ++ where was it recorded? ++ when was it recorded? ++ what is it? +Org capture provides a way to do that seamlessly without opening the +todo file directly. + +#+begin_src emacs-lisp +(use-package org-capture + :defer t + :init + (setq + org-capture-templates + '(("t" "Todo" entry + (file "general.org") + "* TODO %? +%T +%a") + ("q" "Quote" entry + (file "quotes.org") + "* %^{Title} +,#+caption: %^{Origin} %t +,#+begin_quote +%? +,#+end_quote"))) + :general + (org-leader + "c" #'org-capture) + (nmmap + :keymaps 'org-capture-mode-map + "ZZ" #'org-capture-finalize + "ZR" #'org-capture-refile + "ZQ" #'org-capture-kill)) +#+end_src +*** WAIT Org Clock-in +:PROPERTIES: +:header-args:emacs-lisp: :tangle no :results none +:END: +2025-02-15: I haven't found much use for this yet but the system is +quite expressive. If I needed time-keeping somewhere, I know where to +go. + +Org provides a nice timekeeping system that allows for managing how +much time is taken per task. It even has an extensive reporting +system to see how much time you spend on specific tasks or overall. + +#+begin_src emacs-lisp +(use-package org-clock + :after org + :general + (local-leader + :keymaps 'org-mode-map + :infix "c" + "d" #'org-clock-display + "c" #'org-clock-in + "o" #'org-clock-out + "r" #'org-clock-report)) +#+end_src +*** WAIT Org Ref +:PROPERTIES: +:header-args:emacs-lisp: :tangle no :results none +:END: +For bibliographic stuff in $\LaTeX$ export. + +#+begin_src emacs-lisp +(use-package org-ref + :straight t + :defer t + :init + (setq bibtex-files '("~/Text/bibliography.bib") + bibtex-completion-bibliography '("~/Text/bibliography.bib") + bibtex-completion-additional-search-fields '(keywords))) +#+end_src +*** Org Message +Org message allows for the use of org mode when composing mails, +generating HTML multipart emails. This integrates the WYSIWYG +experience with mail in Emacs while also providing powerful text +features with basically no learning curve (as long as you've already +learnt the basics of org). + +#+begin_src emacs-lisp +(use-package org-msg + :straight t + :hook + (message-mode-hook . org-msg-mode) + (notmuch-message-mode-hook . org-msg-mode) + :config + (setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t tex:dvipng" + org-msg-greeting-name-limit 3) + + (add-to-list + 'org-msg-enforce-css + '(img latex-fragment-inline + ((transform . ,(format "translateY(-1px) scale(%.3f)" + (/ 1.0 (if (boundp 'preview-scale) + preview-scale 1.4)))) + (margin . "0 -0.35em"))))) +#+end_src +*** Org for Evil +Evil org for some nice bindings. + +#+begin_src emacs-lisp +(use-package evil-org + :straight t + :defer t + :hook (org-mode-hook . evil-org-mode)) +#+end_src ** Makefile Defines an auto-insert for Makefiles. Assumes C but it's very easy to change it for C++. @@ -4145,12 +4179,8 @@ I may disagree with some. So I use it in a mode to mode basis. #+begin_src emacs-lisp (use-package evil-collection - :defer t - :hook (after-init-hook . evil-collection-init) - :straight t - :init - (setq evil-collection-mode-list '(eww flycheck magit calendar notmuch - ibuffer proced calc image))) + :after evil + :straight t) #+end_src *** Evil number Increment/decrement a number at point like Vim does, but use bindings @@ -4239,27 +4269,6 @@ but I prefer Emacs' hence the configuration here. #+begin_src emacs-lisp (use-package register :config - (defvar +register/--choice 0) - (defconst +register/quick-registers - (list ?a ?s ?d ?f ?g ?h ?j ?k ?l)) - (defun +register/--quick-jump () - (let ((choice (nth +register/--choice +register/quick-registers))) - (if (assoc choice register-alist) - (jump-to-register choice)))) - (defun +register/jump-prev () - (interactive) - (setq +register/--choice (mod (- +register/--choice 1) - (length +register/quick-registers))) - (+register/--quick-jump)) - (defun +register/jump-next () - (interactive) - (setq +register/--choice (mod (+ 1 +register/--choice) - (length +register/quick-registers))) - (+register/--quick-jump)) - :general - (leader - "," #'+register/jump-prev - "." #'+register/jump-next) (nmmap "m" #'point-to-register "'" #'jump-to-register)) @@ -4436,6 +4445,9 @@ itself. The only feature left is describing changes... :general (leader "u" #'undo-tree-visualize) + (mmap + :keymaps 'undo-tree-visualizer-mode-map + "t" #'undo-tree-visualizer-toggle-timestamps) :init (setq undo-tree-auto-save-history t undo-tree-history-directory-alist backup-directory-alist) @@ -4465,8 +4477,7 @@ with abstracting a few things away. (use-package abbrev :defer t :hook - (prog-mode-hook . abbrev-mode) - (text-mode-hook . abbrev-mode) + ((prog-mode-hook text-mode-hook) . abbrev-mode) :init (defmacro +abbrev/define-abbrevs (abbrev-table &rest abbrevs) `(progn @@ -4490,7 +4501,11 @@ with abstracting a few things away. ("smon" (format-time-string "%B" (current-time))) ("swho" - (format "%s <%s>" user-full-name user-mail-address)))) + (format "%s <%s>" user-full-name user-mail-address)) + ("stodo" + (thread-last (current-time) + (format-time-string "%Y-%m-%d %H:%M") + (format "TODO(%s)[%s]:" user-login-name))))) #+end_src ** Amx Amx is a fork of Smex that works to enhance the diff --git a/Emacs/.config/emacs/elisp/better-mode-line.el b/Emacs/.config/emacs/elisp/better-mode-line.el index 4569cac..2776005 100644 --- a/Emacs/.config/emacs/elisp/better-mode-line.el +++ b/Emacs/.config/emacs/elisp/better-mode-line.el @@ -67,8 +67,8 @@ extreme end to CENTRE-SEGMENT." (:eval (bml/--generate-padding bml/left-segment)) ,bml/centre-segment - (:eval (bml/--generate-padding - bml/right-segment)) + ;; NOTE: Emacs 30! + mode-line-format-right-align ,bml/right-segment))) (provide 'better-mode-line) diff --git a/Emacs/.config/emacs/elisp/elfeed-org.el b/Emacs/.config/emacs/elisp/elfeed-org.el index 2b68acc..4416926 100644 --- a/Emacs/.config/emacs/elisp/elfeed-org.el +++ b/Emacs/.config/emacs/elisp/elfeed-org.el @@ -29,11 +29,12 @@ (defun elfeed-org/--parse-link (context) (thread-last (org-element-property :title context) search-forward) - (let ((title-context (org-element-context))) - (org-element-property :raw-link title-context))) + (org-element-property :raw-link (org-element-context))) (defun elfeed-org/--parse-tags () - (mapcar #'intern (org-get-tags))) + (thread-last + (org-get-tags) + (mapcar #'intern))) (defun elfeed-org/--parse-headline () (if-let* ((ctx (org-element-context)) @@ -43,14 +44,15 @@ nil)) (defun elfeed-org/--parse-headlines () - (cl-remove-if - #'null - (org-map-entries #'elfeed-org/--parse-headline t))) + (thread-last + (org-map-entries #'elfeed-org/--parse-headline t) + (cl-remove-if #'null))) (defun elfeed-org () - (setq elfeed-feeds - (with-current-buffer (find-file-noselect elfeed-org/file) - (elfeed-org/--parse-headlines)))) + (thread-last + (elfeed-org/--parse-headlines) + (with-current-buffer (find-file-noselect elfeed-org/file)) + (setq elfeed-feeds))) (provide 'elfeed-org) ;;; elfeed-org.el ends here diff --git a/Emacs/.config/emacs/elisp/eshell-additions.el b/Emacs/.config/emacs/elisp/eshell-additions.el index a9362db..47674ff 100644 --- a/Emacs/.config/emacs/elisp/eshell-additions.el +++ b/Emacs/.config/emacs/elisp/eshell-additions.el @@ -41,14 +41,21 @@ "Change to directory `project-root'" (if (project-current) (eshell/cd (list (project-root (project-current)))) + (setq eshell-last-command-status 1) (eshell/echo (format "[%s]: No project in current directory" (propertize "Error" 'font-lock-face '(:foreground "red")))))) (defun eshell/sudo-switch (&rest args) - "Switch to a tramp connection sudo in the current directory" - (let ((wrapped-dir (concat "/sudo::" default-directory))) - (eshell/cd wrapped-dir))) + "Switch to and from administrative (sudo) mode in Eshell. +Uses tramp to figure out if we're in sudo mode or not. " + (let ((user (file-remote-p default-directory 'user))) + (cond + ((null user) + (let ((wrapped-dir (concat "/sudo::" default-directory))) + (eshell/cd wrapped-dir))) + ((string= user "root") + (eshell/cd (file-remote-p default-directory 'localname)))))) ;; Additional functions (defun +eshell/at-cwd (&optional arg) @@ -71,6 +78,19 @@ Pass argument to `+eshell/open'." collect (cons (buffer-name buffer) buffer))) +(defun +eshell/--choose-instance () + (let* ((current-instances (+eshell/--current-instances)) + (answer (completing-read "Enter name: " (mapcar #'car current-instances))) + (result (assoc answer current-instances))) + (cond + (result (switch-to-buffer (cdr result)) + (cdr result)) + ((not (string= answer "")) + (let ((eshell-buffer-name (format "*%s-eshell*" answer))) + (eshell nil))) + (t + (eshell))))) + (defun +eshell/open (&optional arg) "Open an instance of EShell, displaying it. @@ -80,35 +100,28 @@ Otherwise, create an instance with the name given. If `arg' is non nil, then always prompt user to select an instance." (interactive "P") - (let ((current-instances (+eshell/--current-instances)) - (buffer nil)) - (cond - ((and (null current-instances) - (null arg)) - (setq buffer (eshell))) - ((and (= (length current-instances) 1) - (null arg)) - (setq buffer (cdar current-instances)) - (switch-to-buffer (cdar current-instances))) - (t - (let* ((answer (completing-read "Enter name: " (mapcar #'car current-instances))) - (result (assoc answer current-instances))) - (cond - (result (switch-to-buffer (cdr result)) - (setq buffer (cdr result))) - ((not (string= answer "")) - (let ((eshell-buffer-name (format "*%s-eshell*" answer))) - (setq buffer (eshell nil)))) - (t - (setq buffer (eshell))))))) - (if (and (consp arg) (> (car arg) 4)) - (with-current-buffer buffer - (thread-last (read-file-name "Enter directory: ") - file-name-directory - list - eshell/cd) - (eshell-send-input))) - buffer)) + (cond + ((null arg) + ;; No arg => Choose a default instance + (let* ((candidates (+eshell/--current-instances)) + (default-cand (assoc "*eshell*" candidates #'string=)) + (vacuous-cand (car candidates))) + (if-let ((cand (or default-cand vacuous-cand))) + (switch-to-buffer (cdr cand)) + (eshell)))) + ((= (car arg) 4) + ;; Arg => Choose an instance + (+eshell/--choose-instance)) + (t + ;; Double arg => Choose an instance then choose the directory + (let ((instance (+eshell/--choose-instance))) + (with-current-buffer instance + (thread-last (read-file-name "Enter directory: ") + file-name-directory + list + eshell/cd) + (eshell-send-input)) + instance)))) (provide 'eshell-additions) ;;; eshell-additions.el ends here diff --git a/Emacs/.config/emacs/elisp/eshell-prompt.el b/Emacs/.config/emacs/elisp/eshell-prompt.el index d0a4e91..83e5943 100644 --- a/Emacs/.config/emacs/elisp/eshell-prompt.el +++ b/Emacs/.config/emacs/elisp/eshell-prompt.el @@ -19,25 +19,57 @@ ;;; Commentary: -;; We provide a function +eshell-prompt which generates a prompt on +;; We provide a function ep which generates a prompt on ;; demand. ;;; Code: -(defvar +eshell-prompt/user-prompt "𝜆> " +(defvar ep/user-prompt " λ " "Prompt for user to input.") -(defvar +eshell-prompt/dir-colour "deepskyblue") -(defvar +eshell-prompt/success-colour "forestgreen") -(defvar +eshell-prompt/failure-colour "red") - -(defun +eshell-prompt/--colour-on-last-command () +(defvar ep/dir-colour "deepskyblue") +(defvar ep/success-colour "green2") +(defvar ep/failure-colour "red") +(defvar ep/branch-name-colour "LightSalmon") +(defvar ep/pipe-colour "green4") +(defvar ep/ahead-colour "dodger blue") +(defvar ep/remote-colour "DarkGoldenrod") + +(defun ep/make-prompt () + (let ((git (ep/--git-status))) + (thread-last + `(("┌──" :foreground ,ep/pipe-colour) + "[" + (,(ep/--user-and-remote) :foreground ,ep/remote-colour) + (,(abbreviate-file-name (tramp-file-local-name (eshell/pwd))) + :foreground ,ep/dir-colour) + ,(if (string= git "") + "" + (concat "]─[" git)) + "]" + "\n" + ("└─>" :foreground ,ep/pipe-colour) + (,ep/user-prompt :foreground ,(ep/--colour-on-last-command))) + (mapconcat + #'(lambda (item) + (if (listp item) + (propertize (car item) + 'font-lock-face (cdr item) + 'front-sticky '(font-lock-face read-only) + 'rear-nonsticky '(font-lock-face read-only)) + item)))))) + +(defun ep/--with-fg-colour (s colour) + "Helper which propertises a string `s' with foreground colour `colour'" + (propertize s 'font-lock-face `(:foreground ,colour))) + +(defun ep/--colour-on-last-command () "Returns an Emacs colour based on ESHELL-LAST-COMMAND-STATUS." (if (zerop eshell-last-command-status) - +eshell-prompt/success-colour - +eshell-prompt/failure-colour)) + ep/success-colour + ep/failure-colour)) -(defun +eshell-prompt/--git-remote-status () +(defun ep/--git-remote-status () "Returns a propertized string for the status of a repository in comparison to its remote. 3 differing strings are returned dependent on: @@ -53,67 +85,96 @@ behind or ahead the local repository is." (status (nth 3 branch-status)) (diff (cl-position "by" branch-status :test #'string=))) (if (null diff) - (propertize "=" 'font-lock-face `(:foreground ,+eshell-prompt/success-colour)) + (ep/--with-fg-colour "=" ep/success-colour) (let ((n (nth (+ 1 diff) branch-status))) (concat (cond ((string= status "ahead") - (propertize "→" 'font-lock-face '(:foreground "dodger blue"))) + (ep/--with-fg-colour "→" ep/ahead-colour)) ((string= status "behind") - (propertize "←" 'font-lock-face '(:foreground "red")))) + (ep/--with-fg-colour "←" ep/failure-colour))) n))))) -(defun +eshell-prompt/--git-change-status () +(defun ep/--git-change-status () "Returns a propertized string for the condition of the worktree in -a repository. If there are no changes i.e. the worktree is clean -then a green tick is returned, but if there are changes then the -number of files affected are returned in red." +a repository. + +If there are no changes i.e. the worktree is clean then a green tick is +returned. + +If there are changes then we characterise it by the following parameters: +- staged changes in green +- unstaged but tracked changes in blue +- untracked files in red +" (let* ((git-cmd "git status -s") - (command-output (split-string (shell-command-to-string git-cmd) "\n")) - (changed-files (- (length command-output) 1))) - (if (= changed-files 0) - (propertize "✓" - 'font-lock-face - `(:foreground ,+eshell-prompt/success-colour)) - (propertize (number-to-string changed-files) - 'font-lock-face - `(:foreground ,+eshell-prompt/failure-colour))))) - -(defun +eshell-prompt/--git-status () - "Returns a completely formatted string of -form (BRANCH-NAME<CHANGES>[REMOTE-STATUS])." - (let ((git-branch (thread-last - (split-string (shell-command-to-string "git branch") "\n") - (cl-remove-if (lambda (s) (= (length s) 0))) - (cl-find-if (lambda (s) (string= "*" (substring s 0 1))))))) + (command-output + (thread-first (shell-command-to-string git-cmd) + (split-string "\n") + butlast)) + (status-codes (mapcar #'(lambda (s) (cons (substring s 0 1) (substring s 1 2))) + command-output)) + (filter-f (lambda (x) (not (or (string= x "?") (string= x " "))))) + (total (length status-codes)) + (staged (cl-count-if (lambda (x) (funcall filter-f (car x))) status-codes)) + (modified (cl-count-if (lambda (x) (funcall filter-f (cdr x))) status-codes)) + (not-tracked (cl-count-if (lambda (x) (string= (cdr x) "?")) status-codes))) + (if (= total 0) + (ep/--with-fg-colour "✓" ep/success-colour) + (thread-last + (list + (ep/--with-fg-colour (number-to-string staged) ep/success-colour) + (ep/--with-fg-colour (number-to-string modified) ep/ahead-colour) + (ep/--with-fg-colour (number-to-string not-tracked) ep/failure-colour)) + (cl-remove-if #'(lambda (s) (string= s "0"))) + (mapconcat #'(lambda (s) (concat s "/"))))))) + +(defun ep/--git-branch-name () + "Get the branch name of the current working directory. + +If a deteached head, return the SHA." + (let* ((branch-name (thread-last + (split-string (shell-command-to-string "git branch") "\n") + (cl-remove-if #'(lambda (s) (= (length s) 0))) + (cl-find-if #'(lambda (s) (string= "*" (substring s 0 1)))))) + (branch-name (if (null branch-name) nil + (substring branch-name 2)))) + (cond + ((null branch-name) nil) + ((string= "(" (substring branch-name 0 1)) + (replace-regexp-in-string + "\n$" "" + (shell-command-to-string "git rev-parse --short HEAD"))) + (t branch-name)))) + +(defun ep/--git-status () + "Returns a completely formatted string of form +BRANCH-NAME(REMOTE-STATUS)(CHANGES)." + (let ((git-branch (ep/--git-branch-name))) (if (null git-branch) "" (format - "(%s<%s>[%s])" - (nth 2 (split-string git-branch "\n\\|\\*\\| ")) - (+eshell-prompt/--git-change-status) - (+eshell-prompt/--git-remote-status))))) - -(defun +eshell-prompt/make-prompt () - (let ((git (+eshell-prompt/--git-status))) - (mapconcat - (lambda (item) - (if (listp item) - (propertize (car item) - 'font-lock-face (cdr item) - 'front-sticky '(font-lock-face read-only) - 'rear-nonsticky '(font-lock-face read-only)) - item)) - (list - "[" - `(,(abbreviate-file-name (eshell/pwd)) :foreground ,+eshell-prompt/dir-colour) - "]" - (if (string= git "") - "" - (concat " " git)) - "\n" - (list "𝜆> " ':foreground (+eshell-prompt/--colour-on-last-command)))))) - + "%s(%s)(%s)" + (ep/--with-fg-colour git-branch ep/branch-name-colour) + (ep/--git-remote-status) + (ep/--git-change-status))))) + +(defun ep/--user-and-remote () + "If in a remote directory, return a string representing that host, +otherwise empty string." + (if (file-remote-p default-directory) + (let ((user (file-remote-p default-directory 'user)) + (host (file-remote-p default-directory 'host))) + (concat + (if user + (format "%s@%s" user host) + host) + ":")) + "")) (provide 'eshell-prompt) ;;; eshell-prompt.el ends here + +;; Local Variables: +;; read-symbol-shorthands: (("ep" . "eshell-prompt")) +;; End: diff --git a/Emacs/.config/emacs/elisp/personal-light-theme.el b/Emacs/.config/emacs/elisp/personal-light-theme.el index c8e4f3e..d05f880 100644 --- a/Emacs/.config/emacs/elisp/personal-light-theme.el +++ b/Emacs/.config/emacs/elisp/personal-light-theme.el @@ -81,6 +81,19 @@ '(org-quote ((t (:slant italic)))) '(org-verbatim ((t (:foreground "red3")))) '(query-replace ((t (:inherit (isearch))))) + '(rainbow-delimiters-base-error-face ((t (:extend t :foreground "white" + :background "red1")))) + '(rainbow-delimiters-depth-1-face ((t (:extend t :foreground "red")))) + '(rainbow-delimiters-depth-2-face ((t (:extend t :foreground "darkorange")))) + '(rainbow-delimiters-depth-3-face ((t (:extend t :foreground "yellow")))) + '(rainbow-delimiters-depth-4-face ((t (:extend t :foreground "green")))) + '(rainbow-delimiters-depth-5-face ((t (:extend t :foreground "DeepSkyBlue")))) + '(rainbow-delimiters-depth-6-face ((t (:extend t :foreground "purple")))) + '(rainbow-delimiters-depth-7-face ((t (:extend t :foreground "violet")))) + '(rainbow-delimiters-mismatched-face ((t (:extend t :foreground "white" + :background "red4")))) + '(rainbow-delimiters-unmatched-face ((t (:extend t :foreground "white" + :background "red3")))) '(region ((t (:extend t :background "#C2D5E9")))) '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t)))) '(shadow ((((class color grayscale) (min-colors 88) (background light)) diff --git a/Emacs/.config/emacs/elisp/personal-solarized-theme.el b/Emacs/.config/emacs/elisp/personal-solarized-theme.el index d0b4cd9..ab06055 100644 --- a/Emacs/.config/emacs/elisp/personal-solarized-theme.el +++ b/Emacs/.config/emacs/elisp/personal-solarized-theme.el @@ -1,15 +1,18 @@ (deftheme personal-solarized - "Created 2024-07-02.") + "Created 2024-07-02." + :background-mode 'dark) (defvar personal-solarized-name-colour "#3c98e0" "Colour of names in this theme.") (custom-theme-set-faces 'personal-solarized + '(Info-quoted ((t (:inherit fixed-pitch-serif :underline t)))) '(button ((t (:inherit (link))))) '(child-frame-border ((t (:background "white")))) '(company-preview ((t (:foreground "wheat" :background "blue4")))) '(company-preview-common ((t (:inherit company-preview :foreground "grey")))) + '(company-template-field ((t (:inherit company-preview :foreground "grey" :slant italic)))) '(company-tooltip ((t (:background "black" :foreground "white")))) '(company-tooltip-annotation ((t (:foreground "grey")))) '(company-tooltip-selection ((t (:background "grey31")))) @@ -21,35 +24,25 @@ '(evil-goggles-default-face ((t (:background "#004065")))) '(evil-mc-cursor-default-face ((t (:foreground "black" :background "white")))) '(evil-mc-region-face ((t (:extend t :background "grey50")))) - '(fill-column-indicator ((t (:inherit shadow :foreground "gray23" - :background "gray23" :weight thin)))) + '(fill-column-indicator ((t (:inherit shadow :foreground "gray23" :weight thin)))) '(fixed-pitch-serif ((t (:family "Noto Serif" :height 0.95)))) '(font-latex-bold-face ((t (:weight bold :foreground "#9eacac")))) '(font-latex-doctex-documentation-face ((t (:background unspecified)))) - '(font-latex-doctex-preprocessor-face ((t (:inherit (font-latex-doctex-documentation-face - font-lock-builtin-face - font-lock-preprocessor-face))))) + '(font-latex-doctex-preprocessor-face ((t (:inherit (font-latex-doctex-documentation-face font-lock-builtin-face font-lock-preprocessor-face))))) '(font-latex-italic-face ((t (:style italic :foreground "#9eacac")))) '(font-latex-math-face ((t (:foreground "#7a7ed2")))) - '(font-latex-sectioning-0-face ((t (:inherit font-latex-sectioning-5-face - :height 1.1)))) - '(font-latex-sectioning-1-face ((t (:inherit font-latex-sectioning-5-face - :height 1.1)))) - '(font-latex-sectioning-2-face ((t (:inherit font-latex-sectioning-5-face - :height 1.1)))) - '(font-latex-sectioning-3-face ((t (:inherit font-latex-sectioning-5-face - :height 1.1)))) - '(font-latex-sectioning-4-face ((t (:inherit font-latex-sectioning-5-face - :height 1.1)))) + '(font-latex-sectioning-0-face ((t (:inherit font-latex-sectioning-5-face :height 1.1)))) + '(font-latex-sectioning-1-face ((t (:inherit font-latex-sectioning-5-face :height 1.1)))) + '(font-latex-sectioning-2-face ((t (:inherit font-latex-sectioning-5-face :height 1.1)))) + '(font-latex-sectioning-3-face ((t (:inherit font-latex-sectioning-5-face :height 1.1)))) + '(font-latex-sectioning-4-face ((t (:inherit font-latex-sectioning-5-face :height 1.1)))) '(font-latex-sectioning-5-face ((t (:foreground "#c49619" :weight bold)))) '(font-latex-sedate-face ((t (:foreground "#9eacac")))) - '(font-latex-slide-title-face ((t (:inherit (default font-lock-type-face) - :weight bold :height 1.2)))) + '(font-latex-slide-title-face ((t (:inherit (default font-lock-type-face) :weight bold :height 1.2)))) '(font-latex-string-face ((t (:foreground "#3cafa5")))) '(font-latex-subscript-face ((t (:height 0.8)))) '(font-latex-superscript-face ((t (:height 0.8)))) - '(font-latex-verbatim-face ((t (:inherit fixed-pitch-serif :foreground "#8d9fa1" - :slant italic)))) + '(font-latex-verbatim-face ((t (:inherit fixed-pitch-serif :foreground "#8d9fa1" :slant italic)))) '(font-latex-warning-face ((t (:inherit bold :foreground "#db5823")))) '(font-lock-builtin-face ((t (:foreground "#8d9fa1" :weight bold :slant normal)))) '(font-lock-comment-delimiter-face ((t (:foreground "#62787f" :slant normal)))) @@ -64,29 +57,21 @@ '(font-lock-warning-face ((t (:inherit error :weight bold)))) '(fringe ((t (:inherit (default))))) '(haskell-interactive-face-prompt ((t (:foreground "green")))) - '(header-line ((t (:box nil :foreground "grey90" :background "grey20" - :inherit (mode-line))))) + '(header-line ((t (:box nil :foreground "grey90" :background "grey20" :inherit (mode-line))))) '(highlight ((t (:extend t :background "#222233")))) '(homoglyph ((t (:foreground "cyan")))) - '(Info-quoted ((t (:inherit fixed-pitch-serif :underline t)))) '(isearch ((t (:foreground "brown4" :background "white")))) '(isearch-fail ((t (:background "red4")))) '(lazy-highlight ((t (:background "paleturquoise4")))) '(line-number ((t (:foreground "grey45" :background "grey1" :inherit (default))))) - '(line-number-current-line ((t (:foreground "white" :background "grey1" - :inherit (default))))) - '(link ((t (:underline (:color foreground-color :style line) - :foreground "cyan1")))) + '(line-number-current-line ((t (:foreground "white" :background "grey1" :inherit (default))))) + '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1")))) '(link-visited ((t (:foreground "violet" :inherit (link))))) '(match ((t (:background "RoyalBlue3")))) - '(minibuffer-prompt ((t (:foreground "cyan")))) - `(mode-line ((t (:box (:line-width 1 :color "white") :foreground "LightSkyBlue" - :background "black" :inherit (default))))) + '(minibuffer-prompt ((t (:background "darkblue" :foreground "cyan")))) '(mode-line-buffer-id ((t (:weight bold)))) '(mode-line-emphasis ((t (:weight bold)))) - '(mode-line-inactive ((t (:box (:line-width 1 :color "grey10") :weight light - :foreground "CadetBlue" :background "grey7" - :inherit (mode-line))))) + '(mode-line-inactive ((t (:box (:line-width 1 :color "grey10") :weight light :foreground "CadetBlue" :background "grey7" :inherit (mode-line))))) '(next-error ((t (:inherit (region))))) '(orderless-match-face-0 ((t (:weight bold :foreground "lime green")))) '(orderless-match-face-1 ((t (:weight bold :foreground "light green")))) @@ -94,25 +79,25 @@ '(orderless-match-face-3 ((t (:weight bold :foreground "dark green")))) '(org-block ((t (:inherit default)))) '(org-code ((t (:foreground "green3")))) + '(org-document-info ((t (:height 1.2 :inherit default)))) + '(org-document-title ((t (:height 1.2 :inherit default)))) '(org-hide ((t (:foreground "black")))) '(org-quote ((t (:slant italic)))) '(org-verbatim ((t (:foreground "red3")))) - '(outline-1 ((t (:inherit default :foreground "#db5823")))) - '(outline-2 ((t (:inherit default :foreground "#93a61a")))) - '(outline-3 ((t (:inherit default :foreground "#3c98e0")))) - '(outline-4 ((t (:inherit default :foreground "#c49619")))) - '(outline-5 ((t (:inherit default :foreground "#3cafa5")))) - '(outline-6 ((t (:inherit default :foreground "#93a61a")))) + '(outline-1 ((t (:inherit default :underline "#444444" :height 1.12 :foreground "#db5823")))) + '(outline-2 ((t (:inherit default :height 1.10 :foreground "#93a61a")))) + '(outline-3 ((t (:inherit default :height 1.08 :foreground "#3c98e0")))) + '(outline-4 ((t (:inherit default :height 1.06 :foreground "#c49619")))) + '(outline-5 ((t (:inherit default :height 1.04 :foreground "#3cafa5")))) + '(outline-6 ((t (:inherit default :height 1.02 :foreground "#93a61a")))) '(outline-7 ((t (:inherit default :foreground "#ec423a")))) '(outline-8 ((t (:inherit default :foreground "#3c98e0")))) '(outline-minor-0 ((t (:extend t :weight bold :background "#01323d")))) - '(outline-minor-1 ((t (:extend t :inherit (outline-minor-0 outline-1) - :background "#1e9d310d32a3")))) + '(outline-minor-1 ((t (:extend t :inherit (outline-minor-0 outline-1) :background "#1e9d310d32a3")))) '(pdf-isearch-batch ((t (:foreground "black" :background "white")))) '(pretty-mode-symbol-face ((t (:foreground "#c49619" :weight normal)))) '(query-replace ((t (:inherit (isearch))))) - '(rainbow-delimiters-base-error-face ((t (:extend t :foreground "white" - :background "red1")))) + '(rainbow-delimiters-base-error-face ((t (:extend t :foreground "white" :background "red1")))) '(rainbow-delimiters-depth-1-face ((t (:extend t :foreground "red")))) '(rainbow-delimiters-depth-2-face ((t (:extend t :foreground "darkorange")))) '(rainbow-delimiters-depth-3-face ((t (:extend t :foreground "yellow")))) @@ -120,38 +105,28 @@ '(rainbow-delimiters-depth-5-face ((t (:extend t :foreground "DeepSkyBlue")))) '(rainbow-delimiters-depth-6-face ((t (:extend t :foreground "purple")))) '(rainbow-delimiters-depth-7-face ((t (:extend t :foreground "violet")))) - '(rainbow-delimiters-mismatched-face ((t (:extend t :foreground "white" - :background "red4")))) - '(rainbow-delimiters-unmatched-face ((t (:extend t :foreground "white" - :background "red3")))) + '(rainbow-delimiters-mismatched-face ((t (:extend t :foreground "white" :background "red4")))) + '(rainbow-delimiters-unmatched-face ((t (:extend t :foreground "white" :background "red3")))) '(region ((t (:extend t :background "grey25")))) '(secondary-selection ((t (:extend t :background "SkyBlue4")))) '(shadow ((t (:foreground "grey70")))) - '(show-paren-match ((t (:foreground unspecified :background "green4" - :weight bold)))) - '(show-paren-mismatch ((t (:foreground "#01323d" :background "#ec1111" - :weight bold)))) + '(show-paren-match ((t (:foreground unspecified :background "green4" :weight bold)))) + '(show-paren-mismatch ((t (:foreground "#01323d" :background "#ec1111" :weight bold)))) '(tab-bar ((t (:background "black")))) - '(tab-bar-tab ((t (:background "grey5" :foreground "white" - :box (:line-width 2 :color "grey19"))))) + '(tab-bar-tab ((t (:background "grey5" :foreground "white" :box (:line-width 2 :color "grey19"))))) '(tab-bar-tab-inactive ((t (:background "black" :foreground "DimGrey")))) - '(tooltip ((t (:foreground "black" :background "lightyellow" - :inherit (variable-pitch))))) + '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) '(trailing-whitespace ((t (:background "red1")))) '(whitespace-line ((t (:background "black" :foreground "violet")))) '(whitespace-space ((t (:background "#171717" :foreground "black")))) '(whitespace-tab ((t (:background "#171717" :foreground "grey40")))) - `(font-lock-constant-face ((t (:foreground ,personal-solarized-name-colour - :weight bold)))) - `(font-lock-function-name-face ((t (:box nil - :foreground ,personal-solarized-name-colour)))) + `(font-lock-constant-face ((t (:foreground ,personal-solarized-name-colour :weight bold)))) + `(font-lock-function-name-face ((t (:box nil :foreground ,personal-solarized-name-colour)))) `(font-lock-preprocessor-face ((t (:foreground ,personal-solarized-name-colour)))) `(font-lock-variable-name-face ((t (:foreground ,personal-solarized-name-colour)))) - '(default ((t (:family "Jetbrains Mono" :foundry "ADBO" :width normal - :weight normal :slant normal :underline nil - :overline nil :extend nil :strike-through nil - :box nil :inverse-video nil - :foreground "#b6b6b6" :background "#0a0a0a" - :stipple nil :inherit nil))))) + `(mode-line ((t (:box (:line-width 1 :color "white") :foreground "LightSkyBlue" :background "black" :inherit (default))))) + `(org-block-begin-line ((t (:underline t :background "#1a1a1a")))) + `(org-block-end-line ((t (:overline t :background "#1a1a1a")))) + '(default ((t (:family "Jetbrains Mono" :foundry "ADBO" :width normal :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#b6b6b6" :background "#0a0a0a" :stipple nil :inherit nil))))) (provide-theme 'personal-solarized) diff --git a/Emacs/.config/emacs/elisp/search.el b/Emacs/.config/emacs/elisp/search.el index 7522d6f..eccc050 100644 --- a/Emacs/.config/emacs/elisp/search.el +++ b/Emacs/.config/emacs/elisp/search.el @@ -53,7 +53,7 @@ Returns a list of files with the directory preprended to them." (thread-last (+search/get-all-candidates) (cl-remove-if #'directory-name-p) (mapcar #'(lambda (x) (concat "\"" x "\" "))) - (string-join))) + string-join)) (defun +search/search-all () (interactive) @@ -61,7 +61,7 @@ Returns a list of files with the directory preprended to them." (candidates (+search/-format-grep-candidates))) (thread-last candidates (format "grep --color=auto -nIHZe \"%s\" -- %s" term) - (grep)) + grep) (next-error))) (provide 'search) diff --git a/Emacs/.config/emacs/init.el b/Emacs/.config/emacs/init.el index 7e74e4f..2bae99c 100644 --- a/Emacs/.config/emacs/init.el +++ b/Emacs/.config/emacs/init.el @@ -45,10 +45,10 @@ (load bootstrap-file nil 'nomessage)) ;; Setup benchmark to get current statistics - enable only if profiling. -;; (straight-use-package 'benchmark-init) -;; (require 'benchmark-init) -;; (add-hook 'after-init-hook 'benchmark-init/deactivate) -;; (benchmark-init/activate) +(straight-use-package 'benchmark-init) +(require 'benchmark-init) +(add-hook 'after-init-hook 'benchmark-init/deactivate) +(benchmark-init/activate) (setq use-package-enable-imenu-support t use-package-always-demand nil @@ -60,10 +60,8 @@ (straight-use-package 'org-mode) (straight-use-package 'no-littering) -(setq no-littering-etc-directory (expand-file-name ".config/" - user-emacs-directory) - no-littering-var-directory (expand-file-name ".var/" - user-emacs-directory) +(setq no-littering-etc-directory (expand-file-name ".config/" user-emacs-directory) + no-littering-var-directory (expand-file-name ".var/" user-emacs-directory) custom-file (no-littering-expand-etc-file-name "custom.el")) (load-file custom-file) @@ -79,6 +77,7 @@ (+literate/load-config) (when (daemonp) + ;; No need to lazy load this stuff (require 'general) (require 'evil) (require 'dired) @@ -88,7 +87,6 @@ (require 'org) (require 'company) (require 'eshell) - (require 'org) (require 'eglot)) (setq gc-cons-threshold (* 100 1024 1024) ; ~100MiB @@ -97,7 +95,8 @@ ;; FIXME: Problem with memory-report after running Emacs for a ;; bit, causes a Lisp nesting error, so I just set it up really ;; high so it doesn't reach that. - max-lisp-eval-depth 999999) + max-lisp-eval-depth 999999 + garbage-collection-messages t) (provide 'init) ;;; init.el ends here diff --git a/Emacs/.config/emacs/straight/versions/default.el b/Emacs/.config/emacs/straight/versions/default.el index f9a3d48..f536692 100644 --- a/Emacs/.config/emacs/straight/versions/default.el +++ b/Emacs/.config/emacs/straight/versions/default.el @@ -6,6 +6,7 @@ ("amx" . "5b3aa1aae84f4a225cb8d26ab79a32f97693f023") ("annalist.el" . "134fa3f0fb91a636a1c005c483516d4b64905a6d") ("avy" . "be612110cb116a38b8603df367942e2bb3d9bdbe") + ("benchmark-init-el" . "6507caa3c4cb2a6c9b85c771c5e9e5aeb7d745bc") ("closql" . "dc7924c1d206483a2555a98470c96fadf419f32d") ("company-mode" . "7c24dc8668af5aea8a5d07aeceda5fac7a2a85b5") ("compat" . "9428a64eb8a579f35d57bc4d4cdb6c5cf10806c1") @@ -19,7 +20,6 @@ ("elfeed" . "a39fb78e34ee25dc8baea83376f929d7c128344f") ("elisp-refs" . "bf3cca8f74065b1b31036f461e3a093b162311bd") ("emacs-htmlize" . "dd27bc3f26efd728f2b1f01f9e4ac4f61f2ffbf9") - ("emacs-libvterm" . "988279316fc89e6d78947b48513f248597ba969a") ("emacs-lorem-ipsum" . "4e87a899868e908a7a9e1812831d76c8d072f885") ("emacs-powerthesaurus" . "4b97797cf789aaba411c61a85fe23474ebc5bedc") ("emacs-request" . "c22e3c23a6dd90f64be536e176ea0ed6113a5ba6") @@ -27,7 +27,7 @@ ("emacsql" . "5470adaf5dcabebc80c913ac831258fd47a87cbe") ("embark" . "d5df0eff182b014ab49328a4dbb1d69eb7faafbd") ("emmet-mode" . "322d3bb112fced57d63b44863357f7a0b7eee1e3") - ("empv.el" . "4c660fe44f7ea562896924ce9de28cd37ef15a38") + ("empv.el" . "f14d4ac96e24368ad4688efc4a71da39804892f0") ("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6") ("eshell-syntax-highlighting" . "fa1d368452ebd11727d267076ae568b892fa9cb9") ("evil" . "c222ce1ea6fbefaed08308c061371ebdf01b078f") @@ -42,7 +42,7 @@ ("f.el" . "931b6d0667fe03e7bf1c6c282d6d8d7006143c52") ("fd-dired" . "458464771bb220b6eb87ccfd4c985c436e57dc7e") ("flycheck" . "773c3eb31ebeb6bb2f9f57d28177882ca7073df0") - ("forge" . "64d02997dc8f2e86037bc8467a18ef5279d945a7") + ("forge" . "8e4dd7ed05212abb3f5318d1f2de5ef880d0d848") ("geiser" . "97ce88463f346ff0dab147334fa0ce7b81569d7c") ("general.el" . "833dea2c4a60e06fcd552b653dfc8960935c9fb4") ("ghub" . "7467c905cd11199538e96403d1c58ae3b268d852") @@ -58,7 +58,7 @@ ("jira.el" . "961ef56406980958f345a9265970b7100b0e92a4") ("let-alist" . "021fc10df2e44faba4728d849ee767cf890aa51a") ("llama" . "48e5bc4919a4a29665362832d59ade8e248b0c3e") - ("magit" . "95ee9d8c5102bc5619f0e2c6d50104cae17b2009") + ("magit" . "75c61919994a23494152f726102898456a6055b7") ("markdown-mode" . "6102ac5b7301b4c4fc0262d9c6516693d5a33f2b") ("melpa" . "922cce631e17b7978c5d711569abf151c3301b35") ("nasm-mode" . "7079eb4ce14d94830513facf9bf2fca9e030a4d1") @@ -83,7 +83,7 @@ ("smartparens" . "79a338db115f441cd47bb91e6f75816c5e78a772") ("straight.el" . "88e574ae75344e39b436f863ef0344135c7b6517") ("tablist" . "fcd37147121fabdf003a70279cf86fbe08cfac6f") - ("transient" . "c7845bfd9f3b9ec76c491e9791001a5f7438d835") + ("transient" . "41b6e06cf56c029465fae72dc4c6e16cfd304e47") ("treepy.el" . "651e2634f01f346da9ec8a64613c51f54b444bc3") ("typescript.el" . "fc3a4f3b275e8cf6cf41aa0c9ef42e25ef908feb") ("undo-tree" . "16f4121032d09ef44b3d7d02c4d02c3c2f18041f") diff --git a/Mail/.local/share/mail/.notmuch/hooks/post-new b/Mail/.local/share/mail/.notmuch/hooks/post-new index 7558d11..f65d477 100755 --- a/Mail/.local/share/mail/.notmuch/hooks/post-new +++ b/Mail/.local/share/mail/.notmuch/hooks/post-new @@ -37,3 +37,6 @@ notmuch tag -inbox +bank from:'*@*hsbc*' from:'*@*lloydsbank*' notmuch tag +flagged from:'expiry@letsencrypt.org' notmuch tag -inbox +unread +trading from:"*trading212.com" + +notmuch tag -inbox +unread +projects from:"jira*" +notmuch tag -inbox +unread +projects from:"*@github.com" diff --git a/NeoVim/.config/nvim/lazy-lock.json b/NeoVim/.config/nvim/lazy-lock.json index bc33983..333b1b7 100644 --- a/NeoVim/.config/nvim/lazy-lock.json +++ b/NeoVim/.config/nvim/lazy-lock.json @@ -2,6 +2,6 @@ "NeoSolarized": { "branch": "master", "commit": "b94b1a9ad51e2de015266f10fdc6e142f97bd617" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, - "vim-tmux-navigator": { "branch": "master", "commit": "33afa80db65113561dc53fa732b7f5e53d5ecfd0" } + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "vim-tmux-navigator": { "branch": "master", "commit": "97e58f2b3b4f8fd30ce149302f10202f363cc361" } } @@ -16,7 +16,8 @@ Assumptions: - You have [[https://www.gnu.org/software/stow/][GNU/stow]] #+begin_src sh -mkdir -p ~/.local/src \ +mkdir -p \ + ~/.local/src \ ~/.local/bin \ ~/.local/lib \ ~/.local/share \ @@ -27,38 +28,49 @@ mkdir -p ~/.local/src \ ~/Projects \ ~/Text; -cd Dotfiles; -stow Emacs tmux vim Shell XServer Scripts SystemD SXHkD mpv aspell \ - ClangFormat Dunst Zathura +cd ~/Dotfiles; +stow Emacs \ + tmux \ + vim \ + Shell \ + XServer \ + Scripts \ + SystemD \ + SXHkD \ + mpv \ + aspell \ + ClangFormat \ + Dunst \ + Zathura; #+end_src * Why use this -Please don't. If you're looking for inspiration, this is where it -dies. I don't maintain this for anyone but me; verily, I have no -shame about it. Don't expect this to work for you if you're not -willing to roll your sleeves up. -* Emacs archives -On a fresh machine it takes a horrendous amount of time to completely -setup my Emacs configuration. This is largely due to /straight/ (the -package manager I use for Emacs) having to pull over 80 git -repositories for the different packages in my configuration, which is -obviously a network bound task. In comparison, it takes a much -shorter time to build the Lisp in these packages then load my -configuration. - -Hence I've introduced this measure: a compressed archive of a minimal -viable configuration for Emacs. This contains my configuration files, -custom Lisp code, all the repositories for external packages I use and -the straight package cache. Instead of downloading each repository -individually, this archive contains all of them immediately. +Please don't. I don't maintain this for anyone but me so don't expect +this to work for you if you're not willing to roll your sleeves up. +On the other hand, I'd say there's some pretty good work here - +particularly in my Emacs configuration. Some highlights are: -On my current machine after downloading the archive it takes around -209s to completely build the system including both package and custom -Lisp compilation. Once this is done Emacs takes less than 1 second to -boot. +- A custom + [[file:Emacs/.config/emacs/elisp/eshell-prompt.el][eshell prompt]] + which provides git status information and a bit of dynamic colouring + based on command exit status +- A complete [[file:Emacs/.config/emacs/elisp/literate.el][literate]] + system which compiles my configuration +- A [[file:Emacs/.config/emacs/elisp/better-mode-line.el][better mode + line]] which auto configures the default mode line to make it more + aesthetically pleasing +- 55 line [[file:Emacs/.config/emacs/elisp/elfeed-org.el][package + extension]] for elfeed which adds org mode support +* Emacs archives +99 Git repositories is a lot for Emacs to pull in order to setup my +configuration. Would be nice if I could pull all of it down at once +for use instead of having to wait for _straight_ (my Emacs package +manager of choice) to do it synchronously. -*NOTE*: This time doesn't include the native compilation time, as that - is asynchronous anyway. +These Emacs archives are an MVC (Minimum Viable Configuration) +including all the necessary Lisp which you can pull down and load +directly. You should be able to find the latest archive +[[https://aryadevchavali.com/resources][here]]. ** Scripts *IMPORTANT*: These are heavy scripts, expect them to take a while. Therefore, if in Emacs, do _not_ run these via ~C-c C-c~ because it @@ -82,3 +94,8 @@ And this script sends it over via rsync rsync -avz --info=progress2 --info=name0 emacs-config.tar.zst \ root@aryadevchavali.com:/var/www/html/resources #+end_src + +You can do the last bit if using Emacs: just open the directory where +you've compressed the configuration in ~dired~, open the remote +directory in another split, then =M-r= ~dired-rsync~ to copy it over. +You get a cute Little progress indicator in the mode line as well! diff --git a/SXHkD/.config/sxhkd/sxhkdrc b/SXHkD/.config/sxhkd/sxhkdrc index 7d733e0..ee95a8b 100644 --- a/SXHkD/.config/sxhkd/sxhkdrc +++ b/SXHkD/.config/sxhkd/sxhkdrc @@ -19,7 +19,10 @@ super + e super + s notify-send -u low "Launching browser"; \ - xdg-open "https://duckduckgo.com" + xdg-open "https://duckduckgo.com"; + +super + C + dunstctl close; super + semicolon $HOME/.local/scripts/localstream -f; @@ -49,17 +52,12 @@ super + alt + l super + alt + L xtrlock; +super + ctrl + alt + l + i3lock -c 000000; + super + ctrl + m $HOME/.local/scripts/mail_fetch -super + ctrl + d - notify-send -u low "Changing background"; \ - $HOME/.local/scripts/background; - -super + ctrl + D - notify-send -u low "Changing background"; \ - $HOME/.local/scripts/black-bg; - super + p passmenu -f -i @@ -72,7 +70,7 @@ super + F12 super + Home onboard -# Music and volume +# Media super + F{6,7,8} playerctl {previous,play-pause,next}; @@ -98,10 +96,21 @@ XF86AudioMute Pause playerctl --player=spotify play-pause -# Connections Print - scrot -f -s '%Y%m%d_%H%M%S.png' -e 'mv $f ~/Pictures/'; + $HOME/.local/scripts/screenshot; +super + alt + s + $HOME/.local/scripts/screenshot; + +super + ctrl + d + notify-send -u low "Changing background"; \ + $HOME/.local/scripts/background; + +super + ctrl + D + notify-send -u low "Changing background"; \ + $HOME/.local/scripts/black-bg; + +# Connections Scroll_Lock conn=$(nmcli | grep "connected to" | sed 's/.*connected to //g' | head -1); \ nmcli c down "$conn"; \ diff --git a/Scripts/.local/scripts/compositor b/Scripts/.local/scripts/compositor new file mode 100755 index 0000000..903ee30 --- /dev/null +++ b/Scripts/.local/scripts/compositor @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +killall picom; +picom \ + --backend glx \ + --no-fading-openclose \ + ; diff --git a/Scripts/.local/scripts/screenshot b/Scripts/.local/scripts/screenshot new file mode 100755 index 0000000..8bbc6a9 --- /dev/null +++ b/Scripts/.local/scripts/screenshot @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +scrot -f -s '%Y%m%d_%H%M%S.png' -e 'mv $f ~/Pictures/'; diff --git a/XServer/.xprofile b/XServer/.xprofile index d4e3575..f487099 100644 --- a/XServer/.xprofile +++ b/XServer/.xprofile @@ -1,4 +1,4 @@ #!/usr/bin/env sh setxkbmap gb -option shift:both_capslock -option caps:escape; xmodmap ~/.Xmodmap; -[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources; +[ -f ~/.Xresources ] && xrdb -merge -I$HOME ~/.Xresources; diff --git a/aspell/.aspell.en.pws b/aspell/.aspell.en.pws index 893337a..1b5b2b2 100644 --- a/aspell/.aspell.en.pws +++ b/aspell/.aspell.en.pws @@ -1,4 +1,4 @@ -personal_ws-1.1 en 183 +personal_ws-1.1 en 186 Architecting Aryadev Automorphism @@ -48,6 +48,9 @@ anonymised anonymises architected arity +artifact +artifacting +artifacts automorphism automorphisms biconnected diff --git a/gpg/.gnupg/gpg-agent.conf b/gpg/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..7d304df --- /dev/null +++ b/gpg/.gnupg/gpg-agent.conf @@ -0,0 +1 @@ +pinentry-timeout 0 diff --git a/mpv/.config/mpv/mpv.conf b/mpv/.config/mpv/mpv.conf index 5727f39..2894899 100644 --- a/mpv/.config/mpv/mpv.conf +++ b/mpv/.config/mpv/mpv.conf @@ -4,4 +4,3 @@ save-watch-history hwdec=vaapi gpu-context=x11egl cache=yes -demuxer-max-bytes=512M
\ No newline at end of file |