From 2bab24ec08bbea6d7c174c064b978d41f5d56c44 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Tue, 31 Dec 2024 12:51:51 -0800 Subject: [PATCH] mostly works --- custom-lisp/nebkor-personal.el | 17 + custom-lisp/vedang-personal.el | 394 --- init.el | 42 +- unravel-emacs.org => nebkor-emacs.org | 2686 ++++++----------- .../nebkor-completion.el | 179 +- .../nebkor-dired.el | 2 +- .../nebkor-essentials.el | 79 +- nebkor-modules/nebkor-functions.el | 74 + .../nebkor-git.el | 2 +- .../nebkor-langs.el | 2 +- .../nebkor-org.el | 2 +- .../nebkor-search.el | 6 +- .../nebkor-study.el | 6 +- .../nebkor-theme.el | 90 +- nebkor-modules/nebkor-window.el | 75 + unravel-modules/unravel-shell.el | 35 - unravel-modules/unravel-window.el | 173 -- 17 files changed, 1295 insertions(+), 2569 deletions(-) create mode 100644 custom-lisp/nebkor-personal.el delete mode 100644 custom-lisp/vedang-personal.el rename unravel-emacs.org => nebkor-emacs.org (69%) rename unravel-modules/unravel-completion.el => nebkor-modules/nebkor-completion.el (66%) rename unravel-modules/unravel-dired.el => nebkor-modules/nebkor-dired.el (99%) rename unravel-modules/unravel-essentials.el => nebkor-modules/nebkor-essentials.el (76%) create mode 100644 nebkor-modules/nebkor-functions.el rename unravel-modules/unravel-git.el => nebkor-modules/nebkor-git.el (99%) rename unravel-modules/unravel-langs.el => nebkor-modules/nebkor-langs.el (99%) rename unravel-modules/unravel-org.el => nebkor-modules/nebkor-org.el (99%) rename unravel-modules/unravel-search.el => nebkor-modules/nebkor-search.el (96%) rename unravel-modules/unravel-study.el => nebkor-modules/nebkor-study.el (98%) rename unravel-modules/unravel-theme.el => nebkor-modules/nebkor-theme.el (70%) create mode 100644 nebkor-modules/nebkor-window.el delete mode 100644 unravel-modules/unravel-shell.el delete mode 100644 unravel-modules/unravel-window.el diff --git a/custom-lisp/nebkor-personal.el b/custom-lisp/nebkor-personal.el new file mode 100644 index 0000000..7e185a5 --- /dev/null +++ b/custom-lisp/nebkor-personal.el @@ -0,0 +1,17 @@ +;; stand-in +(global-set-key [C-tab] #'other-window) +(global-set-key [C-S-tab] #'sother-window) +(global-set-key [C-iso-lefttab] #'sother-window) +(global-set-key [f4] #'nebkor/kill-buffer) +(global-set-key [f7] 'revert-buffer) + +(setq-default auto-fill-function 'do-auto-fill) +(setq-default fill-column 100) +(turn-on-auto-fill) +(add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1))) +(define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command) + +(add-hook 'before-save-hook #'delete-trailing-whitespace) +(fset 'yes-or-no-p 'y-or-n-p) + +(provide 'nebkor-personal) diff --git a/custom-lisp/vedang-personal.el b/custom-lisp/vedang-personal.el deleted file mode 100644 index 196eefd..0000000 --- a/custom-lisp/vedang-personal.el +++ /dev/null @@ -1,394 +0,0 @@ -;;; Personal Basic settings -(use-package emacs - :ensure nil - :config - (setq user-mail-address "vedang@unravel.tech")) - -(use-package org - :ensure nil - :config - (setq org-default-notes-file - (expand-file-name "brain/daily.org" org-directory)) - (setq org-blogpost-file - (expand-file-name "brain/projects/blogposts.org" org-directory)) - (setq org-crm-file - (expand-file-name "brain/projects/crm.org" org-directory)) - (setq org-sales-file - (expand-file-name "brain/projects/sales.org" org-directory)) - (setq org-company-file - (expand-file-name "brain/daily.org" org-directory)) - (setq org-agenda-files - (append (list org-default-notes-file - (expand-file-name "brain/projects" org-directory) - (expand-file-name "brain/areas/prm.org" org-directory))))) - -;;;; org-capture -(use-package org-capture - :ensure nil - :config -;;; Default definitions for variables used in capture templates - (when (not (boundp 'org-blogpost-file)) - (defvar org-blogpost-file org-default-notes-file - "File in which blogposts and microblogposts are stored.")) - (when (not (boundp 'org-company-file)) - (defvar org-company-file org-default-notes-file - "File in which company documentation is stored.")) - -;;; *CRITICAL NOTE* Read before modifying the push stack below: - ;; Pushing to capture templates is a stack. What goes in first shows - ;; up at the bottom of the capture templates list. - -;;; Templates for thinking tools - (push '("T" "Templates for Helping Me Think") org-capture-templates) - ;; Capture a decision that you've taken, for review and reflection later. - (push `("Td" "Decision Journal" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.decision.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Current Reality Tree for a problem - (push `("Tc" "Current Reality Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.crt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create an Evaporating Cloud for a problem - (push `("Te" "Evaporating Cloud" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.ec.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Future Reality Tree for a problem - (push `("Tf" "Future Reality Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.frt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Prerequisite Tree for a problem - (push `("Tp" "Prerequisite Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.prt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Transition Tree for a problem - (push `("Tt" "Transition Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.trt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a new Business idea for sketching out / thinking through - (push `("Tb" "Business Canvas" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/business.canvas.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a customer persona, note that this is always captured in - ;; the current clocking task, and is something I should do under the - ;; business canvas. - (push `("TP" "Customer Persona (under Business Canvas)" entry - (clock) - (file ,(expand-file-name "capture-templates/business.customer.persona.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a customer journey through your product, note that this is - ;; always captured in the current clocking task - (push `("Tj" "Customer Journey (under Business Canvas)" entry - (clock) - (file ,(expand-file-name "capture-templates/business.customer.journey.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - -;;; Templates for capturing data about myself on a day-to-day basis - (push '("d" "Templates for Capturing Data (personal)") org-capture-templates) - - ;; Capture weight / food. This seems hard to get into a laptop habit. - ;; This is the kind of quantitative life that a mobile solution would - ;; have helped with. - - (push `("dw" "Weight Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.weight.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - - (push `("df" "Food Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.food.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - - (push `("dd" "Downtime Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.dt.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - -;;; Templates for capturing build in public ideas - (push '("b" "Templates for Capturing Build in Public") org-capture-templates) - - ;; Capture Micro-blogging - (push `("bm" "New Microblogging entry" entry - (file+olp+datetree org-blogpost-file "Microblogging") - (file ,(expand-file-name "capture-templates/microblog.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; New blogpost idea - (push `("bb" "New Blogpost entry" entry - (file+headline org-blogpost-file "Meta: Blogposts to write") - (file ,(expand-file-name "capture-templates/todo.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - -;;; Templates for when I want to capture specific feedback about something - (push '("f" "Templates for Feedback, Reflection, Journaling") org-capture-templates) - - ;; Capture feedback for people I am working with - (push `("fp" "Feedback for People I'm working with" item - (file+headline org-company-file "Feedback") - (file ,(expand-file-name "capture-templates/feedback.others.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; The monthly newsletter to send to investors, friends and mentors - (push `("fn" "Company Newsletters" entry - (file+headline org-company-file "Company Newsletters") - (file ,(expand-file-name "capture-templates/business.updates.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture suggestions / ideas from other people, which can be - ;; expanded into actual projects later. - (push `("fs" "Ideas and Suggestions" entry - (file+headline org-company-file "Ideas and Suggestions") - (file ,(expand-file-name "capture-templates/suggestion.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - -;;; Templates for planning on a day-to-day basis - (push '("p" "Templates for Planning") org-capture-templates) - - ;; Deliberately plan out and make a routine out of start of day and - ;; end of day activities. - - (push `("ps" "The Start of Day Planning Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.start.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - (push `("pe" "The End of Day Reflection Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.end.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - (push `("pn" "The Next Day Intentions Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.next.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - -;;; Templates for capturing meetings, events, something happening at this time - (push '("m" "Templates for Capturing Meetings or Events") org-capture-templates) - - ;; Capture an upcoming meeting or one that has already happened - (push `("mp" "Meeting some other day" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/meeting.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :time-prompt t) - org-capture-templates) - - ;; Capture notes for an ongoing meeting or a meeting that's already - ;; happened. - (push `("mn" "Meeting today" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/meeting.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t) - org-capture-templates) - -;;; Templates for Capturing Tasks - (push '("t" "Templates for Capturing Tasks") org-capture-templates) - - ;; Set up a new habit for tracking. This should be refiled to the - ;; correct location later. - (push `("th" "Habit" entry - (file+headline org-default-notes-file "My Habit Tracker") - (file ,(expand-file-name "capture-templates/habit.org" user-emacs-directory))) - org-capture-templates) - - ;; One-click Capture for replying to emails from notmuch. Creates a - ;; task to remind you that you need to reply to this email. - (push `("tr" "Respond to email" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/reply.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates) - - ;; One-click capture of links from the clipboard. Used in conjunction - ;; with `org-protocol', or as a stand-alone to capture links. - (push `("tw" "Website Link Immediate Capture" entry - (file+olp org-default-notes-file "Links Captured from the Browser") - (file ,(expand-file-name "capture-templates/website.org" user-emacs-directory)) - :immediate-finish t) - org-capture-templates) - - ;; A more nuanced capture for browser links, which I use for cleaning - ;; out my browser 2/3 times a week. - (push `("tl" "Website Link Pinboard Capture" entry - (file+olp org-default-notes-file "Links Captured from the Browser") - (file ,(expand-file-name "capture-templates/pinboard.capture.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates) - - ;; Capture a task where someone expects me to communicate when it's done - (push `("tj" "Jira or External-facing Task" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/jira.org" user-emacs-directory)) - :clock-in t - :clock-resume t) - org-capture-templates) - - ;; One-click Capture for Tasks. Captures the task immediately and gets - ;; out of your way. - (push `("ti" "Simple Task Immediate Finish" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/todo.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates)) - -;;;; Sales and CRM capture templates -(use-package org-capture - :ensure nil - :config -;;; Default definitions for variables used in capture templates - (when (not (boundp 'org-crm-file)) - (defvar org-crm-file org-default-notes-file - "File in which CRM data is stored.")) - (when (not (boundp 'org-sales-file)) - (defvar org-sales-file org-default-notes-file - "File in which Sales Deal data is stored.")) - -;;; *CRITICAL NOTE* Read before modifying the push stack below: - ;; Pushing to capture templates is a stack. What goes in first shows - ;; up at the bottom of the capture templates list. - - (push '("s" "Sales and CRM templates") org-capture-templates) - (push `("sl" "New Sales Lead" entry - (file+headline org-sales-file "Leads to be Refiled") - (file ,(expand-file-name "capture-templates/sales.newlead.org" user-emacs-directory)) - :prepend t - :kill-buffer t - :empty-lines-after 1 - :clock-in t - :clock-resume t) - org-capture-templates) - (push `("sc" "New Company in CRM" entry - (file org-crm-file) - (file ,(expand-file-name "capture-templates/crm.newcompany.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :kill-buffer t - :empty-lines-after 1) - org-capture-templates) - (push `("sp" "New Person in CRM" entry - (file+headline org-crm-file "CRM to be Refiled") - (file ,(expand-file-name "capture-templates/crm.newperson.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - (push `("sm" "Sales Related Meeting" entry - (file+headline org-sales-file "Sales to be Refiled") - (file ,(expand-file-name "capture-templates/sales.newmeeting.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates)) - -;;; Ledger for personal finance management, plain-text accounting -(use-package ledger-mode - :ensure t) - -(provide 'vedang-personal) diff --git a/init.el b/init.el index adf2cf3..aa1a7ec 100644 --- a/init.el +++ b/init.el @@ -1,12 +1,14 @@ ;; init.el -*- lexical-binding: t; -*- -;; Make native compilation silent and prune its cache. -(when (native-comp-available-p) - (setq native-comp-async-report-warnings-errors 'silent) ; Emacs 28 with native compilation - (setq native-compile-prune-cache t)) ; Emacs 29 +(set-language-environment "UTF-8") +;; Make native compilation silent and prune its cache. +(setq native-compile-prune-cache t) + +(setq custom-file "~/.emacs.d/custom.el") +(load custom-file) ;; Disable custom.el by making it disposable. -(setq custom-file (make-temp-file "emacs-custom-")) +;; (setq custom-file (make-temp-file "emacs-custom-")) ;; Enable these commands which have been disabled by default (mapc @@ -23,7 +25,7 @@ (mapc (lambda (string) (add-to-list 'load-path (locate-user-emacs-file string))) - '("unravel-modules" "custom-lisp")) + '("nebkor-modules" "custom-lisp")) ;;; Install Elpaca @@ -110,24 +112,20 @@ making an abbreviation to a function." (seq-split definitions 2))) (error "%s is not an abbrev table" ,table))) -(require 'unravel-theme) -(require 'unravel-essentials) -(require 'unravel-completion) -(require 'unravel-search) -(require 'unravel-dired) -(require 'unravel-window) -(require 'unravel-git) -(require 'unravel-org) -(require 'unravel-shell) -(require 'unravel-langs) -(require 'unravel-study) +(require 'nebkor-theme) +(require 'nebkor-essentials) +(require 'nebkor-functions) +(require 'nebkor-completion) +(require 'nebkor-search) +(require 'nebkor-dired) +(require 'nebkor-window) +(require 'nebkor-git) +(require 'nebkor-org) +(require 'nebkor-langs) +(require 'nebkor-study) ;;; Comment this next line if you don't want to use my personal ;;; settings (like specific directories or org variables) -;;(require 'vedang-personal) - -;; Name the default frame -;; You can select a frame with M-x select-frame-by-name -(add-hook 'elpaca-after-init-hook (lambda () (set-frame-name "unravel/emacs"))) +(require 'nebkor-personal) ;; Local Variables: ;; no-byte-compile: t diff --git a/unravel-emacs.org b/nebkor-emacs.org similarity index 69% rename from unravel-emacs.org rename to nebkor-emacs.org index 60b4ba5..4c7df1d 100644 --- a/unravel-emacs.org +++ b/nebkor-emacs.org @@ -1,27 +1,21 @@ #+title: GNU Emacs configuration for Emacs 30 and above -#+author: Vedang Manerikar -#+email: vedang@unravel.tech +#+author: Joe Ardent #+language: en -#+options: ':t toc:nil num:nil author:t email:t +#+options: ':t toc:nil num:t author:t * Quick Start :PROPERTIES: :CUSTOM_ID: h:2818C76B-3A6D-4676-8159-ED7BBFA45501 -:CREATED: [2024-12-19 Thu 17:06] +:CREATED: <2024-12-31 Tue> :END: 1. Install the latest available Emacs version, with native-compilation and tree-sitter support. - - I use the latest release from [[https://github.com/jimeh/emacs-builds?tab=readme-ov-file][jimeh/emacs-builds]] on MacOSX 2. Clone this repository as your =.emacs.d= folder and start Emacs. -3. When you open any programming language file, run =M-x eglot= to - start an LSP server in the background and connect to it. -4. Go through the Table of Contents below and read details of +3. Go through the Table of Contents below and read details of whichever section you are interested in knowing more about. Reach out with questions, they will help me improve the README further! -[ A short thread on the configuration: https://fosstodon.org/@vedang/113685331202099234 (2024-12-20) ] - * Table of Contents :TOC: - [[#quick-start][Quick Start]] - [[#introduction][Introduction]] @@ -41,172 +35,151 @@ - [[#the-initel-macro-to-do-nothing-with-elisp-code-prot-emacs-comment][The =init.el= macro to do nothing with Elisp code (~prot-emacs-comment~)]] - [[#the-initel-macro-to-define-abbreviations-prot-emacs-abbrev][The =init.el= macro to define abbreviations (~prot-emacs-abbrev~)]] - [[#the-initel-section-to-load-the-individual-modules][The =init.el= section to load the individual modules]] - - [[#the-initel-section-to-name-to-the-default-frame][The =init.el= section to name to the default frame]] - [[#finally-the-initel-section-for-local-variables][Finally, the =init.el= section for local variables]] -- [[#the-unravel-themeel-module][The =unravel-theme.el= module]] - - [[#the-unravel-themeel-section-for-cool-modern-themes-ef-themes][The =unravel-theme.el= section for cool, modern themes (~ef-themes~)]] - - [[#the-unravel-themeel-section-for-highlighting-lines-lin][The =unravel-theme.el= section for highlighting lines (~lin~)]] - - [[#the-unravel-themeel-section-for-padding-spacious-padding][The =unravel-theme.el= section for padding (~spacious-padding~)]] - - [[#the-unravel-themeel-section-for-color-previews-rainbow-mode][The =unravel-theme.el= section for color previews (~rainbow-mode~)]] - - [[#the-unravel-themeel-section-for-cursor-styles-cursory][The =unravel-theme.el= section for cursor styles (~cursory~)]] - - [[#the-unravel-themeel-section-for-switching-themes-theme-buffet][The =unravel-theme.el= section for switching themes (~theme-buffet~)]] - - [[#the-unravel-themeel-section-about-font-styles-fontaine][The =unravel-theme.el= section about font styles (~fontaine~)]] - - [[#the-unravel-themeel-section-for-font-previews-show-font][The =unravel-theme.el= section for font previews (~show-font~)]] - - [[#the-unravel-themeel-section-about-font-resizing-variable-pitch-mode][The =unravel-theme.el= section about font resizing (~variable-pitch-mode~)]] - - [[#finally-we-provide-the-unravel-themeel-module][Finally, we provide the =unravel-theme.el= module]] -- [[#the-unravel-essentialsel-module][The =unravel-essentials.el= module]] - - [[#the-unravel-essentialsel-block-with-basic-configurations][The =unravel-essentials.el= block with basic configurations]] - - [[#the-unravel-essentialsel-section-for-fixing-path-on-osx-exec-path-from-shell][The =unravel-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~)]] - - [[#the-unravel-essentialsel-configuration-to-track-recently-visited-files-recentf][The =unravel-essentials.el= configuration to track recently visited files (~recentf~)]] - - [[#the-unravel-essentialsel-configuration-to-track-my-place-in-visited-files-saveplace][The =unravel-essentials.el= configuration to track my place in visited files (~saveplace~)]] - - [[#the-unravel-essentialsel-settings-for-bookmarks][The =unravel-essentials.el= settings for bookmarks]] - - [[#the-unravel-essentialsel-settings-for-registers][The =unravel-essentials.el= settings for registers]] - - [[#the-unravel-essentialsel-settings-for-files][The =unravel-essentials.el= settings for files]] - - [[#the-unravel-essentialsel-section-for-delete-selection-mode][The =unravel-essentials.el= section for ~delete-selection-mode~]] - - [[#the-unravel-essentialsel-settings-for-tooltips][The =unravel-essentials.el= settings for tooltips]] - - [[#the-unravel-essentialsel-arrangement-to-run-emacs-as-a-server][The =unravel-essentials.el= arrangement to run Emacs as a server]] - - [[#the-unravel-essentialsel-section-about-quick-copying-easy-kill][The =unravel-essentials.el= section about quick copying (~easy-kill~)]] - - [[#the-unravel-essentialsel-section-about-auto-management-of-treesit-modules-treesit-auto][The =unravel-essentials.el= section about auto management of treesit modules (~treesit-auto~)]] - - [[#the-unravel-essentialsel-section-about-using-tree-sitter-for-marking-expreg][The =unravel-essentials.el= section about using tree-sitter for marking (~expreg~)]] - - [[#the-unravel-essentialsel-section-for-battery-display][The =unravel-essentials.el= section for Battery display]] - - [[#the-unravel-essentialsel-section-for-osx-changes][The =unravel-essentials.el= section for OSX changes]] - - [[#the-unravel-essentialsel-section-for-simpleel-changes][The =unravel-essentials.el= section for ~simple.el~ changes]] - - [[#the-unravel-essentialsel-section-for-better-help-helpful][The =unravel-essentials.el= section for better help (~helpful~)]] - - [[#finally-we-provide-the-unravel-essentialsel-module][Finally, we provide the =unravel-essentials.el= module]] -- [[#the-unravel-completionel-module][The =unravel-completion.el= module]] - - [[#the-unravel-completionel-settings-for-completion-styles][The =unravel-completion.el= settings for completion styles]] - - [[#the-unravel-completionel-for-the-orderless-completion-style][The =unravel-completion.el= for the ~orderless~ completion style]] - - [[#the-unravel-completionel-settings-to-ignore-letter-casing][The =unravel-completion.el= settings to ignore letter casing]] - - [[#the-unravel-completionel-settings-for-recursive-minibuffers][The =unravel-completion.el= settings for recursive minibuffers]] - - [[#the-unravel-completionel-settings-for-default-values][The =unravel-completion.el= settings for default values]] - - [[#the-unravel-completionel-settings-for-common-interactions][The =unravel-completion.el= settings for common interactions]] - - [[#the-unravel-completionel-generic-minibuffer-ui-settings][The =unravel-completion.el= generic minibuffer UI settings]] - - [[#the-unravel-completionel-settings-for-saving-the-history-savehist-mode][The =unravel-completion.el= settings for saving the history (~savehist-mode~)]] - - [[#the-unravel-completionel-settings-for-dynamic-text-expansion-dabbrev][The =unravel-completion.el= settings for dynamic text expansion (~dabbrev~)]] - - [[#the-unravel-completionel-settings-for-dynamic-text-expansion-hippie][The =unravel-completion.el= settings for dynamic text expansion (~hippie~)]] - - [[#the-unravel-completionel-for-in-buffer-completion-popup-corfu-and-cape][The =unravel-completion.el= for in-buffer completion popup (~corfu~ and ~cape~)]] - - [[#the-unravel-completionel-settings-for-filtering-previewing-candidates-consult][The =unravel-completion.el= settings for filtering, previewing candidates (~consult~)]] - - [[#the-unravel-completionel-section-for-performing-actions-in-context-embark][The =unravel-completion.el= section for performing actions in context (~embark~)]] - - [[#the-unravel-completionel-section-to-configure-completion-annotations-marginalia][The =unravel-completion.el= section to configure completion annotations (~marginalia~)]] - - [[#the-unravel-completionel-section-for-vertical-minibuffer-layout-vertico][The =unravel-completion.el= section for vertical minibuffer layout (~vertico~)]] - - [[#finally-we-provide-the-unravel-completionel-module][Finally, we provide the ~unravel-completion.el~ module]] -- [[#the-unravel-searchel-module][The =unravel-search.el= module]] - - [[#the-unravel-searchel-section-for-heading-navigation-imenu][The =unravel-search.el= section for heading navigation (~imenu~)]] - - [[#the-unravel-searchel-section-on-relaxed-searching-isearch][The =unravel-search.el= section on relaxed searching (~isearch~)]] - - [[#the-unravel-searchel-settings-for-highlighting-search-results-isearch][The =unravel-search.el= settings for highlighting search results (~isearch~)]] - - [[#the-unravel-searchel-section-on-showing-search-result-count-isearch][The =unravel-search.el= section on showing search result count (~isearch~)]] - - [[#the-unravel-searchel-tweaks-for-the-search-results-in-buffer-occur][The =unravel-search.el= tweaks for the search results in buffer (~occur~)]] - - [[#the-unravel-searchel-section-for-search-key-bindings][The =unravel-search.el= section for search key bindings]] - - [[#the-unravel-searchel-tweaks-to-xref-re-builder-and-grep][The =unravel-search.el= tweaks to (~xref~), (~re-builder~) and (~grep~)]] - - [[#the-unravel-searchel-setup-for-editable-grep-buffers-grep-edit-mode-or-wgrep][The =unravel-search.el= setup for editable grep buffers (~grep-edit-mode~ or ~wgrep~)]] - - [[#the-unravel-searchel-settings-for-jumping-avy][The =unravel-search.el= settings for jumping (~avy~)]] - - [[#finally-we-provide-the-unravel-searchel-module][Finally, we provide the =unravel-search.el= module]] -- [[#the-unravel-diredel-module][The =unravel-dired.el= module]] - - [[#the-unravel-diredel-settings-for-common-operations][The =unravel-dired.el= settings for common operations]] - - [[#the-unravel-diredel-switches-for-how-files-are-listed-ls][The =unravel-dired.el= switches for how files are listed (~ls~)]] - - [[#the-unravel-diredel-setting-for-dual-pane-dired][The =unravel-dired.el= setting for dual-pane Dired]] - - [[#the-unravel-diredel-miscellaneous-tweaks][The =unravel-dired.el= miscellaneous tweaks]] - - [[#the-unravel-diredel-section-for-using-multi-occur-noccur][The =unravel-dired.el= section for using multi-occur (~noccur~)]] - - [[#the-unravel-diredel-section-about-various-conveniences][The =unravel-dired.el= section about various conveniences]] - - [[#the-unravel-diredel-section-about-subdirectory-contents-dired-subtree][The =unravel-dired.el= section about subdirectory contents (~dired-subtree~)]] - - [[#the-unravel-diredel-section-about-writable-dired-wdired][The =unravel-dired.el= section about writable Dired (~wdired~)]] - - [[#the-unravel-diredel-section-about-moving-to-trash-trashed][The =unravel-dired.el= section about moving to Trash (~trashed~)]] - - [[#finally-we-provide-the-unravel-diredel-module][Finally, we provide the =unravel-dired.el= module]] -- [[#the-unravel-windowel-module][The =unravel-window.el= module]] - - [[#the-unravel-windowel-section-about-uniquifying-buffer-names][The =unravel-window.el= section about uniquifying buffer names]] - - [[#the-unravel-windowel-rules-for-displaying-buffers-display-buffer-alist][The =unravel-window.el= rules for displaying buffers (~display-buffer-alist~)]] - - [[#the-unravel-windowel-section-about-frame-oriented-workflows-beframe][The =unravel-window.el= section about frame-oriented workflows (~beframe~)]] - - [[#the-unravel-windowel-configuration-of-window-layouts-undelete-frame-mode-and-winner-mode][The =unravel-window.el= configuration of window layouts (~undelete-frame-mode~ and ~winner-mode~)]] - - [[#the-unravel-windowel-section-for-zone-zone][The =unravel-window.el= section for Zone (~zone~)]] - - [[#the-unravel-windowel-section-for-displaying-time][The =unravel-window.el= section for displaying time]] - - [[#finally-we-provide-the-unravel-windowel-module][Finally, we provide the =unravel-window.el= module]] -- [[#the-unravel-gitel-module][The =unravel-git.el= module]] - - [[#the-unravel-gitel-section-about-ediff][The =unravel-git.el= section about ediff]] - - [[#the-unravel-gitel-section-about-project-management-project][The =unravel-git.el= section about project management (~project~)]] - - [[#the-unravel-gitel-section-about-diff-management-diff-mode][The =unravel-git.el= section about diff management (~diff-mode~)]] - - [[#the-unravel-gitel-section-about-using-git-magit][The =unravel-git.el= section about using Git (~magit~)]] - - [[#finally-we-provide-the-unravel-gitel-module][Finally, we provide the =unravel-git.el= module]] -- [[#the-unravel-orgel-module][The =unravel-org.el= module]] - - [[#the-unravel-orgel-section-on-calendar][The =unravel-org.el= section on (~calendar~)]] - - [[#the-unravel-orgel-section-about-appointment-reminders-appt][The =unravel-org.el= section about appointment reminders (~appt~)]] - - [[#the-unravel-orgel-section-on-paragraphs][The =unravel-org.el= section on paragraphs]] - - [[#the-unravel-orgel-section-with-basic-org-settings][The =unravel-org.el= section with basic Org settings]] - - [[#the-unravel-orgel-section-for-archival-settings][The =unravel-org.el= section for archival settings]] - - [[#the-unravel-orgel-section-for-narrowing-and-folding][The =unravel-org.el= section for narrowing and folding]] - - [[#the-unravel-orgel-org-to-do-and-refile-settings][The =unravel-org.el= Org to-do and refile settings]] - - [[#the-unravel-orgel-org-heading-tags][The =unravel-org.el= Org heading tags]] - - [[#the-unravel-orgel-org-priorities-settings][The =unravel-org.el= Org priorities settings]] - - [[#the-unravel-orgel-org-timestate-logging][The =unravel-org.el= Org time/state logging]] - - [[#the-unravel-orgel-org-link-settings][The =unravel-org.el= Org link settings]] - - [[#the-unravel-orgel-org-list-items-settings][The =unravel-org.el= Org list items settings]] - - [[#the-unravel-orgel-org-code-block-settings][The =unravel-org.el= Org code block settings]] - - [[#the-unravel-orgel-org-export-settings][The =unravel-org.el= Org export settings]] - - [[#the-unravel-orgel-org-capture-templates-org-capture][The =unravel-org.el= Org capture templates (~org-capture~)]] - - [[#the-unravel-orgel-section-on-yasnippet][The =unravel-org.el= section on YASnippet]] - - [[#the-unravel-orgel-org-agenda-settings][The =unravel-org.el= Org agenda settings]] - - [[#finally-we-provide-the-unravel-orgel-module][Finally, we provide the =unravel-org.el= module]] -- [[#the-unravel-shellel-module][The =unravel-shell.el= module]] - - [[#the-unravel-shellel-section-for-using-a-terminal-inside-emacs-vterm][The =unravel-shell.el= section for using a terminal inside Emacs (~vterm~)]] - - [[#the-unravel-shellel-section-for-keeping-track-of-visited-directories-zoxide][The =unravel-shell.el= section for keeping track of visited directories (~zoxide~)]] - - [[#the-unravel-shellel-section-for-writing-fish-configuration-fish-mode][The =unravel-shell.el= section for writing fish configuration (~fish-mode~)]] - - [[#the-unravel-shellel-section-for-executing-shell-commands-dwim-shell-command][The =unravel-shell.el= section for executing shell commands (~dwim-shell-command~)]] - - [[#finally-we-provide-the-unravel-shellel-module][Finally, we provide the =unravel-shell.el= module]] -- [[#the-unravel-langsel-module][The =unravel-langs.el= module]] - - [[#the-unravel-langsel-settings-for-tab][The =unravel-langs.el= settings for TAB]] - - [[#the-unravel-langsel-settings-highlighting-parens-show-paren-mode][The =unravel-langs.el= settings highlighting parens (~show-paren-mode~)]] - - [[#the-unravel-langsel-settings-for-showing-relevant-documentation-eldoc][The =unravel-langs.el= settings for showing relevant documentation (~eldoc~)]] - - [[#the-unravel-langsel-settings-for-connecting-to-lsp-servers-eglot][The =unravel-langs.el= settings for connecting to LSP servers (~eglot~)]] - - [[#the-unravel-langsel-settings-for-writing-markdown-markdown-mode][The =unravel-langs.el= settings for writing Markdown (~markdown-mode~)]] - - [[#the-unravel-langsel-settings-for-dealing-with-csv-files-csv-mode][The =unravel-langs.el= settings for dealing with CSV files (~csv-mode~)]] - - [[#the-unravel-langsel-settings-for-spell-checking-flyspell][The =unravel-langs.el= settings for spell checking (~flyspell~)]] - - [[#the-unravel-langsel-settings-for-code-linting-flymake][The =unravel-langs.el= settings for code linting (~flymake~)]] - - [[#the-unravel-langsel-settings-for-quick-outlines-outline-minor-mode][The =unravel-langs.el= settings for quick outlines (~outline-minor-mode~)]] - - [[#the-unravel-langsel-settings-for-definitions-dictionary][The =unravel-langs.el= settings for definitions (~dictionary~)]] - - [[#the-unravel-langsel-settings-for-paren-matching-paredit][The =unravel-langs.el= settings for paren matching (~paredit~)]] - - [[#the-unravel-langsel-settings-for-code-formatting-apheleia][The =unravel-langs.el= settings for code formatting (~apheleia~)]] - - [[#the-unravel-langsel-settings-for-changing-many-things-multiple-cursors][The =unravel-langs.el= settings for changing many things (~multiple-cursors~)]] - - [[#the-unravel-langsel-section-for-python][The =unravel-langs.el= section for Python]] - - [[#the-unravel-langsel-section-for-ziglang-zig-mode][The =unravel-langs.el= section for Ziglang (~zig-mode~)]] - - [[#the-unravel-langsel-section-for-clojure-programming][The =unravel-langs.el= section for Clojure programming]] - - [[#the-unravel-langsel-section-for-emacs-lisp][The =unravel-langs.el= section for Emacs Lisp]] - - [[#finally-we-provide-the-unravel-langsel-module][Finally, we provide the =unravel-langs.el= module]] -- [[#the-unravel-studyel-module][The =unravel-study.el= module]] - - [[#the-unravel-studyel-section-for-notes-and-file-naming-denote][The =unravel-study.el= section for notes and file-naming (~denote~)]] - - [[#the-unravel-studyel-section-for-reading-and-annotation-of-pdfs-pdf-tools][The =unravel-study.el= section for reading and annotation of PDFs (~pdf-tools~)]] - - [[#the-unravel-studyel-section-for-annotation-of-org-and-eww-files-org-remark][The =unravel-study.el= section for annotation of org and eww files (~org-remark~)]] - - [[#the-unravel-studyel-section-for-flashcards-org-fc][The =unravel-study.el= section for flashcards (~org-fc~)]] - - [[#the-unravel-studyel-section-for-table-of-contents-toc-org][The =unravel-study.el= section for table of contents (~toc-org~)]] - - [[#the-unravel-studyel-section-for-archiving-web-content-org-board][The =unravel-study.el= section for archiving web content (~org-board~)]] - - [[#the-unravel-studeel-section-for-publishing-org-mode-content-ox-gfm][The =unravel-stude.el= section for publishing org-mode content (~ox-gfm~)]] - - [[#finally-we-provide-the-unravel-studyel-module][Finally, we provide the =unravel-study.el= module]] +- [[#the-nebkor-themeel-module][The =nebkor-theme.el= module]] + - [[#the-nebkor-themeel-section-for-cool-modern-themes-ef-themes][The =nebkor-theme.el= section for cool, modern themes (~ef-themes~)]] + - [[#the-nebkor-themeel-section-for-highlighting-lines-lin][The =nebkor-theme.el= section for highlighting lines (~lin~)]] + - [[#the-nebkor-themeel-section-for-color-previews-rainbow-mode][The =nebkor-theme.el= section for color previews (~rainbow-mode~)]] + - [[#the-nebkor-themeel-section-for-cursor-styles-cursory][The =nebkor-theme.el= section for cursor styles (~cursory~)]] + - [[#the-nebkor-themeel-section-about-font-styles-fontaine][The =nebkor-theme.el= section about font styles (~fontaine~)]] + - [[#the-nebkor-themeel-section-for-font-previews-show-font][The =nebkor-theme.el= section for font previews (~show-font~)]] + - [[#the-nebkor-themeel-section-about-font-resizing-variable-pitch-mode][The =nebkor-theme.el= section about font resizing (~variable-pitch-mode~)]] + - [[#finally-we-provide-the-nebkor-themeel-module][Finally, we provide the =nebkor-theme.el= module]] +- [[#the-nebkor-essentialsel-module][The =nebkor-essentials.el= module]] + - [[#the-nebkor-essentialsel-block-with-basic-configurations][The =nebkor-essentials.el= block with basic configurations]] + - [[#the-nebkor-essentialsel-section-for-fixing-path-on-osx-exec-path-from-shell][The =nebkor-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~)]] + - [[#the-nebkor-essentialsel-configuration-to-track-recently-visited-files-recentf][The =nebkor-essentials.el= configuration to track recently visited files (~recentf~)]] + - [[#the-nebkor-essentialsel-configuration-to-track-my-place-in-visited-files-saveplace][The =nebkor-essentials.el= configuration to track my place in visited files (~saveplace~)]] + - [[#the-nebkor-essentialsel-settings-for-bookmarks][The =nebkor-essentials.el= settings for bookmarks]] + - [[#the-nebkor-essentialsel-settings-for-registers][The =nebkor-essentials.el= settings for registers]] + - [[#the-nebkor-essentialsel-settings-for-files][The =nebkor-essentials.el= settings for files]] + - [[#the-nebkor-essentialsel-section-for-delete-selection-mode][The =nebkor-essentials.el= section for ~delete-selection-mode~]] + - [[#the-nebkor-essentialsel-settings-for-tooltips][The =nebkor-essentials.el= settings for tooltips]] + - [[#the-nebkor-essentialsel-arrangement-to-run-emacs-as-a-server][The =nebkor-essentials.el= arrangement to run Emacs as a server]] + - [[#the-nebkor-essentialsel-section-about-quick-copying-easy-kill][The =nebkor-essentials.el= section about quick copying (~easy-kill~)]] + - [[#the-nebkor-essentialsel-section-about-auto-management-of-treesit-modules-treesit-auto][The =nebkor-essentials.el= section about auto management of treesit modules (~treesit-auto~)]] + - [[#the-nebkor-essentialsel-section-about-using-tree-sitter-for-marking-expreg][The =nebkor-essentials.el= section about using tree-sitter for marking (~expreg~)]] + - [[#the-nebkor-essentialsel-section-for-osx-changes][The =nebkor-essentials.el= section for OSX changes]] + - [[#the-nebkor-essentialsel-section-for-simpleel-changes][The =nebkor-essentials.el= section for ~simple.el~ changes]] + - [[#the-nebkor-essentialsel-section-for-better-help-helpful][The =nebkor-essentials.el= section for better help (~helpful~)]] + - [[#the-nebkor-essentials-section-for-indent-tools][The =nebkor-essentials= section for ~indent-tools~]] + - [[#the-nebkor-essentials-section-for-fancy-keyboard-shortcuts-key-chord][The =nebkor-essentials= section for fancy keyboard shortcuts (~key-chord~)]] + - [[#the-nebkor-essentials-section-for-which-key][The =nebkor-essentials= section for ~which-key~]] + - [[#the-nebkor-essentials-section-for-blackout-and-other-random-shit][The =nebkor-essentials= section for blackout and other random shit]] + - [[#finally-we-provide-the-nebkor-essentialsel-module][Finally, we provide the =nebkor-essentials.el= module]] +- [[#the-nebkor-completionel-module][The =nebkor-completion.el= module]] + - [[#the-nebkor-completionel-settings-for-completion-styles][The =nebkor-completion.el= settings for completion styles]] + - [[#the-nebkor-completionel-for-the-orderless-completion-style][The =nebkor-completion.el= for the ~orderless~ completion style]] + - [[#the-nebkor-completionel-settings-to-ignore-letter-casing][The =nebkor-completion.el= settings to ignore letter casing]] + - [[#the-nebkor-completionel-settings-for-recursive-minibuffers][The =nebkor-completion.el= settings for recursive minibuffers]] + - [[#the-nebkor-completionel-settings-for-default-values][The =nebkor-completion.el= settings for default values]] + - [[#the-nebkor-completionel-settings-for-common-interactions][The =nebkor-completion.el= settings for common interactions]] + - [[#the-nebkor-completionel-generic-minibuffer-ui-settings][The =nebkor-completion.el= generic minibuffer UI settings]] + - [[#the-nebkor-completionel-settings-for-saving-the-history-savehist-mode][The =nebkor-completion.el= settings for saving the history (~savehist-mode~)]] + - [[#the-nebkor-completionel-settings-for-dynamic-text-expansion-dabbrev][The =nebkor-completion.el= settings for dynamic text expansion (~dabbrev~)]] + - [[#the-nebkor-completionel-settings-for-dynamic-text-expansion-hippie][The =nebkor-completion.el= settings for dynamic text expansion (~hippie~)]] + - [[#the-nebkor-completionel-for-in-buffer-completion-popup-corfu-and-cape][The =nebkor-completion.el= for in-buffer completion popup (~corfu~ and ~cape~)]] + - [[#the-nebkor-completionel-settings-for-filtering-previewing-candidates-consult][The =nebkor-completion.el= settings for filtering, previewing candidates (~consult~)]] + - [[#the-nebkor-completionel-section-to-configure-completion-annotations-marginalia][The =nebkor-completion.el= section to configure completion annotations (~marginalia~)]] + - [[#the-nebkor-completionel-section-for-vertical-minibuffer-layout-vertico][The =nebkor-completion.el= section for vertical minibuffer layout (~vertico~)]] + - [[#finally-we-provide-the-nebkor-completionel-module][Finally, we provide the ~nebkor-completion.el~ module]] +- [[#the-nebkor-functionsel-module][The =nebkor-functions.el= module]] +- [[#the-nebkor-searchel-module][The =nebkor-search.el= module]] + - [[#the-nebkor-searchel-section-for-heading-navigation-imenu][The =nebkor-search.el= section for heading navigation (~imenu~)]] + - [[#the-nebkor-searchel-section-on-relaxed-searching-isearch][The =nebkor-search.el= section on relaxed searching (~isearch~)]] + - [[#the-nebkor-searchel-settings-for-highlighting-search-results-isearch][The =nebkor-search.el= settings for highlighting search results (~isearch~)]] + - [[#the-nebkor-searchel-section-on-showing-search-result-count-isearch][The =nebkor-search.el= section on showing search result count (~isearch~)]] + - [[#the-nebkor-searchel-tweaks-for-the-search-results-in-buffer-occur][The =nebkor-search.el= tweaks for the search results in buffer (~occur~)]] + - [[#the-nebkor-searchel-section-for-search-key-bindings][The =nebkor-search.el= section for search key bindings]] + - [[#the-nebkor-searchel-tweaks-to-xref-re-builder-and-grep][The =nebkor-search.el= tweaks to (~xref~), (~re-builder~) and (~grep~)]] + - [[#the-nebkor-searchel-setup-for-editable-grep-buffers-grep-edit-mode-or-wgrep][The =nebkor-search.el= setup for editable grep buffers (~grep-edit-mode~ or ~wgrep~)]] + - [[#the-nebkor-searchel-settings-for-jumping-avy][The =nebkor-search.el= settings for jumping (~avy~)]] + - [[#finally-we-provide-the-nebkor-searchel-module][Finally, we provide the =nebkor-search.el= module]] +- [[#the-nebkor-diredel-module][The =nebkor-dired.el= module]] + - [[#the-nebkor-diredel-settings-for-common-operations][The =nebkor-dired.el= settings for common operations]] + - [[#the-nebkor-diredel-switches-for-how-files-are-listed-ls][The =nebkor-dired.el= switches for how files are listed (~ls~)]] + - [[#the-nebkor-diredel-setting-for-dual-pane-dired][The =nebkor-dired.el= setting for dual-pane Dired]] + - [[#the-nebkor-diredel-miscellaneous-tweaks][The =nebkor-dired.el= miscellaneous tweaks]] + - [[#the-nebkor-diredel-section-for-using-multi-occur-noccur][The =nebkor-dired.el= section for using multi-occur (~noccur~)]] + - [[#the-nebkor-diredel-section-about-various-conveniences][The =nebkor-dired.el= section about various conveniences]] + - [[#the-nebkor-diredel-section-about-subdirectory-contents-dired-subtree][The =nebkor-dired.el= section about subdirectory contents (~dired-subtree~)]] + - [[#the-nebkor-diredel-section-about-writable-dired-wdired][The =nebkor-dired.el= section about writable Dired (~wdired~)]] + - [[#the-nebkor-diredel-section-about-moving-to-trash-trashed][The =nebkor-dired.el= section about moving to Trash (~trashed~)]] + - [[#finally-we-provide-the-nebkor-diredel-module][Finally, we provide the =nebkor-dired.el= module]] +- [[#the-nebkor-windowel-module][The =nebkor-window.el= module]] + - [[#the-nebkor-windowel-section-about-uniquifying-buffer-names][The =nebkor-window.el= section about uniquifying buffer names]] + - [[#the-nebkor-windowel-section-about-frame-oriented-workflows-beframe][The =nebkor-window.el= section about frame-oriented workflows (~beframe~)]] + - [[#the-nebkor-windowel-use-of-contextual-header-line-breadcrumb][The =nebkor-window.el= use of contextual header line (~breadcrumb~)]] + - [[#finally-we-provide-the-nebkor-windowel-module][Finally, we provide the =nebkor-window.el= module]] +- [[#the-nebkor-gitel-module][The =nebkor-git.el= module]] + - [[#the-nebkor-gitel-section-about-ediff][The =nebkor-git.el= section about ediff]] + - [[#the-nebkor-gitel-section-about-project-management-project][The =nebkor-git.el= section about project management (~project~)]] + - [[#the-nebkor-gitel-section-about-diff-management-diff-mode][The =nebkor-git.el= section about diff management (~diff-mode~)]] + - [[#the-nebkor-gitel-section-about-using-git-magit][The =nebkor-git.el= section about using Git (~magit~)]] + - [[#finally-we-provide-the-nebkor-gitel-module][Finally, we provide the =nebkor-git.el= module]] +- [[#the-nebkor-orgel-module][The =nebkor-org.el= module]] + - [[#the-nebkor-orgel-section-on-calendar][The =nebkor-org.el= section on (~calendar~)]] + - [[#the-nebkor-orgel-section-about-appointment-reminders-appt][The =nebkor-org.el= section about appointment reminders (~appt~)]] + - [[#the-nebkor-orgel-section-on-paragraphs][The =nebkor-org.el= section on paragraphs]] + - [[#the-nebkor-orgel-section-with-basic-org-settings][The =nebkor-org.el= section with basic Org settings]] + - [[#the-nebkor-orgel-section-for-archival-settings][The =nebkor-org.el= section for archival settings]] + - [[#the-nebkor-orgel-section-for-narrowing-and-folding][The =nebkor-org.el= section for narrowing and folding]] + - [[#the-nebkor-orgel-org-to-do-and-refile-settings][The =nebkor-org.el= Org to-do and refile settings]] + - [[#the-nebkor-orgel-org-heading-tags][The =nebkor-org.el= Org heading tags]] + - [[#the-nebkor-orgel-org-priorities-settings][The =nebkor-org.el= Org priorities settings]] + - [[#the-nebkor-orgel-org-timestate-logging][The =nebkor-org.el= Org time/state logging]] + - [[#the-nebkor-orgel-org-link-settings][The =nebkor-org.el= Org link settings]] + - [[#the-nebkor-orgel-org-list-items-settings][The =nebkor-org.el= Org list items settings]] + - [[#the-nebkor-orgel-org-code-block-settings][The =nebkor-org.el= Org code block settings]] + - [[#the-nebkor-orgel-org-export-settings][The =nebkor-org.el= Org export settings]] + - [[#the-nebkor-orgel-org-capture-templates-org-capture][The =nebkor-org.el= Org capture templates (~org-capture~)]] + - [[#the-nebkor-orgel-section-on-yasnippet][The =nebkor-org.el= section on YASnippet]] + - [[#the-nebkor-orgel-org-agenda-settings][The =nebkor-org.el= Org agenda settings]] + - [[#finally-we-provide-the-nebkor-orgel-module][Finally, we provide the =nebkor-org.el= module]] +- [[#the-nebkor-langsel-module][The =nebkor-langs.el= module]] + - [[#the-nebkor-langsel-settings-for-tab][The =nebkor-langs.el= settings for TAB]] + - [[#the-nebkor-langsel-settings-highlighting-parens-show-paren-mode][The =nebkor-langs.el= settings highlighting parens (~show-paren-mode~)]] + - [[#the-nebkor-langsel-settings-for-showing-relevant-documentation-eldoc][The =nebkor-langs.el= settings for showing relevant documentation (~eldoc~)]] + - [[#the-nebkor-langsel-settings-for-connecting-to-lsp-servers-eglot][The =nebkor-langs.el= settings for connecting to LSP servers (~eglot~)]] + - [[#the-nebkor-langsel-settings-for-writing-markdown-markdown-mode][The =nebkor-langs.el= settings for writing Markdown (~markdown-mode~)]] + - [[#the-nebkor-langsel-settings-for-dealing-with-csv-files-csv-mode][The =nebkor-langs.el= settings for dealing with CSV files (~csv-mode~)]] + - [[#the-nebkor-langsel-settings-for-spell-checking-flyspell][The =nebkor-langs.el= settings for spell checking (~flyspell~)]] + - [[#the-nebkor-langsel-settings-for-code-linting-flymake][The =nebkor-langs.el= settings for code linting (~flymake~)]] + - [[#the-nebkor-langsel-settings-for-quick-outlines-outline-minor-mode][The =nebkor-langs.el= settings for quick outlines (~outline-minor-mode~)]] + - [[#the-nebkor-langsel-settings-for-definitions-dictionary][The =nebkor-langs.el= settings for definitions (~dictionary~)]] + - [[#the-nebkor-langsel-settings-for-paren-matching-paredit][The =nebkor-langs.el= settings for paren matching (~paredit~)]] + - [[#the-nebkor-langsel-settings-for-code-formatting-apheleia][The =nebkor-langs.el= settings for code formatting (~apheleia~)]] + - [[#the-nebkor-langsel-settings-for-changing-many-things-multiple-cursors][The =nebkor-langs.el= settings for changing many things (~multiple-cursors~)]] + - [[#the-nebkor-langsel-section-for-lsp][The =nebkor-langs.el= section for LSP]] + - [[#the-nebkor-langsel-section-for-rust][The =nebkor-langs.el= section for Rust]] + - [[#the-nebkor-langsel-section-for-python][The =nebkor-langs.el= section for Python]] + - [[#the-nebkor-langsel-section-for-ziglang-zig-mode][The =nebkor-langs.el= section for Ziglang (~zig-mode~)]] + - [[#the-nebkor-langsel-section-for-clojure-programming][The =nebkor-langs.el= section for Clojure programming]] + - [[#the-nebkor-langsel-section-for-emacs-lisp][The =nebkor-langs.el= section for Emacs Lisp]] + - [[#finally-we-provide-the-nebkor-langsel-module][Finally, we provide the =nebkor-langs.el= module]] +- [[#the-nebkor-studyel-module][The =nebkor-study.el= module]] + - [[#the-nebkor-studyel-section-for-notes-and-file-naming-denote][The =nebkor-study.el= section for notes and file-naming (~denote~)]] + - [[#the-nebkor-studyel-section-for-reading-and-annotation-of-pdfs-pdf-tools][The =nebkor-study.el= section for reading and annotation of PDFs (~pdf-tools~)]] + - [[#the-nebkor-studyel-section-for-annotation-of-org-and-eww-files-org-remark][The =nebkor-study.el= section for annotation of org and eww files (~org-remark~)]] + - [[#the-nebkor-studyel-section-for-flashcards-org-fc][The =nebkor-study.el= section for flashcards (~org-fc~)]] + - [[#the-nebkor-studyel-section-for-table-of-contents-toc-org][The =nebkor-study.el= section for table of contents (~toc-org~)]] + - [[#the-nebkor-studyel-section-for-archiving-web-content-org-board][The =nebkor-study.el= section for archiving web content (~org-board~)]] + - [[#finally-we-provide-the-nebkor-studyel-module][Finally, we provide the =nebkor-study.el= module]] - [[#custom-libraries][Custom libraries]] - [[#the-prot-commonel-library][The =prot-common.el= library]] - [[#the-prot-embarkel-library][The =prot-embark.el= library]] - [[#the-prot-windowel-library][The =prot-window.el= library]] - - [[#the-vedang-personalel-module][The =vedang-personal.el= module]] + - [[#the-nebkor-personalel-module][The =nebkor-personal.el= module]] * Introduction :PROPERTIES: :CUSTOM_ID: h:D8816D6D-3B30-4ED5-9AE5-892029BA6C24 -:CREATED: [2024-12-19 Thu 17:05] +:CREATED: <2024-12-30> :END: -This configuration is inspired from the work of [[https://github.com/protesilaos/dotfiles/blob/master/emacs/.emacs.d/prot-emacs.org][my hero Prot]]. I've -copied straight from his config file, because I think the explanations -he has created are worthwhile and should be read by everyone. Prot's -files are all prefixed with =prot-emacs-*=. I have changed this to -=unravel-*=. The reason for this is that I have picked up only what I -need and changed it based on my usage. As such, any issues you face -with this configuration are likely introduced by me. - -I use emacs on Mac OSX as my primary development environment. I -install the latest available pre-compiled Emacs (with native -compilation), as provided by Jimeh here: [[https://github.com/jimeh/emacs-builds?tab=readme-ov-file][jimeh/emacs-builds]]. - -Any quote without attribution is directly taken from [[https://github.com/protesilaos/dotfiles/blob/master/emacs/.emacs.d/prot-emacs.org][Prot's org file]]. -Prot gives even more detailed explanations in his writing, I have only -picked snippets. The interested reader should definitely go through -Prot's notes. +This configuration is inspired by [[https://github.com/unravel-team/emacs][Vedang's Prot-inspired literate config]]. As in +Vedang's, any unattributed quotes are taken directly from [[https://github.com/protesilaos/dotfiles/blob/master/emacs/.emacs.d/prot-emacs.org][Prot's org file]]. Also as in Vedang's, any +errors are probably his ;) To make a change to this Emacs configuration, edit this file and then type =C-c C-v C-t= (=M-x org-babel-tangle=) to republish all the @@ -257,6 +230,7 @@ by delegating to the =init.el ** The =early-init.el= basic frame settings :PROPERTIES: :CUSTOM_ID: h:a1288a07-93f6-4e14-894e-707d5ad8b6dc +:ID: 01JGD3335N000DX6AG8WW5NJZA :END: #+begin_src emacs-lisp :tangle "early-init.el" @@ -275,6 +249,7 @@ by delegating to the =init.el ** The =early-init.el= tweaks to startup time and garbage collection :PROPERTIES: :CUSTOM_ID: h:50d28f3c-3ada-4db5-b830-bbbbee7fec4e +:ID: 01JGD3335V000DC3NGG4C0CBBH :END: #+begin_src emacs-lisp :tangle "early-init.el" @@ -308,6 +283,7 @@ by delegating to the =init.el ** If you have both .el and .elc files, load the newer one :PROPERTIES: :CUSTOM_ID: h:F8987E20-3E36-4E27-9EAE-D0680303A95B +:ID: 01JGD33360000BCR54T9VJDAYE :END: #+begin_src emacs-lisp :tangle "early-init.el" @@ -320,6 +296,7 @@ by delegating to the =init.el ** The =early-init.el= package cache settings :PROPERTIES: :CUSTOM_ID: h:7a037504-8a2f-4df0-8482-ce6476354440 +:ID: 01JGD33365000DGT26EDXZ3SVD :END: Do not initialize the package cache, we want to use ~elpaca~ instead of ~package.el~ @@ -334,6 +311,7 @@ Do not initialize the package cache, we want to use ~elpaca~ instead of ~package :PROPERTIES: :CUSTOM_ID: h:C65F8419-568D-4B37-B864-5FF29F72F17B :CREATED: [2024-12-10 Tue 14:39] +:ID: 01JGD3336B0008SMGXGH47ABD3 :END: Note that this should be the last section of the ~early-init.el~ file. @@ -351,11 +329,13 @@ Note that this should be the last section of the ~early-init.el~ file. :CUSTOM_ID: h:dae63bd9-93a8-41c4-af1b-d0f39ba50974 :END: -This is the main initialisation file of Emacs. Everything loads from here, even if it has been split into multiple files for convenience. +This is the main initialisation file of Emacs. Everything loads from here, even if it has been split +into multiple files for convenience. ** The =init.el= tweaks to make native compilation silent :PROPERTIES: :CUSTOM_ID: h:3563ceb5-b70c-4191-9c81-f2f5a202c4da +:ID: 01JGD3336G0004H4FS2D0AYMA0 :END: These warnings are unnecessarily scary. @@ -376,18 +356,20 @@ red spots everywhere, as if we have totally broken Emacs. #+begin_src emacs-lisp :tangle "init.el" ;; init.el -*- lexical-binding: t; -*- + (set-language-environment "UTF-8") + ;; Make native compilation silent and prune its cache. - (when (native-comp-available-p) - (setq native-comp-async-report-warnings-errors 'silent) ; Emacs 28 with native compilation - (setq native-compile-prune-cache t)) ; Emacs 29 + (setq native-compile-prune-cache t) #+end_src ** The =init.el= setting to send ~custom-file~ to oblivion :PROPERTIES: :CUSTOM_ID: h:f2ffe0e9-a58d-4bba-9831-cc35940ea83f +:ID: 01JGD3336P00087XGHY73810B9 :END: -There is no need to use the =M-x customize= infrastructure. It's easier to just rely on the init file instead. +There is no need to use the =M-x customize= infrastructure. It's easier to just rely on the init +file instead. But I'll get there in baby steps, so for now, load my custom file. #+begin_quote I would prefer to just have an option to avoid the Custom @@ -395,13 +377,16 @@ infrastructure altogether, but this is not possible. So here we are... #+end_quote #+begin_src emacs-lisp :tangle "init.el" + (setq custom-file "~/.emacs.d/custom.el") + (load custom-file) ;; Disable custom.el by making it disposable. - (setq custom-file (make-temp-file "emacs-custom-")) + ;; (setq custom-file (make-temp-file "emacs-custom-")) #+end_src ** The =init.el= settings to enable commands disabled by default :PROPERTIES: :CUSTOM_ID: h:4ed6593f-6f55-4258-a1c2-ddb50e9e2465 +:ID: 01JGD3336W000EAX31DZ1A75R4 :END: These commands are actually useful, especially in org-mode. @@ -415,6 +400,9 @@ These commands are actually useful, especially in org-mode. #+end_src ** The =init.el= settings to disable unnecessary commands enabled by default +:PROPERTIES: +:ID: 01JGD333710006SE327410PMMM +:END: These commands are "unsafe", in that we should be using the alternatives (like ~vterm~ and ~org~) @@ -429,15 +417,18 @@ These commands are "unsafe", in that we should be using the alternatives (like ~ ** The =init.el= section to add the modules folder to the load-path :PROPERTIES: :CUSTOM_ID: h:e289a614-4f17-4d6c-a028-42fe45aebe66 +:ID: 01JGD333760004GJ8RRH5D0Z0W :END: -This is where all the custom configuration sits for all the packages we use. We write configuration on a per-file basis instead of in a giant file, because these smaller files are more readable, approachable and shareable. +This is where all the custom configuration sits for all the packages we use. We write configuration +on a per-file basis instead of in a giant file, because these smaller files are more readable, +approachable and shareable. #+begin_src emacs-lisp :tangle "init.el" (mapc (lambda (string) (add-to-list 'load-path (locate-user-emacs-file string))) - '("unravel-modules" "custom-lisp")) + '("nebkor-modules" "custom-lisp")) #+end_src ** COMMENT The =init.el= settings for packages (=package.el=) @@ -485,16 +476,13 @@ package archives, pinning packages, and setting priorities: :PROPERTIES: :CUSTOM_ID: h:13B17ABF-19E3-4723-9B72-E1201F7298AA :CREATED: [2024-12-10 Tue 14:43] +:ID: 01JGD3337C000BVH5SAFT1D9BR :END: I use ~elpaca~ for package management, and ~use-package~ for configuration management. This means that ~elpaca~ replaces the built-in ~package.el~ functionality. -I do it this way because it simplifies my developement workflow for -the emacs-lisp packages I want to contribute to, by letting me use -code directly from git forges. - When using ~elpaca~, here are some gotchas you should be aware of (Note: these only apply for =:ensure t= cases): @@ -506,10 +494,6 @@ When using ~elpaca~, here are some gotchas you should be aware of deferring for a certain number of seconds. Do not make any assumptions about order of execution. -The built-in ~package.el~ is just fine, and if you prefer that, you -should just COMMENT this section, uncomment [[#h:424340cc-f3d7-4083-93c9-d852d40dfd40][The =init.el= settings for -packages (=package.el=)]] and re-export all the code-blocks. - #+begin_src emacs-lisp :tangle "init.el" ;;; Install Elpaca @@ -561,6 +545,7 @@ packages (=package.el=)]] and re-export all the code-blocks. ** The =init.el= macro to do nothing with Elisp code (~prot-emacs-comment~) :PROPERTIES: :CUSTOM_ID: h:3b14faa6-83fd-4d5f-b3bc-85f72fd572d4 +:ID: 01JGD3337H0005C5TPY1Q8PVZS :END: #+begin_quote @@ -611,6 +596,7 @@ effects." ** The =init.el= macro to define abbreviations (~prot-emacs-abbrev~) :PROPERTIES: :CUSTOM_ID: h:e7a12825-7848-42bd-b99b-b87903012814 +:ID: 01JGD3337P0004RW7VP6HFQW7F :END: [ Watch Prot's video: [[https://protesilaos.com/codelog/2024-02-03-emacs-abbrev-mode/][abbreviations with abbrev-mode (quick text expansion)]] (2024-02-03). ] @@ -640,42 +626,32 @@ making an abbreviation to a function." ** The =init.el= section to load the individual modules :PROPERTIES: :CUSTOM_ID: h:e6c4acf5-5b51-4b38-a86a-bf3f698ac872 +:ID: 01JGD3337W000DMNV6V386R0Q4 :END: Now we are ready to load our per-module configuration files: #+begin_src emacs-lisp :tangle "init.el" - (require 'unravel-theme) - (require 'unravel-essentials) - (require 'unravel-completion) - (require 'unravel-search) - (require 'unravel-dired) - (require 'unravel-window) - (require 'unravel-git) - (require 'unravel-org) - (require 'unravel-shell) - (require 'unravel-langs) - (require 'unravel-study) + (require 'nebkor-theme) + (require 'nebkor-essentials) + (require 'nebkor-functions) + (require 'nebkor-completion) + (require 'nebkor-search) + (require 'nebkor-dired) + (require 'nebkor-window) + (require 'nebkor-git) + (require 'nebkor-org) + (require 'nebkor-langs) + (require 'nebkor-study) ;;; Comment this next line if you don't want to use my personal ;;; settings (like specific directories or org variables) - ;;(require 'vedang-personal) + (require 'nebkor-personal) #+end_src -** The =init.el= section to name to the default frame -:PROPERTIES: -:CUSTOM_ID: h:ad227f7e-b0a7-43f8-91d6-b50db82da9ad -:END: - -Naming frames allows you to select them using completion (=M-x select-frame-by-name=). - -#+begin_src emacs-lisp :tangle "init.el" - ;; Name the default frame - ;; You can select a frame with M-x select-frame-by-name - (add-hook 'elpaca-after-init-hook (lambda () (set-frame-name "unravel/emacs"))) -#+end_src - - ** Finally, the =init.el= section for local variables +:PROPERTIES: +:ID: 01JGCWAQD5000DT5BKY7AC94Z4 +:END: #+begin_src emacs-lisp :tangle "init.el" ;; Local Variables: @@ -684,69 +660,37 @@ Naming frames allows you to select them using completion (=M-x select-frame-by-n ;; no-update-autoloads: t ;; End: #+end_src -* The =unravel-theme.el= module + +* The =nebkor-theme.el= module :PROPERTIES: :CUSTOM_ID: h:8cf67c82-1ebb-4be8-b0e7-161bbf5419ce +:ID: 01JGD333820001G48BX1C8MR2R :END: This module defines everything related to the aesthetics of Emacs. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" :mkdirp yes ;;; Everything related to the look of Emacs #+end_src -** The =unravel-theme.el= section for cool, modern themes (~ef-themes~) +** The =nebkor-theme.el= section for cool, modern themes (~ef-themes~) :PROPERTIES: :CUSTOM_ID: h:2b2a27a1-6d2e-4b59-bf60-94682e173f2f +:ID: 01JGD33387000F4AZ3ZBKKE507 :END: -I use themes from the ~ef-themes~ package exclusively. +I have an ancient color scheme that's mostly inside the custom.el file, but I'd like to make a +proper theme some day. Until then... -Prot is the lead developer and maintainer of this package. - -+ Package name (GNU ELPA): ~ef-themes~ -+ Official manual: -+ Change log: -+ Git repositories: - - GitHub: - - GitLab: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" - ;;; The Ef (εὖ) themes - - ;; The themes are customisable. Read the manual: - ;; . - (use-package ef-themes - :ensure t - :demand t - :bind - (("" . ef-themes-rotate) - ("C-" . ef-themes-select)) - :config - (setq ef-themes-to-toggle '(ef-elea-light ef-elea-dark)) - (setq ef-themes-variable-pitch-ui t) - (setq ef-themes-mixed-fonts t) - (setq ef-themes-rotate ef-themes-items) - (setq ef-themes-headings ; read the manual's entry of the doc string - '((0 . (variable-pitch light 1.9)) - (1 . (variable-pitch light 1.8)) - (2 . (variable-pitch regular 1.7)) - (3 . (variable-pitch regular 1.6)) - (4 . (variable-pitch regular 1.5)) - (5 . (variable-pitch 1.4)) ; absence of weight means `bold' - (6 . (variable-pitch 1.3)) - (7 . (variable-pitch 1.2)) - (agenda-date . (semilight 1.5)) - (agenda-structure . (variable-pitch light 1.9)) - (t . (variable-pitch 1.1)))) - (setq ef-themes-disable-other-themes t) - (mapc #'disable-theme custom-enabled-themes)) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" + (add-to-list 'default-frame-alist '(background-color . "snow")) #+end_src -** The =unravel-theme.el= section for highlighting lines (~lin~) +** The =nebkor-theme.el= section for highlighting lines (~lin~) :PROPERTIES: :CUSTOM_ID: h:bf5b4d08-8f33-4a8c-8ecd-fca19bf2497a +:ID: 01JGD3338D000CFHSKXPKGB71Y :END: ~lin~ is an improvement on ~hl-line-mode~. @@ -760,7 +704,7 @@ Prot is the lead developer and maintainer of this package. - GitHub: - GitLab: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;;; Lin ;; Read the lin manual: . (use-package lin @@ -770,53 +714,10 @@ Prot is the lead developer and maintainer of this package. (setopt lin-face 'lin-cyan)) #+end_src -** The =unravel-theme.el= section for padding (~spacious-padding~) -:PROPERTIES: -:CUSTOM_ID: h:6c118185-fcb1-4c9a-93af-71814cb84279 -:END: - -~spacious-padding~ gives us a comfortable reading experience. - -Prot is the lead developer and maintainer of this package. - -#+begin_quote -Inspiration for this package comes from [[https://github.com/rougier][Nicolas Rougier's impressive -designs]] and [[https://github.com/minad/org-modern][Daniel Mendler's ~org-modern~ package]]. -#+end_quote - -+ Package name (GNU ELPA): ~spacious-padding~ -+ Official manual: -+ Git repositories: - - GitHub: - - GitLab: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" - ;;;; Increase padding of windows/frames - ;; . - (use-package spacious-padding - :ensure t - :if (display-graphic-p) - :hook (elpaca-after-init . spacious-padding-mode) - :init - ;; These are the defaults, but I keep it here for visiibility. - (setq spacious-padding-widths - '(:internal-border-width 30 - :header-line-width 4 - :mode-line-width 6 - :tab-width 4 - :right-divider-width 30 - :scroll-bar-width 8 - :left-fringe-width 20 - :right-fringe-width 20)) - - ;; Read the doc string of `spacious-padding-subtle-mode-line' as - ;; it is very flexible. - (setq spacious-padding-subtle-mode-line t)) -#+end_src - -** The =unravel-theme.el= section for color previews (~rainbow-mode~) +** The =nebkor-theme.el= section for color previews (~rainbow-mode~) :PROPERTIES: :CUSTOM_ID: h:9438236e-a8a4-45e0-8c61-8268c634d50b +:ID: 01JGD3338R0006WTSGQED8JAE5 :END: #+begin_quote @@ -825,7 +726,7 @@ those while developing my themes, hence the ~prot/rainbow-mode-in-themes~ to activate ~rainbow-mode~ if I am editing a theme file. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;;; Rainbow mode for colour previewing (rainbow-mode.el) (use-package rainbow-mode :ensure t @@ -843,9 +744,10 @@ to activate ~rainbow-mode~ if I am editing a theme file. :hook (emacs-lisp-mode . prot/rainbow-mode-in-themes)) #+end_src -** The =unravel-theme.el= section for cursor styles (~cursory~) +** The =nebkor-theme.el= section for cursor styles (~cursory~) :PROPERTIES: :CUSTOM_ID: h:34ce98fe-0b57-44d9-b5f3-0224632114a5 +:ID: 01JGD3338X0004DJKAPD4MFQCV :END: #+begin_quote @@ -867,7 +769,7 @@ Prot is the lead developer and maintainer. - GitHub: - GitLab: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;; Cursor appearance (cursory) ;; Read the manual: . (use-package cursory @@ -909,7 +811,7 @@ Prot is the lead developer and maintainer. :cursor-type box :cursor-in-non-selected-windows hollow :blink-cursor-mode 1 - :blink-cursor-blinks 10 + :blink-cursor-blinks 5 :blink-cursor-interval 0.2 :blink-cursor-delay 0.2))) @@ -921,47 +823,10 @@ Prot is the lead developer and maintainer. (cursory-mode 1)) #+end_src -** The =unravel-theme.el= section for switching themes (~theme-buffet~) -:PROPERTIES: -:CUSTOM_ID: h:2af10314-c8c2-4946-bf9c-a5b0f5fe881b -:END: - -The ~theme-buffet~ package automatically changes the theme based on time of day. - -Bruno Boal is the lead developer and Prot is a co-maintainer. - -+ Package name (GNU ELPA): ~theme-buffet~ -+ Git repo on SourceHut: - - Mirrors: - + GitHub: - + Codeberg: -+ Mailing list: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" - ;;;; Theme buffet - ;; - (use-package theme-buffet - :ensure t - :after (:any modus-themes ef-themes) - :config - (let ((modus-themes-p (featurep 'modus-themes)) - (ef-themes-p (featurep 'ef-themes))) - (setq theme-buffet-menu 'end-user) - (setq theme-buffet-time-offset 0) - (setq theme-buffet-end-user - '( :night (ef-dark ef-winter ef-autumn ef-night ef-duo-dark ef-symbiosis ef-owl) - :morning (ef-light ef-cyprus ef-spring ef-frost ef-duo-light ef-eagle) - :afternoon (ef-arbutus ef-day ef-kassio ef-summer ef-elea-light ef-maris-light ef-melissa-light ef-trio-light ef-reverie) - :evening (ef-rosa ef-elea-dark ef-maris-dark ef-melissa-dark ef-trio-dark ef-dream))) - - (when (or modus-themes-p ef-themes-p) - (theme-buffet-timer-hours 2) - (theme-buffet-a-la-carte)))) -#+end_src - -** The =unravel-theme.el= section about font styles (~fontaine~) +** The =nebkor-theme.el= section about font styles (~fontaine~) :PROPERTIES: :CUSTOM_ID: h:cb41fef0-41a5-4a85-9552-496d96290258 +:ID: 01JGD333B5000D6VCHQWSPH6SY :END: [ Watch Prot's video: [[https://protesilaos.com/codelog/2024-01-16-customize-emacs-fonts/][Customise Emacs fonts]] (2024-01-16) ] @@ -985,9 +850,9 @@ Prot is the lead developer and maintainer. - GitLab: Another section defines some complementary functionality -([[#h:60d6aae2-6e4b-402c-b6a8-411fc49a6857][The =unravel-theme.el= section about ~variable-pitch-mode~ and font resizing]]). +([[#h:60d6aae2-6e4b-402c-b6a8-411fc49a6857][The =nebkor-theme.el= section about ~variable-pitch-mode~ and font resizing]]). -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;;; Fontaine (font configurations) ;; Read the manual: (use-package fontaine @@ -1000,25 +865,21 @@ Another section defines some complementary functionality (elpaca-after-init . (lambda () ;; Set last preset or fall back to desired style from `fontaine-presets'. (fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular)))) - (enable-theme-functions . fontaine-apply-current-preset) - (ef-themes-post-load . fontaine-apply-current-preset)) + (enable-theme-functions . fontaine-apply-current-preset)) :config ;; This is defined in Emacs C code: it belongs to font settings. (setq x-underline-at-descent-line nil) - ;; And this is for Emacs28. - (setq-default text-scale-remap-header-line t) - ;; This is the default value. Just including it here for ;; completeness. (setq fontaine-latest-state-file (locate-user-emacs-file "fontaine-latest-state.eld")) (setq fontaine-presets '((small - :default-family "Iosevka" + :default-family "Noto Sans" :default-height 130) (regular - :default-height 150) + :default-height 130) (medium :default-weight semilight :default-height 170 @@ -1036,7 +897,7 @@ Another section defines some complementary functionality ;; I keep all properties for didactic purposes, but most can be ;; omitted. See the fontaine manual for the technicalities: ;; . - :default-family "Iosevka" + :default-family "Noto Sans" :default-weight regular :default-slant normal :default-width normal @@ -1111,9 +972,10 @@ Another section defines some complementary functionality :line-spacing nil)))) #+end_src -** The =unravel-theme.el= section for font previews (~show-font~) +** The =nebkor-theme.el= section for font previews (~show-font~) :PROPERTIES: :CUSTOM_ID: h:60a005be-77bd-49f1-a865-78d7cf75bd2a +:ID: 01JGD333BC000BGHW3SXPF8ZQG :END: #+begin_quote @@ -1133,9 +995,9 @@ Prot is the developer and maintainer of this package. + Change log: + Git repository: -To actually set fonts, use the ~fontaine~ package ([[#h:cb41fef0-41a5-4a85-9552-496d96290258][The =unravel-theme.el= section about ~fontaine~]]). +To actually set fonts, use the ~fontaine~ package ([[#h:cb41fef0-41a5-4a85-9552-496d96290258][The =nebkor-theme.el= section about ~fontaine~]]). -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;;; Show Font (preview fonts) ;; Read the manual: (use-package show-font @@ -1157,9 +1019,10 @@ To actually set fonts, use the ~fontaine~ package ([[#h:cb41fef0-41a5-4a85-9552- ")) #+end_src -** The =unravel-theme.el= section about font resizing (~variable-pitch-mode~) +** The =nebkor-theme.el= section about font resizing (~variable-pitch-mode~) :PROPERTIES: :CUSTOM_ID: h:60d6aae2-6e4b-402c-b6a8-411fc49a6857 +:ID: 01JGD333BH000DSVZXX8Q4965R :END: [ Watch Prot's video: [[https://protesilaos.com/codelog/2024-01-16-customize-emacs-fonts/][Customise Emacs fonts]] (2024-01-16) ] @@ -1169,7 +1032,7 @@ The built-in ~variable-pitch-mode~ makes the current buffer use a proportionately spaced font. In technical terms, it remaps the ~default~ face to ~variable-pitch~, so whatever applies to the latter takes effect over the former. I take care of their respective font -families in my ~fontaine~ setup ([[#h:cb41fef0-41a5-4a85-9552-496d96290258][The =unravel-theme.el= section about ~fontaine~]]). +families in my ~fontaine~ setup ([[#h:cb41fef0-41a5-4a85-9552-496d96290258][The =nebkor-theme.el= section about ~fontaine~]]). I want to activate ~variable-pitch-mode~ in all buffers where I normally focus on prose. The exact mode hooks are specified in the @@ -1179,7 +1042,7 @@ my opinion should not be derived from ~text-mode~): these are excluded in the function ~prot/enable-variable-pitch~. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" ;;;;; `variable-pitch-mode' setup (use-package face-remap :ensure nil @@ -1191,7 +1054,7 @@ in the function ~prot/enable-variable-pitch~. ;; NOTE 2022-11-20: This may not cover every case, though it works ;; fine in my workflow. I am still undecided by EWW. (defun prot/enable-variable-pitch () - (unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode) + (unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode 'prog-mode) (variable-pitch-mode 1))) ;;;;; Resize keys with global effect :bind @@ -1204,63 +1067,28 @@ in the function ~prot/enable-variable-pitch~. ("C-x C-0" . global-text-scale-adjust))) #+end_src -*** Information about the Iosevka Comfy fonts -:PROPERTIES: -:CUSTOM_ID: h:3b989679-7e3f-4f03-b4bb-611006ea01ce -:END: - -/Iosevka Comfy/ is a customised build of the Iosevka typeface, with a -consistent rounded style and overrides for almost all individual -glyphs in both roman (upright) and italic (slanted) variants. Many -font families are available, covering a broad range of typographic -weights. The README file in the git repository covers all the -technicalities. - - | Family | Shapes | Spacing | Style | Ligatures | - |---------------------------------+--------+---------+------------+-----------| - | Iosevka Comfy | Sans | Compact | Monospaced | Yes | - | Iosevka Comfy Fixed | Sans | Compact | Monospaced | No | - | Iosevka Comfy Duo | Sans | Compact | Duospaced | Yes | - |---------------------------------+--------+---------+------------+-----------| - | Iosevka Comfy Motion | Slab | Compact | Monospaced | Yes | - | Iosevka Comfy Motion Fixed | Slab | Compact | Monospaced | No | - | Iosevka Comfy Motion Duo | Slab | Compact | Duospaced | Yes | - |---------------------------------+--------+---------+------------+-----------| - | Iosevka Comfy Wide | Sans | Wide | Monospaced | Yes | - | Iosevka Comfy Wide Fixed | Sans | Wide | Monospaced | No | - | Iosevka Comfy Wide Duo | Sans | Wide | Duospaced | Yes | - |---------------------------------+--------+---------+------------+-----------| - | Iosevka Comfy Wide Motion | Slab | Wide | Monospaced | Yes | - | Iosevka Comfy Wide Motion Fixed | Slab | Wide | Monospaced | No | - | Iosevka Comfy Wide Motion Duo | Slab | Wide | Duospaced | Yes | - -+ Git repositories: - - GitHub: - - GitLab: -+ Sample pictures: -+ Backronym: Iosevka ... Could Only Modify a Font, Yes - - -** Finally, we provide the =unravel-theme.el= module +** Finally, we provide the =nebkor-theme.el= module :PROPERTIES: :CUSTOM_ID: h:bac0ce0a-db68-42e7-ba2c-f350f91f80ef +:ID: 01JGD333BQ000CWYYVX8CY9XAJ :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-theme.el" -(provide 'unravel-theme) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" +(provide 'nebkor-theme) #+end_src -* The =unravel-essentials.el= module +* The =nebkor-essentials.el= module :PROPERTIES: :CUSTOM_ID: h:0ef52ed9-7b86-4329-ae4e-eff9ab8d07f2 :END: -** The =unravel-essentials.el= block with basic configurations +** The =nebkor-essentials.el= block with basic configurations :PROPERTIES: :CUSTOM_ID: h:713ede33-3802-40c6-a8e3-7e1fc0d0a924 +:ID: 01JGD333BW00026259X7RRF0TT :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" :mkdirp yes ;;; Essential configurations (use-package emacs :ensure nil @@ -1282,14 +1110,15 @@ technicalities. (setq debug-on-error t)) #+end_src -** The =unravel-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~) +** The =nebkor-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~) :PROPERTIES: :CUSTOM_ID: h:D4517B67-0D90-417E-97D7-60A08EABB3DA +:ID: 01JGD333C1000DW1VBA3PQGRYH :END: The ~PATH~ variable does not get set properly on Mac OSX and Windows machines, and due to this Emacs often does not find the right executables when calling external programs. ~exec-path-from-shell~ fixes this. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package exec-path-from-shell :if (memq (window-system) '(mac ns)) :ensure t @@ -1298,12 +1127,13 @@ The ~PATH~ variable does not get set properly on Mac OSX and Windows machines, a (exec-path-from-shell-initialize)) #+end_src -** The =unravel-essentials.el= configuration to track recently visited files (~recentf~) +** The =nebkor-essentials.el= configuration to track recently visited files (~recentf~) :PROPERTIES: :CUSTOM_ID: h:f9aa7523-d88a-4080-add6-073f36cb8b9a +:ID: 01JGD333C70005AM4ECT7FR4E1 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package recentf :ensure nil :hook (elpaca-after-init . recentf-mode) @@ -1318,13 +1148,14 @@ The ~PATH~ variable does not get set properly on Mac OSX and Windows machines, a (setq recentf-show-file-shortcuts-flag nil)) #+end_src -** The =unravel-essentials.el= configuration to track my place in visited files (~saveplace~) +** The =nebkor-essentials.el= configuration to track my place in visited files (~saveplace~) :PROPERTIES: :CUSTOM_ID: h:01DD3C5F-B871-408F-98F6-6B845921C541 :CREATED: [2024-12-19 Thu 11:35] +:ID: 01JGD333CC0006A5AWJ6E9EKRC :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package saveplace :ensure nil :hook (elpaca-after-init . save-place-mode) @@ -1332,9 +1163,10 @@ The ~PATH~ variable does not get set properly on Mac OSX and Windows machines, a (setq save-place-file (locate-user-emacs-file "saveplace"))) #+end_src -** The =unravel-essentials.el= settings for bookmarks +** The =nebkor-essentials.el= settings for bookmarks :PROPERTIES: :CUSTOM_ID: h:581aa0ff-b136-4099-a321-3b86edbfbccb +:ID: 01JGD333CJ000A5CTS5YD0HFCR :END: #+begin_quote @@ -1346,10 +1178,10 @@ Use the ~bookmark-set~ command (=C-x r m= by default) to record a bookmark and then visit one of your bookmarks with ~bookmark-jump~ (=C-x r b= by default). -Also see [[#h:5685df62-4484-42ad-a062-d55ab19022e3][the =unravel-essentials.el= settings for registers]]. +Also see [[#h:5685df62-4484-42ad-a062-d55ab19022e3][the =nebkor-essentials.el= settings for registers]]. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Built-in bookmarking framework (bookmark.el) (use-package bookmark :ensure nil @@ -1366,16 +1198,17 @@ Also see [[#h:5685df62-4484-42ad-a062-d55ab19022e3][the =unravel-essentials.el= (setq bookmark-save-flag 1)) #+end_src -** The =unravel-essentials.el= settings for registers +** The =nebkor-essentials.el= settings for registers :PROPERTIES: :CUSTOM_ID: h:5685df62-4484-42ad-a062-d55ab19022e3 +:ID: 01JGD333CQ000796BXGRFT17V1 :END: [ Watch Prot's video: [[https://protesilaos.com/codelog/2023-06-28-emacs-mark-register-basics/][Mark and register basics]] (2023-06-28). ] #+begin_quote Much like bookmarks, registers store data that we can reinstate -quickly ([[#h:581aa0ff-b136-4099-a321-3b86edbfbccb][The =unravel-essentials.el= settings for bookmarks]]). A +quickly ([[#h:581aa0ff-b136-4099-a321-3b86edbfbccb][The =nebkor-essentials.el= settings for bookmarks]]). A common use-case is to write some text to a register and then insert that text by calling the given register. This is much better than relying on the ~kill-ring~, because registers are meant to be @@ -1385,10 +1218,10 @@ text that we do not necessarily need. To me, registers are essential for keyboard macros. By default, registers do not persist between Emacs sessions, though I do need to re-use them from time to time, hence the arrangement to record them -with ~savehist-mode~ ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =unravel-completion.el= settings for saving the history (~savehist-mode~)]]). +with ~savehist-mode~ ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =nebkor-completion.el= settings for saving the history (~savehist-mode~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Registers (register.el) (use-package register :ensure nil @@ -1401,9 +1234,12 @@ with ~savehist-mode~ ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =unravel-co (add-to-list 'savehist-additional-variables 'register-alist))) #+end_src -** The =unravel-essentials.el= settings for files +** The =nebkor-essentials.el= settings for files +:PROPERTIES: +:ID: 01JGD333CW0009W0AE8Q6VNSFA +:END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package files :ensure nil :config @@ -1413,21 +1249,23 @@ with ~savehist-mode~ ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =unravel-co `(("." . ,(locate-user-emacs-file "temp-files/backups"))))) #+end_src -** The =unravel-essentials.el= section for ~delete-selection-mode~ +** The =nebkor-essentials.el= section for ~delete-selection-mode~ :PROPERTIES: :CUSTOM_ID: h:d551b90d-d730-4eb5-976a-24b010fd4db3 +:ID: 01JGD333D20000FVSM2MNMZ6WV :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Delete selection (use-package delsel :ensure nil :hook (elpaca-after-init . delete-selection-mode)) #+end_src -** The =unravel-essentials.el= settings for tooltips +** The =nebkor-essentials.el= settings for tooltips :PROPERTIES: :CUSTOM_ID: h:26afeb95-7920-45ed-8ff6-3648256c280b +:ID: 01JGD333D800059VVCWZ50M8SJ :END: #+begin_quote @@ -1437,7 +1275,7 @@ we can benefit from the text properties that can be added to these messages (e.g. a different colour or a slant). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Tooltips (tooltip-mode) (use-package tooltip :ensure nil @@ -1453,9 +1291,10 @@ messages (e.g. a different colour or a slant). (no-special-glyphs . t)))) #+end_src -** The =unravel-essentials.el= arrangement to run Emacs as a server +** The =nebkor-essentials.el= arrangement to run Emacs as a server :PROPERTIES: :CUSTOM_ID: h:7709b7e9-844f-49f3-badf-784aacec4bca +:ID: 01JGD333DD00072XGXC6TJPWHF :END: #+begin_quote @@ -1466,7 +1305,7 @@ launch new frames that share resources with the existing running process. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Emacs server (allow emacsclient to connect to running session) (use-package server :ensure nil @@ -1477,14 +1316,15 @@ process. (server-start))) #+end_src -** The =unravel-essentials.el= section about quick copying (~easy-kill~) +** The =nebkor-essentials.el= section about quick copying (~easy-kill~) :PROPERTIES: :CUSTOM_ID: h:891BA3F6-6229-45B5-B5E8-80FA4837662B +:ID: 01JGD333DJ000CP0TFT7PW7WB1 :END: ~easy-kill~ is a drop-in replacement for ~kill-ring-save~, letting me easily and quickly copy / kill anything I want. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package easy-kill :ensure t :bind @@ -1492,10 +1332,11 @@ process. #+end_src -** The =unravel-essentials.el= section about auto management of treesit modules (~treesit-auto~) +** The =nebkor-essentials.el= section about auto management of treesit modules (~treesit-auto~) :PROPERTIES: :CUSTOM_ID: h:C9748AB2-AEFB-46E7-A3AD-0910D9CB153A :CREATED: [2024-12-10 Tue 13:45] +:ID: 01JGD333DQ0006TSDHEXBRAK54 :END: ~treesit-auto~ automatically downloads and installs tree-sitter @@ -1504,20 +1345,20 @@ v29 onwards, and enables much better syntax highlighting and code-navigation. I'll write more about tree-sitter in this section at a later date. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;; Install and use tree-sitter major modes where possible - (when (treesit-available-p) (use-package treesit-auto :ensure t :config (setq treesit-auto-install 'prompt) (treesit-auto-add-to-auto-mode-alist) - (global-treesit-auto-mode))) + (global-treesit-auto-mode)) #+end_src -** The =unravel-essentials.el= section about using tree-sitter for marking (~expreg~) +** The =nebkor-essentials.el= section about using tree-sitter for marking (~expreg~) :PROPERTIES: :CUSTOM_ID: h:ceb193bf-0de3-4c43-8ab7-6daa50817754 +:ID: 01JGD333DX000BE7CV17TXCMP5 :END: #+begin_quote @@ -1533,40 +1374,40 @@ The package offers the ~expreg-expand~ and ~expreg-contract~ commands. I expect ~expreg~ to eventually completely replace ~easy-kill~ () -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;; Mark syntactic constructs efficiently if tree-sitter is available (expreg) - (when (and (fboundp 'treesit-available-p) - (treesit-available-p)) - (use-package expreg - :ensure t - :functions (prot/expreg-expand prot/expreg-expand-dwim) - :bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp' - :config - (defun prot/expreg-expand (n) - "Expand to N syntactic units, defaulting to 1 if none is provided interactively." - (interactive "p") - (dotimes (_ n) - (expreg-expand))) + (use-package expreg + :ensure t + :functions (prot/expreg-expand prot/expreg-expand-dwim) + :bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp' + :config + (defun prot/expreg-expand (n) + "Expand to N syntactic units, defaulting to 1 if none is provided interactively." + (interactive "p") + (dotimes (_ n) + (expreg-expand))) - (defun prot/expreg-expand-dwim () - "Do-What-I-Mean `expreg-expand' to start with symbol or word. + (defun prot/expreg-expand-dwim () + "Do-What-I-Mean `expreg-expand' to start with symbol or word. If over a real symbol, mark that directly, else start with a word. Fall back to regular `expreg-expand'." - (interactive) - (let ((symbol (bounds-of-thing-at-point 'symbol))) - (cond - ((equal (bounds-of-thing-at-point 'word) symbol) - (prot/expreg-expand 1)) - (symbol (prot/expreg-expand 2)) - (t (expreg-expand))))))) + (interactive) + (let ((symbol (bounds-of-thing-at-point 'symbol))) + (cond + ((equal (bounds-of-thing-at-point 'word) symbol) + (prot/expreg-expand 1)) + (symbol (prot/expreg-expand 2)) + (t (expreg-expand)))))) #+end_src - -** The =unravel-essentials.el= section for OSX changes +** The =nebkor-essentials.el= section for OSX changes +:PROPERTIES: +:ID: 01JGD333E200029PNFYCFH4JRK +:END: These are modifications to basic configuration I use on my Mac OSX machine. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" ;;;; Configuration on Mac OS X machine (when (eq system-type 'darwin) (use-package ns-win @@ -1592,19 +1433,16 @@ These are modifications to basic configuration I use on my Mac OSX machine. (setq system-name (car (split-string system-name "\\."))) ;;; Binaries (setq vc-git-program (or (executable-find "git") "/usr/local/bin/git")) - (setq epg-gpg-program (or (executable-find "gpg") "/usr/local/bin/gpg")) - ;;; Source dirs - ;; Note: These are hard-coded to my machine. - (setq source-directory (expand-file-name "~/src/emacs/src/")) - (setq find-function-C-source-directory (expand-file-name "~/src/emacs/src/")))) + (setq epg-gpg-program (or (executable-find "gpg") "/usr/local/bin/gpg")))) #+end_src -** The =unravel-essentials.el= section for ~simple.el~ changes +** The =nebkor-essentials.el= section for ~simple.el~ changes :PROPERTIES: :CUSTOM_ID: h:6B18F988-DBAD-458C-97BE-129D1FF988F4 +:ID: 01JGD333E8000D5AGKW1J2VJGK :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (defun vedang/backward-kill-word-or-kill-region (&optional arg) "fancy C-w. If the region is selected, retain the original behaviour, otherwise call @@ -1631,35 +1469,104 @@ These are modifications to basic configuration I use on my Mac OSX machine. (setq column-number-mode t)) #+end_src -** The =unravel-essentials.el= section for better help (~helpful~) +** The =nebkor-essentials.el= section for better help (~helpful~) :PROPERTIES: :CUSTOM_ID: h:ECAF81D8-4111-4C71-AB77-3C3D322B235F :CREATED: [2024-12-02 Mon 09:50] +:ID: 01JGD333ED000CFWD9GWED35XD :END: -Helpful is a package that improves the default Emacs *Help* buffer. I don't want to replace what Emacs provides with default, and I find myself using Helpful only as an Avy action ([[#h:4E8593F7-C065-4DFA-B513-98602EC2BA1A][The =unravel-search.el= settings for ~avy~ (jumping)]]). However, it's really useful in that context. +Helpful is a package that improves the default Emacs *Help* buffer. I don't want to replace what +Emacs provides with default, and I find myself using Helpful only as an Avy action ([[#h:4E8593F7-C065-4DFA-B513-98602EC2BA1A][The +=nebkor-search.el= settings for ~avy~ (jumping)]]). However, it's really useful in that context. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" (use-package helpful :ensure t) #+end_src -** Finally, we provide the =unravel-essentials.el= module + +** The =nebkor-essentials= section for ~indent-tools~ :PROPERTIES: -:CUSTOM_ID: h:c8b2f021-fe5a-4f6b-944c-20340f764fb2 +:ID: 01JGD1ASTX0008J83XRB4TZW77 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-essentials.el" -(provide 'unravel-essentials) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" + (use-package indent-tools + :ensure t) #+end_src -* The =unravel-completion.el= module +** The =nebkor-essentials= section for fancy keyboard shortcuts (~key-chord~) +:PROPERTIES: +:ID: 01JGD1AZDG00072YN0C6Y1FFEG +:END: +The [[https://github.com/emacsorphanage/key-chord][key-chord package]] lets you define multi-key inputs, including double-taps of single keys, that +map to emacs commands. I use it for common window operations, like splitting, deleting, or rotating +them; the other major chord I use is =BB= which switches buffers. + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" + (use-package key-chord + :ensure t + :config + (key-chord-mode +1) + (setq key-chord-one-key-delay 0.185) ; e.g. "jj", default 0.2 + (setq key-chord-two-keys-delay 0.1) ; e.g. "jk", default 0.1 + (setq key-chord-safety-interval-backward 0.2) ; default 0.1 is too close to key delays + (setq key-chord-safety-interval-forward 0.3) ; default 0.35 causes laggy experience + + (key-chord-define-global "VV" 'split-window-right) + (key-chord-define-global "HH" 'split-window-below) + (key-chord-define-global "BB" 'switch-to-buffer) + (key-chord-define-global "CC" 'recenter) + (key-chord-define-global "00" 'delete-window) + (key-chord-define-global "11" 'delete-other-windows) + (key-chord-define-global "WW" 'rotate-windows) + ) +#+end_src + +** The =nebkor-essentials= section for ~which-key~ +:PROPERTIES: +:ID: 01JGD1BCEX00019X4P0RCQXVQW +:END: + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" + (use-package which-key + :ensure t + :config + (which-key-mode t) + (setq which-key-idle-delay 0.5) + (setq which-key-sort-order 'which-key-description-order)) +#+end_src + +** The =nebkor-essentials= section for blackout and other random shit +:PROPERTIES: +:ID: e810ad77-7720-4af4-98ee-9b5240c750f5 +:END: + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" + (use-package blackout + :ensure t + :demand t) +#+end_src + +** Finally, we provide the =nebkor-essentials.el= module +:PROPERTIES: +:CUSTOM_ID: h:c8b2f021-fe5a-4f6b-944c-20340f764fb2 +:ID: 01JGD333EP0004KBQ2VGJWV332 +:END: + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" +(provide 'nebkor-essentials) +#+end_src + +* The =nebkor-completion.el= module :PROPERTIES: :CUSTOM_ID: h:15edf2c3-4419-4101-928a-6e224958a741 :END: -** The =unravel-completion.el= settings for completion styles +** The =nebkor-completion.el= settings for completion styles :PROPERTIES: :CUSTOM_ID: h:14b09958-279e-4069-81e3-5a16c9b69892 +:ID: 01JGD333EV0009D1WF55ZYS97Q :END: #+begin_quote @@ -1696,7 +1603,7 @@ interpret user input and match candidates accordingly. - orderless :: This is the only completion style I use which is not built into Emacs and which I tweak further in a separate section - ([[#h:7cc77fd0-8f98-4fc0-80be-48a758fcb6e2][The =unravel-completion.el= for the ~orderless~ completion style]]). + ([[#h:7cc77fd0-8f98-4fc0-80be-48a758fcb6e2][The =nebkor-completion.el= for the ~orderless~ completion style]]). It matches patterns out-of-order. Patterns are typically words separated by spaces, though they can also be regular expressions, and even styles that are the same as the aforementioned ~flex~ and @@ -1715,7 +1622,7 @@ soon as I type a space after some characters I am using ~orderless~. (There are more details in Prot's file, for the interested reader) -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" :mkdirp yes ;;; General minibuffer settings (use-package minibuffer :ensure nil @@ -1785,14 +1692,15 @@ soon as I type a space after some characters I am using ~orderless~. (eglot (styles . (emacs22 substring orderless)))))) #+end_src -** The =unravel-completion.el= for the ~orderless~ completion style +** The =nebkor-completion.el= for the ~orderless~ completion style :PROPERTIES: :CUSTOM_ID: h:7cc77fd0-8f98-4fc0-80be-48a758fcb6e2 +:ID: 01JGD333F10001KD5GP2BYZSY8 :END: #+begin_quote The ~orderless~ package by Omar Antolín Camarena provides one of the -completion styles that I use ([[#h:14b09958-279e-4069-81e3-5a16c9b69892][The =unravel-completion.el= settings for completion styles]]). +completion styles that I use ([[#h:14b09958-279e-4069-81e3-5a16c9b69892][The =nebkor-completion.el= settings for completion styles]]). It is a powerful pattern matching algorithm that parses user input and interprets it out-of-order, so that =in pa= will cover ~insert-pair~ as well as ~package-install~. Components of the search are @@ -1803,7 +1711,7 @@ explain how I use ~orderless~ and why its power does not result in lots of false positives. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; Orderless completion style (use-package orderless :ensure t @@ -1821,9 +1729,10 @@ lots of false positives. ("?" . nil))) #+end_src -** The =unravel-completion.el= settings to ignore letter casing +** The =nebkor-completion.el= settings to ignore letter casing :PROPERTIES: :CUSTOM_ID: h:7fe1787d-dba3-46fe-82a9-5dc5f8ea6217 +:ID: 01JGD333F6000CVYYSRJ49BABE :END: #+begin_quote @@ -1831,30 +1740,31 @@ I never really need to match letters case-sensitively in the minibuffer. Let's have everything ignore casing by default. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" (setq completion-ignore-case t) (setq read-buffer-completion-ignore-case t) (setq-default case-fold-search t) ; For general regexp (setq read-file-name-completion-ignore-case t) #+end_src -** The =unravel-completion.el= settings for recursive minibuffers +** The =nebkor-completion.el= settings for recursive minibuffers :PROPERTIES: :CUSTOM_ID: h:4299825a-db51-49fe-b415-fb1749eed289 +:ID: 01JGD333FB000DN0A03K5M671B :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" (use-package mb-depth :ensure nil :hook (elpaca-after-init . minibuffer-depth-indicate-mode) :config - (setq read-minibuffer-restore-windows nil) ; Emacs 28 (setq enable-recursive-minibuffers t)) #+end_src -** The =unravel-completion.el= settings for default values +** The =nebkor-completion.el= settings for default values :PROPERTIES: :CUSTOM_ID: h:aebbdd4c-6e5b-4773-9f0a-c69f0d3c7158 +:ID: 01JGD333HJ0005YP3PGPPMDVH4 :END: #+begin_quote @@ -1864,26 +1774,19 @@ behaviour of Emacs is to append informative text to the prompt like =(default some-default-value)=. With the tweak to ~minibuffer-default-prompt-format~ we get a more compact style of =[some-default-value]=, which looks better to me. - -The ~minibuffer-electric-default-mode~ displays the default value next -to the prompt only if =RET= will actually use the default in that -situation. This means that while you start typing in the minibuffer, -the =[some-default-value]= indicator disappears, since it is no longer -applicable. Without this mode, the indicator stays there at all times, -which can be confusing or distracting. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" -(use-package minibuf-eldef - :ensure nil - :hook (elpaca-after-init . minibuffer-electric-default-mode) - :config - (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" + ;; (use-package minibuf-eldef + ;; :ensure nil + ;; :config + ;; (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 #+end_src -** The =unravel-completion.el= settings for common interactions +** The =nebkor-completion.el= settings for common interactions :PROPERTIES: :CUSTOM_ID: h:b640f032-ad11-413e-ad8f-63408671d500 +:ID: 01JGD333HR000148M2B81S4H0H :END: #+begin_quote @@ -1934,56 +1837,57 @@ experience. out. With ~file-name-shadow-mode~ the "shadowed" part is removed altogether. This is especially nice when combined with the completion style called ~partial-completion~ - ([[#h:14b09958-279e-4069-81e3-5a16c9b69892][The =unravel-completion.el= settings for completion styles]]). + ([[#h:14b09958-279e-4069-81e3-5a16c9b69892][The =nebkor-completion.el= settings for completion styles]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" - (use-package rfn-eshadow - :ensure nil - :hook (minibuffer-setup . cursor-intangible-mode) - :config - ;; Not everything here comes from rfn-eshadow.el, but this is fine. +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" + ;; (use-package rfn-eshadow + ;; :ensure nil + ;; :hook (minibuffer-setup . cursor-intangible-mode) + ;; :config + ;; ;; Not everything here comes from rfn-eshadow.el, but this is fine. - (setq resize-mini-windows t) - (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 - (setq echo-keystrokes 0.25) - (setq kill-ring-max 60) ; Keep it small + ;; (setq resize-mini-windows t) + ;; (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 + ;; (setq echo-keystrokes 0.25) + ;; (setq kill-ring-max 60) ; Keep it small - ;; Do not allow the cursor to move inside the minibuffer prompt. I - ;; got this from the documentation of Daniel Mendler's Vertico - ;; package: . - (setq minibuffer-prompt-properties - '(read-only t cursor-intangible t face minibuffer-prompt)) + ;; ;; Do not allow the cursor to move inside the minibuffer prompt. I + ;; ;; got this from the documentation of Daniel Mendler's Vertico + ;; ;; package: . + ;; (setq minibuffer-prompt-properties + ;; '(read-only t cursor-intangible t face minibuffer-prompt)) - ;; Add prompt indicator to `completing-read-multiple'. We display - ;; [`completing-read-multiple': ], e.g., - ;; [`completing-read-multiple': ,] if the separator is a comma. This - ;; is adapted from the README of the `vertico' package by Daniel - ;; Mendler. I made some small tweaks to propertize the segments of - ;; the prompt. - (defun crm-indicator (args) - (cons (format "[`completing-read-multiple': %s] %s" - (propertize - (replace-regexp-in-string - "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" - crm-separator) - 'face 'error) - (car args)) - (cdr args))) + ;; ;; Add prompt indicator to `completing-read-multiple'. We display + ;; ;; [`completing-read-multiple': ], e.g., + ;; ;; [`completing-read-multiple': ,] if the separator is a comma. This + ;; ;; is adapted from the README of the `vertico' package by Daniel + ;; ;; Mendler. I made some small tweaks to propertize the segments of + ;; ;; the prompt. + ;; (defun crm-indicator (args) + ;; (cons (format "[`completing-read-multiple': %s] %s" + ;; (propertize + ;; (replace-regexp-in-string + ;; "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" + ;; crm-separator) + ;; 'face 'error) + ;; (car args)) + ;; (cdr args))) - (advice-add #'completing-read-multiple :filter-args #'crm-indicator) + ;; (advice-add #'completing-read-multiple :filter-args #'crm-indicator) - (file-name-shadow-mode 1)) + ;; (file-name-shadow-mode 1)) #+end_src -** The =unravel-completion.el= generic minibuffer UI settings +** The =nebkor-completion.el= generic minibuffer UI settings :PROPERTIES: :CUSTOM_ID: h:de61a607-0bdf-462b-94cd-c0898319590e +:ID: 01JGD333HY00045FXEKVFX5AYN :END: These are some settings for the default completion user interface. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" (use-package minibuffer :ensure nil :demand t @@ -2002,9 +1906,10 @@ These are some settings for the default completion user interface. (setq completions-sort 'historical)) #+end_src -** The =unravel-completion.el= settings for saving the history (~savehist-mode~) +** The =nebkor-completion.el= settings for saving the history (~savehist-mode~) :PROPERTIES: :CUSTOM_ID: h:25765797-27a5-431e-8aa4-cc890a6a913a +:ID: 01JGD333J300040Q53S5C7TCZB :END: #+begin_quote @@ -2021,8 +1926,8 @@ Since we are already recording minibuffer histories, we can instruct them next time we use Emacs. Hence ~savehist-additional-variables~. I do this in a few of places: -- [[#h:804b858f-7913-47ef-aaf4-8eef5b59ecb4][The =unravel-completion.el= for in-buffer completion popup and preview (~corfu~)]] -- [[#h:5685df62-4484-42ad-a062-d55ab19022e3][The =unravel-essentials.el= settings for registers]] +- [[#h:804b858f-7913-47ef-aaf4-8eef5b59ecb4][The =nebkor-completion.el= for in-buffer completion popup and preview (~corfu~)]] +- [[#h:5685df62-4484-42ad-a062-d55ab19022e3][The =nebkor-essentials.el= settings for registers]] Note that the user option ~history-length~ applies to each individual history variable: it is not about all histories combined. @@ -2031,7 +1936,7 @@ Overall, I am happy with this feature and benefit from it on a daily basis. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;;; `savehist' (minibuffer and related histories) (use-package savehist :ensure nil @@ -2044,9 +1949,10 @@ basis. (add-to-list 'savehist-additional-variables 'kill-ring)) #+end_src -** The =unravel-completion.el= settings for dynamic text expansion (~dabbrev~) +** The =nebkor-completion.el= settings for dynamic text expansion (~dabbrev~) :PROPERTIES: :CUSTOM_ID: h:567bb00f-1d82-4746-93e5-e0f60721728a +:ID: 01JGD333J90004H93AMVCN8Y1Z :END: #+begin_quote @@ -2059,7 +1965,7 @@ static, user-defined abbreviations ([[#h:fd84b79a-351e-40f0-b383-bf520d77834b][S (~abbrev~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" (use-package dabbrev :ensure nil :commands (dabbrev-expand dabbrev-completion) @@ -2078,13 +1984,16 @@ static, user-defined abbreviations ([[#h:fd84b79a-351e-40f0-b383-bf520d77834b][S '(archive-mode image-mode docview-mode pdf-view-mode))) #+end_src -** The =unravel-completion.el= settings for dynamic text expansion (~hippie~) +** The =nebkor-completion.el= settings for dynamic text expansion (~hippie~) +:PROPERTIES: +:ID: 01JGD333JE0005C8Y78JYDAJEF +:END: Hippie is a built-in expansion mechanism that competes with dabbrev. I prefer hippie because of the simpler configuration and detailed expansion options it provides. Hippie uses Dabbrev as one of the expansion sources, so all the dabbrev settings above are still important. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" (use-package hippie-ext :ensure nil :bind @@ -2092,9 +2001,10 @@ Hippie uses Dabbrev as one of the expansion sources, so all the dabbrev settings ("M-/" . hippie-expand)) #+end_src -** The =unravel-completion.el= for in-buffer completion popup (~corfu~ and ~cape~) +** The =nebkor-completion.el= for in-buffer completion popup (~corfu~ and ~cape~) :PROPERTIES: :CUSTOM_ID: h:804b858f-7913-47ef-aaf4-8eef5b59ecb4 +:ID: 01JGD333JN000BY927DVDYYPG8 :END: #+begin_quote @@ -2107,10 +2017,10 @@ where the cursor is. The companion ~corfu-popupinfo-mode~ will show a secondary documentation popup if we move over a candidate but do not do anything with it. -Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =unravel-completion.el= settings for dynamic text expansion (~dabbrev~)]]. +Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =nebkor-completion.el= settings for dynamic text expansion (~dabbrev~)]]. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; Corfu (in-buffer completion popup) (use-package corfu :ensure t @@ -2144,7 +2054,7 @@ Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =unravel-completion.el= (completion-at-point-functions . cape-file)) #+end_src -** COMMENT The =unravel-completion.el= for in-buffer completion using TAB (~smart-tab~) +** COMMENT The =nebkor-completion.el= for in-buffer completion using TAB (~smart-tab~) :PROPERTIES: :CUSTOM_ID: h:240488D1-B225-4877-86EE-40D5318B0A7E :CREATED: [2024-12-18 Wed 14:59] @@ -2154,7 +2064,7 @@ Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =unravel-completion.el= "do the right thing". Other packages somehow fail to replicate this functionality correctly. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; smart-tab (TAB to do completion reliably) (use-package smart-tab :ensure (:repo "https://git.genehack.net/genehack/smart-tab.git" :branch "main") @@ -2167,9 +2077,10 @@ functionality correctly. (global-smart-tab-mode 1)) #+end_src -** The =unravel-completion.el= settings for filtering, previewing candidates (~consult~) +** The =nebkor-completion.el= settings for filtering, previewing candidates (~consult~) :PROPERTIES: :CUSTOM_ID: h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d +:ID: 01JGD333JV0008J1P5PCK30RP7 :END: #+begin_quote @@ -2182,7 +2093,7 @@ current candidate's context. which many users have as a drop-in replacement to the generic =C-x b= (=M-x switch-to-buffer=). It is a one-stop-shop for buffers, recently visited files (if ~recentf-mode~ is used---I don't), - bookmarks ([[#h:581aa0ff-b136-4099-a321-3b86edbfbccb][The =unravel-essentials.el= settings for bookmarks]]), + bookmarks ([[#h:581aa0ff-b136-4099-a321-3b86edbfbccb][The =nebkor-essentials.el= settings for bookmarks]]), and, in principle, anything else that defines a source for this interface. To filter those source, we can type at the empty minibuffer =b SPC=, which will insert a filter specific to buffers. @@ -2198,7 +2109,7 @@ current candidate's context. by wrapping the former inside of =#=. So the input =#prot-#completion= will send =prot-= to the ~grep~ program and then use =completion= inside of the minibuffer to perform the subsequent pattern-matching - (e.g. with help from ~orderless~ ([[#h:7cc77fd0-8f98-4fc0-80be-48a758fcb6e2][The =unravel-completion.el= for the ~orderless~ completion style]]). + (e.g. with help from ~orderless~ ([[#h:7cc77fd0-8f98-4fc0-80be-48a758fcb6e2][The =nebkor-completion.el= for the ~orderless~ completion style]]). The part that is sent to the external program does not block Emacs. It is handled asynchronously, so everything stays responsive. @@ -2212,10 +2123,10 @@ current candidate's context. search terms to narrow down to it simply by typing at the minibuffer prompt. -Also check: [[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =unravel-search.el= module]]. +Also check: [[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =nebkor-search.el= module]]. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; Enhanced minibuffer commands (consult.el) (use-package consult :ensure t @@ -2272,7 +2183,6 @@ Also check: [[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =unravel-search.el= m (setq consult-preview-key 'any) ;; the `imenu' extension is in its own file (require 'consult-imenu) - (consult-customize consult-imenu :initial (thing-at-point 'symbol)) (dolist (clj '(clojure-mode clojure-ts-mode)) (add-to-list 'consult-imenu-config `(,clj :toplevel "Functions" @@ -2285,163 +2195,10 @@ Also check: [[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =unravel-search.el= m (add-to-list 'consult-mode-histories '(vc-git-log-edit-mode . log-edit-comment-ring))) #+end_src -** The =unravel-completion.el= section for performing actions in context (~embark~) -:PROPERTIES: -:CUSTOM_ID: h:61863da4-8739-42ae-a30f-6e9d686e1995 -:END: - -#+begin_quote -The ~embark~ package by Omar Antolín Camarena provides a mechanism to -perform relevant actions in the given context. What constitutes "the -given context" depends on where the cursor is, such as if it is at the -end of a symbolic expression in Lisp code or inside the minibuffer. -The single point of entry is the ~embark-act~ command or variants like -~embark-dwim~. - -With ~embark-act~ we gain access to a customisable list of commands -for the given context. If we are over a Lisp symbol, one possible -action is to describe it (i.e. produce documentation about it). If we -are browsing files in the minibuffer, possible actions include file -operations such as to delete or rename the file. And so on for -everything. - -The ~embark-dwim~ command always performs the default action for the -given context. It is like invoking ~embark-act~ and then typing the -=RET= key. - -A killer feature of ~embark~ is the concepts of "collect" and -"export". These are used in the minibuffer to produce a dedicated -buffer that contains all the completion candidates. For example, if we -are reading documentation about =embark-= and have 10 items there, we -can "collect" the results in their own buffer and then navigate it as -if it were the minibuffer: =RET= will perform the action that the -actual minibuffer would have carried out (to show documentation, in -this case). Similarly, the export mechanism takes the completion -candidates out of the minibuffer, though it also puts them in a major -mode that is appropriate for them. Files, for instance, will be placed -in a Dired buffer ([[#h:f8b08a77-f3a8-42fa-b1a9-f940348889c3][The =unravel-dired.el= module]]). - -Depending on the configurations about the "indicator", the ~embark-act~ -command will display an informative buffer with keys and their -corresponding commands. - -One downside of ~embark~ is that it is hard to know what the context -is. I have had this experience myself several times, where I though I -was targeting the URL at point while the actions were about Org source -blocks, headings, and whatnot. Embark is probably correct in such a -case, though I cannot make my brain think the way it expects. - -Another downside, which is also true for ~which-key~, -is the sheer number of options for each context. I feel that the -defaults should be more conservative, to have 3-4 actions per context -to make it easier to find stuff. Those who need more, can add them. -Documentation can also be provided to that end. Adding commands to -such a list is not a trivial task, because the user must modify -keymaps and thus understand the relevant concepts. Sure, we can all -learn, but this is not your usual ~setq~ tweak. - -All things considered, I do not recommend ~embark~ to new users as I -know for a fact that people have trouble using it effectively. Power -users can benefit from it, though you will notice in the following -code block and in =prot-embark.el= how even power users need to put in -some work ([[#h:fb034be5-c316-4c4f-a46f-cebcab332a47][The =prot-embark.el= library]]). Whether it is worth it or -not depends on one's use-case. - -Karthik Chikmagalur has an excellently written and presented essay on -[[https://karthinks.com/software/fifteen-ways-to-use-embark/][Fifteen ways to use Embark]]. If you plan on becoming an ~embark~ power -user, this will help you. -#+end_quote - -Here are the main keybindings you should be aware of: - -- ~C-.~ to enter embark with ~prot-embark-act-quit~ -- ~E~ to ~embark-export~ (eg: when you want to see grep results in the ~grep-mode~ window -- ~S~ to ~embark-collect~ (eg: when you just want to save the consult results for inspection) -- ~A~ to ~embark-act~ (eg: to choose a new action in the middle of an existing action) - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" - ;;; Extended minibuffer actions and more (embark.el and prot-embark.el) - (use-package embark - :ensure t - :defer 1 - :config - (setq embark-confirm-act-all nil) - (setq embark-mixed-indicator-both nil) - (setq embark-mixed-indicator-delay 1.0) - (setq embark-indicators '(embark-mixed-indicator embark-highlight-indicator)) - (setq embark-verbose-indicator-nested nil) ; I think I don't have them, but I do not want them either - (setq embark-verbose-indicator-buffer-sections '(bindings)) - (setq embark-verbose-indicator-excluded-actions - '(embark-cycle embark-act-all embark-collect embark-export embark-insert)) - - ;; I never cycle and want to disable the damn thing. Normally, a - ;; nil value disables a key binding but here that value is - ;; interpreted as the binding for `embark-act'. So I just add - ;; some obscure key that I do not have. I absolutely do not want - ;; to cycle! - (setq embark-cycle-key "") - - ;; I do not want `embark-org' and am not sure what is loading it. - ;; So I just unsert all the keymaps... This is the nuclear option - ;; but here we are. - (with-eval-after-load 'embark-org - (defvar prot/embark-org-keymaps - '(embark-org-table-cell-map - embark-org-table-map - embark-org-link-copy-map - embark-org-link-map - embark-org-src-block-map - embark-org-item-map - embark-org-plain-list-map - embark-org-export-in-place-map) - "List of Embark keymaps for Org.") - - ;; Reset `prot/embark-org-keymaps'. - (seq-do - (lambda (keymap) - (set keymap (make-sparse-keymap))) - prot/embark-org-keymaps))) - - ;; I define my own keymaps because I only use a few functions in a - ;; limited number of contexts. - (use-package prot-embark - :ensure nil - :after embark - :bind - ( :map global-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit) - :map embark-collect-mode-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit) - :map minibuffer-local-filename-completion-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit)) - :config - (setq embark-keymap-alist - '((buffer prot-embark-buffer-map) - (command prot-embark-command-map) - (expression prot-embark-expression-map) - (file prot-embark-file-map) - (function prot-embark-function-map) - (identifier prot-embark-identifier-map) - (package prot-embark-package-map) - (region prot-embark-region-map) - (symbol prot-embark-symbol-map) - (url prot-embark-url-map) - (variable prot-embark-variable-map) - (t embark-general-map)))) - - ;; Needed for correct exporting while using Embark with Consult - ;; commands. - (use-package embark-consult - :ensure t - :after (embark consult)) -#+end_src - -** The =unravel-completion.el= section to configure completion annotations (~marginalia~) +** The =nebkor-completion.el= section to configure completion annotations (~marginalia~) :PROPERTIES: :CUSTOM_ID: h:bd3f7a1d-a53d-4d3e-860e-25c5b35d8e7e +:ID: 01JGD333K8000BX0JZS6CE3RQV :END: #+begin_quote @@ -2452,7 +2209,7 @@ each command has a brief description next to it (taken from its doc string) as well as a key binding, if it has one. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; Detailed completion annotations (marginalia.el) (use-package marginalia :ensure t @@ -2461,9 +2218,10 @@ string) as well as a key binding, if it has one. (setq marginalia-max-relative-age 0)) ; absolute time #+end_src -** The =unravel-completion.el= section for vertical minibuffer layout (~vertico~) +** The =nebkor-completion.el= section for vertical minibuffer layout (~vertico~) :PROPERTIES: :CUSTOM_ID: h:cff33514-d3ac-4c16-a889-ea39d7346dc5 +:ID: 01JGD333KE0003C8GAJ69KR511 :END: #+begin_quote @@ -2474,23 +2232,24 @@ handle even massive completion tables gracefully. I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provide. The configuration for that is also part of this section. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" ;;; Vertical completion layout (vertico) (use-package vertico :ensure t :hook (elpaca-after-init . vertico-mode) :config (setq vertico-scroll-margin 0) - (setq vertico-count 5) + (setq vertico-count 8) (setq vertico-resize t) (setq vertico-cycle t) - (with-eval-after-load 'rfn-eshadow - ;; This works with `file-name-shadow-mode' enabled. When you are in - ;; a sub-directory and use, say, `find-file' to go to your home '~/' - ;; or root '/' directory, Vertico will clear the old path to keep - ;; only your current input. - (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))) + ;; (with-eval-after-load 'rfn-eshadow + ;; ;; This works with `file-name-shadow-mode' enabled. When you are in + ;; ;; a sub-directory and use, say, `find-file' to go to your home '~/' + ;; ;; or root '/' directory, Vertico will clear the old path to keep + ;; ;; only your current input. + ;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) + ) (use-package vertico-repeat :after vertico @@ -2501,20 +2260,109 @@ I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provi ("M-P" . vertico-repeat-previous)) :hook (minibuffer-setup . vertico-repeat-save)) - (use-package vertico-suspend - :after vertico - ;; Note: `enable-recursive-minibuffers' must be t - :bind ( :map global-map - ("M-S" . vertico-suspend) - ("C-x c b" . vertico-suspend))) + ;; (use-package vertico-suspend + ;; :after vertico + ;; ;; Note: `enable-recursive-minibuffers' must be t + ;; :bind ( :map global-map + ;; ("M-S" . vertico-suspend) + ;; ("C-x c b" . vertico-suspend))) #+end_src -** Finally, we provide the ~unravel-completion.el~ module +** Finally, we provide the ~nebkor-completion.el~ module +:PROPERTIES: +:ID: 01JGCZHZSH0008MPA02ZJV43CY +:END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-completion.el" -(provide 'unravel-completion) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" +(provide 'nebkor-completion) #+end_src -* The =unravel-search.el= module + + +* The =nebkor-functions.el= module +:PROPERTIES: +:ID: 3b74f636-b722-4306-b053-e4e51796e7e6 +:END: + +My old custom functions file. + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-functions.el" :mkdirp yes + (defun diff-and-set-modified-p () + "Diff the current buffer with its associated file and set buffer modified status." + (let* ((tmpfile (diff-file-local-copy (current-buffer))) + (cmd (format "diff -q '%s' '%s'" (buffer-file-name) tmpfile)) + (result (call-process-shell-command cmd nil nil))) + (set-buffer-modified-p (not (zerop result))))) + + (defun nebkor/kill-buffer () + (interactive) + (diff-and-set-modified-p) + (kill-buffer (current-buffer)) + ) + + (defun sother-window () + "shift-other-window" + (interactive) + (other-window -1) + ) + + ;;; From: + ;;; https://fluca1978.github.io/2022/04/13/EmacsPgFormatter.html, with + ;;; minor modifications to add the function to a `before-save-hook` + (defun pgformatter-on-region () + "A function to invoke pg_format as an external program." + (interactive) + (let ((b (if mark-active (min (point) (mark)) (point-min))) + (e (if mark-active (max (point) (mark)) (point-max))) + (pgfrm (executable-find "pg_format"))) + (when pgfrm + (let ((p (point))) + (progn + (shell-command-on-region b e pgfrm (current-buffer) 1) + (goto-char p) + )) + ) + ) + ) + + (defun sql-format-buffer-on-save () + "When saving an SQL buffer, format it with pg_format." + (add-hook 'before-save-hook #'pgformatter-on-region -10 t)) + + (defun nebkor-ksuidgen-p (orig-fn id) + "Check if an ID is a valid ksuid, and if not, return whatever ORIG-FN does." + (or (string-match (rx bol (= 27 alnum) eol) id) + (orig-fn id))) + + (defun nebkor-julid-p (orig-fn id) + "Check if an ID is a valid Julid, and if not, return whatever ORIG-FN does." + (or (string-match (rx bol (= 26 alnum) eol) id) + (orig-fn id))) + + (defun rotate-windows (arg) + "Rotate your windows; use the prefix argument to rotate the other direction" + (interactive "P") + (if (not (> (count-windows) 1)) + (message "You can't rotate a single window!") + (let* ((rotate-times (prefix-numeric-value arg)) + (direction (if (or (< rotate-times 0) (equal arg '(4))) + 'reverse 'identity))) + (dotimes (_ (abs rotate-times)) + (dotimes (i (- (count-windows) 1)) + (let* ((w1 (elt (funcall direction (window-list)) i)) + (w2 (elt (funcall direction (window-list)) (+ i 1))) + (b1 (window-buffer w1)) + (b2 (window-buffer w2)) + (s1 (window-start w1)) + (s2 (window-start w2)) + (p1 (window-point w1)) + (p2 (window-point w2))) + (set-window-buffer-start-and-point w1 b2 s2 p2) + (set-window-buffer-start-and-point w2 b1 s1 p1))))))) + + (provide 'nebkor-functions) +#+end_src + +* The =nebkor-search.el= module :PROPERTIES: :CUSTOM_ID: h:e0f9c30e-3a98-4479-b709-7008277749e4 :END: @@ -2560,7 +2408,7 @@ the basics of search and replace: - =M-s o= (~occur~) :: Search for the given regular expression throughout the buffer and collect the matches in an =*occur*= buffer. Also check what I am doing with this in my custom - extensions: [[#h:b902e6a3-cdd2-420f-bc99-3d973c37cd20][The =unravel-search.el= extras provided by the =prot-search.el= library]]. + extensions: [[#h:b902e6a3-cdd2-420f-bc99-3d973c37cd20][The =nebkor-search.el= extras provided by the =prot-search.el= library]]. - =C-u 5 M-s o= (~occur~) :: Like the above, but give it N lines of context when N is the prefix numeric argument (5 in @@ -2605,14 +2453,16 @@ For starters, just learn: Now on to the configurations. #+end_quote -** The =unravel-search.el= section for heading navigation (~imenu~) +** The =nebkor-search.el= section for heading navigation (~imenu~) :PROPERTIES: :CUSTOM_ID: h:7151F001-75DB-4808-95CB-3BC6BEC6A8CA +:ID: 01JGD333KM000D9V344X6ZW0S9 :END: -~imenu~ is amazing and I use it as my primary tool for navigating any file. Here, we make a small tweak to ensure that ~consult-imenu~ returns good ~imenu~ results to us. +~imenu~ is amazing and I use it as my primary tool for navigating any file. Here, we make a small +tweak to ensure that ~consult-imenu~ returns good ~imenu~ results to us. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" :mkdirp yes (use-package imenu :ensure nil :config @@ -2621,9 +2471,10 @@ Now on to the configurations. (setq imenu-max-item-length 'unlimited)) #+end_src -** The =unravel-search.el= section on relaxed searching (~isearch~) +** The =nebkor-search.el= section on relaxed searching (~isearch~) :PROPERTIES: :CUSTOM_ID: h:95947b37-2071-4ee7-a201-8e19bf3322e9 +:ID: 01JGD333KT0008M1W14VHW2GM3 :END: #+begin_quote @@ -2638,7 +2489,7 @@ do exactly this for regular =C-s= (~isearch-forward~) and =C-r= (~isearch-backward~). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" ;;; Isearch, occur, grep (use-package isearch :ensure nil @@ -2649,9 +2500,10 @@ do exactly this for regular =C-s= (~isearch-forward~) and =C-r= isearch-regexp-lax-whitespace nil)) #+end_src -** The =unravel-search.el= settings for highlighting search results (~isearch~) +** The =nebkor-search.el= settings for highlighting search results (~isearch~) :PROPERTIES: :CUSTOM_ID: h:ed1307e7-f8a0-4b0a-8d91-2de9c1e2479c +:ID: 01JGD333KZ000BSK41M88SBRRC :END: #+begin_quote @@ -2661,7 +2513,7 @@ The rest are done after ~lazy-highlight-initial-delay~ unless they are longer in character count than ~lazy-highlight-no-delay-length~. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" (use-package isearch :ensure nil :demand t @@ -2672,9 +2524,10 @@ longer in character count than ~lazy-highlight-no-delay-length~. (setq lazy-highlight-no-delay-length 4)) #+end_src -** The =unravel-search.el= section on showing search result count (~isearch~) +** The =nebkor-search.el= section on showing search result count (~isearch~) :PROPERTIES: :CUSTOM_ID: h:acfdc17f-7ffb-48d3-90ff-49bd00463934 +:ID: 01JGD333M50003ZSPQA5K0KAE3 :END: #+begin_quote @@ -2684,7 +2537,7 @@ of the current match relative to the total count (like =5/20=). As we move to the next/previous match, the counter is updated accordingly. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" (use-package isearch :ensure nil :demand t @@ -2694,20 +2547,21 @@ move to the next/previous match, the counter is updated accordingly. (setq lazy-count-suffix-format nil)) #+end_src -** The =unravel-search.el= tweaks for the search results in buffer (~occur~) +** The =nebkor-search.el= tweaks for the search results in buffer (~occur~) :PROPERTIES: :CUSTOM_ID: h:85aca4da-b89b-4fbe-89e9-3ec536ad7b0d +:ID: 01JGD333MA00084NRNV8JWJ476 :END: #+begin_quote Here I am making some minor tweaks to =*occur*= buffer (remember to -read the introduction to this section ([[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =unravel-search.el= module]])). +read the introduction to this section ([[#h:e0f9c30e-3a98-4479-b709-7008277749e4][The =nebkor-search.el= module]])). I always want (i) the cursor to be at the top of the buffer, (ii) the current line to be highlighted, as it is easier for selection purposes ... #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" (use-package isearch :ensure nil :demand t @@ -2716,12 +2570,13 @@ purposes ... (add-hook 'occur-mode-hook #'hl-line-mode)) #+end_src -** The =unravel-search.el= section for search key bindings +** The =nebkor-search.el= section for search key bindings :PROPERTIES: :CUSTOM_ID: h:5ce6216d-f318-4191-9d4f-9681c92f7582 +:ID: 01JGD333MG0003B2Q382PGA3FD :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" (use-package isearch :ensure nil :demand t @@ -2735,12 +2590,13 @@ purposes ... ("M-/" . isearch-complete))) #+end_src -** The =unravel-search.el= tweaks to (~xref~), (~re-builder~) and (~grep~) +** The =nebkor-search.el= tweaks to (~xref~), (~re-builder~) and (~grep~) :PROPERTIES: :CUSTOM_ID: h:ceb286c5-a5f7-4cc8-b883-89d20a75ea02 +:ID: 01JGD333MN000F5QC0CDHZ9EJ9 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" ;;; grep and xref (use-package re-builder :ensure nil @@ -2773,14 +2629,15 @@ purposes ... (setq grep-program executable) (setq grep-template (if rgp - "/usr/bin/rg -nH --null -e " - "/usr/bin/grep -nH --null -e ")) + "rg -nH --null -e " + "grep -nH --null -e ")) (setq xref-search-program (if rgp 'ripgrep 'grep)))) #+end_src -** The =unravel-search.el= setup for editable grep buffers (~grep-edit-mode~ or ~wgrep~) +** The =nebkor-search.el= setup for editable grep buffers (~grep-edit-mode~ or ~wgrep~) :PROPERTIES: :CUSTOM_ID: h:9a3581df-ab18-4266-815e-2edd7f7e4852 +:ID: 01JGD333MV000F1CQFCAMH98BR :END: #+begin_quote @@ -2788,14 +2645,14 @@ Starting with Emacs 31, buffers using ~grep-mode~ can now be edited directly. The idea is to collect the results of a search in one place and quickly apply a change across all or some of them. We have the same concept with occur (=M-x occur=) as well as with Dired buffers -([[#h:1b53bc10-8b1b-4f68-bbec-165909761e43][The =unravel-dired.el= section about ~wdired~ (writable Dired)]]). +([[#h:1b53bc10-8b1b-4f68-bbec-165909761e43][The =nebkor-dired.el= section about ~wdired~ (writable Dired)]]). For older versions of Emacs, we have the ~wgrep~ package by Masahiro Hayashi. I configure it to have key bindings like those of the ~occur~ edit mode, which ~grep-edit-mode~ also uses. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" ;;; wgrep (writable grep) ;; See the `grep-edit-mode' for the new built-in feature. (unless (>= emacs-major-version 31) @@ -2812,10 +2669,11 @@ edit mode, which ~grep-edit-mode~ also uses. (setq wgrep-change-readonly-file t))) #+end_src -** The =unravel-search.el= settings for jumping (~avy~) +** The =nebkor-search.el= settings for jumping (~avy~) :PROPERTIES: :CUSTOM_ID: h:4E8593F7-C065-4DFA-B513-98602EC2BA1A :CREATED: [2024-12-02 Mon 08:51] +:ID: 01JGD333N0000AHYGRX0BWJ960 :END: Avy is my favorite package to jump around on an Emacs screen. This @@ -2827,7 +2685,7 @@ section binds my primary entry-point to Avy (~avy-goto-char-timer~) to - When you jump anywhere on the screen using ~avy~, you can return to your starting point by using =C-x C-SPC= (~pop-global-mark~) -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" (use-package avy :ensure t :bind @@ -2864,16 +2722,17 @@ section binds my primary entry-point to Avy (~avy-goto-char-timer~) to (setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark))) #+end_src -** Finally, we provide the =unravel-search.el= module +** Finally, we provide the =nebkor-search.el= module :PROPERTIES: :CUSTOM_ID: h:c8b2f021-fe5a-4f6b-944c-20340f764fb2 +:ID: 01JGD333N6000AK30WV39XVTFZ :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-search.el" -(provide 'unravel-search) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" +(provide 'nebkor-search) #+end_src -* The =unravel-dired.el= module +* The =nebkor-dired.el= module :PROPERTIES: :CUSTOM_ID: h:f8b08a77-f3a8-42fa-b1a9-f940348889c3 :END: @@ -2899,9 +2758,10 @@ the command-line, yet has more powerful interactive features than even fully fledged, graphical file managers. #+end_quote -** The =unravel-dired.el= settings for common operations +** The =nebkor-dired.el= settings for common operations :PROPERTIES: :CUSTOM_ID: h:39fb0eab-54bb-4e5b-8e38-9443dbe5c5ee +:ID: 01JGD333NB00015DHSKF3MV4D0 :END: #+begin_quote @@ -2916,10 +2776,10 @@ Depending on the system, files in the trash are either removed automatically after a few days, or we still have to permanently delete them manually. I prefer this extra layer of safety. Plus, we have the ~trashed~ package to navigate the trash folder in a Dired-like way -([[#h:2e005bd1-d098-426d-91f9-2a31a6e55caa][The =unravel-dired.el= section about =trashed.el=]]). +([[#h:2e005bd1-d098-426d-91f9-2a31a6e55caa][The =nebkor-dired.el= section about =trashed.el=]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" :mkdirp yes ;;; Dired file manager and prot-dired.el extras (use-package dired :ensure nil @@ -2930,14 +2790,15 @@ them manually. I prefer this extra layer of safety. Plus, we have the (setq delete-by-moving-to-trash t)) #+end_src -** The =unravel-dired.el= switches for how files are listed (~ls~) +** The =nebkor-dired.el= switches for how files are listed (~ls~) :PROPERTIES: :CUSTOM_ID: h:679e4460-b306-450f-aa20-497243057e02 +:ID: 01JGD333NH000CD2S51Z1KSVES :END: #+begin_quote As I already explained, Dired is a layer of interactivity on top of -standard Unix tools ([[#h:f8b08a77-f3a8-42fa-b1a9-f940348889c3][The =unravel-dired.el= module]]). We can see +standard Unix tools ([[#h:f8b08a77-f3a8-42fa-b1a9-f940348889c3][The =nebkor-dired.el= module]]). We can see this in how Dired produces the file listing and how we can affect it. The ~ls~ program accepts an =-l= flag for a "long", detailed list of files. This is what Dired uses. But we can pass more flags by setting @@ -2957,7 +2818,7 @@ for the ~ls~ manpage to learn about what I have here. In short: the =@= and the =>= are for stuff I have never seen. - =-h= :: Make file sizes easier to read, such as =555k= instead of - =568024= (the size of =unravel.org= as of this writing). + =568024= (the size of =nebkor.org= as of this writing). - =-l= :: Produce a long, detailed listing. Dired requires this. @@ -2975,20 +2836,21 @@ for the ~ls~ manpage to learn about what I have here. In short: =2023-12-30 06:38= to show the last modified time. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package dired :ensure nil :commands (dired) :config (setq insert-directory-program - (or (executable-find "gls") "/opt/homebrew/bin/gls")) + (or (executable-find "ls") "/opt/homebrew/bin/gls")) (setq dired-listing-switches "-AGFhlv --group-directories-first --time-style=long-iso")) #+end_src -** The =unravel-dired.el= setting for dual-pane Dired +** The =nebkor-dired.el= setting for dual-pane Dired :PROPERTIES: :CUSTOM_ID: h:8225364c-3856-48bc-bf64-60d40ddd3320 +:ID: 01JGD333NP000FDB23RX1HP32F :END: #+begin_quote @@ -3003,10 +2865,10 @@ target is the previously visited window. Note that this only affects how quickly we can access the default value, as we can always type =M-p= (~previous-history-element~) and =M-n= (~next-history-element~) to cycle through the minibuffer -history ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =unravel-completion.el= settings for saving the history (~savehist-mode~)]]). +history ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =nebkor-completion.el= settings for saving the history (~savehist-mode~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package dired :ensure nil :commands (dired) @@ -3014,9 +2876,10 @@ history ([[#h:25765797-27a5-431e-8aa4-cc890a6a913a][The =unravel-completion.el= (setq dired-dwim-target t)) #+end_src -** The =unravel-dired.el= miscellaneous tweaks +** The =nebkor-dired.el= miscellaneous tweaks :PROPERTIES: :CUSTOM_ID: h:6327e6ba-a468-416f-ad26-b530c32fe235 +:ID: 01JGD333NW00067R4QF0AC2SGH :END: #+begin_quote @@ -3024,14 +2887,14 @@ These are some minor tweaks that I do not really care about. The only one which is really nice in my opinion is the hook that involves the ~dired-hide-details-mode~. This is the command that hides the noisy output of the ~ls~ =-l= flag, leaving only the file names in the list -([[#h:679e4460-b306-450f-aa20-497243057e02][The =unravel-dired.el= switches for ~ls~ (how files are listed)]]). +([[#h:679e4460-b306-450f-aa20-497243057e02][The =nebkor-dired.el= switches for ~ls~ (how files are listed)]]). We can toggle this effect at any time with the =(= key, by default. I disable the repetition of the =j= key as I do use ~repeat-mode~ -([[#h:fbe6f9da-25ee-46a3-bb03-8fa7c1d48dab][The =unravel-essentials.el= settings for ~repeat-mode~]]). +([[#h:fbe6f9da-25ee-46a3-bb03-8fa7c1d48dab][The =nebkor-essentials.el= settings for ~repeat-mode~]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package dired :ensure nil :commands (dired) @@ -3050,10 +2913,11 @@ I disable the repetition of the =j= key as I do use ~repeat-mode~ (define-key dired-jump-map (kbd "j") nil)) #+end_src -** The =unravel-dired.el= section for using multi-occur (~noccur~) +** The =nebkor-dired.el= section for using multi-occur (~noccur~) :PROPERTIES: :CUSTOM_ID: h:6EA8DE69-4FA3-48CE-BAF7-066680675AD7 :CREATED: [2024-12-29 Sun 20:51] +:ID: 01JGD333R20000VGT6DPM8C86F :END: ~multi-occur~ is brilliant. But most of the times, I do not have all @@ -3063,9 +2927,9 @@ buffer using ~denote-sort~, and then use ~noccur-dired~ on it. This tiny function is super-handy, and it's taken from the ~noccur~ package (because that's all I need from that package) -(see: [[#h:e86a66dc-7ef9-4f09-ad7e-946de2034e8d][The =unravel-study.el= section for notes and file-naming (~denote~)]]) +(see: [[#h:e86a66dc-7ef9-4f09-ad7e-946de2034e8d][The =nebkor-study.el= section for notes and file-naming (~denote~)]]) -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" ;;; Multi-occur in project and dired! (use-package dired :ensure nil @@ -3081,9 +2945,10 @@ tiny function is super-handy, and it's taken from the ~noccur~ package #+end_src -** The =unravel-dired.el= section about various conveniences +** The =nebkor-dired.el= section about various conveniences :PROPERTIES: :CUSTOM_ID: h:6758bf16-e47e-452e-b39d-9d67c2b9aa4b +:ID: 01JGD333R80003W7TM8MHB2C93 :END: #+begin_quote @@ -3100,10 +2965,10 @@ are: deletion of buffers related to files that we delete from Dired. - the key binding for ~dired-do-open~, which opens the file or - directory externally ([[#h:d7d5e619-3d50-4d9e-a951-7262462a60c9][The =unravel-dired.el= settings to open files externally]]). + directory externally ([[#h:d7d5e619-3d50-4d9e-a951-7262462a60c9][The =nebkor-dired.el= settings to open files externally]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package dired-aux :ensure nil :after dired @@ -3134,9 +2999,10 @@ are: (setq dired-bind-info nil)) #+end_src -** The =unravel-dired.el= section about subdirectory contents (~dired-subtree~) +** The =nebkor-dired.el= section about subdirectory contents (~dired-subtree~) :PROPERTIES: :CUSTOM_ID: h:3a4a29bc-3491-4d01-9d64-1cef63b3116a +:ID: 01JGD333RE000AB6XV70AYHGEH :END: #+begin_quote @@ -3150,7 +3016,7 @@ I do not use this feature frequently, though I appreciate it when I do need it. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package dired-subtree :ensure t :after dired @@ -3164,24 +3030,25 @@ need it. (setq dired-subtree-use-backgrounds nil)) #+end_src -** The =unravel-dired.el= section about writable Dired (~wdired~) +** The =nebkor-dired.el= section about writable Dired (~wdired~) :PROPERTIES: :CUSTOM_ID: h:1b53bc10-8b1b-4f68-bbec-165909761e43 +:ID: 01JGD333RM0006N67R3T2F0MNZ :END: #+begin_quote As noted in the introduction, Dired can be made writable -([[#h:f8b08a77-f3a8-42fa-b1a9-f940348889c3][The =unravel-dired.el= module]]). This way, we can quickly rename +([[#h:f8b08a77-f3a8-42fa-b1a9-f940348889c3][The =nebkor-dired.el= module]]). This way, we can quickly rename multiple files using Emacs' panoply of editing capabilities. Both of the variables I configure here have situational usage. I cannot remember the last time I benefited from them. Note that we have a variant of ~wdired~ for ~grep~ buffers -([[#h:9a3581df-ab18-4266-815e-2edd7f7e4852][The =unravel-search.el= setup for editable grep buffers (~wgrep~)]]). +([[#h:9a3581df-ab18-4266-815e-2edd7f7e4852][The =nebkor-search.el= setup for editable grep buffers (~wgrep~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" (use-package wdired :ensure nil :commands (wdired-change-to-wdired-mode) @@ -3190,9 +3057,10 @@ Note that we have a variant of ~wdired~ for ~grep~ buffers (setq wdired-create-parent-directories t)) #+end_src -** The =unravel-dired.el= section about moving to Trash (~trashed~) +** The =nebkor-dired.el= section about moving to Trash (~trashed~) :PROPERTIES: :CUSTOM_ID: h:2e005bd1-d098-426d-91f9-2a31a6e55caa +:ID: 01JGD333RS000DC92B8GQB57VC :END: The ~trashed~ package by Shingo Tanaka provides a Dired-like interface @@ -3201,7 +3069,7 @@ restore a file, I do =M-x trashed=, then type =r= to mark the file to be restored (=M-x trashed-flag-restore=), and then type =x= (=M-x trashed-do-execute=) to apply the effect. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" ;;; dired-like mode for the trash (trashed.el) (use-package trashed :ensure t @@ -3213,16 +3081,17 @@ to apply the effect. (setq trashed-date-format "%Y-%m-%d %H:%M:%S")) #+end_src -** Finally, we provide the =unravel-dired.el= module +** Finally, we provide the =nebkor-dired.el= module :PROPERTIES: :CUSTOM_ID: h:c8b2f021-fe5a-4f6b-944c-20340f764fb2 +:ID: 01JGD333RY000FC7EQB90W9RSC :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-dired.el" -(provide 'unravel-dired) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" +(provide 'nebkor-dired) #+end_src -* The =unravel-window.el= module +* The =nebkor-window.el= module :PROPERTIES: :CUSTOM_ID: h:b5fa481d-8549-4424-869e-91091cdf730b :END: @@ -3232,9 +3101,10 @@ This module is all about buffers and windows. How they are managed and displayed. #+end_quote -** The =unravel-window.el= section about uniquifying buffer names +** The =nebkor-window.el= section about uniquifying buffer names :PROPERTIES: :CUSTOM_ID: h:cfbea29c-3290-4fd1-a02a-d7e887c15674 +:ID: 01JGD333S40001750PN9KWYHGB :END: #+begin_quote @@ -3258,7 +3128,7 @@ I use the =forward= style, which is the closest to the actual file name. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" ;;; General window and buffer configurations (use-package uniquify :ensure nil @@ -3269,162 +3139,8 @@ name. (setq uniquify-after-kill-buffer-p t)) #+end_src -** The =unravel-window.el= rules for displaying buffers (~display-buffer-alist~) -:PROPERTIES: -:CUSTOM_ID: h:50f8b1e4-b14e-453f-a37e-1c0e495ab80f -:END: -[ Watch Prot's talk: [[https://protesilaos.com/codelog/2024-02-08-emacs-window-rules-display-buffer-alist/][control where buffers are displayed (the ~display-buffer-alist~)]] (2024-02-08). ] - -#+begin_quote -The ~display-buffer-alist~ is a powerful user option and somewhat hard -to get started with. The reason for its difficulty comes from the -knowledge required to understand the underlying ~display-buffer~ -mechanism. - -Here is the gist of what we do with it: - -- The alist is a list of lists. -- Each element of the alist (i.e. one of the lists) is of the - following form: - - #+begin_example - (BUFFER-MATCHER - FUNCTIONS-TO-DISPLAY-BUFFER - OTHER-PARAMETERS) - #+end_example - -- The =BUFFER-MATCHER= is either a regular expression to match the - buffer by its name or a method to get the buffer whose major mode is - the one specified. In the latter case, you will see the use of cons - cells (like =(one . two)=) involving the ~derived-mode~ symbol - (remember that I build Emacs from source, so ~derived-mode~ may not - exist in your version of Emacs). - -- The =FUNCTIONS-TO-DISPLAY-BUFFER= is a list of ~display-buffer~ - functions that are tried in the order they appear in until one - works. The list can be of one element, as you will notice with some - of my entries. - -- The =OTHER-PARAMETERS= are enumerated in the Emacs Lisp Reference - Manual. Evaluate: - - #+begin_src emacs-lisp - (info "(elisp) Buffer Display Action Alists") - #+end_src - -In my =prot-window.el= library, I define functions that determine how -a buffer should be displayed, given size considerations ([[#h:35b8a0a5-c447-4301-a404-bc274596238d][The =prot-window.el= library]]). -You will find the functions ~prot-window-shell-or-term-p~ to determine -what a shell or terminal is, ~prot-window-display-buffer-below-or-pop~ -to display the buffer below the current one or to its side depending -on how much width is available, and ~prot-window-select-fit-size~ to -perform the two-fold task of selecting a window and making it fit up -to a certain height. -#+end_quote - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" - ;;;; `window', `display-buffer-alist', and related - (use-package prot-window - :ensure nil - :demand t - :config - ;; NOTE 2023-03-17: Remember that I am using development versions of - ;; Emacs. Some of my `display-buffer-alist' contents are for Emacs - ;; 29+. - (setq display-buffer-alist - `(;; no window - ("\\`\\*Async Shell Command\\*\\'" - (display-buffer-no-window)) - ("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'" - (display-buffer-no-window) - (allow-no-window . t)) - ;; bottom side window - ("\\*Org \\(Select\\|Note\\)\\*" ; the `org-capture' key selection and `org-add-log-note' - (display-buffer-in-side-window) - (dedicated . t) - (side . bottom) - (slot . 0) - (window-parameters . ((mode-line-format . none)))) - ;; bottom buffer (NOT side window) - ((or . ((derived-mode . flymake-diagnostics-buffer-mode) - (derived-mode . flymake-project-diagnostics-mode) - (derived-mode . messages-buffer-mode) - (derived-mode . backtrace-mode))) - (display-buffer-reuse-mode-window display-buffer-at-bottom) - (window-height . 0.3) - (dedicated . t) - (preserve-size . (t . t))) - ("\\*Embark Actions\\*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . fit-window-to-buffer) - (window-parameters . ((no-other-window . t) - (mode-line-format . none)))) - ("\\*\\(Output\\|Register Preview\\).*" - (display-buffer-reuse-mode-window display-buffer-at-bottom)) - ;; below current window - ("\\(\\*Capture\\*\\|CAPTURE-.*\\)" - (display-buffer-reuse-mode-window display-buffer-below-selected)) - ("\\*\\vc-\\(incoming\\|outgoing\\|git : \\).*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . 0.1) - (dedicated . t) - (preserve-size . (t . t))) - ((derived-mode . reb-mode) ; M-x re-builder - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . 4) ; note this is literal lines, not relative - (dedicated . t) - (preserve-size . (t . t))) - ((or . ((derived-mode . occur-mode) - (derived-mode . grep-mode) - (derived-mode . Buffer-menu-mode) - (derived-mode . log-view-mode) - (derived-mode . help-mode) ; See the hooks for `visual-line-mode' - "\\*\\(|Buffer List\\|Occur\\|vc-change-log\\|eldoc.*\\).*" - prot-window-shell-or-term-p - ;; ,world-clock-buffer-name - )) - (prot-window-display-buffer-below-or-pop) - (body-function . prot-window-select-fit-size)) - ("\\*\\(Calendar\\|Bookmark Annotation\\|ert\\).*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (dedicated . t) - (window-height . fit-window-to-buffer)) - ;; same window - ;; NOTE 2023-02-17: `man' does not fully obey the - ;; `display-buffer-alist'. It works for new frames and for - ;; `display-buffer-below-selected', but otherwise is - ;; unpredictable. See `Man-notify-method'. - ((or . ((derived-mode . Man-mode) - (derived-mode . woman-mode) - "\\*\\(Man\\|woman\\).*")) - (display-buffer-same-window))))) -#+end_src - -#+begin_quote -The following settings are relevant for the ~display-buffer-alist~ we -saw right above. Notice, in particular, the ~split-height-threshold~ -and ~split-width-threshold~ which determine when to split the frame by -height or width. These are relevant for ~prot-window-display-buffer-below-or-pop~ -and the other more basic functions I have defined for this purpose. -#+end_quote - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" -(use-package prot-window - :ensure nil - :demand t - :config - (setq window-combination-resize t) - (setq even-window-sizes 'height-only) - (setq window-sides-vertical nil) - (setq switch-to-buffer-in-dedicated-window 'pop) - (setq split-height-threshold 80) - (setq split-width-threshold 125) - (setq window-min-height 3) - (setq window-min-width 30)) -#+end_src - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" (use-package window :ensure nil :config @@ -3432,12 +3148,13 @@ and the other more basic functions I have defined for this purpose. (setq recenter-positions '(top middle bottom))) #+end_src -** The =unravel-window.el= section about frame-oriented workflows (~beframe~) +** The =nebkor-window.el= section about frame-oriented workflows (~beframe~) :PROPERTIES: :CUSTOM_ID: h:77e4f174-0c86-460d-8a54-47545f922ae9 +:ID: 01JGD333T4000B6PCT3N2X2M84 :END: -[ Also see: [[#h:7dcbcadf-8af6-487d-b864-e4ce56d69530][The =unravel-git.el= section about =project.el=]]. ] +[ Also see: [[#h:7dcbcadf-8af6-487d-b864-e4ce56d69530][The =nebkor-git.el= section about =project.el=]]. ] #+begin_quote My ~beframe~ package enables a frame-oriented Emacs workflow where @@ -3460,14 +3177,14 @@ best changes I ever did to boost my productivity: Some notes on how I use beframe: - I add ~beframe~ as a source for ~consult-buffers~. - + This code comes from the ~beframe~ manual and lets me look at frame-specific buffers first when using ~consult-buffer~ (=M-s M-b=) ([[#h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d][The =unravel-completion.el= settings for ~consult~]]) + + This code comes from the ~beframe~ manual and lets me look at frame-specific buffers first when using ~consult-buffer~ (=M-s M-b=) ([[#h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d][The =nebkor-completion.el= settings for ~consult~]]) - I replace the default =C-x b= (~switch-to-buffer~) with the beframe'd version of the same command. + This lets me focus on the buffers in the current frame, which is what I generally want. When I need to access files or buffers which are not open yet, I use either: - The consult version of the command (=M-s M-b=) - ~project.el~ to find a file in the current project (=C-x p f=) - When I am done with the frame, I delete all the buffers in the frame using ~beframe-kill-buffers-matching-regexp~ (=C-c b k=) with regex ~*~. This automatically kills the frame. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" ;;; Frame-isolated buffers ;; Another package of mine. Read the manual: ;; . @@ -3512,53 +3229,11 @@ Some notes on how I use beframe: (add-to-list 'consult-buffer-sources 'beframe-consult-source))) #+end_src -** The =unravel-window.el= configuration of window layouts (~undelete-frame-mode~ and ~winner-mode~) -:PROPERTIES: -:CUSTOM_ID: h:2df15080-77f9-45f8-a3b5-1adddc70a512 -:END: - -#+begin_quote -Since I am using my ~beframe~ package to isolate buffers per frame -([[#h:77e4f174-0c86-460d-8a54-47545f922ae9][The =unravel-window.el= section about ~beframe~]]), I appreciate the -feature of Emacs 29 to undo the deletion of frames. Note the key -binding I use for this purpose. It overrides one of the alternatives -for the standard ~undo~ command, though I personally only ever use -=C-/=: everything else is free to use as I see fit. -#+end_quote - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" -;;; Frame history (undelete-frame-mode) -(use-package frame - :ensure nil - :bind ("C-x u" . undelete-frame) ; I use only C-/ for `undo' - :hook (elpaca-after-init . undelete-frame-mode)) -#+end_src - -#+begin_quote -The ~winner-mode~ is basically the same idea as ~undelete-frame-mode~ -but for window layouts. Or maybe I should phrase this the other way -round, given that ~winner~ is the older package. But the point is that -we can quickly go back to an earlier arrangement of windows in a -frame. -#+end_quote - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" -;;; Window history (winner-mode) -(use-package winner - :ensure nil - :hook (elpaca-after-init . winner-mode) - :bind - (("C-x " . winner-redo) - ("C-x " . winner-undo))) -#+end_src - -** COMMENT The =unravel-window.el= use of contextual header line (~breadcrumb~) +** The =nebkor-window.el= use of contextual header line (~breadcrumb~) :PROPERTIES: :CUSTOM_ID: h:29ced61b-4b5a-4f63-af00-fe311468d1cd :END: -~breadcrumb~ is an interesting package when demo'ing something, but not useful to me in day-to-day use. Commenting it out until I need it. - #+begin_quote The ~breadcrumb~ package by João Távora lets us display contextual information about the current heading or code definition in the header @@ -3568,7 +3243,7 @@ see the path to the file, followed by a reference to the tree that leads to the current heading. Same idea for programming modes. Neat! #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" ;;; Header line context of symbol/heading (breadcrumb.el) (use-package breadcrumb :ensure t @@ -3586,40 +3261,17 @@ leads to the current heading. Same idea for programming modes. Neat! (breadcrumb-local-mode 1)))) #+end_src -** The =unravel-window.el= section for Zone (~zone~) - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" - (use-package zone - :ensure nil - :config - (zone-when-idle 300)) -#+end_src - -** The =unravel-window.el= section for displaying time -:PROPERTIES: -:CUSTOM_ID: h:8E669AD7-D3BC-4168-AFAD-C6D4A25AF860 -:END: - -I like being able to see the time in the modeline. - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" - (use-package time - :ensure nil - :config - (setq display-time-day-and-date t) - (display-time)) -#+end_src - -** Finally, we provide the =unravel-window.el= module +** Finally, we provide the =nebkor-window.el= module :PROPERTIES: :CUSTOM_ID: h:2124c200-734d-49c4-aeb1-513caaf957ae +:ID: 01JGD333VG000B35SFF4PD7TFS :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-window.el" -(provide 'unravel-window) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" +(provide 'nebkor-window) #+end_src -* The =unravel-git.el= module +* The =nebkor-git.el= module :PROPERTIES: :CUSTOM_ID: h:65e3eff5-0bff-4e1f-b6c5-0d3aa1a0d232 :END: @@ -3632,9 +3284,10 @@ widely for tools related to checking different versions of files and working with so-called "projects". #+end_quote -** The =unravel-git.el= section about ediff +** The =nebkor-git.el= section about ediff :PROPERTIES: :CUSTOM_ID: h:89edea05-4d94-4ea1-b2a8-5ad01422618c +:ID: 01JGD333VP0003NXM8W068900N :END: [ Watch Prot's talk: [[https://protesilaos.com/codelog/2023-11-17-emacs-ediff-basics/][Emacs: ediff basics]] (2023-12-30) ] @@ -3655,10 +3308,10 @@ commands ~ediff-files~, ~ediff-buffers~. Sometimes I use the 3-way variants with ~ediff-files3~ and ~ediff-buffers3~, though this is rare. Do watch the video I link to in the beginning of this section, as it covers the main functionality of this neat tool. I also show how it -integrates with ~magit~ ([[#h:b08af527-9ebf-4425-ac3a-24b4f371a4fd][The =unravel-git.el= section about ~magit~ (great Git client)]]). +integrates with ~magit~ ([[#h:b08af527-9ebf-4425-ac3a-24b4f371a4fd][The =nebkor-git.el= section about ~magit~ (great Git client)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-git.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" :mkdirp yes ;;;; `ediff' (use-package ediff :ensure nil @@ -3673,9 +3326,10 @@ integrates with ~magit~ ([[#h:b08af527-9ebf-4425-ac3a-24b4f371a4fd][The =unravel (setq ediff-show-clashes-only t)) #+end_src -** The =unravel-git.el= section about project management (~project~) +** The =nebkor-git.el= section about project management (~project~) :PROPERTIES: :CUSTOM_ID: h:7dcbcadf-8af6-487d-b864-e4ce56d69530 +:ID: 01JGD333VV0001W3ABZ22GE6QE :END: #+begin_quote @@ -3683,7 +3337,7 @@ In Emacs parlance, a "project" is a collection of files and/or directories that share the same root. The root of a project is identified by a special file or directory, with =.git/= being one of the defaults as it is a version control system supported by the -built-in =vc.el= ([[#h:50add1d8-f0f4-49be-9e57-ab280a4aa300][The =unravel-git.el= section about =vc.el= and related]]). +built-in =vc.el= ([[#h:50add1d8-f0f4-49be-9e57-ab280a4aa300][The =nebkor-git.el= section about =vc.el= and related]]). We can specify more project roots as a list of strings in the user option ~project-vc-extra-root-markers~. I work exclusively with Git @@ -3722,10 +3376,10 @@ out their action. I combine projects with my ~beframe~ package, so that when I switch to a project I get a new frame that limits the buffers I visit there -limited to that frame ([[#h:77e4f174-0c86-460d-8a54-47545f922ae9][The =unravel-window.el= section about ~beframe~]]). +limited to that frame ([[#h:77e4f174-0c86-460d-8a54-47545f922ae9][The =nebkor-window.el= section about ~beframe~]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-git.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" ;;;; `project' (use-package project :ensure nil @@ -3747,12 +3401,13 @@ limited to that frame ([[#h:77e4f174-0c86-460d-8a54-47545f922ae9][The =unravel-w (setq project-key-prompt-style t)) ; Emacs 30 #+end_src -** The =unravel-git.el= section about diff management (~diff-mode~) +** The =nebkor-git.el= section about diff management (~diff-mode~) :PROPERTIES: :CUSTOM_ID: h:8b426a69-e3cd-42ac-8788-f41f6629f879 +:ID: 01JGD333W1000101YRR8RRSWV4 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-git.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" ;;;; `diff-mode' (use-package diff-mode :ensure nil @@ -3767,9 +3422,10 @@ limited to that frame ([[#h:77e4f174-0c86-460d-8a54-47545f922ae9][The =unravel-w (setq diff-font-lock-syntax 'hunk-also)) #+end_src -** The =unravel-git.el= section about using Git (~magit~) +** The =nebkor-git.el= section about using Git (~magit~) :PROPERTIES: :CUSTOM_ID: h:b08af527-9ebf-4425-ac3a-24b4f371a4fd +:ID: 01JGD333W6000B0WS815JQZTE7 :END: #+begin_quote @@ -3802,7 +3458,7 @@ such as for viewing commit logs, setting the remotes, switching branches, etc. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-git.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" ;;; Interactive and powerful git front-end (Magit) (use-package magit :ensure t @@ -3834,18 +3490,19 @@ branches, etc. '(("~/src/prototypes" . 1)))) #+end_src -** Finally, we provide the =unravel-git.el= module +** Finally, we provide the =nebkor-git.el= module :PROPERTIES: :CUSTOM_ID: h:4e7035c5-9350-4c51-be85-85f2539ed295 +:ID: 01JGD333WC0000QX1SSCQEWGT7 :END: Finally, we ~provide~ the module. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-git.el" -(provide 'unravel-git) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" +(provide 'nebkor-git) #+end_src -* The =unravel-org.el= module +* The =nebkor-org.el= module :PROPERTIES: :CUSTOM_ID: h:d799c3c0-bd6a-40bb-bd1a-ba4ea5367840 :END: @@ -3891,7 +3548,7 @@ otherwise plain text notation. Some of the headline features: your time. - Link to files regardless of file type. This includes special links such as to an Info manual or an email, if you also have that running - locally and integrated with Emacs ([[#h:755e195b-9471-48c7-963b-33055969b4e2][The =unravel-email.el= module]]). + locally and integrated with Emacs ([[#h:755e195b-9471-48c7-963b-33055969b4e2][The =nebkor-email.el= module]]). In other words, Org is highly capable and widely considered one of the killer apps of Emacs. @@ -3901,9 +3558,10 @@ it is not limited to Org, as some other built-in features are also relevant here. #+end_quote -** The =unravel-org.el= section on (~calendar~) +** The =nebkor-org.el= section on (~calendar~) :PROPERTIES: :CUSTOM_ID: h:94d48381-1711-4d6b-8449-918bc1e3836c +:ID: 01JGD333WH0003P7D9T0K7JKQ4 :END: #+begin_quote @@ -3916,7 +3574,7 @@ Note that Emacs also has a ~diary~ command. I used it for a while, but Org is far more capable, so I switched to it completely. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" :mkdirp yes ;;; Calendar (use-package calendar :ensure nil @@ -3941,9 +3599,10 @@ Org is far more capable, so I switched to it completely. (setq calendar-daylight-time-zone-name "+0300")) #+end_src -** The =unravel-org.el= section about appointment reminders (~appt~) +** The =nebkor-org.el= section about appointment reminders (~appt~) :PROPERTIES: :CUSTOM_ID: h:bd4b0dcb-a925-4bd7-90db-6379a7ca6f5e +:ID: 01JGD333WQ000EYDFGKCTMGP6N :END: #+begin_quote @@ -3951,7 +3610,7 @@ The built in =appt.el= defines functionality for handling notifications about appointments. It is originally designed to work with the generic diary feature (the =M-x diary= one, I mean), which I do not use anymore, but also integrates nicely with the Org agenda -([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =unravel-org.el= Org agenda settings]]). I deepen this +([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =nebkor-org.el= Org agenda settings]]). I deepen this integration further, such that after adding a task or changing its state, the appointments mechanism re-reads my data to register new notifications. This is done via a series of hooks and with the use of @@ -3965,10 +3624,10 @@ many minutes are left until the event. In Org files, every heading can have an =APPT_WARNTIME= property: it takes a numeric value representing minutes for a forewarning from =appt.el=. I use this in tandem with ~org-capture~ for tasks that need to be -done at a specific time, such as coaching sessions ([[#h:f8f06938-0dfe-45c3-b4cf-996d36cba82d][The =unravel-org.el= Org capture templates (~org-capture~)]]). +done at a specific time, such as coaching sessions ([[#h:f8f06938-0dfe-45c3-b4cf-996d36cba82d][The =nebkor-org.el= Org capture templates (~org-capture~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; Appt (appointment reminders which also integrate with Org agenda) (use-package appt :ensure nil @@ -3989,21 +3648,23 @@ done at a specific time, such as coaching sessions ([[#h:f8f06938-0dfe-45c3-b4cf (org-agenda-to-appt))) #+end_src -** The =unravel-org.el= section on paragraphs +** The =nebkor-org.el= section on paragraphs :PROPERTIES: :CUSTOM_ID: h:71AF485F-9C6B-4936-B50F-3A126663FFB0 +:ID: 01JGD333WX0000S737A5GHEDRA :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" (use-package emacs :ensure nil :config (setq sentence-end-double-space nil)) #+end_src -** The =unravel-org.el= section with basic Org settings +** The =nebkor-org.el= section with basic Org settings :PROPERTIES: :CUSTOM_ID: h:e03df1e0-b43e-49b5-978e-6a511165617c +:ID: 01JGD333X300013BMYP0MPMW75 :END: By default, Org looks for files in the =~/org= directory. If you want to use a location other than the default localtion for your ~org-mode~ files, set the environment variable ~ORG_DIRECTORY~. @@ -4043,7 +3704,7 @@ any configuration. The following sections contain further commentary on how I use Org. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; Org-mode (personal information manager) (use-package org :ensure nil @@ -4106,15 +3767,16 @@ on how I use Org. (setq org-track-ordered-property-with-tag t)) #+end_src -** The =unravel-org.el= section for archival settings +** The =nebkor-org.el= section for archival settings :PROPERTIES: :CUSTOM_ID: h:119A0C7D-03E1-41D0-AC98-F14FD92245F1 :CREATED: [2024-11-28 Thu 11:46] +:ID: 01JGD333X9000CTWDYYA5XGGSR :END: -I like all my archived files to sit in a single location, because I generally do not refer to archived notes unless I am specifically looking for something. Note that these settings depend on the ~org-directory~ being set ([[#h:e03df1e0-b43e-49b5-978e-6a511165617c][The =unravel-org.el= section with basic Org settings]]) +I like all my archived files to sit in a single location, because I generally do not refer to archived notes unless I am specifically looking for something. Note that these settings depend on the ~org-directory~ being set ([[#h:e03df1e0-b43e-49b5-978e-6a511165617c][The =nebkor-org.el= section with basic Org settings]]) -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; archival, org-archive (use-package org :ensure nil @@ -4125,14 +3787,15 @@ I like all my archived files to sit in a single location, because I generally do (setq org-archive-location (concat org-archive-directory "/%s_archive::"))) #+end_src -** The =unravel-org.el= section for narrowing and folding +** The =nebkor-org.el= section for narrowing and folding :PROPERTIES: :CUSTOM_ID: h:D11C6331-86BB-466D-AF65-A2A50F49A808 :CREATED: [2024-11-28 Thu 15:55] +:ID: 01JGD333XF0007SC5KTFAQ8KGV :END: Narrowing and folding are really powerful ways of working with org-mode, since we tend to create so many nodes and subtrees when we write documents in Org -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; Narrowing and Folding (use-package org :ensure nil @@ -4147,9 +3810,10 @@ Narrowing and folding are really powerful ways of working with org-mode, since w :config (setq org-fold-catch-invisible-edits 'show-and-error)) #+end_src -** The =unravel-org.el= Org to-do and refile settings +** The =nebkor-org.el= Org to-do and refile settings :PROPERTIES: :CUSTOM_ID: h:024dd541-0061-4a10-b10b-b17dcd4794b9 +:ID: 01JGD333XN000CM4ZSYQ6HA3E5 :END: #+begin_quote @@ -4165,14 +3829,14 @@ as it is more precise. Whenever a task state changes, we can log that event in a special =LOGBOOK= drawer. This is automatically placed right below the heading, before any paragraph text. Logging data is an opt-in feature, -which I consider helpful ([[#h:0884658e-9eb5-47e3-9338-66e09004a1a0][The =unravel-org.el= Org time/state logging]]). +which I consider helpful ([[#h:0884658e-9eb5-47e3-9338-66e09004a1a0][The =nebkor-org.el= Org time/state logging]]). Tasks can be associated with timestamps, typically a scheduled date+time or a deadline+time. This can be helpful when we are reviewing the source Org file, though it really shines in tandem with the agenda. Any heading that has a timestamp and which belongs to a file in the ~org-agenda-files~ will show up on the agenda in the given -date ([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =unravel-org.el= Org agenda settings]]). +date ([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =nebkor-org.el= Org agenda settings]]). By default, the ~org-todo-keywords~ are =TODO= and =DONE=. We can write more keywords if we wish to implement a descriptive workflow. @@ -4209,10 +3873,10 @@ up, all the agenda files plus the current file's headings up to level In terms of workflow, I have not done a refile in a very long time, because my entries always stay in the same place as I had envisaged at -the capture phase ([[#h:f8f06938-0dfe-45c3-b4cf-996d36cba82d][The =unravel-org.el= Org capture templates (~org-capture~)]]). +the capture phase ([[#h:f8f06938-0dfe-45c3-b4cf-996d36cba82d][The =nebkor-org.el= Org capture templates (~org-capture~)]]). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; refile, todo (use-package org :ensure nil @@ -4248,9 +3912,10 @@ the capture phase ([[#h:f8f06938-0dfe-45c3-b4cf-996d36cba82d][The =unravel-org.e (setq org-enforce-todo-checkbox-dependencies t)) #+end_src -** The =unravel-org.el= Org heading tags +** The =nebkor-org.el= Org heading tags :PROPERTIES: :CUSTOM_ID: h:81de4e32-a1af-4e1f-9e10-90eb0c90afa2 +:ID: 01JGD333ZY0005VCWP14FFR51P :END: #+begin_quote @@ -4264,11 +3929,11 @@ heading text. Tagging is useful for searching and retrieving the data we store. The Org agenda, in particular, provides commands to filter tasks by tag: -- [[#h:024dd541-0061-4a10-b10b-b17dcd4794b9][The =unravel-org.el= Org to-do and refile settings]] -- [[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =unravel-org.el= Org agenda settings]] +- [[#h:024dd541-0061-4a10-b10b-b17dcd4794b9][The =nebkor-org.el= Org to-do and refile settings]] +- [[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =nebkor-org.el= Org agenda settings]] #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; tags (use-package org :ensure nil @@ -4306,13 +3971,14 @@ Org agenda, in particular, provides commands to filter tasks by tag: (setq org-tags-column 0)) #+end_src -** The =unravel-org.el= Org priorities settings +** The =nebkor-org.el= Org priorities settings :PROPERTIES: :CUSTOM_ID: h:5D8AF9BA-E1D5-4908-834D-E21718199D88 :CREATED: [2024-11-30 Sat 16:33] +:ID: 01JGD3340400041EGA7QK2YKN3 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; org-priorities (use-package org :ensure nil @@ -4322,22 +3988,23 @@ Org agenda, in particular, provides commands to filter tasks by tag: (setq org-default-priority ?A) (setq org-priority-faces nil)) #+end_src -** The =unravel-org.el= Org time/state logging +** The =nebkor-org.el= Org time/state logging :PROPERTIES: :CUSTOM_ID: h:0884658e-9eb5-47e3-9338-66e09004a1a0 +:ID: 01JGD3340B0000D3SPSA10CMC8 :END: #+begin_quote Org can keep a record of state changes, such as when we set an entry marked with the =TODO= keyword as =DONE= or when we reschedule an -appointment ([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =unravel-org.el= Org agenda settings]]). This data +appointment ([[#h:7fe87b83-2815-4617-a5f9-d3417dd9d248][The =nebkor-org.el= Org agenda settings]]). This data is stored in a =LOGBOOK= drawer right below the heading. I choose to keep track of this information, as it is sometimes useful to capture mistakes or figure out intent in the absence of further clarification (though I do tend to write why something happened). #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; log (use-package org :ensure nil @@ -4378,9 +4045,10 @@ mistakes or figure out intent in the absence of further clarification (setq org-clock-in-switch-to-state 'bh/clock-in-to-working)) #+end_src -** The =unravel-org.el= Org link settings +** The =nebkor-org.el= Org link settings :PROPERTIES: :CUSTOM_ID: h:da8ce883-7f21-4a6e-a41f-d668ad762b41 +:ID: 01JGD3340H0002E974HHEPEXCW :END: #+begin_quote @@ -4398,9 +4066,9 @@ file, as documented in the manual. Evaluate this inside of Emacs: #+end_quote I bind ~org-store-link~ in main section of the Org configuration: -[[#h:e03df1e0-b43e-49b5-978e-6a511165617c][The =unravel-org.el= section with basic Org settings]]. +[[#h:e03df1e0-b43e-49b5-978e-6a511165617c][The =nebkor-org.el= section with basic Org settings]]. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; links (use-package org :ensure nil @@ -4410,8 +4078,11 @@ I bind ~org-store-link~ in main section of the Org configuration: (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) #+end_src -** The =unravel-org.el= Org list items settings -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +** The =nebkor-org.el= Org list items settings +:PROPERTIES: +:ID: 01JGD3340Q0005C7RVKGBVTBY3 +:END: +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; org-list (use-package org-list :ensure nil @@ -4440,9 +4111,10 @@ I bind ~org-store-link~ in main section of the Org configuration: (define-key org-mode-map (kbd "C-c j") 'suv/org-move-item-or-tree)) #+end_src -** The =unravel-org.el= Org code block settings +** The =nebkor-org.el= Org code block settings :PROPERTIES: :CUSTOM_ID: h:1f5a0d46-5202-48dd-8048-b48ce17f3df8 +:ID: 01JGD3340Y000D4V8FDJQDMT01 :END: #+begin_quote @@ -4476,7 +4148,7 @@ something like the following: #+end_example #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; code blocks (use-package org :ensure nil @@ -4490,12 +4162,13 @@ something like the following: (setq org-edit-src-content-indentation 2)) #+end_src -** The =unravel-org.el= Org export settings +** The =nebkor-org.el= Org export settings :PROPERTIES: :CUSTOM_ID: h:bd11d4d8-6e9f-4536-87a4-4018783bf8f5 +:ID: 01JGD334140000KCW78KV54YZ3 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; export (use-package org :ensure nil @@ -4548,9 +4221,10 @@ something like the following: (setq org-image-actual-width nil)) #+end_src -** The =unravel-org.el= Org capture templates (~org-capture~) +** The =nebkor-org.el= Org capture templates (~org-capture~) :PROPERTIES: :CUSTOM_ID: h:f8f06938-0dfe-45c3-b4cf-996d36cba82d +:ID: 01JGD3341Z000B0WMK23B069EP :END: #+begin_quote @@ -4562,21 +4236,22 @@ title of the task, and the like. The documentation string of ~org-capture-templates~ covers the technicalities. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; org-capture (use-package org-capture :ensure nil :bind ("C-c c" . org-capture)) #+end_src -** The =unravel-org.el= section on YASnippet +** The =nebkor-org.el= section on YASnippet :PROPERTIES: :CUSTOM_ID: h:75C672E5-4636-4CC0-A5ED-500EAFAB01DE +:ID: 01JGD3342T00034JXJBD1KCF9K :END: ~yasnippet~ is the primary tool I use when I need templates of any kind. Since most of my templating is in ~org-mode~, it makes sense to keep YAS in this section. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;; YASnippets for daily life improvements (use-package yasnippet :ensure t @@ -4620,15 +4295,16 @@ title of the task, and the like. The documentation string of (cons beg end)))) #+end_src -** The =unravel-org.el= Org agenda settings +** The =nebkor-org.el= Org agenda settings :PROPERTIES: :CUSTOM_ID: h:7fe87b83-2815-4617-a5f9-d3417dd9d248 +:ID: 01JGD3343Q000FF721CKG7YFZ2 :END: [ Watch Prot's talk: [[https://protesilaos.com/codelog/2021-12-09-emacs-org-block-agenda/][Demo of my custom Org block agenda]] (2021-12-09). It has changed a bit since then, but the idea is the same. ] -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" ;;;; agenda (use-package org-agenda :ensure nil @@ -4853,120 +4529,28 @@ title of the task, and the like. The documentation string of (setq org-habit-show-all-today t)) #+end_src -** Finally, we provide the =unravel-org.el= module +** Finally, we provide the =nebkor-org.el= module :PROPERTIES: :CUSTOM_ID: h:62eb7ca3-2f79-45a6-a018-38238b486e98 +:ID: 01JGD3344J0007E5E5DSRFDYH0 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-org.el" -(provide 'unravel-org) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" +(provide 'nebkor-org) #+end_src -* The =unravel-shell.el= module -:PROPERTIES: -:CUSTOM_ID: h:1E30455D-BB40-44E7-9FB1-92529FE03BDE -:END: - -I use ~vterm~ for my shell inside Emacs, and at the moment, this section is about ~vterm~ configuration only. - -** The =unravel-shell.el= section for using a terminal inside Emacs (~vterm~) -:PROPERTIES: -:CUSTOM_ID: h:2945DD5C-6AF1-4323-A287-A4F5C109471C -:END: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-shell.el" :mkdirp yes - ;;;; Vterm - (use-package vterm - :ensure t - :bind - ("C-x m" . vterm) - :config - (setq vterm-shell (or (executable-find "fish") "/opt/homebrew/bin/fish"))) -#+end_src - -** The =unravel-shell.el= section for keeping track of visited directories (~zoxide~) -:PROPERTIES: -:CUSTOM_ID: h:6D2BDBA6-EBCE-4DEC-ABDD-4BB106ED5988 -:CREATED: [2024-12-02 Mon 08:34] -:END: - -~zoxide~ is an amazing tool for quickly navigating to the "right -place" on the terminal. I cannot imagine using the terminal without -it. Since Emacs is where I do most of my file opening, I can use my -Emacs navigation to enrich my Zoxide database and improve the scoring -of different paths inside Zoxide. This is how to do it: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-shell.el" - ;;; Enrich zoxide db based on everything I open in Emacs - (when (executable-find "zoxide") - (use-package zoxide - :ensure t - :hook - (consult-after-jump . zoxide-add) - (find-file . zoxide-add) - (dired-mode . zoxide-add))) -#+end_src - -** The =unravel-shell.el= section for writing fish configuration (~fish-mode~) -:PROPERTIES: -:CUSTOM_ID: h:B728F188-405C-43F7-89AD-E589ACF7579B -:CREATED: [2024-12-06 Fri 14:37] -:END: - -I use ~fish~ as my primary shell, and want a mode for reading ~.fish~ files. This is what ~fish-mode~ gives me. - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-shell.el" - ;; Mode to read/write fish functions and files - (use-package fish-mode - :ensure t) -#+end_src - -** The =unravel-shell.el= section for executing shell commands (~dwim-shell-command~) -:PROPERTIES: -:CUSTOM_ID: h:DDA419D2-AFDD-4CEA-B158-FB271BE8E17C -:CREATED: [2024-12-15 Sun 12:10] -:END: - -~dwim-shell-command~ is a super powered replacement for the built-in -~shell-command~, and makes life really easy, especially on a Mac. The -usage is exactly as you would use ~shell-command~ (which, in my case, -is primarily by marking files in Dired and running =!= -(~dired-do-shell-command~) on the files. - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-shell.el" - (use-package dwim-shell-command - :ensure t - :bind - ( :map global-map - ([remap shell-command] . dwim-shell-command) - :map dired-mode-map - ([remap dired-do-async-shell-command] . dwim-shell-command) - ([remap dired-do-shell-command] . dwim-shell-command) - ([remap dired-smart-shell-command] . dwim-shell-command)) - :config - ;; Also make available all the utility functions provided by Xenodium - (require 'dwim-shell-commands)) -#+end_src -** Finally, we provide the =unravel-shell.el= module -:PROPERTIES: -:CUSTOM_ID: h:83F2ADFB-D72B-4F8C-8B01-BA1A9CA4939C -:END: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-shell.el" -(provide 'unravel-shell) -#+end_src - -* The =unravel-langs.el= module +* The =nebkor-langs.el= module :PROPERTIES: :CUSTOM_ID: h:f44afb76-a1d7-4591-934d-b698cc79a792 :END: -** The =unravel-langs.el= settings for TAB +** The =nebkor-langs.el= settings for TAB :PROPERTIES: :CUSTOM_ID: h:559713c8-0e1e-44aa-bca8-0caae01cc8bb +:ID: 01JGD3344R000523XVMWTAS946 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" :mkdirp yes ;;;; Tabs, indentation, and the TAB key (use-package emacs :ensure nil @@ -4978,9 +4562,10 @@ is primarily by marking files in Dired and running =!= indent-tabs-mode nil)) #+end_src -** The =unravel-langs.el= settings highlighting parens (~show-paren-mode~) +** The =nebkor-langs.el= settings highlighting parens (~show-paren-mode~) :PROPERTIES: :CUSTOM_ID: h:7cd21ea6-c5d8-4258-999d-ad94cac2d8bf +:ID: 01JGD3344X0000EJPQTZ9YSMFW :END: #+begin_quote @@ -4992,7 +4577,7 @@ highlights the ~if~ and ~fi~ keywords. This mode also works for prose and I use it globally. Simple and effective! #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Parentheses (show-paren-mode) (use-package paren :ensure nil @@ -5004,9 +4589,10 @@ and I use it globally. Simple and effective! (setq show-paren-context-when-offscreen 'overlay)) ; Emacs 29 #+end_src -** The =unravel-langs.el= settings for showing relevant documentation (~eldoc~) +** The =nebkor-langs.el= settings for showing relevant documentation (~eldoc~) :PROPERTIES: :CUSTOM_ID: h:a5773a39-a78f-43fa-8feb-669492c1d5a9 +:ID: 01JGD334530008VQ1KT64C77QG :END: #+begin_quote @@ -5020,7 +4606,7 @@ remember its arity. Same principle for variables, where ~eldoc-mode~ puts the first line of their documentation string in the echo area. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Eldoc (Emacs live documentation feedback) (use-package eldoc :ensure nil @@ -5029,9 +4615,10 @@ puts the first line of their documentation string in the echo area. (setq eldoc-message-function #'message)) ; don't use mode line for M-x eval-expression, etc. #+end_src -** The =unravel-langs.el= settings for connecting to LSP servers (~eglot~) +** The =nebkor-langs.el= settings for connecting to LSP servers (~eglot~) :PROPERTIES: :CUSTOM_ID: h:92258aa8-0d8c-4c12-91b4-5f44420435ce +:ID: 01JGD33459000C9EVJ59KD31VP :END: #+begin_quote @@ -5045,13 +4632,13 @@ following capabilities: - Code completion :: This can be visualised for in-buffer automatic expansion of function calls, variables, and the like - ([[#h:804b858f-7913-47ef-aaf4-8eef5b59ecb4][The =unravel-completion.el= for in-buffer completion popup (~corfu~)]]). + ([[#h:804b858f-7913-47ef-aaf4-8eef5b59ecb4][The =nebkor-completion.el= for in-buffer completion popup (~corfu~)]]). - Code linting :: To display suggestions, warnings, or errors. These are highlighted in the buffer, usually with an underline, and can also be displayed in a standalone buffer with the commands ~flymake-show-buffer-diagnostics~, ~flymake-show-project-diagnostics~ - ([[#h:df6d1b52-0306-4ace-9099-17dded11fbed][The =unravel-langs.el= settings for code linting (~flymake~)]]). + ([[#h:df6d1b52-0306-4ace-9099-17dded11fbed][The =nebkor-langs.el= settings for code linting (~flymake~)]]). - Code navigation and cross-referencing :: While over a symbol, use a command to jump directly to its definition. The default key bindings @@ -5071,7 +4658,7 @@ I use ~eglot~ as the main LSP entry point, and as such, I have key-bindings for Note that demanding ~eglot~ is not a mistake. I want it loaded so that I can advice functions for different programming langauges. For example, Python uses ~emacs-pet~ for tracking the environment of each project, and this needs to load after ~eglot~ so that it can advice the necessary functions. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Eglot (built-in client for the language server protocol) (use-package eglot :ensure nil @@ -5094,9 +4681,10 @@ Note that demanding ~eglot~ is not a mistake. I want it loaded so that I can adv (setq eglot-extend-to-xref t)) #+end_src -** The =unravel-langs.el= settings for writing Markdown (~markdown-mode~) +** The =nebkor-langs.el= settings for writing Markdown (~markdown-mode~) :PROPERTIES: :CUSTOM_ID: h:c9063898-07ae-4635-8853-bb5f4bbab421 +:ID: 01JGD3345F0005PP8A5XVC3JNA :END: #+begin_quote @@ -5108,7 +4696,7 @@ file's HTML representation on a web page. Though I only use it for basic text editing. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; Markdown (markdown-mode) (use-package markdown-mode :ensure t @@ -5117,9 +4705,10 @@ basic text editing. (setq markdown-fontify-code-blocks-natively t)) #+end_src -** The =unravel-langs.el= settings for dealing with CSV files (~csv-mode~) +** The =nebkor-langs.el= settings for dealing with CSV files (~csv-mode~) :PROPERTIES: :CUSTOM_ID: h:bae58479-86c1-410f-867e-c548def65b1c +:ID: 01JGD3345N0008XB6ATFE04Y30 :END: #+begin_quote @@ -5130,19 +4719,20 @@ with the command ~csv-align-mode~: it hides the field delimiter (comma or space) and shows a tab stop in its stead. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; csv-mode (use-package csv-mode :ensure t :commands (csv-align-mode)) #+end_src -** The =unravel-langs.el= settings for spell checking (~flyspell~) +** The =nebkor-langs.el= settings for spell checking (~flyspell~) :PROPERTIES: :CUSTOM_ID: h:115806c4-88b0-43c1-8db2-d9d8d20a5c17 +:ID: 01JGD3345V000A2VNTSK2YQBGQ :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; Flyspell (use-package flyspell :ensure nil @@ -5158,9 +4748,10 @@ or space) and shows a tab stop in its stead. (setq ispell-dictionary "en_GB")) #+end_src -** The =unravel-langs.el= settings for code linting (~flymake~) +** The =nebkor-langs.el= settings for code linting (~flymake~) :PROPERTIES: :CUSTOM_ID: h:df6d1b52-0306-4ace-9099-17dded11fbed +:ID: 01JGD33461000BHZVSJV90Z8QZ :END: #+begin_quote @@ -5174,7 +4765,7 @@ the command ~flymake-show-buffer-diagnostics~, or ~flymake-show-project-diagnost Highlights are shown in the context of the file. The built-in ~eglot~ feature uses ~flymake~ internally to handle the -LSP linter output ([[#h:92258aa8-0d8c-4c12-91b4-5f44420435ce][The =unravel-langs.el= settings for ~eglot~]]). +LSP linter output ([[#h:92258aa8-0d8c-4c12-91b4-5f44420435ce][The =nebkor-langs.el= settings for ~eglot~]]). As for what I have in this configuration block, the essentials for me are the user options ~flymake-start-on-save-buffer~ and ~flymake-start-on-flymake-mode~ @@ -5187,7 +4778,7 @@ to make ~flymake~ report issues with Emacs Lisp files for the purposes of packaging. I use it whenever I work on my numerous Emacs packages. #+end_quote -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; Flymake (use-package flymake :ensure nil @@ -5228,12 +4819,13 @@ of packaging. I use it whenever I work on my numerous Emacs packages. (add-hook 'flymake-diagnostic-functions #'package-lint-flymake)) #+end_src -** The =unravel-langs.el= settings for quick outlines (~outline-minor-mode~) +** The =nebkor-langs.el= settings for quick outlines (~outline-minor-mode~) :PROPERTIES: :CUSTOM_ID: h:ffff5f7b-a62b-4d4a-ae29-af75402e5c35 +:ID: 01JGD33467000CA30X0721EZM9 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; General configurations for prose/writing ;;;; `outline' (`outline-mode' and `outline-minor-mode') @@ -5248,15 +4840,16 @@ of packaging. I use it whenever I work on my numerous Emacs packages. (setq outline-minor-mode-use-margins nil)) ; as above #+end_src -** The =unravel-langs.el= settings for definitions (~dictionary~) +** The =nebkor-langs.el= settings for definitions (~dictionary~) :PROPERTIES: :CUSTOM_ID: h:f91563d8-f176-4555-b45b-ece56de03279 +:ID: 01JGD3346D0001F22XTMW8XNR8 :END: Use the entry point ~M-x dictionary-search~ -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; `dictionary' (use-package dictionary :ensure nil @@ -5267,12 +4860,13 @@ Use the entry point ~M-x dictionary-search~ dictionary-use-single-buffer t)) #+end_src -** The =unravel-langs.el= settings for paren matching (~paredit~) +** The =nebkor-langs.el= settings for paren matching (~paredit~) :PROPERTIES: :CUSTOM_ID: h:885F9DED-E9C9-4B5B-9FE0-1A33CBD23126 +:ID: 01JGD3346J0006N6CC7T9H3J5P :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" (use-package paredit :ensure t :bind ( :map paredit-mode-map @@ -5287,28 +4881,35 @@ Use the entry point ~M-x dictionary-search~ :hook ((lisp-data-mode lisp-mode clojure-mode clojure-ts-mode cider-repl-mode inferior-emacs-lisp-mode) . paredit-mode)) #+end_src -** The =unravel-langs.el= settings for code formatting (~apheleia~) +** The =nebkor-langs.el= settings for code formatting (~apheleia~) :PROPERTIES: :CUSTOM_ID: h:07B0E6F4-050E-4A7D-B489-E919E4887FF5 +:ID: 01JGD3346R000F126SJG0CE7DC :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" (use-package apheleia :ensure t :demand t + :after blackout :config (apheleia-global-mode +1) (with-eval-after-load 'apheleia-formatters - (push '(zprint . ("zprint")) apheleia-formatters))) + (push '(zprint . ("zprint")) apheleia-formatters)) + :hook + (apheleia-mode . (lambda () (blackout 'apheleia-mode))) + ;;:blackout + ) #+end_src -** The =unravel-langs.el= settings for changing many things (~multiple-cursors~) +** The =nebkor-langs.el= settings for changing many things (~multiple-cursors~) :PROPERTIES: :CUSTOM_ID: h:07712014-B63C-429E-8D81-2D0E21E04ECC :CREATED: [2024-12-18 Wed 14:13] +:ID: 01JGD3346Y000B94BQRJ5ZNFSG :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" (use-package multiple-cursors :ensure t :bind @@ -5317,10 +4918,106 @@ Use the entry point ~M-x dictionary-search~ ("C-c C->" . mc/mark-all-like-this)) #+end_src -** The =unravel-langs.el= section for Python +** The =nebkor-langs.el= section for LSP +:PROPERTIES: +:ID: f6046c17-ff41-4474-8b50-94f652da3b13 +:END: + +Some people like eglot, and it's fine. But it doesn't do semantic highlighting, and I like my pretty +colors (you can use tree-sitter to do *syntactic* highlighting, but that's different). + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" + (use-package lsp-mode + :ensure t + :demand t + :commands lsp + :init + (defun my/lsp-mode-setup-completion () + (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults)) + '(flex))) ;; Configure flex + :bind (("C-c C-c Q" . lsp-workspace-shutdown) + ("C-c C-c q" . lsp-workspace-restart)) + :config + (setq lsp-rust-all-targets nil + lsp-rust-analyzer-cargo-all-targets nil + lsp-log-io nil + lsp-semgrep-server-command nil + lsp-completion-provider :none + lsp-inlay-hint-enable t + lsp-modeline-diagnostics-enable nil + lsp-rust-analyzer-import-merge-behaviour "full" + lsp-rust-analyzer-completion-auto-import-enable t + lsp-rust-rustfmt-path "/home/ardent/.cargo/bin/rustfmt" + lsp-rust-unstable-features t + lsp-semantic-tokens-enable t + lsp-semantic-tokens-warn-on-missing-face nil + lsp-treemacs-error-list-current-project-only t + lsp-ui-sideline-delay 0.1 + lsp-ui-sideline-diagnostic-max-line-length 50 + lsp-ui-sideline-enable nil + lsp-ui-sideline-show-code-actions t + lsp-ui-sideline-update-mode 'line + lsp-eldoc-render-all t + lsp-idle-delay 0.2 + lsp-enable-snippet t + ;; enable / disable the hints as you prefer: + lsp-rust-analyzer-cargo-watch-command "clippy" + lsp-rust-analyzer-server-display-inlay-hints t + lsp-rust-analyzer-call-info-full t + lsp-rust-analyzer-proc-macro-enable t + lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial" + lsp-rust-analyzer-display-chaining-hints t + lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names t + lsp-rust-analyzer-display-closure-return-type-hints t + lsp-rust-analyzer-display-parameter-hints nil + lsp-rust-analyzer-display-reborrow-hints t) + :hook + ( + (lsp-mode . lsp-enable-which-key-integration) + (lsp-mode . subword-mode) + (lsp-completion-mode . my/lsp-mode-setup-completion) + ;;(before-save . lsp-format-buffer) + )) +#+end_src + + +** The =nebkor-langs.el= section for Rust +:PROPERTIES: +:ID: 4cc12328-6cca-4c79-b9ca-fb07492ba890 +:END: + +Rust is my primary development language. + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" + (use-package cargo + :ensure t) + + (use-package rustic + :ensure t + :bind (:map rustic-mode-map + ("M-?" . lsp-find-references) + ("C-c C-c a" . lsp-execute-code-action) + ("C-c C-c r" . lsp-rename) + ("C-c C-c l" . flycheck-list-errors) + ("C-c C-c s" . lsp-rust-analyzer-status)) + :hook rust-ts-mode + :custom + (rustic-format-on-save t) + :config + (setq rustic-format-on-save t + rust-indent-method-chain t + rustic-format-trigger 'on-save + rustic-lsp-format t + rustic-lsp-client 'lsp) + (setq-local buffer-save-without-query t) + (setq-local lsp-semantic-tokens-enable t)) +#+end_src + +** The =nebkor-langs.el= section for Python :PROPERTIES: :CUSTOM_ID: h:EA5EA223-F97D-4EE9-8663-99822A037618 :CREATED: [2024-11-21 Thu 22:51] +:ID: 01JGD33499000EF11QDM5YWNDX :END: The built-in Python mode for Emacs goes a long way. I use the @@ -5360,7 +5057,7 @@ this means: NOTE: Exactly the same instructions also work for Poetry, just replace ~uv~ with ~poetry~ in any of the commands above. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Configuration for Python Programming (use-package python @@ -5416,10 +5113,11 @@ NOTE: Exactly the same instructions also work for Poetry, just replace (auto-virtualenv-setup)) #+end_src -** The =unravel-langs.el= section for Ziglang (~zig-mode~) +** The =nebkor-langs.el= section for Ziglang (~zig-mode~) :PROPERTIES: :CUSTOM_ID: h:4C1D1E7E-7FA1-4D76-A6CF-6D89A10376B6 :CREATED: [2024-11-27 Wed 22:51] +:ID: 01JGD3349H0004FZXRQNFXMHDW :END: I use the Emacs major mode ~zig-mode~, along with the Ziglang langauge @@ -5429,7 +5127,7 @@ To install ~zig~ and ~zls~ on MacOS: =brew install zig zls= -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Configuration for Zig Programming (use-package zig-mode @@ -5440,17 +5138,18 @@ To install ~zig~ and ~zls~ on MacOS: ) #+end_src -** The =unravel-langs.el= section for Clojure programming +** The =nebkor-langs.el= section for Clojure programming :PROPERTIES: :CUSTOM_ID: h:705CEAA5-00C4-4691-9425-7529981A8B18 :CREATED: [2024-12-02 Mon 08:34] +:ID: 01JGD3349Q000DJDRF143PVW7N :END: Clojure is my favorite programming language, and it has been my bread and butter language for well over a decade. I can only hope and pray for this to continue. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; Configuration for Clojure programming (use-package clojure-mode :ensure t) @@ -5468,13 +5167,14 @@ for this to continue. :ensure t)) #+end_src -*** The =unravel-langs.el= section for Clojure interactive development (~cider~) +*** The =nebkor-langs.el= section for Clojure interactive development (~cider~) :PROPERTIES: :CUSTOM_ID: h:92A8163E-68DA-49D2-A40F-69853FD7E68A :CREATED: [2024-12-18 Wed 13:55] +:ID: 01JGD3349X000FNGH5GRV46PXR :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; Cider provides tooling over nREPL for Clojure programming (use-package cider :ensure t @@ -5487,13 +5187,14 @@ for this to continue. (setq cider-repl-prompt-function #'cider-repl-prompt-on-newline)) #+end_src -*** The =unravel-langs.el= section for refactoring clojure code (~clj-refactor~) +*** The =nebkor-langs.el= section for refactoring clojure code (~clj-refactor~) :PROPERTIES: :CUSTOM_ID: h:DCA5B96F-E543-4CB9-8ECC-F73A6531CCEA :CREATED: [2024-12-18 Wed 13:59] +:ID: 01JGD334A40006ZNWEPX38AWNM :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; clj-refactor enables smart refactoring of Clojure code (use-package clj-refactor :ensure t @@ -5510,13 +5211,14 @@ for this to continue. (setq cljr-magic-requires nil)) #+end_src -*** The =unravel-langs.el= section for linting Clojure code (~flymake-kondor~) +*** The =nebkor-langs.el= section for linting Clojure code (~flymake-kondor~) :PROPERTIES: :CUSTOM_ID: h:22939449-DC0E-4551-800D-396D5076C406 :CREATED: [2024-12-18 Wed 14:03] +:ID: 01JGD334AA0007EE6J3C0B4CYW :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; flymake-kondor integrates flymake with clj-kondo, so that we get ;;;; great linting without needing to start a REPL or LSP server. (use-package flymake-kondor @@ -5528,13 +5230,14 @@ for this to continue. (clojure-ts-mode . flymake-kondor-setup))) #+end_src -*** The =unravel-langs.el= Clojure section for Clojure tools (~clojure-snippets~ and ~jet~) +*** The =nebkor-langs.el= Clojure section for Clojure tools (~clojure-snippets~ and ~jet~) :PROPERTIES: :CUSTOM_ID: h:413C1A9A-BFC7-43B8-A062-3A81259DD794 :CREATED: [2024-12-18 Wed 14:05] +:ID: 01JGD334AG0000SH5FDYZG10SH :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;;; clojure-snippets are handy yasnippets for fast coding (use-package clojure-snippets :ensure t @@ -5558,13 +5261,14 @@ for this to continue. (user-error "Could not find jet installed"))))) #+end_src -** The =unravel-langs.el= section for Emacs Lisp +** The =nebkor-langs.el= section for Emacs Lisp :PROPERTIES: :CUSTOM_ID: h:54D8C607-5CF6-425A-BFBD-0602334BE199 :CREATED: [2024-12-06 Fri 22:26] +:ID: 01JGD334AP000EWEHBZCRSKM2B :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" ;;; Settings for Interaction mode for Emacs-Lisp (use-package ielm :ensure nil @@ -5572,16 +5276,17 @@ for this to continue. ( :map ielm-map ("C-j" . newline-and-indent))) #+end_src -** Finally, we provide the =unravel-langs.el= module +** Finally, we provide the =nebkor-langs.el= module :PROPERTIES: :CUSTOM_ID: h:924224F1-61A0-4CCD-A3C3-4F230D3CF0A0 +:ID: 01JGD334AW0002AX2598H8SQHW :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el" -(provide 'unravel-langs) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" +(provide 'nebkor-langs) #+end_src -* The =unravel-study.el= module +* The =nebkor-study.el= module :PROPERTIES: :CUSTOM_ID: h:FE49DE29-DF99-450C-B6E8-AD64D877C518 :CREATED: [2024-12-12 Thu 21:27] @@ -5590,10 +5295,11 @@ for this to continue. This file contains configuration for everything I use to make Emacs my go-to place for studying anything. -** The =unravel-study.el= section for notes and file-naming (~denote~) +** The =nebkor-study.el= section for notes and file-naming (~denote~) :PROPERTIES: :CUSTOM_ID: h:e86a66dc-7ef9-4f09-ad7e-946de2034e8d :CREATED: [2024-12-12 Thu 21:33] +:ID: 01JGD334B4000DNEXGHP7T9FSS :END: Denote is my goto tool for any and all note-taking. This is what @@ -5607,7 +5313,7 @@ localtion for your ~denote~ files, set the environment variable #+begin_quote This is another one of my packages and is extended by my -~consult-denote~ package ([[#h:ee82e629-fb05-4c75-9175-48a760a25691][The =unravel-study.el= integration between Consult and Denote (~consult-denote~)]]). +~consult-denote~ package ([[#h:ee82e629-fb05-4c75-9175-48a760a25691][The =nebkor-study.el= integration between Consult and Denote (~consult-denote~)]]). Denote is a simple note-taking tool for Emacs. It is based on the idea that notes should follow a predictable and descriptive file-naming @@ -5635,7 +5341,7 @@ Prot is the developer and maintainer of this package. + Backronyms: Denote Everything Neatly; Omit The Excesses. Don't Ever Note Only The Epiphenomenal. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" :mkdirp yes +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" :mkdirp yes ;;; Denote (simple note-taking and file-naming) ;; Read the manual: . This does @@ -5849,17 +5555,18 @@ Prot is the developer and maintainer of this package. #+end_src -*** The =unravel-study.el= integration between Consult and Denote (~consult-denote~) +*** The =nebkor-study.el= integration between Consult and Denote (~consult-denote~) :PROPERTIES: :CUSTOM_ID: h:ee82e629-fb05-4c75-9175-48a760a25691 +:ID: 01JGD334BB000DF3EBFKMP10F4 :END: #+begin_quote This is another package of mine which extends my ~denote~ package -([[#h:e86a66dc-7ef9-4f09-ad7e-946de2034e8d][The =unravel-study.el= settings for ~denote~ (notes and file-naming)]]). +([[#h:e86a66dc-7ef9-4f09-ad7e-946de2034e8d][The =nebkor-study.el= settings for ~denote~ (notes and file-naming)]]). This is glue code to integrate ~denote~ with Daniel Mendler's -~consult~ ([[#h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d][The =unravel-completion.el= settings for ~consult~]]). The +~consult~ ([[#h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d][The =nebkor-completion.el= settings for ~consult~]]). The idea is to enhance minibuffer interactions, such as by providing a preview of the file-to-linked/opened and by adding more sources to the ~consult-buffer~ command. @@ -5872,7 +5579,7 @@ Prot is the developer of this package. + Git repositories: + GitHub: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" (use-package consult-denote :ensure t :bind @@ -5883,16 +5590,17 @@ Prot is the developer of this package. #+end_src -** The =unravel-study.el= section for reading and annotation of PDFs (~pdf-tools~) +** The =nebkor-study.el= section for reading and annotation of PDFs (~pdf-tools~) :PROPERTIES: :CUSTOM_ID: h:B662EABD-DC46-468A-BF59-E67AC48D2DDA :CREATED: [2024-12-12 Thu 21:35] +:ID: 01JGD334BH000APPCRC0660Z5C :END: PDF Tools is an absolute powerhouse for reading and annotating PDF files. It is my goto tool for reading any academic papers. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" ;;; PDF Tools for reading and annotating PDF files (use-package pdf-tools :ensure (:host github :repo "vedang/pdf-tools" :branch "master") @@ -5900,13 +5608,14 @@ files. It is my goto tool for reading any academic papers. (pdf-tools-install)) #+end_src -** The =unravel-study.el= section for annotation of org and eww files (~org-remark~) +** The =nebkor-study.el= section for annotation of org and eww files (~org-remark~) :PROPERTIES: :CUSTOM_ID: h:814EC9C8-3182-4B86-ADD9-123096D144D4 :CREATED: [2024-12-12 Thu 21:40] +:ID: 01JGD334BQ000DQSHQJKJX08V8 :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" ;;; org-remark for annotating org and eww files (use-package org-remark :ensure t @@ -5955,13 +5664,14 @@ files. It is my goto tool for reading any academic papers. (org-remark-nov-mode +1))) #+end_src -** The =unravel-study.el= section for flashcards (~org-fc~) +** The =nebkor-study.el= section for flashcards (~org-fc~) :PROPERTIES: :CUSTOM_ID: h:C63AE939-4082-4763-B0A4-A736869B7B41 :CREATED: [2024-12-12 Thu 21:45] +:ID: 01JGD334BX0002JVAP3SEQF8YW :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" ;;; org-fc for flashcards and spaced repetition (use-package org-fc :ensure (:host github :repo "l3kn/org-fc" :branch "main") @@ -5970,10 +5680,11 @@ files. It is my goto tool for reading any academic papers. (setq org-fc-directories `(,(concat org-directory "/notes/")))) #+end_src -** The =unravel-study.el= section for table of contents (~toc-org~) +** The =nebkor-study.el= section for table of contents (~toc-org~) :PROPERTIES: :CUSTOM_ID: h:478591ED-2CEF-4E15-A5DF-77198A34C86A :CREATED: [2024-12-13 Fri 08:42] +:ID: 01JGD334C300070MC86G0PKCM4 :END: ~toc-org~ is a simple and nifty package for automatically creating a @@ -5993,22 +5704,25 @@ in the TOC will be navigable using standard ~org-mode~ shortcuts. To enable ~toc-org~, run =M-x toc-org-mode= in your ~org-mode~ file and create a heading with the tag =:TOC:= added to it. -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" ;;; toc-org for automatic Table of Contents (use-package toc-org :ensure t) #+end_src -** The =unravel-study.el= section for archiving web content (~org-board~) +** The =nebkor-study.el= section for archiving web content (~org-board~) +:PROPERTIES: +:ID: 01JGD334C90006ECQX4W0Z7B3G +:END: ~org-board~ is a fantastic tool that lets me download content directly from various webpages, and store it locally. I use this to download every blogpost I enjoy, and this lets me reliably highlight the page -([[#h:814EC9C8-3182-4B86-ADD9-123096D144D4][The =unravel-study.el= section for ~org-remark~ (annotation of org -and eww files)]]) and extract flashcards from it ([[#h:C63AE939-4082-4763-B0A4-A736869B7B41][The =unravel-study.el= +([[#h:814EC9C8-3182-4B86-ADD9-123096D144D4][The =nebkor-study.el= section for ~org-remark~ (annotation of org +and eww files)]]) and extract flashcards from it ([[#h:C63AE939-4082-4763-B0A4-A736869B7B41][The =nebkor-study.el= section for ~org-fc~ (flashcards)]]). -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" ;;; Downloading and archiving webpages (use-package org-board :ensure t @@ -6016,32 +5730,22 @@ section for ~org-fc~ (flashcards)]]). ("C-c o" . org-board-keymap)) #+end_src -** The =unravel-stude.el= section for publishing org-mode content (~ox-gfm~) -:PROPERTIES: -:CUSTOM_ID: h:85D2A18F-9F3A-423E-9CBC-E09693E192D9 -:CREATED: [2025-01-01 Wed 21:20] -:END: - -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" - ;;; Publishing org-mode content - (use-package ox-gfm - :ensure (:host github :repo "vedang/ox-gfm" :branch "master")) -#+end_src - -** Finally, we provide the =unravel-study.el= module +** Finally, we provide the =nebkor-study.el= module :PROPERTIES: :CUSTOM_ID: h:13AF346B-1721-47FC-87A9-16EEB7818521 :CREATED: [2024-12-12 Thu 22:09] +:ID: 01JGD334CG000FA0TH5FCCW0CK :END: -#+begin_src emacs-lisp :tangle "unravel-modules/unravel-study.el" - (provide 'unravel-study) +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" + (provide 'nebkor-study) #+end_src * Custom libraries ** The =prot-common.el= library :PROPERTIES: :CUSTOM_ID: h:3fccfadf-22e9-457f-b9fd-ed1b48600d23 +:ID: 01JGD334CS000DEHYRMVG75GJH :END: #+begin_src emacs-lisp :tangle "custom-lisp/prot-common.el" :mkdirp yes @@ -6472,6 +6176,7 @@ section for ~org-fc~ (flashcards)]]). ** The =prot-embark.el= library :PROPERTIES: :CUSTOM_ID: h:fb034be5-c316-4c4f-a46f-cebcab332a47 +:ID: 01JGD334D1000CBNZ67JQM8TEF :END: #+begin_src emacs-lisp :tangle "custom-lisp/prot-embark.el" :mkdirp yes @@ -6618,6 +6323,7 @@ section for ~org-fc~ (flashcards)]]). ** The =prot-window.el= library :PROPERTIES: :CUSTOM_ID: h:35b8a0a5-c447-4301-a404-bc274596238d +:ID: 01JGD334D80000B5EYPJTPKNMQ :END: #+begin_src emacs-lisp :tangle "custom-lisp/prot-window.el" :mkdirp yes @@ -6860,458 +6566,52 @@ Also see `prot-window-delete-popup-frame'." command) #+end_src -** The =vedang-personal.el= module +** The =nebkor-personal.el= module :PROPERTIES: :CUSTOM_ID: h:0EAB9FBA-98AD-4E0E-BC01-71D1EC920B8D :END: -I want this section to contain all the personal configuration that anyone using this repo should modify. But I don't know how to do this properly at the moment, in a way such that it's part of the repo, and yet only exported for me. I'll update this section as and when I figure it out. +I want this section to contain all the personal configuration that +anyone using this repo should modify. But I don't know how to do this +properly at the moment, in a way such that it's part of the repo, and +yet only exported for me. I'll update this section as and when I +figure it out. *** My personal user settings :PROPERTIES: :CUSTOM_ID: h:9757A878-D383-47F4-94FD-98374954F83A -:CREATED: [2024-11-28 Thu 16:19] +:CREATED: [2024-12-31 Tue] +:ID: 01JGD334DE0000F5Z5HSR7XYRX :END: -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" :mkdirp yes - ;;; Personal Basic settings - (use-package emacs - :ensure nil - :config - (setq user-mail-address "vedang@unravel.tech")) +#+begin_src emacs-lisp :tangle "custom-lisp/nebkor-personal.el" :mkdirp yes + ;; stand-in + (global-set-key [C-tab] #'other-window) + (global-set-key [C-S-tab] #'sother-window) + (global-set-key [C-iso-lefttab] #'sother-window) + (global-set-key [f4] #'nebkor/kill-buffer) + (global-set-key [f7] 'revert-buffer) + + (setq-default auto-fill-function 'do-auto-fill) + (setq-default fill-column 100) + (turn-on-auto-fill) + (add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1))) + (define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command) + + (add-hook 'before-save-hook #'delete-trailing-whitespace) + (fset 'yes-or-no-p 'y-or-n-p) #+end_src -*** My personal settings for ~org~ -:PROPERTIES: -:CUSTOM_ID: h:5E428EA8-8889-411A-A63B-70E33F12DBF0 -:CREATED: [2024-12-12 Thu 19:39] -:END: - -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" - (use-package org - :ensure nil - :config - (setq org-default-notes-file - (expand-file-name "brain/daily.org" org-directory)) - (setq org-blogpost-file - (expand-file-name "brain/projects/blogposts.org" org-directory)) - (setq org-crm-file - (expand-file-name "brain/projects/crm.org" org-directory)) - (setq org-sales-file - (expand-file-name "brain/projects/sales.org" org-directory)) - (setq org-company-file - (expand-file-name "brain/daily.org" org-directory)) - (setq org-agenda-files - (append (list org-default-notes-file - (expand-file-name "brain/projects" org-directory) - (expand-file-name "brain/areas/prm.org" org-directory))))) -#+end_src - -*** My personal settings for ~org-capture~ -:PROPERTIES: -:CUSTOM_ID: h:12636C22-D561-4726-8B37-10BD21737D54 -:CREATED: [2024-11-28 Thu 16:20] -:END: - -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" - ;;;; org-capture - (use-package org-capture - :ensure nil - :config - ;;; Default definitions for variables used in capture templates - (when (not (boundp 'org-blogpost-file)) - (defvar org-blogpost-file org-default-notes-file - "File in which blogposts and microblogposts are stored.")) - (when (not (boundp 'org-company-file)) - (defvar org-company-file org-default-notes-file - "File in which company documentation is stored.")) - - ;;; *CRITICAL NOTE* Read before modifying the push stack below: - ;; Pushing to capture templates is a stack. What goes in first shows - ;; up at the bottom of the capture templates list. - - ;;; Templates for thinking tools - (push '("T" "Templates for Helping Me Think") org-capture-templates) - ;; Capture a decision that you've taken, for review and reflection later. - (push `("Td" "Decision Journal" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.decision.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Current Reality Tree for a problem - (push `("Tc" "Current Reality Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.crt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create an Evaporating Cloud for a problem - (push `("Te" "Evaporating Cloud" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.ec.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Future Reality Tree for a problem - (push `("Tf" "Future Reality Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.frt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Prerequisite Tree for a problem - (push `("Tp" "Prerequisite Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.prt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Create a Transition Tree for a problem - (push `("Tt" "Transition Tree" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/thinking.trt.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a new Business idea for sketching out / thinking through - (push `("Tb" "Business Canvas" entry - (file+headline org-default-notes-file "Helping Me Think") - (file ,(expand-file-name "capture-templates/business.canvas.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a customer persona, note that this is always captured in - ;; the current clocking task, and is something I should do under the - ;; business canvas. - (push `("TP" "Customer Persona (under Business Canvas)" entry - (clock) - (file ,(expand-file-name "capture-templates/business.customer.persona.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture a customer journey through your product, note that this is - ;; always captured in the current clocking task - (push `("Tj" "Customer Journey (under Business Canvas)" entry - (clock) - (file ,(expand-file-name "capture-templates/business.customer.journey.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;;; Templates for capturing data about myself on a day-to-day basis - (push '("d" "Templates for Capturing Data (personal)") org-capture-templates) - - ;; Capture weight / food. This seems hard to get into a laptop habit. - ;; This is the kind of quantitative life that a mobile solution would - ;; have helped with. - - (push `("dw" "Weight Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.weight.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - - (push `("df" "Food Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.food.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - - (push `("dd" "Downtime Tracking" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/bodylog.dt.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t - :empty-lines 1) - org-capture-templates) - - ;;; Templates for capturing build in public ideas - (push '("b" "Templates for Capturing Build in Public") org-capture-templates) - - ;; Capture Micro-blogging - (push `("bm" "New Microblogging entry" entry - (file+olp+datetree org-blogpost-file "Microblogging") - (file ,(expand-file-name "capture-templates/microblog.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; New blogpost idea - (push `("bb" "New Blogpost entry" entry - (file+headline org-blogpost-file "Meta: Blogposts to write") - (file ,(expand-file-name "capture-templates/todo.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;;; Templates for when I want to capture specific feedback about something - (push '("f" "Templates for Feedback, Reflection, Journaling") org-capture-templates) - - ;; Capture feedback for people I am working with - (push `("fp" "Feedback for People I'm working with" item - (file+headline org-company-file "Feedback") - (file ,(expand-file-name "capture-templates/feedback.others.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; The monthly newsletter to send to investors, friends and mentors - (push `("fn" "Company Newsletters" entry - (file+headline org-company-file "Company Newsletters") - (file ,(expand-file-name "capture-templates/business.updates.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;; Capture suggestions / ideas from other people, which can be - ;; expanded into actual projects later. - (push `("fs" "Ideas and Suggestions" entry - (file+headline org-company-file "Ideas and Suggestions") - (file ,(expand-file-name "capture-templates/suggestion.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;;; Templates for planning on a day-to-day basis - (push '("p" "Templates for Planning") org-capture-templates) - - ;; Deliberately plan out and make a routine out of start of day and - ;; end of day activities. - - (push `("ps" "The Start of Day Planning Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.start.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - (push `("pe" "The End of Day Reflection Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.end.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - (push `("pn" "The Next Day Intentions Routine" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/workday.next.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - - ;;; Templates for capturing meetings, events, something happening at this time - (push '("m" "Templates for Capturing Meetings or Events") org-capture-templates) - - ;; Capture an upcoming meeting or one that has already happened - (push `("mp" "Meeting some other day" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/meeting.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :time-prompt t) - org-capture-templates) - - ;; Capture notes for an ongoing meeting or a meeting that's already - ;; happened. - (push `("mn" "Meeting today" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/meeting.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t) - org-capture-templates) - - ;;; Templates for Capturing Tasks - (push '("t" "Templates for Capturing Tasks") org-capture-templates) - - ;; Set up a new habit for tracking. This should be refiled to the - ;; correct location later. - (push `("th" "Habit" entry - (file+headline org-default-notes-file "My Habit Tracker") - (file ,(expand-file-name "capture-templates/habit.org" user-emacs-directory))) - org-capture-templates) - - ;; One-click Capture for replying to emails from notmuch. Creates a - ;; task to remind you that you need to reply to this email. - (push `("tr" "Respond to email" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/reply.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates) - - ;; One-click capture of links from the clipboard. Used in conjunction - ;; with `org-protocol', or as a stand-alone to capture links. - (push `("tw" "Website Link Immediate Capture" entry - (file+olp org-default-notes-file "Links Captured from the Browser") - (file ,(expand-file-name "capture-templates/website.org" user-emacs-directory)) - :immediate-finish t) - org-capture-templates) - - ;; A more nuanced capture for browser links, which I use for cleaning - ;; out my browser 2/3 times a week. - (push `("tl" "Website Link Pinboard Capture" entry - (file+olp org-default-notes-file "Links Captured from the Browser") - (file ,(expand-file-name "capture-templates/pinboard.capture.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates) - - ;; Capture a task where someone expects me to communicate when it's done - (push `("tj" "Jira or External-facing Task" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/jira.org" user-emacs-directory)) - :clock-in t - :clock-resume t) - org-capture-templates) - - ;; One-click Capture for Tasks. Captures the task immediately and gets - ;; out of your way. - (push `("ti" "Simple Task Immediate Finish" entry - (file+olp+datetree org-default-notes-file) - (file ,(expand-file-name "capture-templates/todo.org" user-emacs-directory)) - :clock-in t - :clock-resume t - :immediate-finish t) - org-capture-templates)) -#+end_src - -*** Sales and CRM settings for ~org-capture~ -:PROPERTIES: -:CUSTOM_ID: h:B1F1472D-7D4A-4620-973C-08FAE263A9F1 -:CREATED: [2024-12-24 Tue 12:40] -:END: - -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" - ;;;; Sales and CRM capture templates - (use-package org-capture - :ensure nil - :config - ;;; Default definitions for variables used in capture templates - (when (not (boundp 'org-crm-file)) - (defvar org-crm-file org-default-notes-file - "File in which CRM data is stored.")) - (when (not (boundp 'org-sales-file)) - (defvar org-sales-file org-default-notes-file - "File in which Sales Deal data is stored.")) - - ;;; *CRITICAL NOTE* Read before modifying the push stack below: - ;; Pushing to capture templates is a stack. What goes in first shows - ;; up at the bottom of the capture templates list. - - (push '("s" "Sales and CRM templates") org-capture-templates) - (push `("sl" "New Sales Lead" entry - (file+headline org-sales-file "Leads to be Refiled") - (file ,(expand-file-name "capture-templates/sales.newlead.org" user-emacs-directory)) - :prepend t - :kill-buffer t - :empty-lines-after 1 - :clock-in t - :clock-resume t) - org-capture-templates) - (push `("sc" "New Company in CRM" entry - (file org-crm-file) - (file ,(expand-file-name "capture-templates/crm.newcompany.org" user-emacs-directory)) - :prepend t - :clock-in t - :clock-resume t - :kill-buffer t - :empty-lines-after 1) - org-capture-templates) - (push `("sp" "New Person in CRM" entry - (file+headline org-crm-file "CRM to be Refiled") - (file ,(expand-file-name "capture-templates/crm.newperson.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates) - (push `("sm" "Sales Related Meeting" entry - (file+headline org-sales-file "Sales to be Refiled") - (file ,(expand-file-name "capture-templates/sales.newmeeting.org" user-emacs-directory)) - :prepend nil - :clock-in t - :clock-resume t - :empty-lines 1) - org-capture-templates)) -#+end_src - - -*** My personal settings for Ledger management -:PROPERTIES: -:CUSTOM_ID: h:D9F36A31-49C6-4481-9CE0-CF4A1616A4CF -:CREATED: [2024-12-05 Thu 16:45] -:END: - -I use the incredible ledger-mode for all my personal finance tracking - -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" - ;;; Ledger for personal finance management, plain-text accounting - (use-package ledger-mode - :ensure t) -#+end_src - -*** Finally, we provide the =vedang-personal.el= module +*** Finally, we provide the =nebkor-personal.el= module :PROPERTIES: :CUSTOM_ID: h:29100A9B-3142-4458-8CE1-43798EB9AA13 :CREATED: [2024-12-05 Thu 16:47] +:ID: 01JGD334GK0005ME4V4H9MVAHY :END: -#+begin_src emacs-lisp :tangle "custom-lisp/vedang-personal.el" - (provide 'vedang-personal) +#+begin_src emacs-lisp :tangle "custom-lisp/nebkor-personal.el" + (provide 'nebkor-personal) #+end_src ** COMMENT Local Variables diff --git a/unravel-modules/unravel-completion.el b/nebkor-modules/nebkor-completion.el similarity index 66% rename from unravel-modules/unravel-completion.el rename to nebkor-modules/nebkor-completion.el index fe383c2..1b4f52b 100644 --- a/unravel-modules/unravel-completion.el +++ b/nebkor-modules/nebkor-completion.el @@ -91,51 +91,49 @@ :ensure nil :hook (elpaca-after-init . minibuffer-depth-indicate-mode) :config - (setq read-minibuffer-restore-windows nil) ; Emacs 28 (setq enable-recursive-minibuffers t)) -(use-package minibuf-eldef - :ensure nil - :hook (elpaca-after-init . minibuffer-electric-default-mode) - :config - (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 +;; (use-package minibuf-eldef +;; :ensure nil +;; :config +;; (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 -(use-package rfn-eshadow - :ensure nil - :hook (minibuffer-setup . cursor-intangible-mode) - :config - ;; Not everything here comes from rfn-eshadow.el, but this is fine. +;; (use-package rfn-eshadow +;; :ensure nil +;; :hook (minibuffer-setup . cursor-intangible-mode) +;; :config +;; ;; Not everything here comes from rfn-eshadow.el, but this is fine. - (setq resize-mini-windows t) - (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 - (setq echo-keystrokes 0.25) - (setq kill-ring-max 60) ; Keep it small +;; (setq resize-mini-windows t) +;; (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 +;; (setq echo-keystrokes 0.25) +;; (setq kill-ring-max 60) ; Keep it small - ;; Do not allow the cursor to move inside the minibuffer prompt. I - ;; got this from the documentation of Daniel Mendler's Vertico - ;; package: . - (setq minibuffer-prompt-properties - '(read-only t cursor-intangible t face minibuffer-prompt)) +;; ;; Do not allow the cursor to move inside the minibuffer prompt. I +;; ;; got this from the documentation of Daniel Mendler's Vertico +;; ;; package: . +;; (setq minibuffer-prompt-properties +;; '(read-only t cursor-intangible t face minibuffer-prompt)) - ;; Add prompt indicator to `completing-read-multiple'. We display - ;; [`completing-read-multiple': ], e.g., - ;; [`completing-read-multiple': ,] if the separator is a comma. This - ;; is adapted from the README of the `vertico' package by Daniel - ;; Mendler. I made some small tweaks to propertize the segments of - ;; the prompt. - (defun crm-indicator (args) - (cons (format "[`completing-read-multiple': %s] %s" - (propertize - (replace-regexp-in-string - "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" - crm-separator) - 'face 'error) - (car args)) - (cdr args))) +;; ;; Add prompt indicator to `completing-read-multiple'. We display +;; ;; [`completing-read-multiple': ], e.g., +;; ;; [`completing-read-multiple': ,] if the separator is a comma. This +;; ;; is adapted from the README of the `vertico' package by Daniel +;; ;; Mendler. I made some small tweaks to propertize the segments of +;; ;; the prompt. +;; (defun crm-indicator (args) +;; (cons (format "[`completing-read-multiple': %s] %s" +;; (propertize +;; (replace-regexp-in-string +;; "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" +;; crm-separator) +;; 'face 'error) +;; (car args)) +;; (cdr args))) - (advice-add #'completing-read-multiple :filter-args #'crm-indicator) +;; (advice-add #'completing-read-multiple :filter-args #'crm-indicator) - (file-name-shadow-mode 1)) +;; (file-name-shadow-mode 1)) (use-package minibuffer :ensure nil @@ -288,84 +286,6 @@ (?v "Variables" font-lock-variable-name-face))))) (add-to-list 'consult-mode-histories '(vc-git-log-edit-mode . log-edit-comment-ring))) -;;; Extended minibuffer actions and more (embark.el and prot-embark.el) -(use-package embark - :ensure t - :defer 1 - :config - (setq embark-confirm-act-all nil) - (setq embark-mixed-indicator-both nil) - (setq embark-mixed-indicator-delay 1.0) - (setq embark-indicators '(embark-mixed-indicator embark-highlight-indicator)) - (setq embark-verbose-indicator-nested nil) ; I think I don't have them, but I do not want them either - (setq embark-verbose-indicator-buffer-sections '(bindings)) - (setq embark-verbose-indicator-excluded-actions - '(embark-cycle embark-act-all embark-collect embark-export embark-insert)) - - ;; I never cycle and want to disable the damn thing. Normally, a - ;; nil value disables a key binding but here that value is - ;; interpreted as the binding for `embark-act'. So I just add - ;; some obscure key that I do not have. I absolutely do not want - ;; to cycle! - (setq embark-cycle-key "") - - ;; I do not want `embark-org' and am not sure what is loading it. - ;; So I just unsert all the keymaps... This is the nuclear option - ;; but here we are. - (with-eval-after-load 'embark-org - (defvar prot/embark-org-keymaps - '(embark-org-table-cell-map - embark-org-table-map - embark-org-link-copy-map - embark-org-link-map - embark-org-src-block-map - embark-org-item-map - embark-org-plain-list-map - embark-org-export-in-place-map) - "List of Embark keymaps for Org.") - - ;; Reset `prot/embark-org-keymaps'. - (seq-do - (lambda (keymap) - (set keymap (make-sparse-keymap))) - prot/embark-org-keymaps))) - -;; I define my own keymaps because I only use a few functions in a -;; limited number of contexts. -(use-package prot-embark - :ensure nil - :after embark - :bind - ( :map global-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit) - :map embark-collect-mode-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit) - :map minibuffer-local-filename-completion-map - ("C-," . prot-embark-act-no-quit) - ("C-." . prot-embark-act-quit)) - :config - (setq embark-keymap-alist - '((buffer prot-embark-buffer-map) - (command prot-embark-command-map) - (expression prot-embark-expression-map) - (file prot-embark-file-map) - (function prot-embark-function-map) - (identifier prot-embark-identifier-map) - (package prot-embark-package-map) - (region prot-embark-region-map) - (symbol prot-embark-symbol-map) - (url prot-embark-url-map) - (variable prot-embark-variable-map) - (t embark-general-map)))) - -;; Needed for correct exporting while using Embark with Consult -;; commands. -(use-package embark-consult - :ensure t - :after (embark consult)) - ;;; Detailed completion annotations (marginalia.el) (use-package marginalia :ensure t @@ -379,16 +299,17 @@ :hook (elpaca-after-init . vertico-mode) :config (setq vertico-scroll-margin 0) - (setq vertico-count 5) + (setq vertico-count 8) (setq vertico-resize t) (setq vertico-cycle t) - (with-eval-after-load 'rfn-eshadow - ;; This works with `file-name-shadow-mode' enabled. When you are in - ;; a sub-directory and use, say, `find-file' to go to your home '~/' - ;; or root '/' directory, Vertico will clear the old path to keep - ;; only your current input. - (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))) + ;; (with-eval-after-load 'rfn-eshadow + ;; ;; This works with `file-name-shadow-mode' enabled. When you are in + ;; ;; a sub-directory and use, say, `find-file' to go to your home '~/' + ;; ;; or root '/' directory, Vertico will clear the old path to keep + ;; ;; only your current input. + ;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) + ) (use-package vertico-repeat :after vertico @@ -399,11 +320,11 @@ ("M-P" . vertico-repeat-previous)) :hook (minibuffer-setup . vertico-repeat-save)) -(use-package vertico-suspend - :after vertico - ;; Note: `enable-recursive-minibuffers' must be t - :bind ( :map global-map - ("M-S" . vertico-suspend) - ("C-x c b" . vertico-suspend))) +;; (use-package vertico-suspend +;; :after vertico +;; ;; Note: `enable-recursive-minibuffers' must be t +;; :bind ( :map global-map +;; ("M-S" . vertico-suspend) +;; ("C-x c b" . vertico-suspend))) -(provide 'unravel-completion) +(provide 'nebkor-completion) diff --git a/unravel-modules/unravel-dired.el b/nebkor-modules/nebkor-dired.el similarity index 99% rename from unravel-modules/unravel-dired.el rename to nebkor-modules/nebkor-dired.el index 49c6c13..c599451 100644 --- a/unravel-modules/unravel-dired.el +++ b/nebkor-modules/nebkor-dired.el @@ -110,4 +110,4 @@ When called with a prefix argument NLINES, display NLINES lines before and after (setq trashed-sort-key '("Date deleted" . t)) (setq trashed-date-format "%Y-%m-%d %H:%M:%S")) -(provide 'unravel-dired) +(provide 'nebkor-dired) diff --git a/unravel-modules/unravel-essentials.el b/nebkor-modules/nebkor-essentials.el similarity index 76% rename from unravel-modules/unravel-essentials.el rename to nebkor-modules/nebkor-essentials.el index 429b944..1d99767 100644 --- a/unravel-modules/unravel-essentials.el +++ b/nebkor-modules/nebkor-essentials.el @@ -112,39 +112,36 @@ ("M-w" . easy-kill)) ; re-map kill-ring-save ;;; Install and use tree-sitter major modes where possible -(when (treesit-available-p) (use-package treesit-auto :ensure t :config (setq treesit-auto-install 'prompt) (treesit-auto-add-to-auto-mode-alist) - (global-treesit-auto-mode))) + (global-treesit-auto-mode)) ;;; Mark syntactic constructs efficiently if tree-sitter is available (expreg) -(when (and (fboundp 'treesit-available-p) - (treesit-available-p)) - (use-package expreg - :ensure t - :functions (prot/expreg-expand prot/expreg-expand-dwim) - :bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp' - :config - (defun prot/expreg-expand (n) - "Expand to N syntactic units, defaulting to 1 if none is provided interactively." - (interactive "p") - (dotimes (_ n) - (expreg-expand))) +(use-package expreg + :ensure t + :functions (prot/expreg-expand prot/expreg-expand-dwim) + :bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp' + :config + (defun prot/expreg-expand (n) + "Expand to N syntactic units, defaulting to 1 if none is provided interactively." + (interactive "p") + (dotimes (_ n) + (expreg-expand))) - (defun prot/expreg-expand-dwim () - "Do-What-I-Mean `expreg-expand' to start with symbol or word. + (defun prot/expreg-expand-dwim () + "Do-What-I-Mean `expreg-expand' to start with symbol or word. If over a real symbol, mark that directly, else start with a word. Fall back to regular `expreg-expand'." - (interactive) - (let ((symbol (bounds-of-thing-at-point 'symbol))) - (cond - ((equal (bounds-of-thing-at-point 'word) symbol) - (prot/expreg-expand 1)) - (symbol (prot/expreg-expand 2)) - (t (expreg-expand))))))) + (interactive) + (let ((symbol (bounds-of-thing-at-point 'symbol))) + (cond + ((equal (bounds-of-thing-at-point 'word) symbol) + (prot/expreg-expand 1)) + (symbol (prot/expreg-expand 2)) + (t (expreg-expand)))))) ;;;; Configuration on Mac OS X machine (when (eq system-type 'darwin) @@ -171,11 +168,7 @@ word. Fall back to regular `expreg-expand'." (setq system-name (car (split-string system-name "\\."))) ;;; Binaries (setq vc-git-program (or (executable-find "git") "/usr/local/bin/git")) - (setq epg-gpg-program (or (executable-find "gpg") "/usr/local/bin/gpg")) -;;; Source dirs - ;; Note: These are hard-coded to my machine. - (setq source-directory (expand-file-name "~/src/emacs/src/")) - (setq find-function-C-source-directory (expand-file-name "~/src/emacs/src/")))) + (setq epg-gpg-program (or (executable-find "gpg") "/usr/local/bin/gpg")))) (defun vedang/backward-kill-word-or-kill-region (&optional arg) "fancy C-w. @@ -205,4 +198,32 @@ If the region is selected, retain the original behaviour, otherwise call (use-package helpful :ensure t) -(provide 'unravel-essentials) +(use-package indent-tools + :ensure t) + +(use-package key-chord + :ensure t + :config + (key-chord-mode +1) + (setq key-chord-one-key-delay 0.185) ; e.g. "jj", default 0.2 + (setq key-chord-two-keys-delay 0.1) ; e.g. "jk", default 0.1 + (setq key-chord-safety-interval-backward 0.2) ; default 0.1 is too close to key delays + (setq key-chord-safety-interval-forward 0.3) ; default 0.35 causes laggy experience + + (key-chord-define-global "VV" 'split-window-right) + (key-chord-define-global "HH" 'split-window-below) + (key-chord-define-global "BB" 'switch-to-buffer) + (key-chord-define-global "CC" 'recenter) + (key-chord-define-global "00" 'delete-window) + (key-chord-define-global "11" 'delete-other-windows) + (key-chord-define-global "WW" 'rotate-windows) + ) + +(use-package which-key + :ensure t + :config + (which-key-mode t) + (setq which-key-idle-delay 0.5) + (setq which-key-sort-order 'which-key-description-order)) + +(provide 'nebkor-essentials) diff --git a/nebkor-modules/nebkor-functions.el b/nebkor-modules/nebkor-functions.el new file mode 100644 index 0000000..8a78921 --- /dev/null +++ b/nebkor-modules/nebkor-functions.el @@ -0,0 +1,74 @@ +(defun diff-and-set-modified-p () + "Diff the current buffer with its associated file and set buffer modified status." + (let* ((tmpfile (diff-file-local-copy (current-buffer))) + (cmd (format "diff -q '%s' '%s'" (buffer-file-name) tmpfile)) + (result (call-process-shell-command cmd nil nil))) + (set-buffer-modified-p (not (zerop result))))) + +(defun nebkor/kill-buffer () + (interactive) + (diff-and-set-modified-p) + (kill-buffer (current-buffer)) + ) + +(defun sother-window () + "shift-other-window" + (interactive) + (other-window -1) + ) + +;;; From: +;;; https://fluca1978.github.io/2022/04/13/EmacsPgFormatter.html, with +;;; minor modifications to add the function to a `before-save-hook` +(defun pgformatter-on-region () + "A function to invoke pg_format as an external program." + (interactive) + (let ((b (if mark-active (min (point) (mark)) (point-min))) + (e (if mark-active (max (point) (mark)) (point-max))) + (pgfrm (executable-find "pg_format"))) + (when pgfrm + (let ((p (point))) + (progn + (shell-command-on-region b e pgfrm (current-buffer) 1) + (goto-char p) + )) + ) + ) + ) + +(defun sql-format-buffer-on-save () + "When saving an SQL buffer, format it with pg_format." + (add-hook 'before-save-hook #'pgformatter-on-region -10 t)) + +(defun nebkor-ksuidgen-p (orig-fn id) + "Check if an ID is a valid ksuid, and if not, return whatever ORIG-FN does." + (or (string-match (rx bol (= 27 alnum) eol) id) + (orig-fn id))) + +(defun nebkor-julid-p (orig-fn id) + "Check if an ID is a valid Julid, and if not, return whatever ORIG-FN does." + (or (string-match (rx bol (= 26 alnum) eol) id) + (orig-fn id))) + +(defun rotate-windows (arg) + "Rotate your windows; use the prefix argument to rotate the other direction" + (interactive "P") + (if (not (> (count-windows) 1)) + (message "You can't rotate a single window!") + (let* ((rotate-times (prefix-numeric-value arg)) + (direction (if (or (< rotate-times 0) (equal arg '(4))) + 'reverse 'identity))) + (dotimes (_ (abs rotate-times)) + (dotimes (i (- (count-windows) 1)) + (let* ((w1 (elt (funcall direction (window-list)) i)) + (w2 (elt (funcall direction (window-list)) (+ i 1))) + (b1 (window-buffer w1)) + (b2 (window-buffer w2)) + (s1 (window-start w1)) + (s2 (window-start w2)) + (p1 (window-point w1)) + (p2 (window-point w2))) + (set-window-buffer-start-and-point w1 b2 s2 p2) + (set-window-buffer-start-and-point w2 b1 s1 p1))))))) + +(provide 'nebkor-functions) diff --git a/unravel-modules/unravel-git.el b/nebkor-modules/nebkor-git.el similarity index 99% rename from unravel-modules/unravel-git.el rename to nebkor-modules/nebkor-git.el index 9e4b387..220956d 100644 --- a/unravel-modules/unravel-git.el +++ b/nebkor-modules/nebkor-git.el @@ -74,4 +74,4 @@ (setq magit-repository-directories '(("~/src/prototypes" . 1)))) -(provide 'unravel-git) +(provide 'nebkor-git) diff --git a/unravel-modules/unravel-langs.el b/nebkor-modules/nebkor-langs.el similarity index 99% rename from unravel-modules/unravel-langs.el rename to nebkor-modules/nebkor-langs.el index b34f6a3..3df3869 100644 --- a/unravel-modules/unravel-langs.el +++ b/nebkor-modules/nebkor-langs.el @@ -280,4 +280,4 @@ NS is the namespace information passed into the function by cider." ( :map ielm-map ("C-j" . newline-and-indent))) -(provide 'unravel-langs) +(provide 'nebkor-langs) diff --git a/unravel-modules/unravel-org.el b/nebkor-modules/nebkor-org.el similarity index 99% rename from unravel-modules/unravel-org.el rename to nebkor-modules/nebkor-org.el index c5b7073..48e4d95 100644 --- a/unravel-modules/unravel-org.el +++ b/nebkor-modules/nebkor-org.el @@ -615,4 +615,4 @@ If WEEK-NUM is not provided, use the current week." (setq org-habit-preceding-days 9) (setq org-habit-show-all-today t)) -(provide 'unravel-org) +(provide 'nebkor-org) diff --git a/unravel-modules/unravel-search.el b/nebkor-modules/nebkor-search.el similarity index 96% rename from unravel-modules/unravel-search.el rename to nebkor-modules/nebkor-search.el index e92bf4b..d0f091e 100644 --- a/unravel-modules/unravel-search.el +++ b/nebkor-modules/nebkor-search.el @@ -82,8 +82,8 @@ (setq grep-program executable) (setq grep-template (if rgp - "/usr/bin/rg -nH --null -e " - "/usr/bin/grep -nH --null -e ")) + "rg -nH --null -e " + "grep -nH --null -e ")) (setq xref-search-program (if rgp 'ripgrep 'grep)))) ;;; wgrep (writable grep) @@ -137,4 +137,4 @@ (setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark))) -(provide 'unravel-search) +(provide 'nebkor-search) diff --git a/unravel-modules/unravel-study.el b/nebkor-modules/nebkor-study.el similarity index 98% rename from unravel-modules/unravel-study.el rename to nebkor-modules/nebkor-study.el index c7f8b4f..75839c9 100644 --- a/unravel-modules/unravel-study.el +++ b/nebkor-modules/nebkor-study.el @@ -287,8 +287,4 @@ modifications." :bind-keymap ("C-c o" . org-board-keymap)) -;;; Publishing org-mode content -(use-package ox-gfm - :ensure (:host github :repo "vedang/ox-gfm" :branch "master")) - -(provide 'unravel-study) +(provide 'nebkor-study) diff --git a/unravel-modules/unravel-theme.el b/nebkor-modules/nebkor-theme.el similarity index 70% rename from unravel-modules/unravel-theme.el rename to nebkor-modules/nebkor-theme.el index 0f50596..9ca0d1b 100644 --- a/unravel-modules/unravel-theme.el +++ b/nebkor-modules/nebkor-theme.el @@ -1,34 +1,6 @@ ;;; Everything related to the look of Emacs -;;; The Ef (εὖ) themes - -;; The themes are customisable. Read the manual: -;; . -(use-package ef-themes - :ensure t - :demand t - :bind - (("" . ef-themes-rotate) - ("C-" . ef-themes-select)) - :config - (setq ef-themes-to-toggle '(ef-elea-light ef-elea-dark)) - (setq ef-themes-variable-pitch-ui t) - (setq ef-themes-mixed-fonts t) - (setq ef-themes-rotate ef-themes-items) - (setq ef-themes-headings ; read the manual's entry of the doc string - '((0 . (variable-pitch light 1.9)) - (1 . (variable-pitch light 1.8)) - (2 . (variable-pitch regular 1.7)) - (3 . (variable-pitch regular 1.6)) - (4 . (variable-pitch regular 1.5)) - (5 . (variable-pitch 1.4)) ; absence of weight means `bold' - (6 . (variable-pitch 1.3)) - (7 . (variable-pitch 1.2)) - (agenda-date . (semilight 1.5)) - (agenda-structure . (variable-pitch light 1.9)) - (t . (variable-pitch 1.1)))) - (setq ef-themes-disable-other-themes t) - (mapc #'disable-theme custom-enabled-themes)) +(add-to-list 'default-frame-alist '(background-color . "snow")) ;;;; Lin ;; Read the lin manual: . @@ -38,28 +10,6 @@ :config (setopt lin-face 'lin-cyan)) -;;;; Increase padding of windows/frames -;; . -(use-package spacious-padding - :ensure t - :if (display-graphic-p) - :hook (elpaca-after-init . spacious-padding-mode) - :init - ;; These are the defaults, but I keep it here for visiibility. - (setq spacious-padding-widths - '(:internal-border-width 30 - :header-line-width 4 - :mode-line-width 6 - :tab-width 4 - :right-divider-width 30 - :scroll-bar-width 8 - :left-fringe-width 20 - :right-fringe-width 20)) - - ;; Read the doc string of `spacious-padding-subtle-mode-line' as - ;; it is very flexible. - (setq spacious-padding-subtle-mode-line t)) - ;;;; Rainbow mode for colour previewing (rainbow-mode.el) (use-package rainbow-mode :ensure t @@ -117,7 +67,7 @@ :cursor-type box :cursor-in-non-selected-windows hollow :blink-cursor-mode 1 - :blink-cursor-blinks 10 + :blink-cursor-blinks 5 :blink-cursor-interval 0.2 :blink-cursor-delay 0.2))) @@ -128,26 +78,6 @@ (cursory-mode 1)) -;;;; Theme buffet -;; -(use-package theme-buffet - :ensure t - :after (:any modus-themes ef-themes) - :config - (let ((modus-themes-p (featurep 'modus-themes)) - (ef-themes-p (featurep 'ef-themes))) - (setq theme-buffet-menu 'end-user) - (setq theme-buffet-time-offset 0) - (setq theme-buffet-end-user - '( :night (ef-dark ef-winter ef-autumn ef-night ef-duo-dark ef-symbiosis ef-owl) - :morning (ef-light ef-cyprus ef-spring ef-frost ef-duo-light ef-eagle) - :afternoon (ef-arbutus ef-day ef-kassio ef-summer ef-elea-light ef-maris-light ef-melissa-light ef-trio-light ef-reverie) - :evening (ef-rosa ef-elea-dark ef-maris-dark ef-melissa-dark ef-trio-dark ef-dream))) - - (when (or modus-themes-p ef-themes-p) - (theme-buffet-timer-hours 2) - (theme-buffet-a-la-carte)))) - ;;;; Fontaine (font configurations) ;; Read the manual: (use-package fontaine @@ -160,25 +90,21 @@ (elpaca-after-init . (lambda () ;; Set last preset or fall back to desired style from `fontaine-presets'. (fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular)))) - (enable-theme-functions . fontaine-apply-current-preset) - (ef-themes-post-load . fontaine-apply-current-preset)) + (enable-theme-functions . fontaine-apply-current-preset)) :config ;; This is defined in Emacs C code: it belongs to font settings. (setq x-underline-at-descent-line nil) - ;; And this is for Emacs28. - (setq-default text-scale-remap-header-line t) - ;; This is the default value. Just including it here for ;; completeness. (setq fontaine-latest-state-file (locate-user-emacs-file "fontaine-latest-state.eld")) (setq fontaine-presets '((small - :default-family "Iosevka" + :default-family "Noto Sans" :default-height 130) (regular - :default-height 150) + :default-height 130) (medium :default-weight semilight :default-height 170 @@ -196,7 +122,7 @@ ;; I keep all properties for didactic purposes, but most can be ;; omitted. See the fontaine manual for the technicalities: ;; . - :default-family "Iosevka" + :default-family "Noto Sans" :default-weight regular :default-slant normal :default-width normal @@ -301,7 +227,7 @@ x×X .,·°;:¡!¿?`'‘’ ÄAÃÀ TODO ;; NOTE 2022-11-20: This may not cover every case, though it works ;; fine in my workflow. I am still undecided by EWW. (defun prot/enable-variable-pitch () - (unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode) + (unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode 'prog-mode) (variable-pitch-mode 1))) ;;;;; Resize keys with global effect :bind @@ -313,4 +239,4 @@ x×X .,·°;:¡!¿?`'‘’ ÄAÃÀ TODO ("C-x C-+" . global-text-scale-adjust) ("C-x C-0" . global-text-scale-adjust))) -(provide 'unravel-theme) +(provide 'nebkor-theme) diff --git a/nebkor-modules/nebkor-window.el b/nebkor-modules/nebkor-window.el new file mode 100644 index 0000000..33ccfe9 --- /dev/null +++ b/nebkor-modules/nebkor-window.el @@ -0,0 +1,75 @@ +;;; General window and buffer configurations +(use-package uniquify + :ensure nil + :config +;;;; `uniquify' (unique names for buffers) + (setq uniquify-buffer-name-style 'forward) + (setq uniquify-strip-common-suffix t) + (setq uniquify-after-kill-buffer-p t)) + +(use-package window + :ensure nil + :config + (setq display-buffer-reuse-frames t) + (setq recenter-positions '(top middle bottom))) + +;;; Frame-isolated buffers +;; Another package of mine. Read the manual: +;; . +(use-package beframe + :ensure t + :hook (elpaca-after-init . beframe-mode) + :bind + ("C-x f" . other-frame-prefix) + ("C-c b" . beframe-prefix-map) + ;; Replace the generic `buffer-menu'. With a prefix argument, this + ;; commands prompts for a frame. Call the `buffer-menu' via M-x if + ;; you absolutely need the global list of buffers. + ("C-x C-b" . beframe-buffer-menu) + ("C-x b" . beframe-switch-buffer) + ("C-x B" . select-frame-by-name) + :config + (setq beframe-functions-in-frames '(project-prompt-project-dir)) + + (defvar consult-buffer-sources) + (declare-function consult--buffer-state "consult") + + (with-eval-after-load 'consult + (defface beframe-buffer + '((t :inherit font-lock-string-face)) + "Face for `consult' framed buffers.") + + (defun my-beframe-buffer-names-sorted (&optional frame) + "Return the list of buffers from `beframe-buffer-names' sorted by visibility. +With optional argument FRAME, return the list of buffers of FRAME." + (beframe-buffer-names frame :sort #'beframe-buffer-sort-visibility)) + + (defvar beframe-consult-source + `( :name "Frame-specific buffers (current frame)" + :narrow ?F + :category buffer + :face beframe-buffer + :history beframe-history + :items ,#'my-beframe-buffer-names-sorted + :action ,#'switch-to-buffer + :state ,#'consult--buffer-state)) + + (add-to-list 'consult-buffer-sources 'beframe-consult-source))) + +;;; Header line context of symbol/heading (breadcrumb.el) +(use-package breadcrumb + :ensure t + :functions (prot/breadcrumb-local-mode) + :hook ((text-mode prog-mode) . prot/breadcrumb-local-mode) + :config + (setq breadcrumb-project-max-length 0.5) + (setq breadcrumb-project-crumb-separator "/") + (setq breadcrumb-imenu-max-length 1.0) + (setq breadcrumb-imenu-crumb-separator " > ") + + (defun prot/breadcrumb-local-mode () + "Enable `breadcrumb-local-mode' if the buffer is visiting a file." + (when buffer-file-name + (breadcrumb-local-mode 1)))) + +(provide 'nebkor-window) diff --git a/unravel-modules/unravel-shell.el b/unravel-modules/unravel-shell.el deleted file mode 100644 index 7a7c8ee..0000000 --- a/unravel-modules/unravel-shell.el +++ /dev/null @@ -1,35 +0,0 @@ -;;;; Vterm -(use-package vterm - :ensure t - :bind - ("C-x m" . vterm) - :config - (setq vterm-shell (or (executable-find "fish") "/opt/homebrew/bin/fish"))) - -;;; Enrich zoxide db based on everything I open in Emacs -(when (executable-find "zoxide") - (use-package zoxide - :ensure t - :hook - (consult-after-jump . zoxide-add) - (find-file . zoxide-add) - (dired-mode . zoxide-add))) - -;; Mode to read/write fish functions and files -(use-package fish-mode - :ensure t) - -(use-package dwim-shell-command - :ensure t - :bind - ( :map global-map - ([remap shell-command] . dwim-shell-command) - :map dired-mode-map - ([remap dired-do-async-shell-command] . dwim-shell-command) - ([remap dired-do-shell-command] . dwim-shell-command) - ([remap dired-smart-shell-command] . dwim-shell-command)) - :config - ;; Also make available all the utility functions provided by Xenodium - (require 'dwim-shell-commands)) - -(provide 'unravel-shell) diff --git a/unravel-modules/unravel-window.el b/unravel-modules/unravel-window.el deleted file mode 100644 index ba12334..0000000 --- a/unravel-modules/unravel-window.el +++ /dev/null @@ -1,173 +0,0 @@ -;;; General window and buffer configurations -(use-package uniquify - :ensure nil - :config -;;;; `uniquify' (unique names for buffers) - (setq uniquify-buffer-name-style 'forward) - (setq uniquify-strip-common-suffix t) - (setq uniquify-after-kill-buffer-p t)) - -;;;; `window', `display-buffer-alist', and related -(use-package prot-window - :ensure nil - :demand t - :config - ;; NOTE 2023-03-17: Remember that I am using development versions of - ;; Emacs. Some of my `display-buffer-alist' contents are for Emacs - ;; 29+. - (setq display-buffer-alist - `(;; no window - ("\\`\\*Async Shell Command\\*\\'" - (display-buffer-no-window)) - ("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'" - (display-buffer-no-window) - (allow-no-window . t)) - ;; bottom side window - ("\\*Org \\(Select\\|Note\\)\\*" ; the `org-capture' key selection and `org-add-log-note' - (display-buffer-in-side-window) - (dedicated . t) - (side . bottom) - (slot . 0) - (window-parameters . ((mode-line-format . none)))) - ;; bottom buffer (NOT side window) - ((or . ((derived-mode . flymake-diagnostics-buffer-mode) - (derived-mode . flymake-project-diagnostics-mode) - (derived-mode . messages-buffer-mode) - (derived-mode . backtrace-mode))) - (display-buffer-reuse-mode-window display-buffer-at-bottom) - (window-height . 0.3) - (dedicated . t) - (preserve-size . (t . t))) - ("\\*Embark Actions\\*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . fit-window-to-buffer) - (window-parameters . ((no-other-window . t) - (mode-line-format . none)))) - ("\\*\\(Output\\|Register Preview\\).*" - (display-buffer-reuse-mode-window display-buffer-at-bottom)) - ;; below current window - ("\\(\\*Capture\\*\\|CAPTURE-.*\\)" - (display-buffer-reuse-mode-window display-buffer-below-selected)) - ("\\*\\vc-\\(incoming\\|outgoing\\|git : \\).*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . 0.1) - (dedicated . t) - (preserve-size . (t . t))) - ((derived-mode . reb-mode) ; M-x re-builder - (display-buffer-reuse-mode-window display-buffer-below-selected) - (window-height . 4) ; note this is literal lines, not relative - (dedicated . t) - (preserve-size . (t . t))) - ((or . ((derived-mode . occur-mode) - (derived-mode . grep-mode) - (derived-mode . Buffer-menu-mode) - (derived-mode . log-view-mode) - (derived-mode . help-mode) ; See the hooks for `visual-line-mode' - "\\*\\(|Buffer List\\|Occur\\|vc-change-log\\|eldoc.*\\).*" - prot-window-shell-or-term-p - ;; ,world-clock-buffer-name - )) - (prot-window-display-buffer-below-or-pop) - (body-function . prot-window-select-fit-size)) - ("\\*\\(Calendar\\|Bookmark Annotation\\|ert\\).*" - (display-buffer-reuse-mode-window display-buffer-below-selected) - (dedicated . t) - (window-height . fit-window-to-buffer)) - ;; same window - ;; NOTE 2023-02-17: `man' does not fully obey the - ;; `display-buffer-alist'. It works for new frames and for - ;; `display-buffer-below-selected', but otherwise is - ;; unpredictable. See `Man-notify-method'. - ((or . ((derived-mode . Man-mode) - (derived-mode . woman-mode) - "\\*\\(Man\\|woman\\).*")) - (display-buffer-same-window))))) - -(use-package prot-window - :ensure nil - :demand t - :config - (setq window-combination-resize t) - (setq even-window-sizes 'height-only) - (setq window-sides-vertical nil) - (setq switch-to-buffer-in-dedicated-window 'pop) - (setq split-height-threshold 80) - (setq split-width-threshold 125) - (setq window-min-height 3) - (setq window-min-width 30)) - -(use-package window - :ensure nil - :config - (setq display-buffer-reuse-frames t) - (setq recenter-positions '(top middle bottom))) - -;;; Frame-isolated buffers -;; Another package of mine. Read the manual: -;; . -(use-package beframe - :ensure t - :hook (elpaca-after-init . beframe-mode) - :bind - ("C-x f" . other-frame-prefix) - ("C-c b" . beframe-prefix-map) - ;; Replace the generic `buffer-menu'. With a prefix argument, this - ;; commands prompts for a frame. Call the `buffer-menu' via M-x if - ;; you absolutely need the global list of buffers. - ("C-x C-b" . beframe-buffer-menu) - ("C-x b" . beframe-switch-buffer) - ("C-x B" . select-frame-by-name) - :config - (setq beframe-functions-in-frames '(project-prompt-project-dir)) - - (defvar consult-buffer-sources) - (declare-function consult--buffer-state "consult") - - (with-eval-after-load 'consult - (defface beframe-buffer - '((t :inherit font-lock-string-face)) - "Face for `consult' framed buffers.") - - (defun my-beframe-buffer-names-sorted (&optional frame) - "Return the list of buffers from `beframe-buffer-names' sorted by visibility. -With optional argument FRAME, return the list of buffers of FRAME." - (beframe-buffer-names frame :sort #'beframe-buffer-sort-visibility)) - - (defvar beframe-consult-source - `( :name "Frame-specific buffers (current frame)" - :narrow ?F - :category buffer - :face beframe-buffer - :history beframe-history - :items ,#'my-beframe-buffer-names-sorted - :action ,#'switch-to-buffer - :state ,#'consult--buffer-state)) - - (add-to-list 'consult-buffer-sources 'beframe-consult-source))) - -;;; Frame history (undelete-frame-mode) -(use-package frame - :ensure nil - :bind ("C-x u" . undelete-frame) ; I use only C-/ for `undo' - :hook (elpaca-after-init . undelete-frame-mode)) - -;;; Window history (winner-mode) -(use-package winner - :ensure nil - :hook (elpaca-after-init . winner-mode) - :bind - (("C-x " . winner-redo) - ("C-x " . winner-undo))) - -(use-package zone - :ensure nil - :config - (zone-when-idle 300)) - -(use-package time - :ensure nil - :config - (setq display-time-day-and-date t) - (display-time)) - -(provide 'unravel-window)