Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7274f3d903 |
30 changed files with 349 additions and 218 deletions
|
|
@ -134,11 +134,16 @@ After Emacs is /kinda/ working, make sure you install *all* the fonts, that is:
|
||||||
M-x nerd-icons-install-fonts
|
M-x nerd-icons-install-fonts
|
||||||
#+end_example
|
#+end_example
|
||||||
|
|
||||||
Everything golden? Great. Want to upgrade all the packages?
|
Everything golden?
|
||||||
#+begin_example
|
#+begin_example
|
||||||
M-x package-upgrade-all
|
M-x elpaca-write-lock-file
|
||||||
#+end_example
|
#+end_example
|
||||||
|
|
||||||
|
Before we can build a Telegram server for [[file:ha-aux-apps.org::*Telega][Telega]], we need to install the /latest/ version:
|
||||||
|
#+begin_src sh
|
||||||
|
brew unlink tdlib # optional
|
||||||
|
brew install tdlib --HEAD
|
||||||
|
#+end_src
|
||||||
* Supporting Packages
|
* Supporting Packages
|
||||||
Now install all the extras:
|
Now install all the extras:
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,7 @@ I’ve crafted my Emacs configuration, I cheekily call /hamacs/, in a literate p
|
||||||
|
|
||||||
The advantage to rolling yer own is I tend to /use/ what I add, leading to less bloat. In reality, this is more fun.
|
The advantage to rolling yer own is I tend to /use/ what I add, leading to less bloat. In reality, this is more fun.
|
||||||
|
|
||||||
Using [[https://howardism.org/Technical/Emacs/literate-devops.html][literate programming]] for my Emacs configuration gives me an easy way to /share/ my code. Feel free to steal whatever you find interesting, as sharing makes our community great. Notice that functions and features I have written begin with =ha-=, but everything else is either /stock Emacs/ or a /package/ I download (see [[file:bootstrap.org][bootstrap]] for the details) and configure with the [[https://github.com/jwiegley/use-package][use-package]] macro (see either [[https://ianyepan.github.io/posts/setting-up-use-package/][this introduction]] or [[https://www.emacswiki.org/emacs/UsePackage][this wiki page]] for those details)… meaning most blocks of code should work on its own.
|
Using [[https://howardism.org/Technical/Emacs/literate-devops.html][literate programming]] for my Emacs configuration gives me an easy way to /share/ my code. Feel free to steal whatever you find interesting, as sharing makes our community great. Notice that functions and features I have written begin with =ha-=, but everything else is either /stock Emacs/ or a /package/ I download using [[https://github.com/progfolio/elpaca][Elpaca]] (see [[file:bootstrap.org][bootstrap]] for the details) and configure with [[https://github.com/jwiegley/use-package][use-package]] (see either [[https://ianyepan.github.io/posts/setting-up-use-package/][this introduction]] or [[https://www.emacswiki.org/emacs/UsePackage][this wiki page]] for those details)… meaning most blocks of code should work on its own.
|
||||||
|
|
||||||
*Note:* I now require Emacs version 30, for a few packages can’t be automatically downloaded from an Emacs Package Archive (like ELPA or MELPA), and I take advantage of the new =:vc= feature of =use-package= to download those packages directly from their Git repository.
|
|
||||||
|
|
||||||
I’ve separated my configuration into /chapters/ around particular subjects, applications and programming languages. This feature allows you, dear reader, to jump our to items of interest, but allows me to /selectively load/ individual chapters. For instance, if I’m not doing much with Ruby at work, I can remove that chapter from the list in my [[file:bootstrap.org::*Load the Rest][bootstrap]]. I also don’t load my [[file:ha-display.org][UI configuration]] when I am using the Terminal (doesn’t happen much, actually).
|
I’ve separated my configuration into /chapters/ around particular subjects, applications and programming languages. This feature allows you, dear reader, to jump our to items of interest, but allows me to /selectively load/ individual chapters. For instance, if I’m not doing much with Ruby at work, I can remove that chapter from the list in my [[file:bootstrap.org::*Load the Rest][bootstrap]]. I also don’t load my [[file:ha-display.org][UI configuration]] when I am using the Terminal (doesn’t happen much, actually).
|
||||||
|
|
||||||
|
|
@ -28,7 +26,7 @@ To create [[file:~/.emacs.d/init.el][~/.emacs.d/init.el]] which starts the proce
|
||||||
|
|
||||||
[[file:screenshots/dashboard-small.png]]
|
[[file:screenshots/dashboard-small.png]]
|
||||||
** Core Configuration
|
** Core Configuration
|
||||||
- [[file:bootstrap.org][Bootstrap]] :: loads basic libraries the rest of the code depends on. It then loads the following files in order.
|
- [[file:bootstrap.org][Bootstrap]] :: explains how I use =elpaca= and loads basic libraries the rest of the code depends on. It then loads the following files in order.
|
||||||
- [[file:ha-config.org][Configuration]] :: contains /most/ of my configuration, setting up my sequence key menus, evil, etc.
|
- [[file:ha-config.org][Configuration]] :: contains /most/ of my configuration, setting up my sequence key menus, evil, etc.
|
||||||
- [[file:ha-evil.org][Evilness]] :: configuration for using VI, er, ~vim~ keybindings in Emacs.
|
- [[file:ha-evil.org][Evilness]] :: configuration for using VI, er, ~vim~ keybindings in Emacs.
|
||||||
- [[file:ha-general.org][Leader]] :: using the ~SPC~ to kick off a hierarchical order of functions.
|
- [[file:ha-general.org][Leader]] :: using the ~SPC~ to kick off a hierarchical order of functions.
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,17 @@ A literate programming file for bootstraping my Emacs Configuration.
|
||||||
#+end_src
|
#+end_src
|
||||||
* Introduction
|
* Introduction
|
||||||
This file contains all the variable definitions and library loading for the other files in my project.
|
This file contains all the variable definitions and library loading for the other files in my project.
|
||||||
|
|
||||||
|
I'm installing everything using [[https://github.com/progfolio/elpaca][Elpaca]] for package installation and management. This is initialization code configured in [[file:initialize][initialize]], and calls to =use-package= now accept an =:elpaca= parameter:
|
||||||
|
|
||||||
|
- =:elpaca nil= for packages that ship with Emacs (or live in my =elisp= directory)
|
||||||
|
- =:elpaca (:host github :repo "user/repo")= to retrieve special versions of some packages
|
||||||
|
- =:elpaca (:wait t)= to block until the package is installed and configured, necessary when later code needs one of its macros or =use-package= keywords
|
||||||
|
|
||||||
|
Without the keyword, =use-package= installs the package from the standard Elpaca menus (see =use-package-defaults= in [[file:initialize][initialize]]).
|
||||||
|
|
||||||
|
Elpaca installs packages /asynchronously/ and processes its queue /after/ Emacs reads the init file. This means a =use-package= body isn't evaluated until its package is installed, but top-level code (outside a =use-package= form) runs immediately. To keep my files loading in order, =ha-hamacs-load= calls =elpaca-wait= after each file.
|
||||||
|
|
||||||
* Initial Settings
|
* Initial Settings
|
||||||
** Garbage Collection Settings
|
** Garbage Collection Settings
|
||||||
GC has always been a contentious subject in Emacs. Lot less of an issue now, but let’s not slow the startup (any more than I already do by checking all the packages to see if anything new needs to be downloaded).
|
GC has always been a contentious subject in Emacs. Lot less of an issue now, but let’s not slow the startup (any more than I already do by checking all the packages to see if anything new needs to be downloaded).
|
||||||
|
|
@ -102,7 +113,7 @@ Getting tired off all the packages that I load spewing a bunch of warnings that
|
||||||
The following packages come with Emacs, but seems like they still need loading:
|
The following packages come with Emacs, but seems like they still need loading:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package cl-lib
|
(use-package cl-lib
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:init (defun first (elt) (car elt))
|
:init (defun first (elt) (car elt))
|
||||||
:commands (first))
|
:commands (first))
|
||||||
|
|
||||||
|
|
@ -126,10 +137,9 @@ Manipulate file paths with the [[https://github.com/rejeep/f.el][f.el]] project:
|
||||||
(use-package f)
|
(use-package f)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
The [[https://github.com/noctuid/general.el][general.el]] project supplies the =:general= keyword that many of my =use-package= declarations use, so the /library/ has to be loaded before any other file is *read*. See [[file:ha-general.org][ha-general]] for the complete definition before I convert to =ha-leader.org= for a more general solution:
|
Since the rest of this file (and the files it loads) call these libraries, block until Elpaca has installed them:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package general :demand t)
|
(elpaca-wait)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
The [[help:shell-command][shell-command]] function is useful, but having it split the output into a list is a helpful abstraction:
|
The [[help:shell-command][shell-command]] function is useful, but having it split the output into a list is a helpful abstraction:
|
||||||
|
|
@ -197,13 +207,13 @@ The following /defines/ the rest of my org-mode literate files, that I load late
|
||||||
(defvar ha-hamacs-files (flatten-list
|
(defvar ha-hamacs-files (flatten-list
|
||||||
`("ha-private.org"
|
`("ha-private.org"
|
||||||
,(when (display-graphic-p)
|
,(when (display-graphic-p)
|
||||||
|
"ha-theme.org"
|
||||||
"ha-display.org")
|
"ha-display.org")
|
||||||
"ha-evil.org"
|
"ha-config.org"
|
||||||
;; We need to replace ha-general (loaded in config) with:
|
;; We need to replace ha-general (loaded in config) with:
|
||||||
;; "ha-leader.org"
|
;; "ha-leader.org"
|
||||||
"ha-general.org"
|
"ha-evil.org"
|
||||||
;; "ha-meow.org"
|
;; "ha-meow.org"
|
||||||
"ha-config.org"
|
|
||||||
"ha-applications.org"
|
"ha-applications.org"
|
||||||
"ha-org.org"
|
"ha-org.org"
|
||||||
,(when (display-graphic-p)
|
,(when (display-graphic-p)
|
||||||
|
|
@ -258,14 +268,17 @@ With this function, we can test/debug/reload any individual file, via:
|
||||||
(ha-hamacs-files :all))))
|
(ha-hamacs-files :all))))
|
||||||
(let ((full-file (expand-file-name file hamacs-source-dir)))
|
(let ((full-file (expand-file-name file hamacs-source-dir)))
|
||||||
(when (file-exists-p full-file)
|
(when (file-exists-p full-file)
|
||||||
;; (message ">>> %s" full-file)
|
(message ">>> %s" full-file)
|
||||||
(if (called-interactively-p)
|
(if (called-interactively-p)
|
||||||
(org-babel-load-file full-file)
|
(org-babel-load-file full-file)
|
||||||
(ignore-errors (org-babel-load-file full-file))))))
|
(ignore-errors (org-babel-load-file full-file)))
|
||||||
|
(elpaca-wait))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Notice that when we call this function /non-interactively/ (e.g. from the Lisp function, =ha-hamacs-reload-all=), we suppress any errors. Obviously, I want to see the errors when calling interactively.
|
Notice that when we call this function /non-interactively/ (e.g. from the Lisp function, =ha-hamacs-reload-all=), we suppress any errors. Obviously, I want to see the errors when calling interactively.
|
||||||
|
|
||||||
|
The call to =elpaca-wait= blocks until Elpaca has installed any packages the file requested, and evaluated the =use-package= bodies. Without it, the next file would load before this one’s packages (and the macros they define) were available.
|
||||||
|
|
||||||
** Tangling the Hamacs
|
** Tangling the Hamacs
|
||||||
And this similar function, will /tangle/ one of my files. Notice that in order to increase the speed of the tangling process (and not wanting to pollute a project perspective), I use a /temporary buffer/ instead of =find-file=.
|
And this similar function, will /tangle/ one of my files. Notice that in order to increase the speed of the tangling process (and not wanting to pollute a project perspective), I use a /temporary buffer/ instead of =find-file=.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,14 @@ Ethic issues aside, I’m [[https://technobabble.bearblog.dev/fine-ill-try-ai/][
|
||||||
Installing Xenodium’s [[https://github.com/xenodium/agent-shell][agent-shell]], requires his [[https://github.com/xenodium/acp.el][ACP package]] for accessing the installed [[https://agentclientprotocol.com/][ACP libraries]], and his [[https://github.com/xenodium/shell-maker][shell-maker]] package.
|
Installing Xenodium’s [[https://github.com/xenodium/agent-shell][agent-shell]], requires his [[https://github.com/xenodium/acp.el][ACP package]] for accessing the installed [[https://agentclientprotocol.com/][ACP libraries]], and his [[https://github.com/xenodium/shell-maker][shell-maker]] package.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package acp)
|
(use-package acp
|
||||||
|
:elpaca (:host github :repo "xenodium/acp.el"))
|
||||||
|
|
||||||
(use-package shell-maker)
|
(use-package shell-maker
|
||||||
|
:elpaca (:host github :repo "xenodium/shell-maker"))
|
||||||
|
|
||||||
(use-package agent-shell
|
(use-package agent-shell
|
||||||
|
:elpaca (:host github :repo "xenodium/agent-shell")
|
||||||
:after acp
|
:after acp
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
|
|
@ -62,11 +65,11 @@ This also requires installing some command line support utilities, as well as [[
|
||||||
*** Notifications
|
*** Notifications
|
||||||
When my /artificial intern/ completes a task, I have long since nipped out to the kitchen, put the kettle on ... buttering scones... and getting crumbs and bits of food out of those round brown straw mats that the teapot goes on.
|
When my /artificial intern/ completes a task, I have long since nipped out to the kitchen, put the kettle on ... buttering scones... and getting crumbs and bits of food out of those round brown straw mats that the teapot goes on.
|
||||||
|
|
||||||
I would like the /intern/ to notify me when it needs attention, so I noticed the [[https://github.com/xenodium/agent-shell-knockknock][agent-shell-knockknock]] project can connect the =agent-shell= project with the [[https://github.com/konrad1977/knockknock/][knock-knock]] project (which is similar to my [[https://howardism.org/Technical/Emacs/beep-for-emacs.html][beep project]]).
|
I would like the /intern/ to notify me when it needs attention, so I noticed the [[https://github.com/zackattackz/agent-shell-notifications/][agent-shell-notifications]] project can connect the =agent-shell= project with the [[https://github.com/konrad1977/knockknock/][knock-knock]] project (which is similar to my [[https://howardism.org/Technical/Emacs/beep-for-emacs.html][beep project]]).
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package knockknock
|
(use-package knockknock
|
||||||
:vc (:url "https://github.com/konrad1977/knockknock" :rev :newest)
|
:elpaca (knockknock :host github :repo "konrad1977/knockknock")
|
||||||
:init
|
:init
|
||||||
(setq knockknock-border-color "brown")
|
(setq knockknock-border-color "brown")
|
||||||
(setq knockknock-border-width 2)
|
(setq knockknock-border-width 2)
|
||||||
|
|
@ -83,13 +86,29 @@ Testing it out:
|
||||||
:icon "nf-md-robot_confused")
|
:icon "nf-md-robot_confused")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
The configuration for [[https://github.com/xenodium/agent-shell-knockknock][agent-shell-knockknock]] and hook it in:
|
The configuration for [[https://github.com/zackattackz/agent-shell-notifications/][agent-shell-notifications]] and hook it to the =agent-shell-notifications-provider=:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package agent-shell-knockknock
|
(use-package agent-shell-notifications
|
||||||
:vc (:url "https://github.com/xenodium/agent-shell-knockknock" :rev :newest)
|
:elpaca (agent-shell-notifications
|
||||||
:after (agent-shell knockknock)
|
:host github
|
||||||
:hook (agent-shell-mode . agent-shell-knockknock-mode))
|
:repo "zackattackz/agent-shell-notifications")
|
||||||
|
:hook
|
||||||
|
;; Enable notifications in each agent-shell buffer
|
||||||
|
(agent-shell-mode . agent-shell-notifications-mode)
|
||||||
|
|
||||||
|
:config
|
||||||
|
;; Notification display timeout in seconds (0 = never expire (the default), -1 = backend default)
|
||||||
|
;; (setq agent-shell-notifications-timeout 5)
|
||||||
|
|
||||||
|
;; Seconds to wait before notifying when the shell is already visible (default: 10)
|
||||||
|
;; (setq agent-shell-notifications-idle-timeout 30)
|
||||||
|
|
||||||
|
;; Use the knockknock backend instead of the default libnotify
|
||||||
|
(setq agent-shell-notifications-provider 'agent-shell-notifications-knockknock)
|
||||||
|
|
||||||
|
;; While that code is _supposed_ to do this, I seem to need to do this manually:
|
||||||
|
(require 'agent-shell-notifications-knockknock))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
I might switch to [[https://github.com/cxa/agent-shell-macext#start-of-content][agent-shell-macext]] if I can’t get KnockKnock to work well on my Linux system.
|
I might switch to [[https://github.com/cxa/agent-shell-macext#start-of-content][agent-shell-macext]] if I can’t get KnockKnock to work well on my Linux system.
|
||||||
|
|
@ -114,7 +133,7 @@ Using the [[https://github.com/cmacrae/agent-shell-sidebar][agent-shell-sidebar]
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package agent-shell-sidebar
|
(use-package agent-shell-sidebar
|
||||||
:after agent-shell
|
:after agent-shell
|
||||||
:vc (:url "https://github.com/cmacrae/agent-shell-sidebar" :rev :newest)
|
:elpaca (:host github :repo "cmacrae/agent-shell-sidebar")
|
||||||
:bind (("s-i" . agent-shell-sidebar-toggle-focus)
|
:bind (("s-i" . agent-shell-sidebar-toggle-focus)
|
||||||
("s-I" . agent-shell-sidebar-toggle)))
|
("s-I" . agent-shell-sidebar-toggle)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
@ -204,6 +223,8 @@ And let’s make that the default now:
|
||||||
* Git and Magit
|
* Git and Magit
|
||||||
Can not live without [[https://magit.vc/][Magit]], a Git porcelain for Emacs. I stole the bulk of this work from Doom Emacs.
|
Can not live without [[https://magit.vc/][Magit]], a Git porcelain for Emacs. I stole the bulk of this work from Doom Emacs.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(use-package transient)
|
||||||
|
|
||||||
(use-package magit
|
(use-package magit
|
||||||
;; See https://github.com/magit/magit/wiki/Emacsclient for why we need to set:
|
;; See https://github.com/magit/magit/wiki/Emacsclient for why we need to set:
|
||||||
:custom (with-editor-emacsclient-executable "emacsclient")
|
:custom (with-editor-emacsclient-executable "emacsclient")
|
||||||
|
|
@ -304,6 +325,7 @@ This project (and others) can use repeat mode, but
|
||||||
The [[https://scripter.co/using-git-delta-with-magit][magit-delta]] project uses [[https://github.com/dandavison/delta][git-delta]] for colorized diffs.
|
The [[https://scripter.co/using-git-delta-with-magit][magit-delta]] project uses [[https://github.com/dandavison/delta][git-delta]] for colorized diffs.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package magit-delta
|
(use-package magit-delta
|
||||||
|
:ensure t
|
||||||
:hook (magit-mode . magit-delta-mode))
|
:hook (magit-mode . magit-delta-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -387,7 +409,8 @@ The crucial parts of this helper function are that we "wash" the result using =a
|
||||||
|
|
||||||
The functions below depend on [[help:magit-thing-at-point][magit-thing-at-point]], and this depends on the [[https://sr.ht/~pkal/compat/][compat]] library, so let’s grab that stuff:
|
The functions below depend on [[help:magit-thing-at-point][magit-thing-at-point]], and this depends on the [[https://sr.ht/~pkal/compat/][compat]] library, so let’s grab that stuff:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package compat)
|
(use-package compat
|
||||||
|
:elpaca (:host github :repo "emacs-straight/compat"))
|
||||||
|
|
||||||
(use-package magit-section
|
(use-package magit-section
|
||||||
:commands magit-thing-at-point)
|
:commands magit-thing-at-point)
|
||||||
|
|
@ -482,7 +505,8 @@ Using the [[https://github.com/emacsmirror/gist][gist package]] to write code sn
|
||||||
|
|
||||||
The gist project depends on the [[https://github.com/sigma/gh.el][gh library]]. There seems to be a problem with it.
|
The gist project depends on the [[https://github.com/sigma/gh.el][gh library]]. There seems to be a problem with it.
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package gh)
|
(use-package gh
|
||||||
|
:elpaca (:host github :repo "sigma/gh.el"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Forge
|
** Forge
|
||||||
|
|
@ -523,6 +547,7 @@ Make sure this works:
|
||||||
:host "api.github.com"
|
:host "api.github.com"
|
||||||
:username "howardabrams"
|
:username "howardabrams"
|
||||||
:auth 'forge)
|
:auth 'forge)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Magit Github
|
** Magit Github
|
||||||
|
|
@ -553,7 +578,8 @@ With the =gh= CLI working, we can install and use this project:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package magit-gh
|
(use-package magit-gh
|
||||||
:after magit)
|
:after magit
|
||||||
|
:elpaca (:host github :repo "jonathanchu/magit-gh"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -615,6 +641,7 @@ Web pages look pretty good with EWW, but I'm having difficulty getting it to ren
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eww
|
(use-package eww
|
||||||
|
:elpaca nil
|
||||||
:init
|
:init
|
||||||
(setq browse-url-browser-function 'eww-browse-url
|
(setq browse-url-browser-function 'eww-browse-url
|
||||||
browse-url-secondary-browser-function 'browse-url-default-browser
|
browse-url-secondary-browser-function 'browse-url-default-browser
|
||||||
|
|
@ -686,6 +713,7 @@ Web pages look pretty good with EWW, but I'm having difficulty getting it to ren
|
||||||
This function allows Imenu to offer HTML headings in EWW buffers, helpful for navigating long, technical documents.
|
This function allows Imenu to offer HTML headings in EWW buffers, helpful for navigating long, technical documents.
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package eww
|
(use-package eww
|
||||||
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(defun unpackaged/imenu-eww-headings ()
|
(defun unpackaged/imenu-eww-headings ()
|
||||||
"Return alist of HTML headings in current EWW buffer for Imenu.
|
"Return alist of HTML headings in current EWW buffer for Imenu.
|
||||||
|
|
@ -713,6 +741,7 @@ Make my EWW browsers /look/ like an Org file with the [[https://github.com/cheny
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package shrface
|
(use-package shrface
|
||||||
|
:elpaca (:host github :repo "chenyanming/shrface")
|
||||||
:config
|
:config
|
||||||
(shrface-basic)
|
(shrface-basic)
|
||||||
;; (shrface-trial)
|
;; (shrface-trial)
|
||||||
|
|
@ -730,6 +759,7 @@ The following connection to EWW throws errors now. Hrm.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package eww
|
(use-package eww
|
||||||
|
:elpaca nil
|
||||||
:after shrface
|
:after shrface
|
||||||
:hook (eww-after-render #'shrface-mode))
|
:hook (eww-after-render #'shrface-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -847,18 +877,18 @@ Instead I use Emacs' built-in directory lister (which accepts the standard, =dir
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ls-lisp
|
(use-package ls-lisp
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(setq ls-lisp-use-insert-directory-program nil
|
(setq ls-lisp-use-insert-directory-program nil
|
||||||
dired-listing-switches
|
dired-listing-switches
|
||||||
"-l --almost-all --human-readable --group-directories-first --no-group"))
|
"-l --almost-all --human-readable --group-directories-first --no-group"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
And [[https://www.masteringemacs.org/article/dired-shell-commands-find-xargs-replacement][this article by Mickey Petersen]] convinced me to turn on the built-in =dired-x=:
|
And [[https://www.masteringemacs.org/article/dired-shell-commands-find-xargs-replacement][this article by Mickey Petersen]] convinced me to turn on the built-in =dired-x= (just have to tell [[file:bootstrap.org::*Introduction][Elpaca]] that knowledge):
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package dired-x
|
(use-package dired-x
|
||||||
:ensure nil)
|
:elpaca nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
The advantage of =dired-x= is the ability to have [[https://www.emacswiki.org/emacs/DiredExtra#Dired_X][shell command guessing]] when selecting one or more files, and running a shell command on them with ~!~ or ~&~.
|
The advantage of =dired-x= is the ability to have [[https://www.emacswiki.org/emacs/DiredExtra#Dired_X][shell command guessing]] when selecting one or more files, and running a shell command on them with ~!~ or ~&~.
|
||||||
|
|
@ -872,6 +902,7 @@ The [[https://github.com/alexluigit/dirvish][dirvish]] project aims to make a pr
|
||||||
I’m beginning with dirvish to use the [[https://github.com/alexluigit/dirvish/blob/main/docs/CUSTOMIZING.org][sample configuration]] and change it:
|
I’m beginning with dirvish to use the [[https://github.com/alexluigit/dirvish/blob/main/docs/CUSTOMIZING.org][sample configuration]] and change it:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package dirvish
|
(use-package dirvish
|
||||||
|
:elpaca (:host github :repo "alexluigit/dirvish")
|
||||||
:init (dirvish-override-dired-mode)
|
:init (dirvish-override-dired-mode)
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
|
|
@ -1053,7 +1084,7 @@ The [[Evil Collection][evil-collection]] package adds the following keybindings:
|
||||||
- ~o~ :: Table of contents (if available)
|
- ~o~ :: Table of contents (if available)
|
||||||
|
|
||||||
I’d like write notes in org files that link to the PDFs (and maybe visa versa), using the [[https://github.com/weirdNox/org-noter][org-noter]] package:
|
I’d like write notes in org files that link to the PDFs (and maybe visa versa), using the [[https://github.com/weirdNox/org-noter][org-noter]] package:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(use-package org-noter
|
(use-package org-noter
|
||||||
:config
|
:config
|
||||||
(major-mode-hydra-define org-noter-doc-mode-map nil
|
(major-mode-hydra-define org-noter-doc-mode-map nil
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ The following applications are not needed. I alternate between trying to /stay i
|
||||||
Glad to see the 2FA feature is working on the [[https://codeberg.org/martianh/mastodon.el][mastodon.el]] project, and even more glad to see the great birdland diaspora arrive in the land of the toots.
|
Glad to see the 2FA feature is working on the [[https://codeberg.org/martianh/mastodon.el][mastodon.el]] project, and even more glad to see the great birdland diaspora arrive in the land of the toots.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package mastodon
|
(use-package mastodon
|
||||||
|
:elpaca (:host codeberg :repo "martianh/mastodon.el")
|
||||||
:init
|
:init
|
||||||
(setq mastodon-instance-url "https://pdx.social"
|
(setq mastodon-instance-url "https://pdx.social"
|
||||||
mastodon-active-user "howard"))
|
mastodon-active-user "howard"))
|
||||||
|
|
@ -94,6 +95,7 @@ Let’s turn on non-fixed-width fonts to make everything easier to read:
|
||||||
Yet another encrypted chat/VoIP client-server, but unlike Signal and Telegram, [[matrix.org][Matrix]] is act ually open source. In other words, a project for nerds. We’ll be using Alphapapa’s latest [[https://github.com/alphapapa/ement.el][ement]] project.
|
Yet another encrypted chat/VoIP client-server, but unlike Signal and Telegram, [[matrix.org][Matrix]] is act ually open source. In other words, a project for nerds. We’ll be using Alphapapa’s latest [[https://github.com/alphapapa/ement.el][ement]] project.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ement
|
(use-package ement
|
||||||
|
:elpaca (:host github :repo "alphapapa/ement.el")
|
||||||
:after major-mode-hydra
|
:after major-mode-hydra
|
||||||
:config
|
:config
|
||||||
(major-mode-hydra-define ement-room-mode (:quit-key "q")
|
(major-mode-hydra-define ement-room-mode (:quit-key "q")
|
||||||
|
|
@ -174,7 +176,7 @@ Been working on my [[https://gitlab.com/howardabrams/emacs-rpgdm][RPG DM project
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(when (f-directory? "~/src/emacs-rpgdm")
|
(when (f-directory? "~/src/emacs-rpgdm")
|
||||||
(use-package rpgdm
|
(use-package rpgdm
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:load-path "~/src/emacs-rpgdm"
|
:load-path "~/src/emacs-rpgdm"
|
||||||
:commands (rpgdm-mode rpgdm-tables-load)
|
:commands (rpgdm-mode rpgdm-tables-load)
|
||||||
:init (setq rpgdm-base (expand-file-name "~/src/emacs-rpgdm"))
|
:init (setq rpgdm-base (expand-file-name "~/src/emacs-rpgdm"))
|
||||||
|
|
@ -185,7 +187,7 @@ Working on my new replacement of my DM code:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(when (f-directory? "~/src/emacs-rpgtk")
|
(when (f-directory? "~/src/emacs-rpgtk")
|
||||||
(use-package rpgtk
|
(use-package rpgtk
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:load-path "~/src/emacs-rpgtk"
|
:load-path "~/src/emacs-rpgtk"
|
||||||
:after hydra
|
:after hydra
|
||||||
;; :commands (rpgtk-mode rpgtk-tables-load rpgtk-dice rpgtk-message)
|
;; :commands (rpgtk-mode rpgtk-tables-load rpgtk-dice rpgtk-message)
|
||||||
|
|
@ -204,7 +206,7 @@ And my [[https://gitlab.com/howardabrams/emacs-ironsworn][new Ironsworn project]
|
||||||
(when (f-directory? "~/src/emacs-ironsworn")
|
(when (f-directory? "~/src/emacs-ironsworn")
|
||||||
(use-package rpgdm-ironsworn
|
(use-package rpgdm-ironsworn
|
||||||
:after rpgdm
|
:after rpgdm
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:load-path "~/src/emacs-ironsworn"
|
:load-path "~/src/emacs-ironsworn"
|
||||||
:init
|
:init
|
||||||
(setq rpgdm-ironsworn-project (expand-file-name "~/src/emacs-ironsworn")
|
(setq rpgdm-ironsworn-project (expand-file-name "~/src/emacs-ironsworn")
|
||||||
|
|
@ -239,6 +241,7 @@ And then the configuration:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ready-player
|
(use-package ready-player
|
||||||
|
:elpaca (:host github :repo "xenodium/ready-player")
|
||||||
:config
|
:config
|
||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
(set-fontset-font t nil "SF Pro Display" nil 'append)
|
(set-fontset-font t nil "SF Pro Display" nil 'append)
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,7 @@ And for even quicker work, we can have special scripts tied to special keybindin
|
||||||
The [[https://gitlab.com/aimebertrand/org-mac-link][org-mac-link]] project makes it easy to tell Emacs to retrieve information from other apps, e.g. the URL of the opened tab in Firefox.
|
The [[https://gitlab.com/aimebertrand/org-mac-link][org-mac-link]] project makes it easy to tell Emacs to retrieve information from other apps, e.g. the URL of the opened tab in Firefox.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-mac-link
|
(use-package org-mac-link
|
||||||
|
:elpaca (:host gitlab :repo "aimebertrand/org-mac-link")
|
||||||
:config
|
:config
|
||||||
(ha-leader "i" '("insert app info" . org-mac-link-get-link)))
|
(ha-leader "i" '("insert app info" . org-mac-link-get-link)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ Once inside a source file, we can jump to one of these /relative locations/:
|
||||||
|
|
||||||
To verify that this works:
|
To verify that this works:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no
|
#+BEGIN_SRC emacs-lisp
|
||||||
(seq-let (file heading offset) (ha-code-notes-location)
|
(seq-let (file heading offset) (ha-code-notes-location)
|
||||||
(ha-code-notes-location-goto file heading offset))
|
(ha-code-notes-location-goto file heading offset))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
|
||||||
|
|
@ -144,8 +144,9 @@ And my copy of his code:
|
||||||
** Emacs Everywhere
|
** Emacs Everywhere
|
||||||
After reading [[https://irreal.org/blog/?p=12139][Jon Sander’s essay]] as well as [[https://mbork.pl/2024-04-27_Emacs_everywhere][Marcin Borkowski's essay]], I decided to try out Tecosaur’s [[https://github.com/tecosaur/emacs-everywhere][Emacs Everywhere]] approach:
|
After reading [[https://irreal.org/blog/?p=12139][Jon Sander’s essay]] as well as [[https://mbork.pl/2024-04-27_Emacs_everywhere][Marcin Borkowski's essay]], I decided to try out Tecosaur’s [[https://github.com/tecosaur/emacs-everywhere][Emacs Everywhere]] approach:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package emacs-everywhere)
|
(use-package emacs-everywhere
|
||||||
|
:elpaca (:host github :repo "tecosaur/emacs-everywhere"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
This package /called outside of Emacs/, so I bound a keybinding to iCanHazShortcut:
|
This package /called outside of Emacs/, so I bound a keybinding to iCanHazShortcut:
|
||||||
|
|
@ -228,7 +229,7 @@ When I push changes to my files to Gerrit and other code review, I don’t want
|
||||||
The [[https://www.emacswiki.org/emacs/RecentFiles][recentf]] feature has been in Emacs for a long time, but it has a problem with Tramp, as we need to turn off the cleanup feature that attempts to =stat= all the files and remove them from the =recent= accessed list if they are readable. The requires recentf to open up a remote files which blocks Emacs at the most inopportune times… like when trying to reboot the machine.
|
The [[https://www.emacswiki.org/emacs/RecentFiles][recentf]] feature has been in Emacs for a long time, but it has a problem with Tramp, as we need to turn off the cleanup feature that attempts to =stat= all the files and remove them from the =recent= accessed list if they are readable. The requires recentf to open up a remote files which blocks Emacs at the most inopportune times… like when trying to reboot the machine.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package recentf
|
(use-package recentf
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(setq recentf-auto-cleanup 'never) ;; disable before we start recentf!
|
(setq recentf-auto-cleanup 'never) ;; disable before we start recentf!
|
||||||
(recentf-mode 1))
|
(recentf-mode 1))
|
||||||
|
|
@ -337,12 +338,14 @@ This means (and I use this fairly often), that the /key/ is shows as a choice, t
|
||||||
The [[https://github.com/minad/vertico][vertico]] package puts the completing read in a vertical format, and like [[https://github.com/raxod502/selectrum#vertico][Selectrum]], it extends Emacs’ built-in functionality, instead of adding a new process. This means all these projects work together.
|
The [[https://github.com/minad/vertico][vertico]] package puts the completing read in a vertical format, and like [[https://github.com/raxod502/selectrum#vertico][Selectrum]], it extends Emacs’ built-in functionality, instead of adding a new process. This means all these projects work together.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
|
:elpaca (:files (:defaults "extensions/vertico-*.el"))
|
||||||
:config (vertico-mode))
|
:config (vertico-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
My issue with Vertico is when calling =find-file=, the Return key opens =dired=, instead of inserting the directory at point. This package addresses this:
|
My issue with Vertico is when calling =find-file=, the Return key opens =dired=, instead of inserting the directory at point. This extension ships with Vertico (see the =:files= recipe above), so we don’t install it separately:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico-directory
|
(use-package vertico-directory
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
|
:after vertico
|
||||||
;; More convenient directory navigation commands
|
;; More convenient directory navigation commands
|
||||||
:bind (:map vertico-map
|
:bind (:map vertico-map
|
||||||
("RET" . vertico-directory-enter)
|
("RET" . vertico-directory-enter)
|
||||||
|
|
@ -383,6 +386,7 @@ How does it compare? Once upon a time, I enjoyed typing ~plp~ for =package-list-
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package fussy
|
(use-package fussy
|
||||||
|
;; :elpaca (:host github :repo "jojojames/fussy")
|
||||||
:config
|
:config
|
||||||
(push 'fussy completion-styles)
|
(push 'fussy completion-styles)
|
||||||
(setq completion-category-defaults nil
|
(setq completion-category-defaults nil
|
||||||
|
|
@ -394,6 +398,7 @@ How does it compare? Once upon a time, I enjoyed typing ~plp~ for =package-list-
|
||||||
Persist history over Emacs restarts using the built-in [[https://www.emacswiki.org/emacs/SaveHist][savehist]] project. Since both Vertico and Selectrum sorts by history position, this should make the choice /smarter/ with time.
|
Persist history over Emacs restarts using the built-in [[https://www.emacswiki.org/emacs/SaveHist][savehist]] project. Since both Vertico and Selectrum sorts by history position, this should make the choice /smarter/ with time.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
|
:elpaca nil
|
||||||
:init
|
:init
|
||||||
(savehist-mode))
|
(savehist-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -438,10 +443,17 @@ The [[https://gitlab.com/ideasman42/emacs-undo-fu][undo-fu]] isn’t much to the
|
||||||
While I generally use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), when I’m on the Mac, I need to cover my bases.
|
While I generally use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), when I’m on the Mac, I need to cover my bases.
|
||||||
|
|
||||||
** Leader Sequences
|
** Leader Sequences
|
||||||
|
Pressing the ~SPACE~ can activate a /leader key sequence/ I define in my [[file:ha-leader.org][ha-leader]] file.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(ha-hamacs-load "ha-general.org")
|
||||||
|
#+end_src
|
||||||
|
This extends the =use-package= to include a =:general= keybinding section.
|
||||||
|
|
||||||
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using Jerry Peng’s [[https://github.com/jerrypnz/major-mode-hydrajjj0.el][Major Mode Hydra]] project:
|
Since I seldom remember keybindings, or even function names, for major-modes, I pull them all together into a nice table using Jerry Peng’s [[https://github.com/jerrypnz/major-mode-hydrajjj0.el][Major Mode Hydra]] project:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package major-mode-hydra
|
(use-package major-mode-hydra
|
||||||
|
:elpaca (:wait t)
|
||||||
:bind ("s-," . major-mode-hydra)
|
:bind ("s-," . major-mode-hydra)
|
||||||
:init
|
:init
|
||||||
(defun major-mode-hydra-title (&optional mode)
|
(defun major-mode-hydra-title (&optional mode)
|
||||||
|
|
@ -567,6 +579,7 @@ The [[https://github.com/minad/cape][Cape project]] deliver particular [[help:co
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(use-package cape
|
(use-package cape
|
||||||
|
:elpaca (:host github :repo "minad/cape")
|
||||||
:init
|
:init
|
||||||
(setq completion-at-point-functions (list #'cape-emoji)))
|
(setq completion-at-point-functions (list #'cape-emoji)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
@ -647,6 +660,7 @@ The [[https://www.emacswiki.org/emacs/AutoInsertMode][auto-insert]] feature is a
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package autoinsert
|
(use-package autoinsert
|
||||||
|
:elpaca nil
|
||||||
:init
|
:init
|
||||||
(setq auto-insert-directory (expand-file-name "templates" user-emacs-directory))
|
(setq auto-insert-directory (expand-file-name "templates" user-emacs-directory))
|
||||||
;; Don't prompt before insertion:
|
;; Don't prompt before insertion:
|
||||||
|
|
@ -699,7 +713,7 @@ As I've mentioned [[http://www.howardism.org/Technical/Emacs/beep-for-emacs.html
|
||||||
'libnotify)))
|
'libnotify)))
|
||||||
|
|
||||||
(use-package beep
|
(use-package beep
|
||||||
:ensure nil
|
:elpaca nil ; Located in my "elisp" directory
|
||||||
:hook (after-init . ha-random-startup-message)
|
:hook (after-init . ha-random-startup-message)
|
||||||
:commands (beep-when-finished beep-when-run-too-long)
|
:commands (beep-when-finished beep-when-run-too-long)
|
||||||
:config
|
:config
|
||||||
|
|
@ -969,6 +983,7 @@ Since I wasn’t using all the features that [[https://github.com/bbatsov/projec
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(ha-leader
|
(ha-leader
|
||||||
"p" '(:ignore t :which-key "projects")
|
"p" '(:ignore t :which-key "projects")
|
||||||
|
|
@ -1085,6 +1100,7 @@ And some shortcut keys from the =general= project:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(general-nmap :prefix "SPC"
|
(general-nmap :prefix "SPC"
|
||||||
"<tab>" '(:ignore t :which-key "workspaces")
|
"<tab>" '(:ignore t :which-key "workspaces")
|
||||||
|
|
@ -1249,7 +1265,7 @@ Also, as [[https://www.bytedude.com/gpg-in-emacs/][bytedude]] mentions, I need t
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package epa-file
|
(use-package epa-file
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:custom
|
:custom
|
||||||
(epg-debug t)
|
(epg-debug t)
|
||||||
(auth-source-debug t)
|
(auth-source-debug t)
|
||||||
|
|
|
||||||
15
ha-demos.org
15
ha-demos.org
|
|
@ -44,8 +44,9 @@ Once I made demonstrations /within/ Emacs with my [[https://github.com/howardabr
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package demo-it
|
(use-package demo-it
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:load-path "~/src/demo-it"
|
:load-path "~/src/demo-it"
|
||||||
|
;; :elpaca (:host github :repo "howardabrams/demo-it")
|
||||||
:commands (demo-it-create demo-it-start demo-it-hide-mode-line
|
:commands (demo-it-create demo-it-start demo-it-hide-mode-line
|
||||||
demo-it--presentation-display-set)
|
demo-it--presentation-display-set)
|
||||||
:custom (demo-it--insert-test-speed :faster))
|
:custom (demo-it--insert-test-speed :faster))
|
||||||
|
|
@ -194,6 +195,7 @@ With some a startup bug that I haven’t been able to resolve, I’m not using i
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package dslide
|
(use-package dslide
|
||||||
|
:elpaca (dslide :host github :repo "positron-solutions/dslide")
|
||||||
:commands (dslide-deck-start dslide-deck-stop)
|
:commands (dslide-deck-start dslide-deck-stop)
|
||||||
:custom
|
:custom
|
||||||
(dslide-start-from 'point)
|
(dslide-start-from 'point)
|
||||||
|
|
@ -226,7 +228,7 @@ With some a startup bug that I haven’t been able to resolve, I’m not using i
|
||||||
(dslide-stop . ha-slide-teardown)))
|
(dslide-stop . ha-slide-teardown)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Let’s try it out by loading this example.[[file:~/.emacs.d/straight/repos/dslide/test/demo.org][ demo.org]]
|
Let’s try it out by loading this example.[[file:~/.emacs.d/elpaca/sources/dslide/test/demo.org][ demo.org]]
|
||||||
|
|
||||||
What features do I like and want to take advantage of?
|
What features do I like and want to take advantage of?
|
||||||
- Inline Children show: =:DSLIDE_SLIDE_ACTION: dslide-slide-action-inline=
|
- Inline Children show: =:DSLIDE_SLIDE_ACTION: dslide-slide-action-inline=
|
||||||
|
|
@ -243,6 +245,7 @@ Call the =ha-slide-notes-update= function automatically after updating a slide.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(use-package dslide
|
(use-package dslide
|
||||||
|
:elpaca (dslide :host github :repo "positron-solutions/dslide")
|
||||||
:commands (dslide-narrow-hook)
|
:commands (dslide-narrow-hook)
|
||||||
:hook (dslide-narrow . 'ha-slide-notes-update))
|
:hook (dslide-narrow . 'ha-slide-notes-update))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
@ -253,7 +256,9 @@ The [[https://github.com/positron-solutions/moc][Master of Ceremonies]] package
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(use-package default-text-scale)
|
(use-package default-text-scale)
|
||||||
|
|
||||||
(use-package moc)
|
(use-package moc
|
||||||
|
:elpaca (:host github
|
||||||
|
:repo "positron-solutions/moc"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Select text, and call =moc-focus= (call =moc-focus-quit= to stop). Highlight more text, and call =moc-focus-highlight= to brighten it, or =moc-focus-obscure= to hide it.
|
Select text, and call =moc-focus= (call =moc-focus-quit= to stop). Highlight more text, and call =moc-focus-highlight= to brighten it, or =moc-focus-obscure= to hide it.
|
||||||
|
|
@ -267,7 +272,8 @@ An interesting approach for making presentations, that I’m not sure I will nee
|
||||||
The [[https://github.com/trevorpogue/topspace][topspace]] project can pad the top of a buffer, to make the first line in the center of the window. Helpful for presentations:
|
The [[https://github.com/trevorpogue/topspace][topspace]] project can pad the top of a buffer, to make the first line in the center of the window. Helpful for presentations:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package topspace)
|
(use-package topspace
|
||||||
|
:elpaca (:host github :repo "trevorpogue/topspace"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Showing Something associated with a Headline
|
*** Showing Something associated with a Headline
|
||||||
|
|
@ -302,6 +308,7 @@ To do this, add =:DSLIDE_ACTIONS: dslide-action-highlight-paragraphs= to the pro
|
||||||
|
|
||||||
#+begin_src elisp emacs-lisp :tangle no
|
#+begin_src elisp emacs-lisp :tangle no
|
||||||
(use-package dslide
|
(use-package dslide
|
||||||
|
:elpaca (:host github :repo "positron-solutions/dslide")
|
||||||
:config
|
:config
|
||||||
(defclass dslide-action-highlight-paragraphs (dslide-action)
|
(defclass dslide-action-highlight-paragraphs (dslide-action)
|
||||||
((overlays :initform nil))
|
((overlays :initform nil))
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ The [[https://github.com/jdtsmith/ultra-scroll][ultra-scroll]] project allows sm
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ultra-scroll
|
(use-package ultra-scroll
|
||||||
|
:elpaca (:host github :repo "jdtsmith/ultra-scroll")
|
||||||
:config
|
:config
|
||||||
(setq scroll-conservatively 101 ; important!
|
(setq scroll-conservatively 101 ; important!
|
||||||
pixel-scroll-precision-interpolate-page t
|
pixel-scroll-precision-interpolate-page t
|
||||||
|
|
@ -122,7 +123,8 @@ I found that the prolific [[https://protesilaos.com/][Protesilaos Stavrou]] [[ht
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pulsar
|
(use-package pulsar
|
||||||
:after (winum ace-window)
|
:elpaca (:host github :repo "protesilaos/pulsar")
|
||||||
|
:after winum ace-window
|
||||||
:custom
|
:custom
|
||||||
(pulsar-face 'pulsar-generic)
|
(pulsar-face 'pulsar-generic)
|
||||||
(pulsar-delay 0.15)
|
(pulsar-delay 0.15)
|
||||||
|
|
@ -186,6 +188,7 @@ Am I ever really ever satisfied with any font? I regularly change my font based
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package mixed-pitch
|
(use-package mixed-pitch
|
||||||
|
;; :elpaca (:host github :repo "jabranham/mixed-pitch")
|
||||||
:config
|
:config
|
||||||
(add-to-list 'mixed-pitch-fixed-pitch-faces 'org-property-value)
|
(add-to-list 'mixed-pitch-fixed-pitch-faces 'org-property-value)
|
||||||
(add-to-list 'mixed-pitch-fixed-pitch-faces 'org-special-keyword)
|
(add-to-list 'mixed-pitch-fixed-pitch-faces 'org-special-keyword)
|
||||||
|
|
@ -415,6 +418,8 @@ This project replaces [[https://github.com/domtronn/all-the-icons.el][all-the-ic
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package nerd-icons
|
(use-package nerd-icons
|
||||||
|
:elpaca (nerd-icons :host github :repo "rainstormstudio/nerd-icons.el"
|
||||||
|
:files (:defaults "data"))
|
||||||
:custom
|
:custom
|
||||||
;; The Nerd Font you want to use in GUI defaults to fixed-font:
|
;; The Nerd Font you want to use in GUI defaults to fixed-font:
|
||||||
(nerd-icons-font-family ha-fixed-font))
|
(nerd-icons-font-family ha-fixed-font))
|
||||||
|
|
@ -669,6 +674,7 @@ In code, if you drop a specific /text/ labels, we can highlight them with [[http
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package hl-todo
|
(use-package hl-todo
|
||||||
|
:elpaca (:host github :repo "tarsius/hl-todo")
|
||||||
:config
|
:config
|
||||||
(setq hl-todo-keyword-faces
|
(setq hl-todo-keyword-faces
|
||||||
`(("TODO" . ,(face-foreground 'warning))
|
`(("TODO" . ,(face-foreground 'warning))
|
||||||
|
|
@ -684,6 +690,7 @@ Suggests to bind some keys to =hl-todo-next= in order to jump from tag to tag, b
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package consult-todo
|
(use-package consult-todo
|
||||||
|
:elpaca (:host github :repo "liuyinz/consult-todo")
|
||||||
:init
|
:init
|
||||||
(defconst consult-todo--narrow
|
(defconst consult-todo--narrow
|
||||||
'((?t . "TODO")
|
'((?t . "TODO")
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ The idea of linking org documents to email could be nice, however, the =ol-notmu
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package ol-notmuch
|
(use-package ol-notmuch
|
||||||
:after org
|
:after org
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config (add-to-list 'org-modules 'ol-notmuch))
|
:config (add-to-list 'org-modules 'ol-notmuch))
|
||||||
#+end_src
|
#+end_src
|
||||||
To use, read a message and save a link to it with ~SPC o l~. Next, in an org document, create a link with ~, l~. Now, you can return to the message from that document with ~, o~. Regardless, I may need to store a local copy when I upgrade Org.
|
To use, read a message and save a link to it with ~SPC o l~. Next, in an org document, create a link with ~, l~. Now, you can return to the message from that document with ~, o~. Regardless, I may need to store a local copy when I upgrade Org.
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,10 @@ A literate programming file for configuring the Emacs Shell.
|
||||||
While I like [[https://github.com/akermu/emacs-libvterm][vterm]] for logging into [[file:ha-remoting.org][remote systems]], I find Emacs’ shell, =eshell=, an interesting alternative.
|
While I like [[https://github.com/akermu/emacs-libvterm][vterm]] for logging into [[file:ha-remoting.org][remote systems]], I find Emacs’ shell, =eshell=, an interesting alternative.
|
||||||
If you find the documentation lacking, I [[http://www.howardism.org/Technical/Emacs/eshell-fun.html][documented most features]], and you might find the following helpful.
|
If you find the documentation lacking, I [[http://www.howardism.org/Technical/Emacs/eshell-fun.html][documented most features]], and you might find the following helpful.
|
||||||
|
|
||||||
|
Tell Elpaca to use the built-in =eshell=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:hook (eshell-mode . ha-eshell-setup))
|
:hook (eshell-mode . ha-eshell-setup))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -86,6 +87,7 @@ Need to hook this when we change the directory.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
|
:elpaca nil
|
||||||
:hook (eshell-directory-change . ha-eshell-header-line))
|
:hook (eshell-directory-change . ha-eshell-header-line))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
@ -975,6 +977,7 @@ The problem with this trick is that =rx= outputs an Emacs-compatible regular exp
|
||||||
The [[https://github.com/joddie/pcre2el][pcre2el]] project can convert from a Lisp regular expression to a [[http://www.pcre.org/][PCRE]] (Perl Compatible Regular Expression), acceptable by [[https://github.com/BurntSushi/ripgrep][ripgrep]].
|
The [[https://github.com/joddie/pcre2el][pcre2el]] project can convert from a Lisp regular expression to a [[http://www.pcre.org/][PCRE]] (Perl Compatible Regular Expression), acceptable by [[https://github.com/BurntSushi/ripgrep][ripgrep]].
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pcre2el
|
(use-package pcre2el
|
||||||
|
:elpaca (:host github :repo "joddie/pcre2el")
|
||||||
:config
|
:config
|
||||||
(defmacro prx (&rest expressions)
|
(defmacro prx (&rest expressions)
|
||||||
"Convert the rx-compatible regular EXPRESSIONS to PCRE.
|
"Convert the rx-compatible regular EXPRESSIONS to PCRE.
|
||||||
|
|
@ -1376,6 +1379,7 @@ The [[https://codeberg.org/akib/emacs-eat][Emulate a Terminal]] project provides
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package eat
|
(use-package eat
|
||||||
:after eshell
|
:after eshell
|
||||||
|
:elpaca (:repo "https://codeberg.org/akib/emacs-eat")
|
||||||
:hook (eshell-load . eat-eshell-visual-command-mode))
|
:hook (eshell-load . eat-eshell-visual-command-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1784,7 +1788,7 @@ Sometimes you need to change something about the current file you are editing...
|
||||||
Here is where we associate all the functions and their hooks with =eshell=, through the magic of =use-package=.
|
Here is where we associate all the functions and their hooks with =eshell=, through the magic of =use-package=.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:custom (eshell-banner-message '(ha-eshell-banner))
|
:custom (eshell-banner-message '(ha-eshell-banner))
|
||||||
:init
|
:init
|
||||||
(setq eshell-error-if-no-glob t
|
(setq eshell-error-if-no-glob t
|
||||||
|
|
@ -1813,6 +1817,7 @@ Note that the default list to [[elisp:(describe-variable 'eshell-visual-commands
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'eshell-visual-commands "ssh"))
|
(add-to-list 'eshell-visual-commands "ssh"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
||||||
18
ha-evil.org
18
ha-evil.org
|
|
@ -45,6 +45,7 @@ TODO: Rebind the ~z~ keys
|
||||||
I split the configuration of Evil mode into sections. First, global settings:
|
I split the configuration of Evil mode into sections. First, global settings:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil
|
(use-package evil
|
||||||
|
:elpaca (:wait t)
|
||||||
:init
|
:init
|
||||||
(setq evil-undo-system 'undo-fu
|
(setq evil-undo-system 'undo-fu
|
||||||
evil-auto-indent t
|
evil-auto-indent t
|
||||||
|
|
@ -211,22 +212,19 @@ To remedy this, I’m using the [[https://www.emacswiki.org/emacs/KeyChord][KeyC
|
||||||
** Evil Text Object Line
|
** Evil Text Object Line
|
||||||
Delete a line, ~d d~ is in basic VI. Since some commands use text objects, and the basic text object doesn’t include lines, the [[https://github.com/emacsorphanage/evil-textobj-line][evil-textobj-line]] project adds that:
|
Delete a line, ~d d~ is in basic VI. Since some commands use text objects, and the basic text object doesn’t include lines, the [[https://github.com/emacsorphanage/evil-textobj-line][evil-textobj-line]] project adds that:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-textobj-line
|
(use-package evil-textobj-line)
|
||||||
:after evil)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
Now ~v i l~ selects the line without initial/trailing whitespace, and ~v a l~ selects the line with spaces, and ~S-v~ selects the line with the final carriage return. Is this much of an improvement? Well, wrapping a line in parenthesis, is just ~y s i l )~
|
Now ~v i l~ selects the line without initial/trailing whitespace, and ~v a l~ selects the line with spaces, and ~S-v~ selects the line with the final carriage return. Is this much of an improvement? Well, wrapping a line in parenthesis, is just ~y s i l )~
|
||||||
** Text Objects based on Indentation
|
** Text Objects based on Indentation
|
||||||
The [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]] project creates text objects based on the indentation level, similar to how the ~b~ works with “blocks” of code.
|
The [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]] project creates text objects based on the indentation level, similar to how the ~b~ works with “blocks” of code.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-indent-plus
|
(use-package evil-indent-plus)
|
||||||
:after evil)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
This can be handy for Python, YAML, and lists in org files. Note that ~i~ works for the current indent, but ~k~ includes one line above and ~j~ includes one line above and below.
|
This can be handy for Python, YAML, and lists in org files. Note that ~i~ works for the current indent, but ~k~ includes one line above and ~j~ includes one line above and below.
|
||||||
** Arguments as Text Objects
|
** Arguments as Text Objects
|
||||||
The [[https://github.com/wcsmith/evil-args][evil-args]] projects creates text objects for symbols, but with trailing ~,~ or other syntax.
|
The [[https://github.com/wcsmith/evil-args][evil-args]] projects creates text objects for symbols, but with trailing ~,~ or other syntax.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-args
|
(use-package evil-args
|
||||||
:after evil
|
|
||||||
:config
|
:config
|
||||||
;; bind evil-args text objects
|
;; bind evil-args text objects
|
||||||
(define-key evil-inner-text-objects-map "a" 'evil-inner-arg)
|
(define-key evil-inner-text-objects-map "a" 'evil-inner-arg)
|
||||||
|
|
@ -363,6 +361,7 @@ Why not use ~f~? I’m reserving the ~f~ for a tree-sitter version that is not a
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package anzu
|
(use-package anzu
|
||||||
|
:ensure t
|
||||||
:config
|
:config
|
||||||
(global-anzu-mode +1))
|
(global-anzu-mode +1))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
@ -372,7 +371,6 @@ I often use the Emacs commands, ~M-t~ and whatnot to exchange words and whatnot,
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-exchange
|
(use-package evil-exchange
|
||||||
:after (evil general)
|
|
||||||
:init
|
:init
|
||||||
(setq evil-exchange-key (kbd "gx")
|
(setq evil-exchange-key (kbd "gx")
|
||||||
evil-exchange-cancel-key (kbd "gX"))
|
evil-exchange-cancel-key (kbd "gX"))
|
||||||
|
|
@ -410,7 +408,7 @@ The [[https://github.com/edkolev/evil-lion][evil-lion]] package is a wrapper aro
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-lion
|
(use-package evil-lion
|
||||||
:after (evil general)
|
:after evil
|
||||||
:general
|
:general
|
||||||
(:states '(normal visual)
|
(:states '(normal visual)
|
||||||
"g a" '("lion ←" . evil-lion-left)
|
"g a" '("lion ←" . evil-lion-left)
|
||||||
|
|
@ -430,7 +428,7 @@ Where I like to align, is on variable assignments, e.g.
|
||||||
If you press ~RETURN~ for the /character/ to align, =evil-lion= package simply calls the built-in [[help:align][align]] function. This function chooses a regular expression based on a list of /rules/, and aligning Lisp variables requires a complicated regular expression. Extend [[elisp:(describe-variable 'align-rules-list)][align-rules-list]]:
|
If you press ~RETURN~ for the /character/ to align, =evil-lion= package simply calls the built-in [[help:align][align]] function. This function chooses a regular expression based on a list of /rules/, and aligning Lisp variables requires a complicated regular expression. Extend [[elisp:(describe-variable 'align-rules-list)][align-rules-list]]:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package align
|
(use-package align
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'align-rules-list
|
(add-to-list 'align-rules-list
|
||||||
`("lisp-assignments"
|
`("lisp-assignments"
|
||||||
|
|
@ -447,7 +445,6 @@ The [[https://github.com/linktohack/evil-commentary][evil-commentary]] is a VI-l
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-commentary
|
(use-package evil-commentary
|
||||||
:after (evil general)
|
|
||||||
:config (evil-commentary-mode)
|
:config (evil-commentary-mode)
|
||||||
|
|
||||||
:general
|
:general
|
||||||
|
|
@ -475,7 +472,7 @@ Not sure what is in a register? Have it show you when you hit ~”~ or ~@~ with
|
||||||
(use-package posframe)
|
(use-package posframe)
|
||||||
|
|
||||||
(use-package evil-owl
|
(use-package evil-owl
|
||||||
:after evil posframe
|
:after posframe
|
||||||
:config
|
:config
|
||||||
(setq evil-owl-display-method 'posframe
|
(setq evil-owl-display-method 'posframe
|
||||||
evil-owl-extra-posframe-args
|
evil-owl-extra-posframe-args
|
||||||
|
|
@ -520,7 +517,6 @@ The [[https//github.com/gilbertw1/better-jumper][better-jumper project]] replace
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package better-jumper
|
(use-package better-jumper
|
||||||
:after evil
|
|
||||||
:config
|
:config
|
||||||
(better-jumper-mode +1)
|
(better-jumper-mode +1)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ I'm not trying an experiment where specially-placed function keys on my fancy er
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package general
|
(use-package general
|
||||||
|
:elpaca (:wait t)
|
||||||
|
:demand t
|
||||||
:config
|
:config
|
||||||
(setq general-use-package-emit-autoloads t)
|
(setq general-use-package-emit-autoloads t)
|
||||||
|
|
||||||
|
|
@ -907,7 +909,7 @@ Remember these keys in the *Help* buffer:
|
||||||
Let's make Info behave a little more VI-like:
|
Let's make Info behave a little more VI-like:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package info
|
(use-package info
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:general
|
:general
|
||||||
(:states 'normal :keymaps 'Info-mode-map
|
(:states 'normal :keymaps 'Info-mode-map
|
||||||
"B" 'Info-bookmark-jump
|
"B" 'Info-bookmark-jump
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@ While the Emacs community have a plethora of options for generating a static web
|
||||||
The RSS needs UUIDs:
|
The RSS needs UUIDs:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp results silent
|
#+BEGIN_SRC emacs-lisp results silent
|
||||||
(use-package uuidgen)
|
(use-package uuidgen
|
||||||
|
:elpaca (:host github :repo "emacsmirror/uuidgen"))
|
||||||
|
|
||||||
(defun org-icalendar-create-uid (&rest ignored)
|
(defun org-icalendar-create-uid (&rest ignored)
|
||||||
"Returns a UUID."
|
"Returns a UUID."
|
||||||
|
|
@ -40,7 +41,8 @@ The RSS needs UUIDs:
|
||||||
While the following packages come with Emacs, they aren't necessarily loaded:
|
While the following packages come with Emacs, they aren't necessarily loaded:
|
||||||
|
|
||||||
#+begin_src emacs-lisp :results silent
|
#+begin_src emacs-lisp :results silent
|
||||||
(use-package ox-rss)
|
(use-package ox-rss
|
||||||
|
:elpaca (:host github :repo "emacsmirror/ox-rss"))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:config
|
:config
|
||||||
|
|
@ -62,6 +64,7 @@ Render my code with my font colors:
|
||||||
Also, we need Jack, and his HTML prowess:
|
Also, we need Jack, and his HTML prowess:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package jack
|
(use-package jack
|
||||||
|
:elpaca (:host github :repo "tonyaldon/jack")
|
||||||
:commands (jack-html))
|
:commands (jack-html))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,7 @@ And hook this function to Org:
|
||||||
The list of things to try:
|
The list of things to try:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq org-hide-leading-stars t)
|
(setq org-hide-leading-stars t) ; or t
|
||||||
(org-indent-mode -1)
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Markup View
|
** Markup View
|
||||||
|
|
@ -110,6 +109,7 @@ The variable, =org-hide-emphasis-markers=, is key to pretending that Emacs can b
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-appear
|
(use-package org-appear
|
||||||
|
:elpaca (:host github :repo "awth13/org-appear")
|
||||||
:init (setq org-appear-trigger 'manual)
|
:init (setq org-appear-trigger 'manual)
|
||||||
:hook
|
:hook
|
||||||
((org-mode . (lambda ()
|
((org-mode . (lambda ()
|
||||||
|
|
@ -330,6 +330,7 @@ The [[https://github.com/minad/org-modern][org-modern]] project attempts to do a
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-modern
|
(use-package org-modern
|
||||||
|
:elpaca (:host github :repo "minad/org-modern")
|
||||||
:after org
|
:after org
|
||||||
:hook ((org-mode . org-modern-mode)
|
:hook ((org-mode . org-modern-mode)
|
||||||
(org-agenda-finalize . org-modern-agenda))
|
(org-agenda-finalize . org-modern-agenda))
|
||||||
|
|
@ -366,7 +367,7 @@ According to an idea by [[https://jft.home.blog/2019/07/17/use-unicode-symbol-to
|
||||||
The [[https://github.com/TonCherAmi/org-padding][org-padding]] project looks places extra space before and after headers and blocks (essentially leading), to create a more word-processor-y experience. Great idea, however, I have spent a lot of extra time entering blank lines before and after my headers and blocks:
|
The [[https://github.com/TonCherAmi/org-padding][org-padding]] project looks places extra space before and after headers and blocks (essentially leading), to create a more word-processor-y experience. Great idea, however, I have spent a lot of extra time entering blank lines before and after my headers and blocks:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-padding
|
(use-package org-padding
|
||||||
:vc (:url "https://github.com/TonCherAmi/org-padding" :rev :newest)
|
:elpaca (:host github :repo "TonCherAmi/org-padding")
|
||||||
:hook (org-mode . org-padding-mode)
|
:hook (org-mode . org-padding-mode)
|
||||||
:config
|
:config
|
||||||
(setq org-padding-block-begin-line-padding '(0.5 . 0.3)
|
(setq org-padding-block-begin-line-padding '(0.5 . 0.3)
|
||||||
|
|
|
||||||
49
ha-org.org
49
ha-org.org
|
|
@ -3,7 +3,7 @@
|
||||||
#+date: 2020-09-18
|
#+date: 2020-09-18
|
||||||
#+tags: emacs org
|
#+tags: emacs org
|
||||||
#+startup: inlineimages
|
#+startup: inlineimages
|
||||||
#+lastmod: [2026-10-29 Thu]
|
#+lastmod: [2026-10-09 Fri]
|
||||||
|
|
||||||
A literate programming file for configuring org-mode and those files.
|
A literate programming file for configuring org-mode and those files.
|
||||||
|
|
||||||
|
|
@ -32,19 +32,15 @@ Org is a /large/ complex beast with a gazillion settings, so I discuss these lat
|
||||||
#+begin_src emacs-lisp :noweb yes
|
#+begin_src emacs-lisp :noweb yes
|
||||||
(use-package org
|
(use-package org
|
||||||
;; TODO: Using the latest org-mode
|
;; TODO: Using the latest org-mode
|
||||||
|
;; :elpaca nil
|
||||||
:mode (("\\.org" . org-mode))
|
:mode (("\\.org" . org-mode))
|
||||||
:init
|
:init
|
||||||
<<variables>>
|
<<variables>>
|
||||||
<<org-todo>>
|
<<org-todo>>
|
||||||
<<org-todo-clock>>
|
<<org-todo-clock>>
|
||||||
<<ob-configuration>>
|
<<ob-configuration>>
|
||||||
<<html-exporting>>)
|
<<html-exporting>>
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Finding a subtle bug in some versions of =use-package=, where the macro can’t have a =:init= /and/ =:config= in the same macro call.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :noweb yes
|
|
||||||
(use-package org
|
|
||||||
:config
|
:config
|
||||||
<<ha-org-leader>>
|
<<ha-org-leader>>
|
||||||
<<visual-hook>>
|
<<visual-hook>>
|
||||||
|
|
@ -57,15 +53,14 @@ Finding a subtle bug in some versions of =use-package=, where the macro can’t
|
||||||
<<org-return-key>>
|
<<org-return-key>>
|
||||||
<<global-keybindings>>
|
<<global-keybindings>>
|
||||||
<<org-keybindings>>)
|
<<org-keybindings>>)
|
||||||
#+END_SRC
|
#+end_src
|
||||||
|
|
||||||
* Initialization Section
|
* Initialization Section
|
||||||
Begin by initializing these org variables:
|
Begin by initializing these org variables:
|
||||||
#+name: variables
|
#+name: variables
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq org-return-follows-link t
|
(setq org-return-follows-link t
|
||||||
org-adapt-indentation nil ; Don't physically change files
|
org-adapt-indentation nil ; Don't physically change files
|
||||||
org-startup-indented nil ; Visually show paragraphs indented
|
org-startup-indented t ; Visually show paragraphs indented
|
||||||
org-list-indent-offset 2
|
org-list-indent-offset 2
|
||||||
org-edit-src-content-indentation 2 ; Doom Emacs sets this to 0,
|
org-edit-src-content-indentation 2 ; Doom Emacs sets this to 0,
|
||||||
; but uses a trick to make it
|
; but uses a trick to make it
|
||||||
|
|
@ -286,7 +281,7 @@ Came up with a great way to search a project for Org-specific files, and wrote [
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-find-file
|
(use-package org-find-file
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(ha-leader "f o" '("load org" . org-find-file)))
|
(ha-leader "f o" '("load org" . org-find-file)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -497,24 +492,12 @@ Need to install and configure Emacs to work with [[https://plantuml.com/][PlantU
|
||||||
curl -o ~/bin/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar
|
curl -o ~/bin/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
After installing the [[https://github.com/skuro/plantuml-mode][plantuml-mode]], we need to reference the location.
|
After installing the [[https://github.com/skuro/plantuml-mode][plantuml-mode]], we need to reference the location:
|
||||||
|
|
||||||
Note the =plantuml-default-exec-mode=. It defaults to ='server=, and entering
|
|
||||||
=plantuml-mode= calls =plantuml-init-once= to build its font-lock keywords by
|
|
||||||
/downloading/ them from =https://www.plantuml.com/plantuml/language=,
|
|
||||||
synchronously. Since =org-src-fontify-natively= puts a buffer into
|
|
||||||
=plantuml-mode= just to colourise a =plantuml= block, and =desktop-save-mode=
|
|
||||||
restores this very file at startup, that download lands squarely in the
|
|
||||||
startup path. Asking the local executable for the same list avoids the
|
|
||||||
round trip, and still works on a plane:
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package plantuml-mode
|
(use-package plantuml-mode
|
||||||
:defer t
|
:elpaca (:host github :repo "skuro/plantuml-mode")
|
||||||
:init
|
:init
|
||||||
(setq plantuml-default-exec-mode 'executable
|
(setq org-plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")))
|
||||||
plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")
|
|
||||||
org-plantuml-jar-path (expand-file-name "~/bin/plantuml.jar")))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
With some [[file:snippets/org-mode/plantuml][YASnippets]], I have =<p= to start a general diagram, and afterwards (while still in the org-mode file), type one of the following to expand as an example:
|
With some [[file:snippets/org-mode/plantuml][YASnippets]], I have =<p= to start a general diagram, and afterwards (while still in the org-mode file), type one of the following to expand as an example:
|
||||||
|
|
@ -565,8 +548,9 @@ Of course, since we are dealing with Emacs, where we assimilate any good idea. J
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pikchr-mode
|
(use-package pikchr-mode
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:load-path "~/src/pikchr-mode"
|
:load-path "~/src/pikchr-mode"
|
||||||
|
;; :elpaca (:host github :repo "kljohann/pikchr-mode")
|
||||||
:custom
|
:custom
|
||||||
(pikchr-executable "~/bin/pikchr"))
|
(pikchr-executable "~/bin/pikchr"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -615,7 +599,6 @@ We can make Mermaid diagrams in Emacs Org files using [[https://github.com/arnm/
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ob-mermaid
|
(use-package ob-mermaid
|
||||||
:after mermaid-mode
|
|
||||||
:config
|
:config
|
||||||
(setq ob-mermaid-cli-path mermaid-mmdc-location))
|
(setq ob-mermaid-cli-path mermaid-mmdc-location))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
@ -755,7 +738,7 @@ I have a special version of tweaked [[file:elisp/ox-confluence.el][Confluence ex
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ox-confluence
|
(use-package ox-confluence
|
||||||
:after org
|
:after org
|
||||||
:ensure nil ; Located in my "elisp" directory
|
:elpaca nil ; Located in my "elisp" directory
|
||||||
:config
|
:config
|
||||||
(ha-leader :keymaps 'org-mode-map
|
(ha-leader :keymaps 'org-mode-map
|
||||||
"o E" '("to confluence" . ox-export-to-confluence)))
|
"o E" '("to confluence" . ox-export-to-confluence)))
|
||||||
|
|
@ -766,6 +749,7 @@ I have a special version of tweaked [[file:elisp/ox-confluence.el][Confluence ex
|
||||||
I’m not afraid of HTML, but I like the idea of doing my HTML work in a Lisp-like way using the [[https://github.com/tonyaldon/jack][jack-html project]]:
|
I’m not afraid of HTML, but I like the idea of doing my HTML work in a Lisp-like way using the [[https://github.com/tonyaldon/jack][jack-html project]]:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package jack
|
(use-package jack
|
||||||
|
:elpaca (:host github :repo "tonyaldon/jack")
|
||||||
:commands (jack-html))
|
:commands (jack-html))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -819,7 +803,7 @@ I've been working on my own [[http://www.howardism.org/Technical/Emacs/focused-w
|
||||||
(use-package async)
|
(use-package async)
|
||||||
|
|
||||||
(use-package ha-focus
|
(use-package ha-focus
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(ha-leader
|
(ha-leader
|
||||||
"o f" '("begin focus" . ha-focus-begin)
|
"o f" '("begin focus" . ha-focus-begin)
|
||||||
|
|
@ -911,9 +895,9 @@ And the Emacs interface to that:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package jinx
|
(use-package jinx
|
||||||
|
:elpaca (:host github :repo "minad/jinx" :files (:defaults "jinx-mod.c" "emacs-module.h"))
|
||||||
:hook (emacs-startup . global-jinx-mode)
|
:hook (emacs-startup . global-jinx-mode)
|
||||||
:bind (("C-:" . jinx-correct-nearest)
|
:bind (("C-;" . jinx-correct-nearest)
|
||||||
("s-:" . jinx-correct-nearest)
|
|
||||||
("s-;" . jinx-correct-nearest)
|
("s-;" . jinx-correct-nearest)
|
||||||
([remap ispell-word] . #'jinx-correct))
|
([remap ispell-word] . #'jinx-correct))
|
||||||
:config
|
:config
|
||||||
|
|
@ -1456,6 +1440,7 @@ The [[https://github.com/rnkn/olivetti][olivetti project]] sets wide margins and
|
||||||
Trying out [[https://protesilaos.com/][Protesilaos Stavrou]]’s [[https://protesilaos.com/emacs/logos][logos project]] as a replacement for [[https://github.com/joostkremers/writeroom-mode][Writeroom-mode]]:
|
Trying out [[https://protesilaos.com/][Protesilaos Stavrou]]’s [[https://protesilaos.com/emacs/logos][logos project]] as a replacement for [[https://github.com/joostkremers/writeroom-mode][Writeroom-mode]]:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package logos
|
(use-package logos
|
||||||
|
:elpaca (:host gitlab :repo "protesilaos/logos")
|
||||||
:init
|
:init
|
||||||
(setq logos-outlines-are-pages t
|
(setq logos-outlines-are-pages t
|
||||||
logos-outline-regexp-alist
|
logos-outline-regexp-alist
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ The obvious keybindings are ~M-h/j/k/l~ … but that is used … well, somewhat.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package spatial-navigate
|
(use-package spatial-navigate
|
||||||
|
:elpaca (:repo "https://codeberg.org/ideasman42/emacs-spatial-navigate")
|
||||||
:config
|
:config
|
||||||
(pretty-hydra-define spatial-navigate (:color amaranth :quit-key "q")
|
(pretty-hydra-define spatial-navigate (:color amaranth :quit-key "q")
|
||||||
("Box"
|
("Box"
|
||||||
|
|
@ -61,6 +62,7 @@ The [[https://github.com/antonj/Highlight-Indentation-for-Emacs][Highlight-Inden
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package highlight-indentation
|
(use-package highlight-indentation
|
||||||
|
:elpaca (:host github :repo "antonj/Highlight-Indentation-for-Emacs")
|
||||||
:hook ((yaml-mode . highlight-indentation-mode)
|
:hook ((yaml-mode . highlight-indentation-mode)
|
||||||
(python-mode . highlight-indentation-mode)))
|
(python-mode . highlight-indentation-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -117,6 +119,7 @@ Allow this mode in Org blocks:
|
||||||
And we hook
|
And we hook
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package yaml-pro
|
(use-package yaml-pro
|
||||||
|
:elpaca (:host github :repo "zkry/yaml-pro")
|
||||||
:after yaml-mode
|
:after yaml-mode
|
||||||
:hook ((yaml-mode . yaml-pro-mode)))
|
:hook ((yaml-mode . yaml-pro-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -221,6 +224,7 @@ Do I consider all YAML files an Ansible file needing [[https://github.com/k1LoW/
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ansible
|
(use-package ansible
|
||||||
|
:elpaca (:host gitlab :repo "emacs-ansible/emacs-ansible")
|
||||||
;; :mode ((rx (or "playbooks" "roles") (one-or-more any) ".y" (optional "a") "ml") . ansible-mode)
|
;; :mode ((rx (or "playbooks" "roles") (one-or-more any) ".y" (optional "a") "ml") . ansible-mode)
|
||||||
:config
|
:config
|
||||||
(setq ansible-vault-password-file "~/.ansible-vault-passfile")
|
(setq ansible-vault-password-file "~/.ansible-vault-passfile")
|
||||||
|
|
@ -238,6 +242,7 @@ Since most Ansible files are a combination of YAML and Jinja, the [[https://gith
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package poly-ansible
|
(use-package poly-ansible
|
||||||
|
:elpaca (:host github :repo "emacsmirror/poly-ansible")
|
||||||
:after ansible)
|
:after ansible)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ The /real problem/ is trying to remember all the [[https://github.com/clojure-em
|
||||||
And of course, we want to put this with org blocks:
|
And of course, we want to put this with org blocks:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-clojure
|
(use-package ob-clojure
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:custom
|
:custom
|
||||||
(org-babel-clojure-backend 'cider)
|
(org-babel-clojure-backend 'cider)
|
||||||
:config
|
:config
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,7 @@ I like the idea of [[https://github.com/abo-abo/lispy][lispy]] for making a Lisp
|
||||||
My primary use-case is for its refactoring and other unique features. For instance, I love [[help:lispy-ace-paren][lispy-ace-paren]] that puts an /ace label/ on every parenthesis, allowing me to quickly jump to any s-expression.
|
My primary use-case is for its refactoring and other unique features. For instance, I love [[help:lispy-ace-paren][lispy-ace-paren]] that puts an /ace label/ on every parenthesis, allowing me to quickly jump to any s-expression.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package zoutline)
|
|
||||||
|
|
||||||
(use-package lispy
|
(use-package lispy
|
||||||
:after zoutline
|
|
||||||
:config
|
:config
|
||||||
(when (fboundp 'evil-define-key)
|
(when (fboundp 'evil-define-key)
|
||||||
(evil-define-key '(normal visual) lispyville-mode-map
|
(evil-define-key '(normal visual) lispyville-mode-map
|
||||||
|
|
@ -283,6 +280,7 @@ These are all good, but the primary keys I need to figure out, are the s-express
|
||||||
Wilfred’s [[https://github.com/Wilfred/emacs-refactor/tree/master#elisp][emacs-refactor]] package can be helpful if you turn on =context-menu-mode= and …
|
Wilfred’s [[https://github.com/Wilfred/emacs-refactor/tree/master#elisp][emacs-refactor]] package can be helpful if you turn on =context-menu-mode= and …
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package emr
|
(use-package emr
|
||||||
|
;; :elpaca (:host github :repo "Wilfred/emacs-refactor")
|
||||||
:config
|
:config
|
||||||
(pretty-hydra-define+ lisp-refactor nil
|
(pretty-hydra-define+ lisp-refactor nil
|
||||||
("To 𝛌"
|
("To 𝛌"
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ The [[https://github.com/mihaimaruseac/hindent][hindent package]] looks interest
|
||||||
* Haskell and Org
|
* Haskell and Org
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-haskell
|
(use-package ob-haskell
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'org-babel-load-languages '(haskell . t)))
|
(add-to-list 'org-babel-load-languages '(haskell . t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,10 @@ A literate programming file for configuring Python.
|
||||||
* Introduction
|
* Introduction
|
||||||
The critical part of Python integration with Emacs is running LSP in Python using [[file:ha-programming.org::*direnv][direnv]]. And the question to ask is if the Python we run it in Docker or in a virtual environment.
|
The critical part of Python integration with Emacs is running LSP in Python using [[file:ha-programming.org::*direnv][direnv]]. And the question to ask is if the Python we run it in Docker or in a virtual environment.
|
||||||
|
|
||||||
While Emacs supplies a Python editing environment, we’ll still use =use-package= to grab the latest:
|
Emacs supplies a Python editing environment. Since =ob-python= loads the built-in version before Elpaca activates anything, we use =:elpaca nil= instead of grabbing a newer one:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package python
|
(use-package python
|
||||||
|
:elpaca nil
|
||||||
:after flycheck
|
:after flycheck
|
||||||
:mode (((rx ".flake8" eol) . conf-mode)
|
:mode (((rx ".flake8" eol) . conf-mode)
|
||||||
((rx "Pipfile" eol) . conf-mode)
|
((rx "Pipfile" eol) . conf-mode)
|
||||||
|
|
@ -355,7 +356,7 @@ The built-in Eglot package natively supports [[https://github.com/Microsoft/pyri
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:after python
|
:after python
|
||||||
:defer t
|
:defer t
|
||||||
:hook (python-mode . eglot-ensure)
|
:hook (python-mode . eglot-ensure)
|
||||||
|
|
@ -370,7 +371,7 @@ Keybindings for the eglot-based LSP sub-menu, wired into the existing =python-mo
|
||||||
(defvar ha-python-lsp-title (font-icons 'faicon "python" :title "Python LSP"))
|
(defvar ha-python-lsp-title (font-icons 'faicon "python" :title "Python LSP"))
|
||||||
|
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:after major-mode-hydra
|
:after major-mode-hydra
|
||||||
:config
|
:config
|
||||||
(pretty-hydra-define python-lsp (:color blue :quit-key "q"
|
(pretty-hydra-define python-lsp (:color blue :quit-key "q"
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ The built-in Eglot package natively supports [[https://github.com/castwide/solar
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:after ruby-mode
|
:after ruby-mode
|
||||||
:defer t
|
:defer t
|
||||||
:hook (ruby-mode . eglot-ensure))
|
:hook (ruby-mode . eglot-ensure))
|
||||||
|
|
@ -278,7 +278,7 @@ Keybindings for the eglot-based LSP sub-menu, wired into the =ruby-mode= local l
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:after ruby-mode
|
:after ruby-mode
|
||||||
:config
|
:config
|
||||||
(ha-local-leader 'ruby-mode-map
|
(ha-local-leader 'ruby-mode-map
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ The [[https://www.nongnu.org/geiser/][geiser project]] attempts to be the interf
|
||||||
Do we need a Scheme work for Org Babel? According to [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html][this document]], we just need to make sure we add the =:session= variable to start the REPL.
|
Do we need a Scheme work for Org Babel? According to [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html][this document]], we just need to make sure we add the =:session= variable to start the REPL.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-scheme
|
(use-package ob-scheme
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(add-to-list 'org-babel-load-languages '(scheme . t)))
|
(add-to-list 'org-babel-load-languages '(scheme . t)))
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ Let’s get the book available as an Info page:
|
||||||
|
|
||||||
Still having difficulty getting the Scheme REPL to output the results back into this document. Let’s try Racket...
|
Still having difficulty getting the Scheme REPL to output the results back into this document. Let’s try Racket...
|
||||||
|
|
||||||
Normally, I would just [[info:SICP][read the book]], however, if we want to read the [[file:~/.emacs.d/straight/build/sicp/sicp.info][sicp.info]] file, we need this, at least, temporarily:
|
Normally, I would just [[info:SICP][read the book]], however, if we want to read the [[file:~/.emacs.d/elpaca/builds/sicp/sicp.info][sicp.info]] file, we need this, at least, temporarily:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode))
|
(add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -122,7 +122,7 @@ While Racket, as a Scheme, should work with Geiser (below), let’s also get [[h
|
||||||
Can we get Racket working with Org?
|
Can we get Racket working with Org?
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-racket
|
(use-package ob-racket
|
||||||
:vc (:url "https://github.com/DEADB17/ob-racket" :rev :newest)
|
:elpaca (:host github :repo "DEADB17/ob-racket")
|
||||||
:after org
|
:after org
|
||||||
:config
|
:config
|
||||||
(add-to-list 'org-babel-load-languages '(racket . t)))
|
(add-to-list 'org-babel-load-languages '(racket . t)))
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ The [[https://github.com/eki3z/mise.el][mise.el]] project overcomes the [[https:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package mise
|
(use-package mise
|
||||||
|
:elpaca (:host github :repo "eki3z/mise.el")
|
||||||
:hook (after-init . global-mise-mode))
|
:hook (after-init . global-mise-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
@ -72,6 +73,7 @@ For all programming languages, I would like to now default to absolute line numb
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(defun ha-prog-mode-config ()
|
(defun ha-prog-mode-config ()
|
||||||
"Configure the `prog-mode'"
|
"Configure the `prog-mode'"
|
||||||
|
|
@ -83,7 +85,7 @@ For all programming languages, I would like to now default to absolute line numb
|
||||||
While Emacs has options for viewing and moving around code, sometimes, we could /collapse/ all functions, and then start to expand them one at a time. For this, we could enable the built-in [[https://www.emacswiki.org/emacs/HideShow][hide-show feature]]:
|
While Emacs has options for viewing and moving around code, sometimes, we could /collapse/ all functions, and then start to expand them one at a time. For this, we could enable the built-in [[https://www.emacswiki.org/emacs/HideShow][hide-show feature]]:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package hide-show
|
(use-package hide-show
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:init
|
:init
|
||||||
(setq hs-hide-comments t
|
(setq hs-hide-comments t
|
||||||
hs-hide-initial-comment-block t
|
hs-hide-initial-comment-block t
|
||||||
|
|
@ -230,6 +232,7 @@ The [[https://www.emacswiki.org/emacs/FlySpell#h5o-2][flyspell-prog-mode]] check
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flyspell
|
(use-package flyspell
|
||||||
|
:elpaca nil
|
||||||
:hook (prog-mode . flyspell-prog-mode))
|
:hook (prog-mode . flyspell-prog-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Linting with Flycheck
|
** Linting with Flycheck
|
||||||
|
|
@ -237,6 +240,7 @@ Why use [[https://www.flycheck.org/][flycheck]] over the built-in =flymake=? Spe
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
|
:elpaca (:host github :repo "flycheck/flycheck")
|
||||||
:init
|
:init
|
||||||
(setq next-error-message-highlight t)
|
(setq next-error-message-highlight t)
|
||||||
:bind (:map flycheck-error-list-mode-map
|
:bind (:map flycheck-error-list-mode-map
|
||||||
|
|
@ -424,15 +428,15 @@ Note that Emacs already has the ability to download and install grammars, so fol
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(when (treesit-available-p)
|
(when (treesit-available-p)
|
||||||
(use-package treesit
|
(use-package treesit
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:preface
|
:preface
|
||||||
(setq treesit-language-source-alist
|
(setq treesit-language-source-alist
|
||||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||||
;; (c "https://github.com/tree-sitter/tree-sitter-c/" "master" "src")
|
;; (c "https://github.com/tree-sitter/tree-sitter-c/" "master" "src")
|
||||||
;; (clojure "https://github.com/sogaiu/tree-sitter-clojure" "master" "src")
|
(clojure "https://github.com/sogaiu/tree-sitter-clojure" "master" "src")
|
||||||
;; (cpp "https://github.com/tree-sitter/tree-sitter-cpp/" "master" "src")
|
;; (cpp "https://github.com/tree-sitter/tree-sitter-cpp/" "master" "src")
|
||||||
;; (cmake "https://github.com/uyha/tree-sitter-cmake")
|
;; (cmake "https://github.com/uyha/tree-sitter-cmake")
|
||||||
;; (css "https://github.com/tree-sitter/tree-sitter-css")
|
(css "https://github.com/tree-sitter/tree-sitter-css")
|
||||||
(dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile" "main" "src")
|
(dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile" "main" "src")
|
||||||
;; From my private cloned repository:
|
;; From my private cloned repository:
|
||||||
;; (dockerfile "file:///opt/src/github/tree-sitter-dockerfile" "main" "src")
|
;; (dockerfile "file:///opt/src/github/tree-sitter-dockerfile" "main" "src")
|
||||||
|
|
@ -440,8 +444,8 @@ Note that Emacs already has the ability to download and install grammars, so fol
|
||||||
;; (elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
;; (elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
||||||
;; (elixir "https://github.com/elixir-lang/tree-sitter-elixir" "main" "src")
|
;; (elixir "https://github.com/elixir-lang/tree-sitter-elixir" "main" "src")
|
||||||
;; (erlang "https://github.com/WhatsApp/tree-sitter-erlang" "main" "src")
|
;; (erlang "https://github.com/WhatsApp/tree-sitter-erlang" "main" "src")
|
||||||
;; (go "https://github.com/tree-sitter/tree-sitter-go")
|
(go "https://github.com/tree-sitter/tree-sitter-go")
|
||||||
;; (templ "https://github.com/vrischmann/tree-sitter-templ")
|
(templ "https://github.com/vrischmann/tree-sitter-templ")
|
||||||
;; (haskell "https://github.com/tree-sitter/tree-sitter-haskell" "master" "src")
|
;; (haskell "https://github.com/tree-sitter/tree-sitter-haskell" "master" "src")
|
||||||
(html "https://github.com/tree-sitter/tree-sitter-html")
|
(html "https://github.com/tree-sitter/tree-sitter-html")
|
||||||
;; (java "https://github.com/tree-sitter/tree-sitter-java" "master" "src")
|
;; (java "https://github.com/tree-sitter/tree-sitter-java" "master" "src")
|
||||||
|
|
@ -450,28 +454,21 @@ Note that Emacs already has the ability to download and install grammars, so fol
|
||||||
;; (julia "https://github.com/tree-sitter/tree-sitter-julia" "master" "src")
|
;; (julia "https://github.com/tree-sitter/tree-sitter-julia" "master" "src")
|
||||||
;; (lua "https://github.com/MunifTanjim/tree-sitter-lua" "main" "src")
|
;; (lua "https://github.com/MunifTanjim/tree-sitter-lua" "main" "src")
|
||||||
(make "https://github.com/alemuller/tree-sitter-make")
|
(make "https://github.com/alemuller/tree-sitter-make")
|
||||||
(mermaid "https://github.com/monaqa/tree-sitter-mermaid")
|
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
||||||
;; (markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
|
||||||
;; (meson "https://github.com/Decodetalkers/tree-sitter-meson" "master" "src")
|
;; (meson "https://github.com/Decodetalkers/tree-sitter-meson" "master" "src")
|
||||||
;; (python "https://github.com/tree-sitter/tree-sitter-python")
|
(python "https://github.com/tree-sitter/tree-sitter-python")
|
||||||
;; (ruby "https://github.com/tree-sitter/tree-sitter-ruby" "master" "src")
|
(ruby "https://github.com/tree-sitter/tree-sitter-ruby" "master" "src")
|
||||||
;; (rust "https://github.com/tree-sitter/tree-sitter-rust" "master" "src")
|
(rust "https://github.com/tree-sitter/tree-sitter-rust" "master" "src")
|
||||||
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
||||||
;; (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
;; (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
||||||
;; (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
;; (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
||||||
(yaml "https://github.com/tree-sitter-grammars/tree-sitter-yaml")))
|
(yaml "https://github.com/tree-sitter-grammars/tree-sitter-yaml")))
|
||||||
|
|
||||||
(defun mp-setup-install-grammars (&optional force)
|
(defun mp-setup-install-grammars ()
|
||||||
"Install Tree-sitter grammars if they are absent.
|
"Install Tree-sitter grammars if they are absent."
|
||||||
Each grammar in `treesit-language-source-alist' is only cloned and
|
(interactive)
|
||||||
compiled when `treesit-language-available-p' says it is missing, as
|
(sit-for 30)
|
||||||
installing one takes a second or two. With a prefix argument, FORCE
|
(mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist)))
|
||||||
reinstalls every grammar, which is how we pick up upstream changes."
|
|
||||||
(interactive "P")
|
|
||||||
(dolist (lang (mapcar #'car treesit-language-source-alist))
|
|
||||||
(when (or force (not (treesit-language-available-p lang)))
|
|
||||||
(message "Installing Tree-sitter grammar for `%s' ..." lang)
|
|
||||||
(treesit-install-language-grammar lang))))
|
|
||||||
|
|
||||||
;; Optional, but Mickey recommends. Tree-sitter enabled major
|
;; Optional, but Mickey recommends. Tree-sitter enabled major
|
||||||
;; modes are distinct from their ordinary counterparts, however,
|
;; modes are distinct from their ordinary counterparts, however,
|
||||||
|
|
@ -508,10 +505,10 @@ And enable the languages:
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Combobulate
|
*** Combobulate
|
||||||
I like [[file:ha-programming-elisp.org::*Clever Parenthesis][Clever Parenthesis]], but can we extend that to other languages generally? After reading Mickey Petersen’s essay, [[https://www.masteringemacs.org/article/combobulate-structured-movement-editing-treesitter][Combobulate project]], I decided to try out his [[https://github.com/mickeynp/combobulate][combobulate package]]. Of course, this can only work with the underlying tooling supplied by the [[https://emacs-tree-sitter.github.io/][Tree Sitter]] →
|
I like [[file:ha-programming-elisp.org::*Clever Parenthesis][Clever Parenthesis]], but can we extend that to other languages generally? After reading Mickey Petersen’s essay, [[https://www.masteringemacs.org/article/combobulate-structured-movement-editing-treesitter][Combobulate project]], I decided to try out his [[https://github.com/mickeynp/combobulate][combobulate package]]. Of course, this can only work with the underlying tooling supplied by the [[https://emacs-tree-sitter.github.io/][Tree Sitter]] →
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(when (treesit-available-p)
|
(when (treesit-available-p)
|
||||||
(use-package combobulate
|
(use-package combobulate
|
||||||
:vc (:url "https://github.com/mickeynp/combobulate" :rev :newest)
|
:elpaca (:host github :repo "mickeynp/combobulate")
|
||||||
:after treesit
|
:after treesit
|
||||||
:hook ((yaml-ts-mode . combobulate-mode)
|
:hook ((yaml-ts-mode . combobulate-mode)
|
||||||
;; (css-ts-mode . combobulate-mode)
|
;; (css-ts-mode . combobulate-mode)
|
||||||
|
|
@ -522,7 +519,7 @@ I like [[file:ha-programming-elisp.org::*Clever Parenthesis][Clever Parenthesis]
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Now, I can create an /interface/ of keystrokes to jump around like a boss:
|
Now, I can create an /interface/ of keystrokes to jump around like a boss:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(when (treesit-available-p)
|
(when (treesit-available-p)
|
||||||
(use-package combobulate
|
(use-package combobulate
|
||||||
:general
|
:general
|
||||||
|
|
@ -570,7 +567,7 @@ Now, I can create an /interface/ of keystrokes to jump around like a boss:
|
||||||
Mickey’s interface is the [[help:combobulate][combobulate]] function (or ~C-c o o~), but mine is more /evil/.
|
Mickey’s interface is the [[help:combobulate][combobulate]] function (or ~C-c o o~), but mine is more /evil/.
|
||||||
|
|
||||||
I can create a /helper function/ to allow me to jump to various types of—well, /types/:
|
I can create a /helper function/ to allow me to jump to various types of—well, /types/:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(when (treesit-available-p)
|
(when (treesit-available-p)
|
||||||
(use-package combobulate
|
(use-package combobulate
|
||||||
:config
|
:config
|
||||||
|
|
@ -660,6 +657,7 @@ While I’m at it, let’s connect various ~g~ sequence keys to =xref-= interfac
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
|
:elpaca nil
|
||||||
:general
|
:general
|
||||||
(:states 'normal
|
(:states 'normal
|
||||||
"g ." '("find def" . xref-find-definitions)
|
"g ." '("find def" . xref-find-definitions)
|
||||||
|
|
@ -691,7 +689,7 @@ Emacs has two LSP projects, and while I have used [[LSP Mode]], but since I don
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:commands eglot-ensure
|
:commands eglot-ensure
|
||||||
:config
|
:config
|
||||||
(setq eglot-autoshutdown t))
|
(setq eglot-autoshutdown t))
|
||||||
|
|
@ -1011,6 +1009,7 @@ Simple to configure languages go here. More advanced languages go into their own
|
||||||
So many configuration files to track:
|
So many configuration files to track:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package conf-mode
|
(use-package conf-mode
|
||||||
|
:elpaca nil
|
||||||
:mode (("\\.conf\\'" . conf-space-mode)
|
:mode (("\\.conf\\'" . conf-space-mode)
|
||||||
("\\.repo\\'" . conf-unix-mode)
|
("\\.repo\\'" . conf-unix-mode)
|
||||||
("\\.setup.*\\'" . conf-space-mode)))
|
("\\.setup.*\\'" . conf-space-mode)))
|
||||||
|
|
@ -1420,7 +1419,7 @@ Using [[https://polymode.github.io/][polymode]], let’s add syntax coloring to
|
||||||
#+end_src
|
#+end_src
|
||||||
** ReStructured Text
|
** ReStructured Text
|
||||||
Support for [[https://docutils.sourceforge.io/rst.html][reStructuredText]] is [[https://www.emacswiki.org/emacs/reStructuredText][well supported]] in Emacs.
|
Support for [[https://docutils.sourceforge.io/rst.html][reStructuredText]] is [[https://www.emacswiki.org/emacs/reStructuredText][well supported]] in Emacs.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package rst
|
(use-package rst
|
||||||
:config
|
:config
|
||||||
(when (and (display-graphic-p) (boundp 'ha-fixed-font))
|
(when (and (display-graphic-p) (boundp 'ha-fixed-font))
|
||||||
|
|
@ -1470,7 +1469,7 @@ While I don't like writing them, I can't get away from them. Check out the goodi
|
||||||
While filename extensions work fine most of the time, I don't like to pre-pend =.sh= to the shell scripts I write, and instead, would like to associate =shell-mode= with all files in a =bin= directory:
|
While filename extensions work fine most of the time, I don't like to pre-pend =.sh= to the shell scripts I write, and instead, would like to associate =shell-mode= with all files in a =bin= directory:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package sh-mode
|
(use-package sh-mode
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:mode (rx (or (seq ".sh" eol)
|
:mode (rx (or (seq ".sh" eol)
|
||||||
"/bin/"))
|
"/bin/"))
|
||||||
:init
|
:init
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ A literate configuration for accessing remote systems.
|
||||||
[[https://www.emacswiki.org/emacs/TrampMode][Tramp]] allows almost all Emacs features to execute on a remote system.
|
[[https://www.emacswiki.org/emacs/TrampMode][Tramp]] allows almost all Emacs features to execute on a remote system.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package tramp
|
(use-package tramp
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
|
|
||||||
:config
|
:config
|
||||||
;; Use remote PATH on tramp (handy for eshell).
|
;; Use remote PATH on tramp (handy for eshell).
|
||||||
|
|
@ -42,7 +42,7 @@ A literate configuration for accessing remote systems.
|
||||||
Will Schenk has [[https://willschenk.com/articles/2020/tramp_tricks/][a simple extension]] to allow editing of files /inside/ a Docker container:
|
Will Schenk has [[https://willschenk.com/articles/2020/tramp_tricks/][a simple extension]] to allow editing of files /inside/ a Docker container:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package tramp
|
(use-package tramp
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(push '("docker" . ((tramp-login-program "docker")
|
(push '("docker" . ((tramp-login-program "docker")
|
||||||
(tramp-login-args (("exec" "-it") ("%h") ("/bin/sh")))
|
(tramp-login-args (("exec" "-it") ("%h") ("/bin/sh")))
|
||||||
|
|
@ -75,7 +75,7 @@ Which means, I need to put it as a link in an org file.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package tramp-sh
|
(use-package tramp-sh
|
||||||
:after tramp
|
:after tramp
|
||||||
:ensure nil
|
:elpaca nil
|
||||||
:custom (tramp-use-ssh-controlmaster-options nil))
|
:custom (tramp-use-ssh-controlmaster-options nil))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Remote Terminals
|
* Remote Terminals
|
||||||
|
|
@ -124,7 +124,7 @@ I'm not giving up on Eshell, but I am playing around with [[https://github.com/a
|
||||||
|
|
||||||
VTerm has an issue (at least for me) with ~M-Backspace~ not deleting the previous word, and yeah, I want to make sure that both keystrokes do the same thing.
|
VTerm has an issue (at least for me) with ~M-Backspace~ not deleting the previous word, and yeah, I want to make sure that both keystrokes do the same thing.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:config
|
:config
|
||||||
(setq vterm-shell "zsh"
|
(setq vterm-shell "zsh"
|
||||||
|
|
@ -162,7 +162,7 @@ An odd use case I have: working in a Terminal session in one buffer window, and
|
||||||
|
|
||||||
Now, I can type: ~s-G~ (with the shift), select the line with Avy, and type ~N~ to have it copy/paste into the buffer:
|
Now, I can type: ~s-G~ (with the shift), select the line with Avy, and type ~N~ to have it copy/paste into the buffer:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:config
|
:config
|
||||||
(defun ha-vterm-avy-paste-line ()
|
(defun ha-vterm-avy-paste-line ()
|
||||||
|
|
@ -180,9 +180,15 @@ Now, I can type: ~s-G~ (with the shift), select the line with Avy, and type ~N~
|
||||||
** Eat
|
** Eat
|
||||||
While not as fast as [[https://github.com/akermu/emacs-libvterm][vterm]], the [[https://codeberg.org/akib/emacs-eat][Emulate a Terminal]] project (eat) is fast enough, and doesn’t require a dedicate library that requires re-compilation. While offering [[https://elpa.nongnu.org/nongnu-devel/doc/eat.html][online documentation]], I’m glad for an [[info:eat#Top][Info version]].
|
While not as fast as [[https://github.com/akermu/emacs-libvterm][vterm]], the [[https://codeberg.org/akib/emacs-eat][Emulate a Terminal]] project (eat) is fast enough, and doesn’t require a dedicate library that requires re-compilation. While offering [[https://elpa.nongnu.org/nongnu-devel/doc/eat.html][online documentation]], I’m glad for an [[info:eat#Top][Info version]].
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package eat
|
(use-package eat
|
||||||
;; :commands (eat eat-make eat-project)
|
:elpaca (:host codeberg :repo "akib/emacs-eat"
|
||||||
|
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||||
|
"*.ti" ("terminfo/e" "terminfo/efo/e/*")
|
||||||
|
("terminfo/65" "terminfo/65/*")
|
||||||
|
("integration" "integration/*")
|
||||||
|
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||||
|
:commands (eat eat-make eat-project)
|
||||||
:bind (:map eat-semi-char-mode-map
|
:bind (:map eat-semi-char-mode-map
|
||||||
("C-c C-t" . ha-eat-narrow-to-shell-prompt-dwim))
|
("C-c C-t" . ha-eat-narrow-to-shell-prompt-dwim))
|
||||||
:config
|
:config
|
||||||
|
|
@ -499,7 +505,8 @@ Instead of making sure I have a list of remote systems already in the favorite h
|
||||||
We'll give =openstack= CLI a =--format json= option to make it easier for parsing:
|
We'll give =openstack= CLI a =--format json= option to make it easier for parsing:
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package json)
|
(use-package json
|
||||||
|
:elpaca nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
|
||||||
26
ha-theme.org
26
ha-theme.org
|
|
@ -438,19 +438,19 @@ Let’s make a /theme/:
|
||||||
`(term-color-bright-yellow ((t (:foreground ,yellow))))
|
`(term-color-bright-yellow ((t (:foreground ,yellow))))
|
||||||
`(term-color-bright-cyan ((t (:foreground ,slate))))
|
`(term-color-bright-cyan ((t (:foreground ,slate))))
|
||||||
|
|
||||||
`(ansi-color-red ((t (:foreground ,red2-lt :background unspecified))))
|
`(ansi-color-red ((t (:foreground ,red2-lt :background nil))))
|
||||||
`(ansi-color-green ((t (:foreground ,green-lt :background unspecified))))
|
`(ansi-color-green ((t (:foreground ,green-lt :background nil))))
|
||||||
`(ansi-color-blue ((t (:foreground ,blue-lt :background unspecified))))
|
`(ansi-color-blue ((t (:foreground ,blue-lt :background nil))))
|
||||||
`(ansi-color-magenta ((t (:foreground ,purple-lt :background unspecified))))
|
`(ansi-color-magenta ((t (:foreground ,purple-lt :background nil))))
|
||||||
`(ansi-color-yellow ((t (:foreground ,yellow-lt :background unspecified))))
|
`(ansi-color-yellow ((t (:foreground ,yellow-lt :background nil))))
|
||||||
`(ansi-color-cyan ((t (:foreground ,slate :background unspecified))))
|
`(ansi-color-cyan ((t (:foreground ,slate :background nil))))
|
||||||
`(ansi-color-bright-red ((t (:foreground ,red2 :background unspecified))))
|
`(ansi-color-bright-red ((t (:foreground ,red2 :background nil))))
|
||||||
`(ansi-color-bright-green ((t (:foreground ,green :background unspecified))))
|
`(ansi-color-bright-green ((t (:foreground ,green :background nil))))
|
||||||
`(ansi-color-bright-blue ((t (:foreground ,blue :background unspecified))))
|
`(ansi-color-bright-blue ((t (:foreground ,blue :background nil))))
|
||||||
`(ansi-color-bright-magenta ((t (:foreground ,purple :background unspecified))))
|
`(ansi-color-bright-magenta ((t (:foreground ,purple :background nil))))
|
||||||
`(ansi-color-bright-yellow ((t (:foreground ,yellow :background unspecified))))
|
`(ansi-color-bright-yellow ((t (:foreground ,yellow :background nil))))
|
||||||
`(ansi-color-bright-cyan ((t (:foreground ,slate :background unspecified))))
|
`(ansi-color-bright-cyan ((t (:foreground ,slate :background nil))))
|
||||||
`(ansi-color-bright-black ((t (:foreground ,gray-50 :background unspecified))))
|
`(ansi-color-bright-black ((t (:foreground ,gray-50 :background nil))))
|
||||||
|
|
||||||
`(sh-heredoc ((t (:foreground ,almond))))
|
`(sh-heredoc ((t (:foreground ,almond))))
|
||||||
`(sh-quoted-exec ((t (:foreground ,orange2-lt))))
|
`(sh-quoted-exec ((t (:foreground ,orange2-lt))))
|
||||||
|
|
|
||||||
88
initialize
88
initialize
|
|
@ -17,9 +17,6 @@ do
|
||||||
ln -s "$HAMACS_DIR/$LINK" "$HAMACS_DEST"
|
ln -s "$HAMACS_DIR/$LINK" "$HAMACS_DEST"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo Download the public keys:
|
|
||||||
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
|
|
||||||
|
|
||||||
cat > "$HAMACS_DEST/early-init.el" <<EOF
|
cat > "$HAMACS_DEST/early-init.el" <<EOF
|
||||||
;;; early-init.el --- Hamacs Early Init -*- lexical-binding: t; -*-
|
;;; early-init.el --- Hamacs Early Init -*- lexical-binding: t; -*-
|
||||||
;;
|
;;
|
||||||
|
|
@ -35,15 +32,15 @@ cat > "$HAMACS_DEST/early-init.el" <<EOF
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;
|
;;
|
||||||
;; This is my early Emacs configuration file. See init.el for the real
|
;; This is my early Emacs configuration file. See init.el for the real
|
||||||
;; boot process. Since init.el calls package-initialize itself, we just
|
;; boot process. Since we are using elpaca, we just need to stop the
|
||||||
;; need to stop the normal package process.
|
;; normal package process.
|
||||||
;;
|
;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; Need the package system near the front:
|
;; Need the package system near the front:
|
||||||
(require 'package)
|
;; (require 'package)
|
||||||
|
|
||||||
;; init.el activates the packages, so we don't want duplicated package loading:
|
;; We'll be using elpaca. So, we don't want duplicated package loading:
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
;; While I would rather program my configurations, sometimes the Emacs
|
;; While I would rather program my configurations, sometimes the Emacs
|
||||||
|
|
@ -99,29 +96,80 @@ cat > "$HAMACS_DEST/init.el" <<EOF
|
||||||
;; Bug fixes for ORG (there always seems to be something):
|
;; Bug fixes for ORG (there always seems to be something):
|
||||||
(defvar native-comp-deferred-compilation-deny-list nil)
|
(defvar native-comp-deferred-compilation-deny-list nil)
|
||||||
|
|
||||||
;; Allow the installation of unsigned packages, but verify the
|
;; Elpaca doesn't use package.el, so no package archives are needed.
|
||||||
;; signature if possible:
|
;; Install and configure Elpaca, see the installer at:
|
||||||
|
;; https://github.com/progfolio/elpaca#installer
|
||||||
|
|
||||||
(setq package-check-signature 'allow-unsigned)
|
(defvar elpaca-installer-version 0.12)
|
||||||
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
|
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
|
||||||
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||||
|
:ref nil :depth 1 :inherit ignore
|
||||||
|
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||||
|
:build (:not elpaca-activate)))
|
||||||
|
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
|
||||||
|
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||||
|
(order (cdr elpaca-order))
|
||||||
|
(default-directory repo))
|
||||||
|
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
||||||
|
(unless (file-exists-p repo)
|
||||||
|
(make-directory repo t)
|
||||||
|
(when (<= emacs-major-version 28) (require 'subr-x))
|
||||||
|
(condition-case-unless-debug err
|
||||||
|
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
|
||||||
|
((zerop (apply #'call-process \`("git" nil ,buffer t "clone"
|
||||||
|
,@(when-let* ((depth (plist-get order :depth)))
|
||||||
|
(list (format "--depth=%d" depth) "--no-single-branch"))
|
||||||
|
,(plist-get order :repo) ,repo))))
|
||||||
|
((zerop (call-process "git" nil buffer t "checkout"
|
||||||
|
(or (plist-get order :ref) "--"))))
|
||||||
|
(emacs (concat invocation-directory invocation-name))
|
||||||
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
|
||||||
|
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
|
||||||
|
((require 'elpaca))
|
||||||
|
((elpaca-generate-autoloads "elpaca" repo)))
|
||||||
|
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
|
||||||
|
(error "%s" (with-current-buffer buffer (buffer-string))))
|
||||||
|
((error) (warn "%s" err) (delete-directory repo 'recursive))))
|
||||||
|
(unless (require 'elpaca-autoloads nil t)
|
||||||
|
(require 'elpaca)
|
||||||
|
(elpaca-generate-autoloads "elpaca" repo)
|
||||||
|
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
|
||||||
|
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||||
|
(elpaca \`(,@elpaca-order))
|
||||||
|
|
||||||
;; Packages come from Melpa and the GNU and NonGNU ELPAs (the latter
|
;; Enable the :elpaca keyword for use-package, and wait for it, since
|
||||||
;; two are Emacs defaults). The rest are installed straight from their
|
;; everything else in my configuration depends on it:
|
||||||
;; repositories with the :vc keyword of use-package (Emacs 30+).
|
|
||||||
|
|
||||||
(require 'package)
|
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
|
|
||||||
(add-to-list 'package-archives
|
(elpaca elpaca-use-package
|
||||||
'("melpa" . "https://melpa.org/packages/"))
|
(elpaca-use-package-mode))
|
||||||
|
(elpaca-wait)
|
||||||
|
|
||||||
(package-initialize)
|
;; Replace straight's \`straight-use-package-by-default'. Every
|
||||||
|
;; use-package declaration installs its package, unless it says
|
||||||
|
;; otherwise, e.g. ':elpaca nil' for built-in features. Note that
|
||||||
|
;; \`use-package-always-ensure' won't work, as it only considers the
|
||||||
|
;; :ensure keyword.
|
||||||
|
|
||||||
;; Install any missing package by default, so we don't need :ensure t.
|
(add-to-list 'use-package-defaults
|
||||||
;; Use :ensure nil for libraries that ship with Emacs (or my own).
|
'(:elpaca (list t)
|
||||||
|
(lambda (name args)
|
||||||
|
(not (or (plist-member args :ensure)
|
||||||
|
(plist-member args :load-path)
|
||||||
|
(elpaca-get name))))) t)
|
||||||
|
|
||||||
(setq use-package-always-ensure t)
|
;; Eglot and its dependencies (project, flymake, xref, jsonrpc, etc.)
|
||||||
|
;; ship with Emacs. Elpaca already ignores built-in packages when
|
||||||
|
;; resolving dependencies, see \`elpaca-ignored-dependencies'.
|
||||||
|
|
||||||
|
;; Install the latest org-mode, and wait, since we need it to load
|
||||||
|
;; the rest of the configuration:
|
||||||
|
|
||||||
(use-package org)
|
(use-package org)
|
||||||
|
(elpaca-wait)
|
||||||
|
|
||||||
;; Let's rock:
|
;; Let's rock:
|
||||||
(org-babel-load-file "$HAMACS_DIR/bootstrap.org")
|
(org-babel-load-file "$HAMACS_DIR/bootstrap.org")
|
||||||
|
|
|
||||||
2
pud.org
2
pud.org
|
|
@ -40,7 +40,7 @@ Use your favorite way to install Emacs’ packages, for instance, with Emacs 30,
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle no :eval no
|
#+BEGIN_SRC emacs-lisp :tangle no :eval no
|
||||||
(use-package pud
|
(use-package pud
|
||||||
:vc (:url "https://howardabrams.com/git/howard/pud" :rev :newest)
|
:vc (:url "https://howardabrams.com/git/howard/pud")
|
||||||
:custom
|
:custom
|
||||||
(pud-worlds
|
(pud-worlds
|
||||||
'(["Remote Moss-n-Puddles" 'ssh "howardabrams.com" 4000 "george"]
|
'(["Remote Moss-n-Puddles" 'ssh "howardabrams.com" 4000 "george"]
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@
|
||||||
# --
|
# --
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ${1:package}
|
(use-package ${1:package}
|
||||||
:straight (:type git ${2::host ${3:github}} :repo "${4:repo}")
|
:elpaca (${2::host ${3:github}} :repo "${4:repo}")
|
||||||
$0)
|
$0)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue