Compare commits

...

12 commits

2 changed files with 99 additions and 41 deletions

13
.gitignore vendored
View file

@ -1,14 +1,5 @@
config.*
!config.org
init.el
packages.el
cli.el
subconf/
modules/
*.el
!.dir-locals.el
_minted-config
abbrev.el
!.dir-locals.el
~*

View file

@ -775,12 +775,9 @@ Emacs's runtime and configuration systems are designed to be as flexible as poss
#+begin_src emacs-lisp :tangle packages.el
(package! el-patch)
(after! el-patch
(setq el-patch-warn-on-eval-template nil))
#+end_src
The package allows you to define /patches/ which modify the definitions of functions in systematic ways. The suite of tools provided by the package is easily comprehensive enough for my needs, but we can make the API a bit nicer with some macros:
The package allows you to define /patches/ which modify the definitions of functions in systematic ways. The suite of tools provided by the package is easily comprehensive enough for my needs, but we can make the API a bit nicer with some macros and configure options:
#+begin_src emacs-lisp
(defmacro defpatch! (feature type-name &rest args)
@ -805,6 +802,9 @@ The package allows you to define /patches/ which modify the definitions of funct
(after! ,feature
,template))
template)))
(after! el-patch
(setq el-patch-warn-on-eval-template nil))
#+end_src
** Automated Nix Builds
@ -1351,7 +1351,7 @@ split."
(unless (or (eq w window)
(window-dedicated-p w))
(throw 'done nil)))
frame)
frame nil 'nomini)
t)))
(not (window-minibuffer-p window))
(let (((el-patch-swap split-height-threshold
@ -2097,8 +2097,7 @@ Having an IDE-style tooltip pop up is nice, but ~flymake-popon~ is a bit ugly by
*** Popups
#+begin_src emacs-lisp
(after! flymake
(set-popup-rule! "^\\*Flymake" :vslot 1 :side 'bottom))
(set-popup-rule! "^\\*Flymake" :vslot 1 :side 'bottom)
#+end_src
** Git
@ -2376,6 +2375,17 @@ Now that we have this word list, we can also plug it into ~cape-dict~ and get pr
(add-hook! 'completion-at-point-functions :local :depth 40 #'cape-dict))
#+end_src
** Undo Tree
#+call: confpkg("Pkg: undo-tree")
#+begin_src emacs-lisp
(after! undo-tree
(setq undo-tree-visualizer-diff nil))
(set-popup-rule! "^ \\*undo-tree\\*" :slot 2 :side 'right :size 30 :select t :quit nil)
#+end_src
** VTerm
#+call: confpkg("Pkg: vterm")
@ -2717,9 +2727,10 @@ I use the standard Unix-style password management system, [[https://www.password
(after! pass
(setq pass-show-keybindings nil ; Keybindings take up too much space
pass-suppress-confirmations t ; Quit shouldn't need a confirm step
)
;; Move to right side
(set-popup-rule! "^\\*Password-Store" :side 'right :size 0.25 :quit nil))
))
;; Move to right side
(set-popup-rule! "^\\*Password-Store" :side 'right :size 0.25 :quit nil)
#+end_src
*** Tweaks
@ -2947,10 +2958,15 @@ It's sometimes nice to be able to click a link in an Org file that takes me to o
#+begin_src emacs-lisp
(after! org
(setq org-pretty-entities t)
(pushnew! org-entities-user
'("top" "\\top" t "⊤" "" "22A4" "")
'("bot" "\\bot" t "⊥" "" "22A5" "⊥")))
(setq org-pretty-entities t
org-entities-user
'(("top" "\\top" t "⊤" "" "22A4" "")
("bot" "\\bot" t "⊥" "" "22A5" "⊥")
("bbN" "\\mathbb{N}" t "" "" "2115" "")
("bbZ" "\\mathbb{Z}" t "" "" "2124" "")
("bbQ" "\\mathbb{Q}" t "" "" "211A" "")
("bbR" "\\mathbb{R}" t "" "" "211D" "")
("qed" "\\square" t "" "" "25A0" "■"))))
#+end_src
*** Modern
@ -4031,7 +4047,18 @@ The variable ~+workspaces-switch-project-function~ contains a function that is r
(setq +workspaces-switch-project-function #'dirvish))
#+end_src
*** Appearance
*** Bindings
The Doom module's bindings for Evil users are currently a bit unpolished, so let's fix them up here.
#+begin_src emacs-lisp
(map! :mode dirvish-mode
:after dirvish
:m "C-o" #'dirvish-history-go-backward
:m "C-i" #'dirvish-history-go-forward)
#+end_src
*** Layout
#+begin_src emacs-lisp
(after! dirvish
@ -4039,10 +4066,43 @@ The variable ~+workspaces-switch-project-function~ contains a function that is r
(setq dirvish-default-layout '(1 0.15 0.45))
;; Show nested directories
(pushnew! dirvish-attributes 'collapse)
(pushnew! dirvish-attributes 'collapse))
#+end_src
;; Set dirvish line highlight to something less blinding
*** Faces
The faces that ~dirvish~ uses to indicate git changes are showing up as gray by default, and the face that it uses to highlight the current line is a bit bright.
To fix the line highlight we can just configure the relevant face (~dirvish-hl-line~), but the faces used by =dirvish-vc= actually inherit from faces for a built-in emacs library =vc=, so it makes more sense to customize those instead.
#+begin_src emacs-lisp
(after! dirvish
(set-face-attribute 'dirvish-hl-line nil :inherit 'hl-line))
(after! vc
(set-face-attribute 'vc-edited-state nil
:foreground (doom-color 'orange))
(set-face-attribute 'vc-locally-added-state nil
:foreground (doom-color 'green))
(set-face-attribute 'vc-conflict-state nil
:foreground (doom-color 'red))
(set-face-attribute 'vc-needs-update-state nil
:foreground (doom-color 'red))
(set-face-attribute 'vc-missing-state nil
:foreground (doom-color 'comments)))
(after! dirvish-vc
(set-face-attribute 'dirvish-vc-unregistered-face nil
:foreground (doom-color 'grey)))
#+end_src
*** =dirvish-fd=
#+begin_src emacs-lisp
(after! dirvish-fd
(setq dirvish-fd-program
(if-let ((path (nix-build-out-path-gcroot "fd" "nixpkgs#fd")))
(concat path "/bin/fd")
(error "Building fd for dirvish-fd failed"))))
#+end_src
*** Sidebar Project Tree
@ -4053,8 +4113,8 @@ I used to use =treemacs= as my dedicated project tree, but ~dirvish~ is much mor
(defun ~/dirvish-side-open (&optional path)
"Select the Dirvish side session, creating one if it does not exist.
If called with \\[universal-arguments], prompt for PATH, otherwise
it defaults to `project-current'."
If called with \\[universal-argument], prompt for PATH, otherwise
it defaults to `project-current'."
(interactive (list (and current-prefix-arg
(read-directory-name "Open sidetree: "))))
(require 'dirvish-side)
@ -4092,8 +4152,7 @@ If a side session is open, we'll configure =winum= to record it as having the in
Operators being in italics looks ugly, so let's fix that.
#+begin_src emacs-lisp
(after! haskell-mode
(custom-set-faces! '(haskell-operator-face :slant normal)))
(custom-set-faces! '(haskell-operator-face :slant normal))
#+end_src
** Idris
@ -4167,8 +4226,7 @@ The Doom module is very outdated, so I'll be overriding it.
Operators being in italics looks ugly in this mode too, but due to Idris's more complicated syntax highlighting system we have to do a bit more work than for Haskell. There's also the issue of the semantic highlighting faces, which don't match our theme colors.
#+begin_src emacs-lisp
(after! idris-mode
(custom-set-faces!
(custom-set-faces!
'((idris-operator-face idris-colon-face idris-equals-face) :slant normal)
;; Semantic highlighting
@ -4176,7 +4234,7 @@ Operators being in italics looks ugly in this mode too, but due to Idris's more
`(idris-semantic-data-face :foreground ,(doom-color 'red))
`(idris-semantic-bound-face :foreground ,(doom-color 'magenta) :slant italic)
`(idris-semantic-function-face :foreground ,(doom-color 'dark-green))
`(idris-semantic-postulate-face :foreground ,(doom-color 'yellow))))
`(idris-semantic-postulate-face :foreground ,(doom-color 'yellow)))
#+end_src
** Indentation
@ -4199,6 +4257,7 @@ The =lsp-java= package provides LSP support using the standard Java language ser
#+begin_src emacs-lisp
(defun +lsp-java-server-store-path ()
"Return the Nix store derivation path to the Java language server."
(require 'lsp-java)
(string-remove-suffix
(concat "/bin/" lsp-java-jdt-ls-command)
(or
@ -4230,6 +4289,14 @@ Since I've started using [[https://github.com/elkowar/eww/tree/master?tab=readme
(package! yuck-mode)
#+end_src
** Slint
#+call: confpkg("Mode: Slint")
#+begin_src emacs-lisp :tangle packages.el
(package! slint-mode)
#+end_src
* Scratch :noexport:
#+call: confpkg()