diff --git a/home.org b/home.org index 94b8e6b..d29d2a1 100644 --- a/home.org +++ b/home.org @@ -1,4 +1,5 @@ #+PROPERTY: header-args :mkdirp yes +#+PROPERTY: header-args:elisp :lexical t * Overall Structure @@ -133,6 +134,7 @@ are still Shibumi-specific; ideally I'd find another way to install them. iosevka kube kubectl + mariadb.client nerd-fonts.jetbrains-mono openssh tokei @@ -602,7 +604,7 @@ emacs. <> ]; emacs.extraConfig = '' - <> + ;;; -*- lexical-binding: t -*- <> ''; #+END_SRC @@ -650,6 +652,10 @@ Turn off some default settings that I don't find useful. (setq make-backup-files nil) (setq split-window-threshold 200) (setq split-height-threshold 200) + (setopt display-buffer-base-action + '((display-buffer-reuse-window display-buffer-same-window + display-buffer-in-previous-window + display-buffer-use-some-window))) (setq view-read-only t) #+END_SRC @@ -763,6 +769,8 @@ Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blo (add-hook 'mhtml-mode 'no-mixed-pitch) #+END_SRC +A basic ace-window setup. Allows switching between windows quickly (although avy can do the same...). + #+BEGIN_SRC elisp :noweb-ref emacs_config (use-package ace-window :bind (("M-o" . ace-window) @@ -772,7 +780,7 @@ Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blo (setq aw-dispatch-always t)) #+END_SRC - Set up a few project- / workspace-related key bindings. +Set up a few project- / workspace-related key bindings. #+name: workspace_keybinds #+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config @@ -801,6 +809,14 @@ I'm trying this out. This disables visual selections. It's bold, which is why I (transient-mark-mode -1) #+END_SRC +I use tabs to manage multiple "workspaces". I don't tie a project to a tab or anything; often fixing +a single bug might involve pulling in files from multiple projects. Rather, I open a file per bug / +fix / issue, and leave it open until I'm done with that issue. + +~tab-bar-history-mode~ allows quickly rolling back window changes; it can be used to undo a context +change when drilling into a help page or something. I've set up repeat mode to make it easier to +move backward / forward through history. + #+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config (use-package tab-bar :config @@ -819,6 +835,7 @@ This configuration affects general text editing, across all modes. First, some p avy devil edit-indirect + embark god-mode string-inflection #+END_SRC @@ -867,6 +884,10 @@ its own devil-mode-only repeat maps that don't interfere when using normal modif (which-key-enable-god-mode-support)) #+END_SRC +Avy allows jumping to any place on the screen with just a few keystrokes. I've stolen most of these +ideas from Karthinks' article [[https://karthinks.com/software/avy-can-do-anything/][Avy can do Anything]]. I need to find more uses for this, in line with +his article. + #+BEGIN_SRC elisp :noweb-ref emacs_config (use-package avy :bind ("M-j" . avy-goto-char-timer)) @@ -888,10 +909,22 @@ its own devil-mode-only repeat maps that don't interfere when using normal modif (bind-keys ("M-J" . avy-goto-char-timer-embark)) + (use-package embark + :bind + (("C-." . embark-act) ;; pick some comfortable binding + )) + +#+END_SRC + +Just "silently" wrap when searching at the bottom of a document. + +#+BEGIN_SRC elisp :noweb-ref emacs_config (use-package isearch :custom (isearch-wrap-pause 'no-ding)) +#+END_SRC +#+BEGIN_SRC elisp :noweb-ref emacs_config (use-package string-inflection :commands string-inflection-java-style-cycle @@ -1138,34 +1171,52 @@ available? It seems to work for now anyway... 'eglot-list-connections-mode-hook)) (add-hook hook 'tab-line-mode)) - (let ((bottom-window-params '((side . bottom) - (slot . 1) - (window-height . 0.33) - (window-parameters (no-delete-other-windows . t)))) - (right-window-params '((side . right) - (window-width . 0.5) - (window-parameters (no-delete-other-windows . t))))) - (setopt display-buffer-alist - (append - (mapcar (lambda (buffer) `(,buffer - (display-buffer-reuse-window display-buffer-in-side-window) - ,@bottom-window-params)) - (list - "\\*Flymake diagnostics *" - "\\*Embark Export *" - "\\*Embark Collect *" - "\\*xref*" - "\\*compilation\\*" - "\\*sly-mrepl *" - "\\*Messages\\*" - "\\*EGLOT connections\\*")) - (mapcar (lambda (buffer) `(,buffer - (display-buffer-reuse-window display-buffer-in-side-window) - ,@right-window-params)) - (list - "magit: *" - "magit-revision: *" - "\\*eldoc\\*"))))) + (cl-flet ((defbottom (&optional (slot 1)) + (lambda (rule) + `(,rule + (display-buffer-reuse-window display-buffer-in-side-window) + (side . bottom) + (slot . ,slot) + (window-height . 0.33) + (window-parameters (no-delete-other-windows . t))))) + (defright (&optional (slot 0)) + (lambda (rule) + `(,rule + (display-buffer-reuse-window display-buffer-in-side-window) + (side . right) + (slot . ,slot) + (window-width . 0.5) + (window-parameters (no-delete-other-windows . t))))) + (defall (def &rest rules) + (mapcar (lambda (rule) (funcall def rule)) rules))) + (let* ((bottom-window-params '((side . bottom) + (slot . 1) + (window-height . 0.33) + (window-parameters (no-delete-other-windows . t)))) + (right-window-params '((side . right) + (window-width . 0.5) + (window-parameters (no-delete-other-windows . t)))) + (right-window-slot-1-params (cons '(slot . 1) right-window-params))) + (setopt display-buffer-alist + (append + (defall (defbottom) + "\\*Flymake diagnostics *" + "\\*Embark Export *" + "\\*Embark Collect *" + "\\*xref*" + "\\*compilation\\*" + "\\*sly-mrepl *" + "\\*Messages\\*" + "\\*lispy-message\\*" + "\\*EGLOT connections\\*" + "\\*trace-output\\*") + (defall (defright) + "magit: *" + "magit-revision: *" + "\\*eldoc\\*" + "\\*Help\\*") + (defall (defright -1) + "\\*Embark Actions\\*"))))) (setq ediff-split-window-function 'split-window-horizontally) #+END_SRC @@ -1200,6 +1251,7 @@ available? It seems to work for now anyway... ("C-c M-g" . magit-file-dispatch)) :custom (magit-save-repository-buffers 'dontask) + (magit-commit-show-diff nil) :config (set-face-attribute 'git-commit-summary nil :inherit nil) (defun magit-fetch-all-on-load () @@ -1223,7 +1275,6 @@ available? It seems to work for now anyway... cape consult corfu - embark embark-consult marginalia orderless @@ -1315,11 +1366,6 @@ available? It seems to work for now anyway... :config (marginalia-mode)) - (use-package embark - :bind - (("C-." . embark-act) ;; pick some comfortable binding - )) - (use-package corfu :custom (corfu-cycle t)