Remove the use of the :general

But to use the (ha-leader), we need to add an :after general
This commit is contained in:
Howard Abrams 2025-09-10 10:52:35 -07:00
parent 65d21999b1
commit a633b22275
5 changed files with 31 additions and 29 deletions

View file

@ -33,6 +33,7 @@ Can not live without [[https://magit.vc/][Magit]], a Git porcelain for Emacs. I
:ensure t) :ensure t)
(use-package magit (use-package magit
:after general
;; 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")
@ -105,6 +106,7 @@ Turning on the mode, as well as binding some new /leader/ keys:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package diff-hl (use-package diff-hl
:after general
:config :config
(global-diff-hl-mode) (global-diff-hl-mode)

View file

@ -350,14 +350,12 @@ I often use the Emacs commands, ~M-t~ and whatnot to exchange words and whatnot,
(setq evil-exchange-key (kbd "gx") (setq evil-exchange-key (kbd "gx")
evil-exchange-cancel-key (kbd "gX")) evil-exchange-cancel-key (kbd "gX"))
:general (:states 'normal :config
"g x" '("exchange" . 'evil-exchange) (define-key evil-normal-state-map (kbd "g x") '("exchange" . evil-exchange))
"g X" '("cancel exchange" . 'evil-exchange-cancel) (define-key evil-normal-state-map (kbd "g X") '("cancel exchange" . evil-exchange-cancel))
(define-key evil-normal-state-map (kbd "z w") '("transpose words" . transpose-words))
;; What about a "normal mode" binding to regular emacs transpose? (define-key evil-normal-state-map (kbd "z x") '("transpose sexps" . transpose-sexps))
"z w" '("transpose words" . transpose-words) (define-key evil-normal-state-map (kbd "z k") '("transpose lines" . transpose-lines))
"z x" '("transpose sexps" . transpose-sexps)
"z k" '("transpose lines" . transpose-lines))
:config (evil-exchange-install)) :config (evil-exchange-install))
#+end_src #+end_src
@ -384,28 +382,29 @@ 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 :after evil
:general :config
(:states '(normal visual) (define-key evil-normal-state-map (kbd "g a") '("lion ←" . evil-lion-left))
"g a" '("lion ←" . evil-lion-left) (define-key evil-normal-state-map (kbd "g A") '("lion →" . evil-lion-right)))
"g A" '("lion →" . evil-lion-right)))
#+end_src #+end_src
Lion sounds like /align/ … get it? Lion sounds like /align/ … get it?
Where I like to align, is on variable assignments, e.g. Where I like to align, is on variable assignments, for instance, converting the code on the left with the code on the right:
#+begin_src emacs-lisp :tangle no #+begin_example
(let ((foobar "Something something") (let ((foobar "Something") (let ((foobar "Something")
(a 42) ⫾ (a 42) ⇒ (a 42)
(very-long-var "odd string")) (very-long-var "odd string")) (very-long-var "odd string")
;; ;; ...
) )
#+end_src #+end_example
When the point is /inside/ the variable assignment section, but not inside any particular assignment (see the ⫾ character), typing ~g a i x~ triggers =align= /inside an s-expression/. If you press ~RETURN~ for the /character/ to align, =evil-lion= package 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
:config :config
(add-to-list 'align-rules-list (add-to-list 'align-rules-list
`("lisp-assignments" `(lisp-assignments
(regexp . ,(rx (group (one-or-more space)) (regexp . ,(rx (group (one-or-more space))
(or (or
(seq "\"" (zero-or-more any) "\"") (seq "\"" (zero-or-more any) "\"")
@ -419,13 +418,10 @@ 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
:config (evil-commentary-mode) :after evil
:config (evil-commentary-mode))
:general
(:states '(normal visual motion operator)
"g c" '("comments" . evil-commentary)
"g y" '("yank comment" . evil-commentary-yank)))
#+end_src #+end_src
** Evil Collection ** Evil Collection
Dropping into Emacs state is better than pure Evil state for applications, however, [[https://github.com/emacs-evil/evil-collection][the evil-collection package]] creates a hybrid between the two, that I like. Dropping into Emacs state is better than pure Evil state for applications, however, [[https://github.com/emacs-evil/evil-collection][the evil-collection package]] creates a hybrid between the two, that I like.

View file

@ -56,6 +56,7 @@ Cant remember all the shortcuts on the ~g~ key, and =which-key= displays the
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(use-package evil (use-package evil
:after general
:general :general
(:states '(normal visual motion operator) (:states '(normal visual motion operator)
;; These go into operator mode, so the key sequence, g U i o ;; These go into operator mode, so the key sequence, g U i o
@ -118,6 +119,7 @@ Cant remember all the shortcuts on the ~g~ key, and =which-key= displays the
While we are at it, lets readd, and relabel the ~z~ command functions: While we are at it, lets readd, and relabel the ~z~ command functions:
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(use-package evil (use-package evil
:after general
:general :general
(:states '(normal visual motion operator) (:states '(normal visual motion operator)
"z q" '("fill para" . fill-paragraph) "z q" '("fill para" . fill-paragraph)
@ -881,6 +883,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
:after general
:general :general
(:states 'normal :keymaps 'Info-mode-map (:states 'normal :keymaps 'Info-mode-map
"B" 'Info-bookmark-jump "B" 'Info-bookmark-jump

View file

@ -110,7 +110,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
:ensure (:type git :host github :repo "awth13/org-appear") :ensure (: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 ()

View file

@ -3,7 +3,7 @@
#+date: 2020-09-18 #+date: 2020-09-18
#+tags: emacs org #+tags: emacs org
#+startup: inlineimages #+startup: inlineimages
#+lastmod: [2025-09-09 Tue] #+lastmod: [2025-09-10 Wed]
A literate programming file for configuring org-mode and those files. A literate programming file for configuring org-mode and those files.
@ -32,6 +32,7 @@ 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
:ensure t :ensure t
:after general
;; TODO: Using the latest org-mode ;; TODO: Using the latest org-mode
;; ;; :straight (:type built-in) ;; ;; :straight (:type built-in)
:mode (("\\.org" . org-mode)) :mode (("\\.org" . org-mode))