Compare commits
No commits in common. "e55bdb194406ce522970a87b08e1bdff81655566" and "7bbdbe5ecce291a5bbed6d2c94ddd94ba286ce43" have entirely different histories.
e55bdb1944
...
7bbdbe5ecc
17 changed files with 2607 additions and 1456 deletions
|
@ -1,17 +0,0 @@
|
||||||
;; 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)
|
|
394
custom-lisp/vedang-personal.el
Normal file
394
custom-lisp/vedang-personal.el
Normal file
|
@ -0,0 +1,394 @@
|
||||||
|
;;; 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)
|
40
init.el
40
init.el
|
@ -1,14 +1,12 @@
|
||||||
;; init.el -*- lexical-binding: t; -*-
|
;; init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(set-language-environment "UTF-8")
|
|
||||||
|
|
||||||
;; Make native compilation silent and prune its cache.
|
;; Make native compilation silent and prune its cache.
|
||||||
(setq native-compile-prune-cache t)
|
(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 custom-file "~/.emacs.d/custom.el")
|
|
||||||
(load custom-file)
|
|
||||||
;; Disable custom.el by making it disposable.
|
;; 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
|
;; Enable these commands which have been disabled by default
|
||||||
(mapc
|
(mapc
|
||||||
|
@ -25,7 +23,7 @@
|
||||||
(mapc
|
(mapc
|
||||||
(lambda (string)
|
(lambda (string)
|
||||||
(add-to-list 'load-path (locate-user-emacs-file string)))
|
(add-to-list 'load-path (locate-user-emacs-file string)))
|
||||||
'("nebkor-modules" "custom-lisp"))
|
'("unravel-modules" "custom-lisp"))
|
||||||
|
|
||||||
;;; Install Elpaca
|
;;; Install Elpaca
|
||||||
|
|
||||||
|
@ -112,20 +110,24 @@ making an abbreviation to a function."
|
||||||
(seq-split definitions 2)))
|
(seq-split definitions 2)))
|
||||||
(error "%s is not an abbrev table" ,table)))
|
(error "%s is not an abbrev table" ,table)))
|
||||||
|
|
||||||
(require 'nebkor-theme)
|
(require 'unravel-theme)
|
||||||
(require 'nebkor-essentials)
|
(require 'unravel-essentials)
|
||||||
(require 'nebkor-functions)
|
(require 'unravel-completion)
|
||||||
(require 'nebkor-completion)
|
(require 'unravel-search)
|
||||||
(require 'nebkor-search)
|
(require 'unravel-dired)
|
||||||
(require 'nebkor-dired)
|
(require 'unravel-window)
|
||||||
(require 'nebkor-window)
|
(require 'unravel-git)
|
||||||
(require 'nebkor-git)
|
(require 'unravel-org)
|
||||||
(require 'nebkor-org)
|
(require 'unravel-shell)
|
||||||
(require 'nebkor-langs)
|
(require 'unravel-langs)
|
||||||
(require 'nebkor-study)
|
(require 'unravel-study)
|
||||||
;;; Comment this next line if you don't want to use my personal
|
;;; Comment this next line if you don't want to use my personal
|
||||||
;;; settings (like specific directories or org variables)
|
;;; settings (like specific directories or org variables)
|
||||||
(require 'nebkor-personal)
|
(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")))
|
||||||
|
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; no-byte-compile: t
|
;; no-byte-compile: t
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
(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)
|
|
|
@ -1,75 +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))
|
|
||||||
|
|
||||||
(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:
|
|
||||||
;; <https://protesilaos.com/emacs/beframe>.
|
|
||||||
(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)
|
|
File diff suppressed because it is too large
Load diff
|
@ -91,49 +91,51 @@
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (elpaca-after-init . minibuffer-depth-indicate-mode)
|
:hook (elpaca-after-init . minibuffer-depth-indicate-mode)
|
||||||
:config
|
:config
|
||||||
|
(setq read-minibuffer-restore-windows nil) ; Emacs 28
|
||||||
(setq enable-recursive-minibuffers t))
|
(setq enable-recursive-minibuffers t))
|
||||||
|
|
||||||
;; (use-package minibuf-eldef
|
(use-package minibuf-eldef
|
||||||
;; :ensure nil
|
:ensure nil
|
||||||
;; :config
|
:hook (elpaca-after-init . minibuffer-electric-default-mode)
|
||||||
;; (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29
|
:config
|
||||||
|
(setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29
|
||||||
|
|
||||||
;; (use-package rfn-eshadow
|
(use-package rfn-eshadow
|
||||||
;; :ensure nil
|
:ensure nil
|
||||||
;; :hook (minibuffer-setup . cursor-intangible-mode)
|
:hook (minibuffer-setup . cursor-intangible-mode)
|
||||||
;; :config
|
:config
|
||||||
;; ;; Not everything here comes from rfn-eshadow.el, but this is fine.
|
;; Not everything here comes from rfn-eshadow.el, but this is fine.
|
||||||
|
|
||||||
;; (setq resize-mini-windows t)
|
(setq resize-mini-windows t)
|
||||||
;; (setq read-answer-short t) ; also check `use-short-answers' for Emacs28
|
(setq read-answer-short t) ; also check `use-short-answers' for Emacs28
|
||||||
;; (setq echo-keystrokes 0.25)
|
(setq echo-keystrokes 0.25)
|
||||||
;; (setq kill-ring-max 60) ; Keep it small
|
(setq kill-ring-max 60) ; Keep it small
|
||||||
|
|
||||||
;; ;; Do not allow the cursor to move inside the minibuffer prompt. I
|
;; Do not allow the cursor to move inside the minibuffer prompt. I
|
||||||
;; ;; got this from the documentation of Daniel Mendler's Vertico
|
;; got this from the documentation of Daniel Mendler's Vertico
|
||||||
;; ;; package: <https://github.com/minad/vertico>.
|
;; package: <https://github.com/minad/vertico>.
|
||||||
;; (setq minibuffer-prompt-properties
|
(setq minibuffer-prompt-properties
|
||||||
;; '(read-only t cursor-intangible t face minibuffer-prompt))
|
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
|
|
||||||
;; ;; Add prompt indicator to `completing-read-multiple'. We display
|
;; Add prompt indicator to `completing-read-multiple'. We display
|
||||||
;; ;; [`completing-read-multiple': <separator>], e.g.,
|
;; [`completing-read-multiple': <separator>], e.g.,
|
||||||
;; ;; [`completing-read-multiple': ,] if the separator is a comma. This
|
;; [`completing-read-multiple': ,] if the separator is a comma. This
|
||||||
;; ;; is adapted from the README of the `vertico' package by Daniel
|
;; is adapted from the README of the `vertico' package by Daniel
|
||||||
;; ;; Mendler. I made some small tweaks to propertize the segments of
|
;; Mendler. I made some small tweaks to propertize the segments of
|
||||||
;; ;; the prompt.
|
;; the prompt.
|
||||||
;; (defun crm-indicator (args)
|
(defun crm-indicator (args)
|
||||||
;; (cons (format "[`completing-read-multiple': %s] %s"
|
(cons (format "[`completing-read-multiple': %s] %s"
|
||||||
;; (propertize
|
(propertize
|
||||||
;; (replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
;; "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||||
;; crm-separator)
|
crm-separator)
|
||||||
;; 'face 'error)
|
'face 'error)
|
||||||
;; (car args))
|
(car args))
|
||||||
;; (cdr 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
|
(use-package minibuffer
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
@ -145,7 +147,7 @@
|
||||||
(setq completion-auto-select nil)
|
(setq completion-auto-select nil)
|
||||||
(setq completions-detailed t)
|
(setq completions-detailed t)
|
||||||
(setq completion-show-inline-help nil)
|
(setq completion-show-inline-help nil)
|
||||||
(setq completions-max-height 10)
|
(setq completions-max-height 6)
|
||||||
(setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic))
|
(setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic))
|
||||||
(setq completions-highlight-face 'completions-highlight)
|
(setq completions-highlight-face 'completions-highlight)
|
||||||
(setq minibuffer-completion-auto-choose t)
|
(setq minibuffer-completion-auto-choose t)
|
||||||
|
@ -274,7 +276,6 @@
|
||||||
(setq consult-preview-key 'any)
|
(setq consult-preview-key 'any)
|
||||||
;; the `imenu' extension is in its own file
|
;; the `imenu' extension is in its own file
|
||||||
(require 'consult-imenu)
|
(require 'consult-imenu)
|
||||||
(consult-customize consult-imenu :initial (thing-at-point 'symbol))
|
|
||||||
(dolist (clj '(clojure-mode clojure-ts-mode))
|
(dolist (clj '(clojure-mode clojure-ts-mode))
|
||||||
(add-to-list 'consult-imenu-config
|
(add-to-list 'consult-imenu-config
|
||||||
`(,clj :toplevel "Functions"
|
`(,clj :toplevel "Functions"
|
||||||
|
@ -286,6 +287,84 @@
|
||||||
(?v "Variables" font-lock-variable-name-face)))))
|
(?v "Variables" font-lock-variable-name-face)))))
|
||||||
(add-to-list 'consult-mode-histories '(vc-git-log-edit-mode . log-edit-comment-ring)))
|
(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 "<XF86Travel>")
|
||||||
|
|
||||||
|
;; 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)
|
;;; Detailed completion annotations (marginalia.el)
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:ensure t
|
:ensure t
|
||||||
|
@ -299,17 +378,16 @@
|
||||||
:hook (elpaca-after-init . vertico-mode)
|
:hook (elpaca-after-init . vertico-mode)
|
||||||
:config
|
:config
|
||||||
(setq vertico-scroll-margin 0)
|
(setq vertico-scroll-margin 0)
|
||||||
(setq vertico-count 8)
|
(setq vertico-count 5)
|
||||||
(setq vertico-resize t)
|
(setq vertico-resize t)
|
||||||
(setq vertico-cycle t)
|
(setq vertico-cycle t)
|
||||||
|
|
||||||
;; (with-eval-after-load 'rfn-eshadow
|
(with-eval-after-load 'rfn-eshadow
|
||||||
;; ;; This works with `file-name-shadow-mode' enabled. When you are in
|
;; 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 '~/'
|
;; a sub-directory and use, say, `find-file' to go to your home '~/'
|
||||||
;; ;; or root '/' directory, Vertico will clear the old path to keep
|
;; or root '/' directory, Vertico will clear the old path to keep
|
||||||
;; ;; only your current input.
|
;; only your current input.
|
||||||
;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))
|
(add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)))
|
||||||
)
|
|
||||||
|
|
||||||
(use-package vertico-repeat
|
(use-package vertico-repeat
|
||||||
:after vertico
|
:after vertico
|
||||||
|
@ -320,11 +398,11 @@
|
||||||
("M-P" . vertico-repeat-previous))
|
("M-P" . vertico-repeat-previous))
|
||||||
:hook (minibuffer-setup . vertico-repeat-save))
|
:hook (minibuffer-setup . vertico-repeat-save))
|
||||||
|
|
||||||
;; (use-package vertico-suspend
|
(use-package vertico-suspend
|
||||||
;; :after vertico
|
:after vertico
|
||||||
;; ;; Note: `enable-recursive-minibuffers' must be t
|
;; Note: `enable-recursive-minibuffers' must be t
|
||||||
;; :bind ( :map global-map
|
:bind ( :map global-map
|
||||||
;; ("M-S" . vertico-suspend)
|
("M-S" . vertico-suspend)
|
||||||
;; ("C-x c b" . vertico-suspend)))
|
("C-x c b" . vertico-suspend)))
|
||||||
|
|
||||||
(provide 'nebkor-completion)
|
(provide 'unravel-completion)
|
|
@ -12,7 +12,7 @@
|
||||||
:commands (dired)
|
:commands (dired)
|
||||||
:config
|
:config
|
||||||
(setq insert-directory-program
|
(setq insert-directory-program
|
||||||
(or (executable-find "ls") "/opt/homebrew/bin/gls"))
|
(or (executable-find "gls") "/opt/homebrew/bin/gls"))
|
||||||
(setq dired-listing-switches
|
(setq dired-listing-switches
|
||||||
"-AGFhlv --group-directories-first --time-style=long-iso"))
|
"-AGFhlv --group-directories-first --time-style=long-iso"))
|
||||||
|
|
||||||
|
@ -39,19 +39,6 @@
|
||||||
;; problem as j calls `dired-goto-file', which I often use.
|
;; problem as j calls `dired-goto-file', which I often use.
|
||||||
(define-key dired-jump-map (kbd "j") nil))
|
(define-key dired-jump-map (kbd "j") nil))
|
||||||
|
|
||||||
;;; Multi-occur in project and dired!
|
|
||||||
(use-package dired
|
|
||||||
:ensure nil
|
|
||||||
:bind
|
|
||||||
( :map dired-mode-map
|
|
||||||
("M-s a m" . noccur-dired))
|
|
||||||
:config
|
|
||||||
(defun noccur-dired (regexp &optional nlines)
|
|
||||||
"Perform `multi-occur' with REGEXP in all dired marked files.
|
|
||||||
When called with a prefix argument NLINES, display NLINES lines before and after."
|
|
||||||
(interactive (occur-read-primary-args))
|
|
||||||
(multi-occur (mapcar #'find-file (dired-get-marked-files)) regexp nlines)))
|
|
||||||
|
|
||||||
(use-package dired-aux
|
(use-package dired-aux
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:after dired
|
:after dired
|
||||||
|
@ -110,4 +97,4 @@ When called with a prefix argument NLINES, display NLINES lines before and after
|
||||||
(setq trashed-sort-key '("Date deleted" . t))
|
(setq trashed-sort-key '("Date deleted" . t))
|
||||||
(setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
(setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
||||||
|
|
||||||
(provide 'nebkor-dired)
|
(provide 'unravel-dired)
|
|
@ -112,36 +112,51 @@
|
||||||
("M-w" . easy-kill)) ; re-map kill-ring-save
|
("M-w" . easy-kill)) ; re-map kill-ring-save
|
||||||
|
|
||||||
;;; Install and use tree-sitter major modes where possible
|
;;; Install and use tree-sitter major modes where possible
|
||||||
|
(when (treesit-available-p)
|
||||||
(use-package treesit-auto
|
(use-package treesit-auto
|
||||||
:ensure t
|
:ensure t
|
||||||
:config
|
:config
|
||||||
(setq treesit-auto-install 'prompt)
|
(setq treesit-auto-install 'prompt)
|
||||||
(treesit-auto-add-to-auto-mode-alist)
|
(treesit-auto-add-to-auto-mode-alist 'all)
|
||||||
(global-treesit-auto-mode))
|
(global-treesit-auto-mode)))
|
||||||
|
|
||||||
;;; Mark syntactic constructs efficiently if tree-sitter is available (expreg)
|
;;; Mark syntactic constructs efficiently if tree-sitter is available (expreg)
|
||||||
(use-package expreg
|
(when (and (fboundp 'treesit-available-p)
|
||||||
:ensure t
|
(treesit-available-p))
|
||||||
:functions (prot/expreg-expand prot/expreg-expand-dwim)
|
(use-package expreg
|
||||||
:bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp'
|
:ensure t
|
||||||
:config
|
:functions (prot/expreg-expand prot/expreg-expand-dwim)
|
||||||
(defun prot/expreg-expand (n)
|
:bind ("C-M-SPC" . prot/expreg-expand-dwim) ; overrides `mark-sexp'
|
||||||
"Expand to N syntactic units, defaulting to 1 if none is provided interactively."
|
:config
|
||||||
(interactive "p")
|
(defun prot/expreg-expand (n)
|
||||||
(dotimes (_ n)
|
"Expand to N syntactic units, defaulting to 1 if none is provided interactively."
|
||||||
(expreg-expand)))
|
(interactive "p")
|
||||||
|
(dotimes (_ n)
|
||||||
|
(expreg-expand)))
|
||||||
|
|
||||||
(defun prot/expreg-expand-dwim ()
|
(defun prot/expreg-expand-dwim ()
|
||||||
"Do-What-I-Mean `expreg-expand' to start with symbol or word.
|
"Do-What-I-Mean `expreg-expand' to start with symbol or word.
|
||||||
If over a real symbol, mark that directly, else start with a
|
If over a real symbol, mark that directly, else start with a
|
||||||
word. Fall back to regular `expreg-expand'."
|
word. Fall back to regular `expreg-expand'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((symbol (bounds-of-thing-at-point 'symbol)))
|
(let ((symbol (bounds-of-thing-at-point 'symbol)))
|
||||||
(cond
|
(cond
|
||||||
((equal (bounds-of-thing-at-point 'word) symbol)
|
((equal (bounds-of-thing-at-point 'word) symbol)
|
||||||
(prot/expreg-expand 1))
|
(prot/expreg-expand 1))
|
||||||
(symbol (prot/expreg-expand 2))
|
(symbol (prot/expreg-expand 2))
|
||||||
(t (expreg-expand))))))
|
(t (expreg-expand)))))))
|
||||||
|
|
||||||
|
;;;; Show battery status on the mode line (battery.el)
|
||||||
|
(use-package battery
|
||||||
|
:ensure nil
|
||||||
|
:hook (elpaca-after-init . display-battery-mode)
|
||||||
|
:config
|
||||||
|
(setq battery-mode-line-format
|
||||||
|
(cond
|
||||||
|
((eq battery-status-function #'battery-linux-proc-acpi)
|
||||||
|
"⏻ %b%p%%,%d°C ")
|
||||||
|
(battery-status-function
|
||||||
|
"⏻ %b%p%% "))))
|
||||||
|
|
||||||
;;;; Configuration on Mac OS X machine
|
;;;; Configuration on Mac OS X machine
|
||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
|
@ -168,10 +183,15 @@ word. Fall back to regular `expreg-expand'."
|
||||||
(setq system-name (car (split-string system-name "\\.")))
|
(setq system-name (car (split-string system-name "\\.")))
|
||||||
;;; Binaries
|
;;; Binaries
|
||||||
(setq vc-git-program (or (executable-find "git") "/usr/local/bin/git"))
|
(setq vc-git-program (or (executable-find "git") "/usr/local/bin/git"))
|
||||||
(setq epg-gpg-program (or (executable-find "gpg") "/usr/local/bin/gpg"))))
|
(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/"))))
|
||||||
|
|
||||||
(defun vedang/backward-kill-word-or-kill-region (&optional arg)
|
(defun vedang/backward-kill-word-or-kill-region (&optional arg)
|
||||||
"fancy C-w.
|
"Rebind `C-w' to work differently based on whether a region is active.
|
||||||
|
|
||||||
If the region is selected, retain the original behaviour, otherwise call
|
If the region is selected, retain the original behaviour, otherwise call
|
||||||
`backward-kill-word' instead. ARG is passed to `backward-kill-word'."
|
`backward-kill-word' instead. ARG is passed to `backward-kill-word'."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
@ -198,36 +218,4 @@ If the region is selected, retain the original behaviour, otherwise call
|
||||||
(use-package helpful
|
(use-package helpful
|
||||||
:ensure t)
|
:ensure t)
|
||||||
|
|
||||||
(use-package indent-tools
|
(provide 'unravel-essentials)
|
||||||
: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))
|
|
||||||
|
|
||||||
(use-package blackout
|
|
||||||
:ensure t
|
|
||||||
:demand t)
|
|
||||||
|
|
||||||
(provide 'nebkor-essentials)
|
|
|
@ -74,4 +74,4 @@
|
||||||
(setq magit-repository-directories
|
(setq magit-repository-directories
|
||||||
'(("~/src/prototypes" . 1))))
|
'(("~/src/prototypes" . 1))))
|
||||||
|
|
||||||
(provide 'nebkor-git)
|
(provide 'unravel-git)
|
|
@ -149,15 +149,10 @@
|
||||||
(use-package apheleia
|
(use-package apheleia
|
||||||
:ensure t
|
:ensure t
|
||||||
:demand t
|
:demand t
|
||||||
:after blackout
|
|
||||||
:config
|
:config
|
||||||
(apheleia-global-mode +1)
|
(apheleia-global-mode +1)
|
||||||
(with-eval-after-load 'apheleia-formatters
|
(with-eval-after-load 'apheleia-formatters
|
||||||
(push '(zprint . ("zprint")) apheleia-formatters))
|
(push '(zprint . ("zprint")) apheleia-formatters)))
|
||||||
:hook
|
|
||||||
(apheleia-mode . (lambda () (blackout 'apheleia-mode)))
|
|
||||||
;;:blackout
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package multiple-cursors
|
(use-package multiple-cursors
|
||||||
:ensure t
|
:ensure t
|
||||||
|
@ -166,81 +161,6 @@
|
||||||
("C-<" . mc/mark-previous-like-this)
|
("C-<" . mc/mark-previous-like-this)
|
||||||
("C-c C->" . mc/mark-all-like-this))
|
("C-c C->" . mc/mark-all-like-this))
|
||||||
|
|
||||||
(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)
|
|
||||||
))
|
|
||||||
|
|
||||||
(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))
|
|
||||||
|
|
||||||
;;;; Configuration for Python Programming
|
;;;; Configuration for Python Programming
|
||||||
|
|
||||||
(use-package python
|
(use-package python
|
||||||
|
@ -360,4 +280,4 @@ NS is the namespace information passed into the function by cider."
|
||||||
( :map ielm-map
|
( :map ielm-map
|
||||||
("C-j" . newline-and-indent)))
|
("C-j" . newline-and-indent)))
|
||||||
|
|
||||||
(provide 'nebkor-langs)
|
(provide 'unravel-langs)
|
|
@ -615,4 +615,4 @@ If WEEK-NUM is not provided, use the current week."
|
||||||
(setq org-habit-preceding-days 9)
|
(setq org-habit-preceding-days 9)
|
||||||
(setq org-habit-show-all-today t))
|
(setq org-habit-show-all-today t))
|
||||||
|
|
||||||
(provide 'nebkor-org)
|
(provide 'unravel-org)
|
|
@ -82,8 +82,8 @@
|
||||||
(setq grep-program executable)
|
(setq grep-program executable)
|
||||||
(setq grep-template
|
(setq grep-template
|
||||||
(if rgp
|
(if rgp
|
||||||
"rg -nH --null -e <R> <F>"
|
"/usr/bin/rg -nH --null -e <R> <F>"
|
||||||
"grep <X> <C> -nH --null -e <R> <F>"))
|
"/usr/bin/grep <X> <C> -nH --null -e <R> <F>"))
|
||||||
(setq xref-search-program (if rgp 'ripgrep 'grep))))
|
(setq xref-search-program (if rgp 'ripgrep 'grep))))
|
||||||
|
|
||||||
;;; wgrep (writable grep)
|
;;; wgrep (writable grep)
|
||||||
|
@ -137,4 +137,4 @@
|
||||||
|
|
||||||
(setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark)))
|
(setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark)))
|
||||||
|
|
||||||
(provide 'nebkor-search)
|
(provide 'unravel-search)
|
35
unravel-modules/unravel-shell.el
Normal file
35
unravel-modules/unravel-shell.el
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
;;;; 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)
|
|
@ -287,4 +287,4 @@ modifications."
|
||||||
:bind-keymap
|
:bind-keymap
|
||||||
("C-c o" . org-board-keymap))
|
("C-c o" . org-board-keymap))
|
||||||
|
|
||||||
(provide 'nebkor-study)
|
(provide 'unravel-study)
|
|
@ -1,6 +1,34 @@
|
||||||
;;; Everything related to the look of Emacs
|
;;; Everything related to the look of Emacs
|
||||||
|
|
||||||
(add-to-list 'default-frame-alist '(background-color . "snow"))
|
;;; The Ef (εὖ) themes
|
||||||
|
|
||||||
|
;; The themes are customisable. Read the manual:
|
||||||
|
;; <https://protesilaos.com/emacs/ef-themes>.
|
||||||
|
(use-package ef-themes
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:bind
|
||||||
|
(("<f5>" . ef-themes-rotate)
|
||||||
|
("C-<f5>" . 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))
|
||||||
|
|
||||||
;;;; Lin
|
;;;; Lin
|
||||||
;; Read the lin manual: <https://protesilaos.com/emacs/lin>.
|
;; Read the lin manual: <https://protesilaos.com/emacs/lin>.
|
||||||
|
@ -10,6 +38,28 @@
|
||||||
:config
|
:config
|
||||||
(setopt lin-face 'lin-cyan))
|
(setopt lin-face 'lin-cyan))
|
||||||
|
|
||||||
|
;;;; Increase padding of windows/frames
|
||||||
|
;; <https://protesilaos.com/codelog/2023-06-03-emacs-spacious-padding/>.
|
||||||
|
(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)
|
;;;; Rainbow mode for colour previewing (rainbow-mode.el)
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:ensure t
|
:ensure t
|
||||||
|
@ -67,17 +117,37 @@
|
||||||
:cursor-type box
|
:cursor-type box
|
||||||
:cursor-in-non-selected-windows hollow
|
:cursor-in-non-selected-windows hollow
|
||||||
:blink-cursor-mode 1
|
:blink-cursor-mode 1
|
||||||
:blink-cursor-blinks 5
|
:blink-cursor-blinks 10
|
||||||
:blink-cursor-interval 0.2
|
:blink-cursor-interval 0.2
|
||||||
:blink-cursor-delay 0.2)))
|
:blink-cursor-delay 0.2)))
|
||||||
|
|
||||||
;; I am using the default values of `cursory-latest-state-file'.
|
;; I am using the default values of `cursory-latest-state-file'.
|
||||||
|
|
||||||
;; Set last preset or fall back to desired style from `cursory-presets'.
|
;; Set last preset or fall back to desired style from `cursory-presets'.
|
||||||
(cursory-set-preset (or (cursory-restore-latest-preset) 'box-no-blink))
|
(cursory-set-preset (or (cursory-restore-latest-preset) 'box))
|
||||||
|
|
||||||
(cursory-mode 1))
|
(cursory-mode 1))
|
||||||
|
|
||||||
|
;;;; Theme buffet
|
||||||
|
;; <https://git.sr.ht/~bboal/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)
|
;;;; Fontaine (font configurations)
|
||||||
;; Read the manual: <https://protesilaos.com/emacs/fontaine>
|
;; Read the manual: <https://protesilaos.com/emacs/fontaine>
|
||||||
(use-package fontaine
|
(use-package fontaine
|
||||||
|
@ -90,21 +160,25 @@
|
||||||
(elpaca-after-init . (lambda ()
|
(elpaca-after-init . (lambda ()
|
||||||
;; Set last preset or fall back to desired style from `fontaine-presets'.
|
;; Set last preset or fall back to desired style from `fontaine-presets'.
|
||||||
(fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular))))
|
(fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular))))
|
||||||
(enable-theme-functions . fontaine-apply-current-preset))
|
(enable-theme-functions . fontaine-apply-current-preset)
|
||||||
|
(ef-themes-post-load . fontaine-apply-current-preset))
|
||||||
:config
|
:config
|
||||||
;; This is defined in Emacs C code: it belongs to font settings.
|
;; This is defined in Emacs C code: it belongs to font settings.
|
||||||
(setq x-underline-at-descent-line nil)
|
(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
|
;; This is the default value. Just including it here for
|
||||||
;; completeness.
|
;; completeness.
|
||||||
(setq fontaine-latest-state-file (locate-user-emacs-file "fontaine-latest-state.eld"))
|
(setq fontaine-latest-state-file (locate-user-emacs-file "fontaine-latest-state.eld"))
|
||||||
|
|
||||||
(setq fontaine-presets
|
(setq fontaine-presets
|
||||||
'((small
|
'((small
|
||||||
:default-family "Noto Sans"
|
:default-family "Iosevka"
|
||||||
:default-height 130)
|
:default-height 130)
|
||||||
(regular
|
(regular
|
||||||
:default-height 130)
|
:default-height 150)
|
||||||
(medium
|
(medium
|
||||||
:default-weight semilight
|
:default-weight semilight
|
||||||
:default-height 170
|
:default-height 170
|
||||||
|
@ -122,7 +196,7 @@
|
||||||
;; I keep all properties for didactic purposes, but most can be
|
;; I keep all properties for didactic purposes, but most can be
|
||||||
;; omitted. See the fontaine manual for the technicalities:
|
;; omitted. See the fontaine manual for the technicalities:
|
||||||
;; <https://protesilaos.com/emacs/fontaine>.
|
;; <https://protesilaos.com/emacs/fontaine>.
|
||||||
:default-family "Noto Sans"
|
:default-family "Iosevka"
|
||||||
:default-weight regular
|
:default-weight regular
|
||||||
:default-slant normal
|
:default-slant normal
|
||||||
:default-width normal
|
:default-width normal
|
||||||
|
@ -227,7 +301,7 @@ x×X .,·°;:¡!¿?`'‘’ ÄAÃÀ TODO
|
||||||
;; NOTE 2022-11-20: This may not cover every case, though it works
|
;; NOTE 2022-11-20: This may not cover every case, though it works
|
||||||
;; fine in my workflow. I am still undecided by EWW.
|
;; fine in my workflow. I am still undecided by EWW.
|
||||||
(defun prot/enable-variable-pitch ()
|
(defun prot/enable-variable-pitch ()
|
||||||
(unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode 'prog-mode)
|
(unless (derived-mode-p 'mhtml-mode 'nxml-mode 'yaml-mode)
|
||||||
(variable-pitch-mode 1)))
|
(variable-pitch-mode 1)))
|
||||||
;;;;; Resize keys with global effect
|
;;;;; Resize keys with global effect
|
||||||
:bind
|
:bind
|
||||||
|
@ -239,4 +313,4 @@ x×X .,·°;:¡!¿?`'‘’ ÄAÃÀ TODO
|
||||||
("C-x C-+" . global-text-scale-adjust)
|
("C-x C-+" . global-text-scale-adjust)
|
||||||
("C-x C-0" . global-text-scale-adjust)))
|
("C-x C-0" . global-text-scale-adjust)))
|
||||||
|
|
||||||
(provide 'nebkor-theme)
|
(provide 'unravel-theme)
|
173
unravel-modules/unravel-window.el
Normal file
173
unravel-modules/unravel-window.el
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
;;; 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:
|
||||||
|
;; <https://protesilaos.com/emacs/beframe>.
|
||||||
|
(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 <right>" . winner-redo)
|
||||||
|
("C-x <left>" . 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)
|
Loading…
Reference in a new issue