Tidy up prose on evil and headers

This commit is contained in:
Howard Abrams 2024-07-16 08:27:36 -07:00
parent 7fdda6fdab
commit 2d41285097
4 changed files with 16 additions and 11 deletions

View file

@ -109,7 +109,7 @@ This package is /called outside of Emacs/, so I bound a keybinding to iCanHazSho
When you type ~C-c C-c~ to close a window, it /doesnt always/ paste back into the original window, but the text is saved to the clipboard, a quick paste works. And now, I dont scream when I need to use those Electron apps, like Slack and Discord. When you type ~C-c C-c~ to close a window, it /doesnt always/ paste back into the original window, but the text is saved to the clipboard, a quick paste works. And now, I dont scream when I need to use those Electron apps, like Slack and Discord.
** Indexed Menu Navigation ** Indexed Menu Navigation (imenu)
Ive often called =imenu= to easily jump to a function definition in a file (or header in an org file), but after reading [[http://yummymelon.com/devnull/til-imenu.html][this essay]] by Charles Choi, I decided to increase =imenu='s utility. Ive often called =imenu= to easily jump to a function definition in a file (or header in an org file), but after reading [[http://yummymelon.com/devnull/til-imenu.html][this essay]] by Charles Choi, I decided to increase =imenu='s utility.

View file

@ -27,9 +27,10 @@ A literate programming file for configuring Evil mode in Emacs.
* Introduction * Introduction
As a grizzled veteran of the Emacs-VI Wars, Ive decided to take advantage of both by using VI keybindings on top of Emacs. However, after thirty years of Emacs, my interface follows different goals: As a grizzled veteran of the Emacs-VI Wars, Ive decided to take advantage of both by using VI keybindings on top of Emacs. However, after thirty years of Emacs, my interface follows different goals:
- Most buffers begin in Evils /normal state/, e.g. normal mode for VIers. - Most buffers begin in Evils /normal state/, e.g. normal mode for VIers.
- Pressing ~i~ or ~a~ jumps into a state of total Emacs, with the exception of ~Escape~ going back to Evil. This means, that while typing ~C-p~ goes up a line, and doesnt auto-complete. - Pressing ~i~ or ~a~ jumps into a state of total Emacs, with the exception of ~Escape~ going back to Evil. This means, that typing ~C-p~ goes up a line, and doesnt auto-complete.
- I dont use ~:~ and instead use ~M-x~ or better yet, ~SPC SPC~ (typing the space key twice). - I dont use ~:~ and instead use ~M-x~ or better yet, ~SPC SPC~ (typing the space key twice) from [[file:ha-general.org][General project]].
- The ~Space~ doesnt advance a letter, but instead displays a tree of highly-customized functions, displayable at the bottom of my screen, e.g. - The ~Space~ doesnt advance a letter, but instead displays a tree of highly-customized functions, displayable at the bottom of my screen, e.g.
[[file:screenshots/ha-leader.png]] [[file:screenshots/ha-leader.png]]
@ -38,6 +39,8 @@ Some advice that I followed:
- [[https://github.com/noctuid/evil-guide][Evil Guide]] - [[https://github.com/noctuid/evil-guide][Evil Guide]]
- [[https://nathantypanski.com/blog/2014-08-03-a-vim-like-emacs-config.html][A Vim-like Emacs Configuration from Nathan Typanski]] - [[https://nathantypanski.com/blog/2014-08-03-a-vim-like-emacs-config.html][A Vim-like Emacs Configuration from Nathan Typanski]]
- [[https://stackoverflow.com/questions/25542097/emacs-evil-mode-how-to-change-insert-state-to-emacs-state-automatically][Evil insert state is really Emacs?]] Real answer to that is to set [[help:evil-disable-insert-state-bindings][evil-disable-insert-state-bindings]] - [[https://stackoverflow.com/questions/25542097/emacs-evil-mode-how-to-change-insert-state-to-emacs-state-automatically][Evil insert state is really Emacs?]] Real answer to that is to set [[help:evil-disable-insert-state-bindings][evil-disable-insert-state-bindings]]
TODO: Rebind the ~z~ keys
* Evil-Specific Keybindings * Evil-Specific Keybindings
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
@ -109,7 +112,7 @@ Im not a long term VI user, and I generally like /easy keys/, e.g. ~w~, have
;; Note that evil-backward-word-end is on the `g e': ;; Note that evil-backward-word-end is on the `g e':
#+end_src #+end_src
Testing: In other words, with the above settings in place, ~w~ and ~e~ should jump from front to back of the entire line, but ~W~ and ~E~ should stop as /subword/:
- =word-subword-subword= - =word-subword-subword=
- =word_subword_subword= - =word_subword_subword=
@ -136,7 +139,7 @@ Keybindings I would like to use more:
- ~xa`~ :: a back quoted string - ~xa`~ :: a back quoted string
- ~xi`~ :: inner back quoted string - ~xi`~ :: inner back quoted string
*Note:* The ~x~ in the above examples are /operations/, e.g. ~d~ for /delete,/ ~v~ for /select,/ ~y~ for /copy/ and ~c~ for /change/. *NOTE:* The ~x~ in the above examples are /operations/, e.g. ~d~ for /delete,/ ~v~ for /select,/ ~y~ for /copy/ and ~c~ for /change/.
What text objects are known? What text objects are known?
- ~w~ :: word - ~w~ :: word
@ -154,6 +157,8 @@ What text objects are known?
- ~u~ :: for URLs, really? Useful much? - ~u~ :: for URLs, really? Useful much?
- ~a~ :: function arguments (probably a lot like symbol, ~o~), but the ~a~ can include commas. This comes from [[https://github.com/wcsmith/evil-args][evil-args]] extension (see below). - ~a~ :: function arguments (probably a lot like symbol, ~o~), but the ~a~ can include commas. This comes from [[https://github.com/wcsmith/evil-args][evil-args]] extension (see below).
TODO: Search for a plugin, like [[https://github.com/coderifous/textobj-word-column.vim][textobj-word-column]] for text objects based on “columns”.
I am not a long term VI user, and dont have much need for any of its control sequences (well, not all), so I made the following more Emacsy. Ill admit, I like ~C-v~ (and use that all the time), so I need to futz around with the scrolling: I am not a long term VI user, and dont have much need for any of its control sequences (well, not all), so I made the following more Emacsy. Ill admit, I like ~C-v~ (and use that all the time), so I need to futz around with the scrolling:
#+begin_src emacs-lisp #+begin_src emacs-lisp

View file

@ -302,7 +302,7 @@ The idea of stealing some of Clojure Modes refactoring is brilliant (see [[ht
", r <" '("to thread first" . clojure-first-last-all))) ", r <" '("to thread first" . clojure-first-last-all)))
#+end_src #+end_src
* Evaluation * Evaluation
** Eval Current Expression ** Eval Current Expression with eros
The [[https://github.com/xiongtx/eros][eros]] package stands for Evaluation Result OverlayS for Emacs Lisp, and basically shows what each s-expression is near the cursor position instead of in the mini-buffer at the bottom of the window. The [[https://github.com/xiongtx/eros][eros]] package stands for Evaluation Result OverlayS for Emacs Lisp, and basically shows what each s-expression is near the cursor position instead of in the mini-buffer at the bottom of the window.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eros (use-package eros