Revert "perform exorcism on evil"

This reverts commit ce3cd3fb7e.
This commit is contained in:
Peter Tillemans 2024-12-03 13:14:31 +01:00
parent dd0b684dc5
commit 35fd6ce31a
2 changed files with 361 additions and 70 deletions

View file

@ -51,9 +51,9 @@
(elpaca elpaca-use-package (elpaca elpaca-use-package
(elpaca-use-package-mode)) (elpaca-use-package-mode))
;; tangling to generate scripts for the local bin directory. This ;; tangling to generate scripts for the local bin directory. This
;; causes the name of the scripts to be returned in the car of the ;; causes the name of the scripts to be returned in the car of the
;; tangle command which is used to load the file. The net result is ;; tangle command which is used to load the file. The net result is
;; that not the initialization is loaded, but the first exported ;; that not the initialization is loaded, but the first exported
;; script. ;; script.
(use-package ob-tangle) (use-package ob-tangle)

427
init.org
View file

@ -12,7 +12,7 @@
- Refactor existing configuration - Refactor existing configuration
** Notes on Elpaca and dev versions of emacs. ** Notes on Elpaca and dev versions of emacs.
Elpaca needs the build date of emacs to compare to package versions or Elpaca needs the build date of emacs to compare to package versions or
something. However it does not support all dev versions. something. However it does not support all dev versions.
For guix emacs-next packages you can find the date with: ( <C-c C-c> For guix emacs-next packages you can find the date with: ( <C-c C-c>
in the source block below: in the source block below:
@ -96,15 +96,15 @@ one to use.
#+END_SRC #+END_SRC
Tangle the init file if it has been updated. I maintain the same Tangle the init file if it has been updated. I maintain the same
configuration on multiple machines and fetch changes with a ~git pull~ configuration on multiple machines and fetch changes with a ~git pull~
outside emacs so there is on opportunity to tangle the new file. If outside emacs so there is on opportunity to tangle the new file. If
I see it is outdated I tangle it. I see it is outdated I tangle it.
#+BEGIN_SRC emacs-lisp :tangle "early-init.el" #+BEGIN_SRC emacs-lisp :tangle "early-init.el"
;; tangling to generate scripts for the local bin directory. This ;; tangling to generate scripts for the local bin directory. This
;; causes the name of the scripts to be returned in the car of the ;; causes the name of the scripts to be returned in the car of the
;; tangle command which is used to load the file. The net result is ;; tangle command which is used to load the file. The net result is
;; that not the initialization is loaded, but the first exported ;; that not the initialization is loaded, but the first exported
;; script. ;; script.
(use-package ob-tangle) (use-package ob-tangle)
@ -141,7 +141,7 @@ Also immediately set lexical binding mode.
** Set the garbage collector threshold, to avoid collections ** Set the garbage collector threshold, to avoid collections
The emacs history goes back to times where memory was counted in The emacs history goes back to times where memory was counted in
bytes, not gigabytes. We can afford to be a bit more generous with the bytes, not gigabytes. We can afford to be a bit more generous with the
garbage collector settings. garbage collector settings.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -175,7 +175,7 @@ on the time since start.
*** Save customizations in a separate file *** Save customizations in a separate file
By default customization settings are saved at the end of the *init.el* By default customization settings are saved at the end of the *init.el*
file. This wreaks havoc with managing the files in git and will not file. This wreaks havoc with managing the files in git and will not
work with the tangled version anyway as it will be removed/overwritten work with the tangled version anyway as it will be removed/overwritten
each time the file is regenerated. each time the file is regenerated.
Here we set the location of the file to save the customizations and Here we set the location of the file to save the customizations and
@ -189,26 +189,38 @@ then load it.
(load custom-file nil :nomessage)) (load custom-file nil :nomessage))
#+END_SRC #+END_SRC
*** Enable Undo Tree *** Load the General
undo-tree is my preferred way of undoing and redoing stuff. The main reason is it doesnt create a linear undo/redo history, but rather a complete tree you can navigate to see your complete editing history. One of the two obvious things to do are to tell Emacs to save all its undo history fies in a dedicated directory, otherwise wed risk littering all of our directories. The second thing is to simply globally enable its mode.
Needs to load early so the ~:general~ keyword is available for ~use-package~.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package undo-tree (use-package general :ensure t :demand t)
:defer t
:ensure t
:custom #+END_SRC
(undo-tree-history-directory-alist
`(("." . ,(expand-file-name (file-name-as-directory "undo-tree-hist") #+RESULTS:
user-emacs-directory))))
:init *** Enable Undo Tree
(global-undo-tree-mode) undo-tree is my preferred way of undoing and redoing stuff. The main reason is it doesnt create a linear undo/redo history, but rather a complete tree you can navigate to see your complete editing history. One of the two obvious things to do are to tell Emacs to save all its undo history fies in a dedicated directory, otherwise wed risk littering all of our directories. The second thing is to simply globally enable its mode.
:config
(setq undo-tree-visualizer-diff t #+BEGIN_SRC emacs-lisp
undo-tree-auto-save-history t (use-package undo-tree
undo-tree-enable-undo-in-region t :defer t
undo-limit (* 800 1024) :straight (:build t)
undo-strong-limit (* 12 1024 1024) :custom
undo-outer-limit (* 128 1024 1024))) (undo-tree-history-directory-alist
`(("." . ,(expand-file-name (file-name-as-directory "undo-tree-hist")
user-emacs-directory))))
:init
(global-undo-tree-mode)
:config
(setq undo-tree-visualizer-diff t
undo-tree-auto-save-history t
undo-tree-enable-undo-in-region t
undo-limit (* 800 1024)
undo-strong-limit (* 12 1024 1024)
undo-outer-limit (* 128 1024 1024)))
#+END_SRC #+END_SRC
@ -246,9 +258,9 @@ undo-tree is my preferred way of undoing and redoing stuff. The main reason is
** Get latest version of a github released project ** Get latest version of a github released project
Many projects nowadays use github to release their software. However Many projects nowadays use github to release their software. However
there is no easy way to get the latest version of a project there is no easy way to get the latest version of a project
provided. This functions uses the releases API to get the latest provided. This functions uses the releases API to get the latest
metadata and get the version number from the JSON. metadata and get the version number from the JSON.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -299,30 +311,30 @@ Heres a breakdown of what each line does:
1. *(set-default-coding-systems 'utf-8)* 1. *(set-default-coding-systems 'utf-8)*
This line sets the default coding system for new buffers. When you This line sets the default coding system for new buffers. When you
create a new buffer or open a file, Emacs will use UTF-8 encoding create a new buffer or open a file, Emacs will use UTF-8 encoding
by default. It will also set the default terminal and keyboard by default. It will also set the default terminal and keyboard
coding systems. This applies to all internal operations where a coding systems. This applies to all internal operations where a
specific coding system has not been specified. specific coding system has not been specified.
2. *(set-language-environment 'utf-8)* 2. *(set-language-environment 'utf-8)*
This sets the language environment to UTF-8. Emacs uses the This sets the language environment to UTF-8. Emacs uses the
language environment to guess the preferred coding systems for language environment to guess the preferred coding systems for
reading and writing files and for other operations. Setting this to reading and writing files and for other operations. Setting this to
UTF-8 ensures that UTF-8 is preferred in all language-related UTF-8 ensures that UTF-8 is preferred in all language-related
contexts. contexts.
3. *(setq locale-coding-system 'utf-8)* 3. *(setq locale-coding-system 'utf-8)*
This sets the coding system for locale data, such as environment This sets the coding system for locale data, such as environment
variables and system messages. It ensures that Emacs correctly variables and system messages. It ensures that Emacs correctly
interprets UTF-8 encoded data coming from the operating system. interprets UTF-8 encoded data coming from the operating system.
4. *(prefer-coding-system 'utf-8)* 4. *(prefer-coding-system 'utf-8)*
This makes UTF-8 the preferred coding system for any situation This makes UTF-8 the preferred coding system for any situation
where Emacs needs to choose an encoding. It ensures that Emacs where Emacs needs to choose an encoding. It ensures that Emacs
prefers UTF-8 over other encodings. prefers UTF-8 over other encodings.
5. *(setq x-select-request-type ...)* 5. *(setq x-select-request-type ...)*
@ -366,7 +378,7 @@ command line and, of course, in *Emacs*.
#+END_SRC #+END_SRC
This enables *pass* secrets to be used for all subsystems supporting This enables *pass* secrets to be used for all subsystems supporting
*auth-source* (which are probably all of them nowadays). It does require *auth-source* (which are probably all of them nowadays). It does require
some finagling to map the parts on the name in the pass system. some finagling to map the parts on the name in the pass system.
- [[https://www.passwordstore.org/][Pass Website]] - [[https://www.passwordstore.org/][Pass Website]]
@ -375,7 +387,7 @@ some finagling to map the parts on the name in the pass system.
*** Use of Pass Secrets in ELisp *** Use of Pass Secrets in ELisp
It is very convenient to get secrets from this store (once gpg is set It is very convenient to get secrets from this store (once gpg is set
up, which a totally different can of worms). A function up, which a totally different can of worms). A function
`auth-source-pass-get` is provided : `auth-source-pass-get` is provided :
#+BEGIN_SRC emacs-lisp :tangle no #+BEGIN_SRC emacs-lisp :tangle no
@ -388,7 +400,7 @@ up, which a totally different can of worms). A function
** GUIX support ** GUIX support
[[https://gitlab.com/emacs-guix/emacs-guix][Emacs-guix]] is a module to interact with the guix system and help [[https://gitlab.com/emacs-guix/emacs-guix][Emacs-guix]] is a module to interact with the guix system and help
manage packages and profiles. It also offers support for creating manage packages and profiles. It also offers support for creating
additional profiles and packages for Guix. additional profiles and packages for Guix.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -439,6 +451,19 @@ It provides a minor-mode
: [nil 26383 36877 803383 nil elpaca-process-queues nil nil 768000 nil] : [nil 26383 36877 803383 nil elpaca-process-queues nil nil 768000 nil]
** Collect visible URLs to open in browser
#+BEGIN_SRC emacs-lisp
(use-package fancy-ffap-menu
:ensure (:host "codeberg.org" :repo "kakafarm/emacs-fancy-ffap-menu"
:main "fancy-ffap-menu.el")
:commands (fancy-ffap-menu-list-urls)
)
#+END_SRC
#+RESULTS:
: [nil 26432 21940 582674 nil elpaca-process-queues nil nil 547000 nil]
* Editor Features * Editor Features
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -456,7 +481,7 @@ It provides a minor-mode
;; Support opening new minibuffers from inside existing minibuffers. ;; Support opening new minibuffers from inside existing minibuffers.
(enable-recursive-minibuffers t) (enable-recursive-minibuffers t)
;; Hide commands in M-x which do not work in the current mode. Vertico ;; Hide commands in M-x which do not work in the current mode. Vertico
;; commands are hidden in normal buffers. This setting is useful beyond ;; commands are hidden in normal buffers. This setting is useful beyond
;; Vertico. ;; Vertico.
(read-extended-command-predicate #'command-completion-default-include-p) (read-extended-command-predicate #'command-completion-default-include-p)
:init :init
@ -480,12 +505,12 @@ It provides a minor-mode
** Enable undo-tree ** Enable undo-tree
see [[https://elpa.gnu.org/packages/undo-tree.html][undo-tree web page]]. There is a lot of background info there to see [[https://elpa.gnu.org/packages/undo-tree.html][undo-tree web page]]. There is a lot of background info there to
explain the problems and solutions. explain the problems and solutions.
Emacs actually maintains undo/redo information is an way that any Emacs actually maintains undo/redo information is an way that any
state can be restored. Both undo and redo is remembered in contrast to state can be restored. Both undo and redo is remembered in contrast to
many apps which essentially reset after doing a redo operation. It is many apps which essentially reset after doing a redo operation. It is
very hard to keep track of the state using the very hard to keep track of the state using the
normal undo/redo machinery to restore a specific state by tracking the normal undo/redo machinery to restore a specific state by tracking the
branching naturranching nature. branching naturranching nature.
@ -526,7 +551,7 @@ In the visualizer you can navigate the undo/redo state with:
** Save history over sessions ** Save history over sessions
Persist history over Emacs restarts. Vertico sorts by history Persist history over Emacs restarts. Vertico sorts by history
position. position.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -539,7 +564,7 @@ position.
** Completion Configuration ** Completion Configuration
*** Use Vertico for better selection lists *** Use Vertico for better selection lists
Vertico is a big package by minad. Well documented in the [[https://github.com/minad/vertico][vertico Vertico is a big package by minad. Well documented in the [[https://github.com/minad/vertico][vertico
github repo]]. github repo]].
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -599,7 +624,7 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
;; Example configuration for Consult ;; Example configuration for Consult
(use-package consult (use-package consult
:ensure t :ensure t
;; Replace bindings. Lazily loaded by `use-package'. ;; Replace bindings. Lazily loaded by `use-package'.
:bind (;; C-c bindings in `mode-specific-map' :bind (;; C-c bindings in `mode-specific-map'
("C-c M-x" . consult-mode-command) ("C-c M-x" . consult-mode-command)
("C-c h" . consult-history) ("C-c h" . consult-history)
@ -653,14 +678,14 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
("M-s" . consult-history) ;; orig. next-matching-history-element ("M-s" . consult-history) ;; orig. next-matching-history-element
("M-r" . consult-history)) ;; orig. previous-matching-history-element ("M-r" . consult-history)) ;; orig. previous-matching-history-element
;; Enable automatic preview at point in the *Completions* buffer. This is ;; Enable automatic preview at point in the *Completions* buffer. This is
;; relevant when you use the default completion UI. ;; relevant when you use the default completion UI.
:hook (completion-list-mode . consult-preview-at-point-mode) :hook (completion-list-mode . consult-preview-at-point-mode)
;; The :init configuration is always executed (Not lazy) ;; The :init configuration is always executed (Not lazy)
:init :init
;; Optionally configure the register formatting. This improves the register ;; Optionally configure the register formatting. This improves the register
;; preview for `consult-register', `consult-register-load', ;; preview for `consult-register', `consult-register-load',
;; `consult-register-store' and the Emacs built-ins. ;; `consult-register-store' and the Emacs built-ins.
(setq register-preview-delay 0.5 (setq register-preview-delay 0.5
@ -678,7 +703,7 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
;; after lazily loading the package. ;; after lazily loading the package.
:config :config
;; Optionally configure preview. The default value ;; Optionally configure preview. The default value
;; is 'any, such that any key triggers the preview. ;; is 'any, such that any key triggers the preview.
;; (setq consult-preview-key 'any) ;; (setq consult-preview-key 'any)
;; (setq consult-preview-key "M-.") ;; (setq consult-preview-key "M-.")
@ -708,6 +733,84 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
: [nil 26434 3705 536018 nil elpaca-process-queues nil nil 266000 nil] : [nil 26434 3705 536018 nil elpaca-process-queues nil nil 266000 nil]
** Evil Vim Keybindings
#+BEGIN_SRC emacs-lisp
;; load evil
(use-package evil
:ensure t ;; install the evil package if not installed
:init ;; tweak evil's configuration before loading it
(setq evil-search-module 'evil-search)
(setq evil-ex-complete-emacs-commands nil)
(setq evil-vsplit-window-right t)
(setq evil-split-window-below t)
(setq evil-shift-round nil)
(setq evil-want-C-u-scroll nil)
:config
(evil-mode)
;; set leader keys
(evil-set-leader nil (kbd "C-SPC"))
(evil-set-leader 'normal (kbd "SPC"))
(evil-set-leader 'normal "," t) ;; set localleader
;; make vc commands available via leader key
(evil-define-key 'normal 'global
(kbd "<leader>v") vc-prefix-map)
(keymap-global-set "C-c v" vc-prefix-map)
;; make project commands available via leader key
(evil-define-key 'normal 'global
(kbd "<leader>p") project-prefix-map)
(keymap-global-set "C-c p" project-prefix-map)
(evil-define-key 'normal 'global
(kbd "<leader>ff") #'find-file
(kbd "<leader>fo") #'recentf
(kbd "<leader>fr") #'revert-buffer
(kbd "<leader>fd") #'diff-buffer-with-file)
(keymap-global-set "C-c f f" #'find-file)
(keymap-global-set "C-c f o" #'recentf)
(keymap-global-set "C-c f r" #'revert-buffer)
(keymap-global-set "C-c f d" #'diff-buffer-with-file)
)
#+END_SRC
** Load Evil Collection for comprehensive evil support
#+BEGIN_SRC emacs-lisp
(use-package evil-collection
:ensure t
:after evil
:init
(evil-collection-init))
#+END_SRC
** Harpoon configuration
#+BEGIN_SRC emacs-lisp :tangle no
(use-package harpoon
:ensure t
:init
(setq pti-harpoon-map (make-sparse-keymap))
(keymap-set pti-harpoon-map (kbd "h") 'harpoon-toggle-quick-menu)
(keymap-set pti-harpoon-map (kbd "a") 'harpoon-add-file)
(keymap-set pti-harpoon-map (kbd "f") 'harpoon-toggle-file)
(keymap-set pti-harpoon-map (kbd "j") 'harpoon-go-to-1)
(keymap-set pti-harpoon-map (kbd "k") 'harpoon-go-to-2)
(keymap-set pti-harpoon-map (kbd "l") 'harpoon-go-to-3)
(keymap-set pti-harpoon-map (kbd ";") 'harpoon-go-to-4)
(keymap-set pti-harpoon-map (kbd "h") 'harpoon-toggle-quick-menu)
:bind
(("<leader>h" . 'pti-harpoon-map)
("C-c h" . 'pti-harpoon-map)))
#+END_SRC
#+RESULTS:
: [nil 26284 54919 318035 nil elpaca-process-queues nil nil 339000 nil]
** User Interface ** User Interface
*** Display startup time *** Display startup time
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -779,7 +882,7 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
*** Update configuration of each created frame *** Update configuration of each created frame
When running as daemon there is no graphical context. This means that When running as daemon there is no graphical context. This means that
all graphical related settings cannot be set properly at initial all graphical related settings cannot be set properly at initial
startup if we need to interrogate the capabilities of the current startup if we need to interrogate the capabilities of the current
screen. screen.
@ -895,9 +998,9 @@ Enables and configures Yasnippet, a template system for Emacs:
#+END_SRC #+END_SRC
** Enable LLM access with Ellama ** Enable LLM access with Ellama
Configures access to language models using Ellama. I don't know Configures access to language models using Ellama. I don't know
whether to put it under writing, comms or programming as it is equally whether to put it under writing, comms or programming as it is equally
/useful(?)/ for either activity. So I promoted it to an Editor feature. /useful(?)/ for either activity. So I promoted it to an Editor feature.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package llm (use-package llm
@ -933,7 +1036,7 @@ whether to put it under writing, comms or programming as it is equally
#+RESULTS: #+RESULTS:
: [nil 26420 49222 463525 nil elpaca-process-queues nil nil 237000 nil] : [nil 26420 49222 463525 nil elpaca-process-queues nil nil 237000 nil]
It seems the *gpt-4o* model provides better responses. I should It seems the *gpt-4o* model provides better responses. I should
investigate local models more. investigate local models more.
** Dired Configuration ** Dired Configuration
@ -1053,7 +1156,7 @@ This enables direnv globally.
** Enable breadcrumbs ** Enable breadcrumbs
Show breadcrumbs in the header line to keep context of the file being Show breadcrumbs in the header line to keep context of the file being
worked on. See the [[https://github.com/joaotavora/breadcrumb][breadcrumb repo]] for more details. worked on. See the [[https://github.com/joaotavora/breadcrumb][breadcrumb repo]] for more details.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package breadcrumb (use-package breadcrumb
@ -1184,7 +1287,7 @@ testing in my [[file:~/org/snamellit/testfile.org::*User Journey Graph][org babe
:defer 3) :defer 3)
#+END_SRC #+END_SRC
Mermaid needs support of the mermaid-cli which is a node package. It Mermaid needs support of the mermaid-cli which is a node package. It
can be installed with can be installed with
#+BEGIN_SRC shell :tangle no #+BEGIN_SRC shell :tangle no
@ -1203,9 +1306,9 @@ npm install -g @mermaid-js/mermaid-cli
Requires nothing special, other than *plantuml.jar* archive installed. Requires nothing special, other than *plantuml.jar* archive installed.
The following code block depends on [[*Get latest version of a github released project][Get latest version of a github The following code block depends on [[*Get latest version of a github released project][Get latest version of a github
released project]] utility function. This block will check if there is a released project]] utility function. This block will check if there is a
plantuml.jar in the emacs config directory and if not download the plantuml.jar in the emacs config directory and if not download the
latest version from github. The `pti-download-latest-plantuml` is made latest version from github. The `pti-download-latest-plantuml` is made
interactive to manually install the latest version if needed. interactive to manually install the latest version if needed.
#+BEGIN_SRC emacs-lisp :lexical t #+BEGIN_SRC emacs-lisp :lexical t
@ -1282,7 +1385,7 @@ interactive to manually install the latest version if needed.
**** TODO Move babel test file to emacs config folder **** TODO Move babel test file to emacs config folder
Alternatively I might add a sample after each configured block to keep Alternatively I might add a sample after each configured block to keep
it in the same context. Hmmm.... sounds even better. it in the same context. Hmmm.... sounds even better.
*** Org Export *** Org Export
@ -1426,7 +1529,7 @@ gicrisf has [[https://github.com/gicrisf/ox-zola][created a package]] to export
#+RESULTS: #+RESULTS:
It is a wrapper around ~ox-hugo~ to export org files to Zola. It It is a wrapper around ~ox-hugo~ to export org files to Zola. It
supports most features of it and directs the user to the [[https://ox-hugo.scripter.co/][the hugo supports most features of it and directs the user to the [[https://ox-hugo.scripter.co/][the hugo
exporter manual.]] exporter manual.]]
@ -1465,6 +1568,125 @@ exporter manual.]]
#+RESULTS: #+RESULTS:
: t : t
*** Evil Support for Org
Better keybinding for evil mode from [[https://github.com/Somelauw/evil-org-mode][the evil-org github repo]].
#+BEGIN_SRC emacs-lisp
(use-package evil-org
:ensure t
:after org
:hook
(org-mode . evil-org-mode)
:config
(require 'evil-org-agenda)
(evil-org-agenda-set-keys))
#+END_SRC
Here is a snapshot of the keybindings dd <2024-07-30 Tue>.
**** Quick overview
|----------------+---------------------------|
| key | explanation |
|----------------+---------------------------|
| gh, gj, gk, gl | navigate between elements |
| vae | select an element |
|----------------+---------------------------|
**** Headings and items
|--------------+------------------------|
| key | explanation |
|--------------+------------------------|
| M-ret | insert heading |
| <tab>, g TAB | fold / unfold headings |
| M-h or << | promote a heading |
| M-l or >> | demote a heading |
| M-k | move subtree up |
| M-j | move subtree down |
| M-S-h or <aR | promote a subtree |
| M-S-l or >aR | demote a subtree |
| vaR | select a subtree |
|--------------+------------------------|
**** Tables
|-----------+--------------------------------|
| key | explanation |
|-----------+--------------------------------|
| ( | previous table cell |
| ) | next table cell |
| { | beginning of table |
| } | end of table |
| M-h / M-l | move table column left / right |
| M-k / M-j | move table column up / down |
| vae | select table cell |
| vaE | select table row |
| var | select whole table |
|-----------+--------------------------------|
**** Agenda
|-------------------------+-------------------------+-----------------------------------------------------------------------------------|
| Evil key | Emacs key | explanation |
|-------------------------+-------------------------+-----------------------------------------------------------------------------------|
| gH | | Move cursor to the top of window |
| gM | | Move cursor to the middle of window |
| gL | | Move cursor to the bottom of window |
| <tab>, S-<return> | <tab> | go to the corresponding entry at point |
| g TAB | <tab> | go to the corresponding entry at point |
| <return> | <return> | go to the Org mode file which contains the item at point |
| M-<return> | L | Display Org file and center around the item |
| <space> | <space> | scroll up |
| <delete> or <backspace> | <delete> or <backspace> | scroll down |
| j, k | n, p | next, previous line |
| gj, gk, C-j, C-k | N, P | next, previous item |
| [, ] | b, f | previous, next week |
| J, K | -, +, S-down, S-up | down, up priority |
| H, L | S-left, S-right | modify date to earlier, later |
| t | t | cycle TODO keywords |
| M-j, M-k | M-down, M-up | drag line forward, backward |
| C-S-h, C-S-l | C-S-left, C-S-right | previous, next keyword |
| u | C-_, C-/ | undo |
| dd | C-k | delete item |
| da | a | ask and archive item |
| dA | $ | archive item |
| ct | : | set tags |
| ce | e | set effort |
| cT | ; | set timer |
| i | i | insert entry in diary |
| a | z | add note |
| A | A | append to agenda |
| C | k | capture |
| m | m | mark |
| * | * | toggle all marks |
| % | % | mark regexp |
| M | U | remove all marks |
| x | B | execute action on marks |
| gr | r | refresh agenda |
| gR | g | refresh all agendas |
| ZQ | x | exit agenda |
| ZZ | Q | quit agenda |
| gD | v | tweak display (deadlines, diary, follow/log-mode, entry text, grid, day/week/year |
| ZD | # | dim blocked tasks |
| sc, sr, se, st, s^ | <, =, _, /, ^ | filter by category, regexp, effort, tag, top headline |
| S | \vert | remove all filters |
| ss | ~ | filter/limit interactively |
| I | I | clock in |
| O | O | clock out |
| cg | J | jump to the currently clocked in task within the agenda |
| cc | X | cancel the current running clock |
| cr | R | toggle clocktable mode in an agenda buffer |
| . | . | go to today's date |
| gc | c | pop up calendar |
| gC | C | pop up date converter |
| p | > | pop up date selector |
| gh | H | pop up holiday calendar |
| gm | M | pop up phases of the moon |
| gs | S | pop up sunrise/sunset times |
| gt | T | pop up tag list |
| +, - | [, ] | manipulate the query by adding a search term with positive or negative selection |
|-------------------------+-------------------------+-----------------------------------------------------------------------------------|
*** Org GCal Support *** Org GCal Support
@ -1559,7 +1781,7 @@ projects:
*** Daviwil's Productivity Tools *** Daviwil's Productivity Tools
@daviwil has a set of productivity tools which are very useful. I have @daviwil has a set of productivity tools which are very useful. I have
**** Find all tasks with a specific tag (or without) **** Find all tasks with a specific tag (or without)
@ -1709,6 +1931,22 @@ We can add a list of queries
;; configure eglot-mode ;; configure eglot-mode
(use-package eglot (use-package eglot
:config :config
(evil-define-key 'normal eglot-mode-map
(kbd "<leader>c a") 'eglot-code-actions
(kbd "<leader>c d") 'eglot-find-declaration
(kbd "<leader>c i") 'eglot-find-implementation
(kbd "<leader>c k") 'eglot-find-typeDefinition
(kbd "<leader>c f") 'eglot-format
(kbd "<leader>c F") 'eglot-format-buffer
(kbd "<leader>c r") 'eglot-rename
(kbd "<leader>c Q") 'eglot-shutdown
(kbd "<leader>c q") 'eglot-reconnect
(kbd "<leader>c n") 'flymake-goto-next-error
(kbd "<leader>c p") 'flymake-goto-prev-error
(kbd "]d") #'flymake-goto-next-error
(kbd "[d") #'flymake-goto-prev-error
)
;; Shutdown server when last managed buffer is killed ;; Shutdown server when last managed buffer is killed
(setq eglot-autoshutdown t) (setq eglot-autoshutdown t)
@ -1730,6 +1968,19 @@ We can add a list of queries
#+END_SRC #+END_SRC
*** Flymake Support
#+BEGIN_SRC emacs-lisp
(defun pti-flymake-evil-keybindings ()
"Map flymake error navigation to easier key sequences."
(evil-define-key 'normal flymake-mode-map
(kbd "]d") #'flymake-goto-next-error
(kbd "[d") #'flymake-goto-prev-error))
(add-hook 'flymake-mode-hook #'pti-flymake-evil-keybindings)
#+END_SRC
*** Use Treesitter parser support *** Use Treesitter parser support
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -1985,12 +2236,36 @@ see also [[https://www.masteringemacs.org/article/how-to-get-started-tree-sitter
lisp-mode-hook lisp-mode-hook
scheme-mode-hook)) scheme-mode-hook))
(add-hook mode #'enable-paredit-mode))) (add-hook mode #'enable-paredit-mode)))
(use-package evil-paredit
:ensure t
:commands (evil-paredit-mode)
:init
(dolist (mode '(emacs-lisp-mode-hook
lisp-interaction-mode-hook
lisp-mode-hook
scheme-mode-hook))
(add-hook mode #'evil-paredit-mode)))
#+END_SRC #+END_SRC
#+RESULTS: #+RESULTS:
***** TODO FIx paredit bug related to obsolete macro
evil-paredit relies on an obsolete (and no longer available method)
`evil-called-interactively-p`. So I define it here till evil-paredit
has implemented the new method.
#+BEGIN_SRC emacs-lisp
(defmacro evil-called-interactively-p ()
"Wrapper for `called-interactively-p'.
In older versions of Emacs, `called-interactively-p' takes
no arguments. In Emacs 23.2 and newer, it takes one argument."
(called-interactively-p 'any))
(make-obsolete 'evil-called-interactively-p
"please use (called-interactively-p 'any) instead."
"Git commit 222b791")
#+END_SRC
**** Rainbow Parentheses **** Rainbow Parentheses
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2129,7 +2404,7 @@ Configure Geiser and Scheme
#+END_SRC #+END_SRC
#+RESULTS: #+RESULTS:
| | geiser-mode | enable-paredit-mode | aggressive-indent-mode | geiser-mode--maybe-activate | | evil-paredit-mode | geiser-mode | enable-paredit-mode | aggressive-indent-mode | geiser-mode--maybe-activate |
**** Enable Cider for Clojure mode **** Enable Cider for Clojure mode
@ -2222,7 +2497,15 @@ This function has to be called in the *sly-inferior-lisp*
:config :config
(setq (setq
terraform-indent-level 2 terraform-indent-level 2
terraform-format-on-save t)) terraform-format-on-save t)
(evil-define-key 'normal terraform-mode-map
(kbd "<leader>c k") #'terraform-open-doc
(kbd "<leader>c f") #'terraform-format
(kbd "<leader>c F") #'terraform-format-buffer
(kbd "<leader>c n") 'flymake-goto-next-error
(kbd "<leader>c p") 'flymake-goto-prev-error
(kbd "]d") #'flymake-goto-next-error
(kbd "[d") #'flymake-goto-prev-error))
#+END_SRC #+END_SRC
Map the keymap consistently to the eglot mappings. Map the keymap consistently to the eglot mappings.
@ -2288,7 +2571,8 @@ Map the keymap consistently to the eglot mappings.
;; (setq dape-repl-use-shorthand t) ;; (setq dape-repl-use-shorthand t)
;; By default dape uses gdb keybinding prefix ;; By default dape uses gdb keybinding prefix
(setq dape-key-prefix "<space>d") ;; (setq dape-key-prefix "<space>d")
(evil-define-key 'normal 'global (kbd "<leader>d") dape-global-map)
;; Kill compile buffer on build success ;; Kill compile buffer on build success
;; (add-hook 'dape-compile-compile-hooks 'kill-buffer) ;; (add-hook 'dape-compile-compile-hooks 'kill-buffer)
@ -2375,7 +2659,8 @@ Map the keymap consistently to the eglot mappings.
:branch "main" :branch "main"
:files ("dist" "*.el")) :files ("dist" "*.el"))
:bind :bind
("C-y" . copilot-accept-completion) (:map evil-insert-state-map
("C-y" . copilot-accept-completion))
:config :config
(add-to-list 'copilot-indentation-alist '(scheme-mode . 2)) (add-to-list 'copilot-indentation-alist '(scheme-mode . 2))
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode . 2)) (add-to-list 'copilot-indentation-alist '(emacs-lisp-mode . 2))
@ -2447,7 +2732,7 @@ Setup all channels which are joined by default.
*** ERC connect function *** ERC connect function
Define a function to login to ERC when needed. In principle ERC Define a function to login to ERC when needed. In principle ERC
reconnects after suspend, and sometimes it even works, but mostly I reconnects after suspend, and sometimes it even works, but mostly I
run this function again to reconnect, which will update the buffers run this function again to reconnect, which will update the buffers
with the rooms I joined. with the rooms I joined.
@ -2472,10 +2757,10 @@ in all kind of weird situation.
**** TODO Figure out how to make ERC reconnect more reliably **** TODO Figure out how to make ERC reconnect more reliably
Although running `snam-erc` is not a big deal, it should not be needed Although running `snam-erc` is not a big deal, it should not be needed
so much. I should figure out in what cases reconnects fail or dropping so much. I should figure out in what cases reconnects fail or dropping
connections fail to be recognized. connections fail to be recognized.
I often see that ERC is _reconnecting_ however this seems to silently I often see that ERC is _reconnecting_ however this seems to silently
fail. I dunno, there is something fishy here... fail. I dunno, there is something fishy here...
*** Integrate ERC with i3 Desktops *** Integrate ERC with i3 Desktops
@ -2589,9 +2874,9 @@ Configures Elfeed, an RSS feed reader for Emacs:
#+RESULTS: #+RESULTS:
: [nil 26289 17361 350243 nil elpaca-process-queues nil nil 817000 nil] : [nil 26289 17361 350243 nil elpaca-process-queues nil nil 817000 nil]
This does all kind of weird things. Apparently elpaca or use-package This does all kind of weird things. Apparently elpaca or use-package
magically namespaces all the functions and for some reason it fails magically namespaces all the functions and for some reason it fails
to require 'elfeed'. ... The weird thing is that the emacs lips to require 'elfeed'. ... The weird thing is that the emacs lips
feature is used to expand o2e to opml-to-elfeed-feeds, by setting the feature is used to expand o2e to opml-to-elfeed-feeds, by setting the
`read-symbol-shorthands` variable to `(("o2e" `read-symbol-shorthands` variable to `(("o2e"
. "opml-to-elfeed-feeds"))`. . "opml-to-elfeed-feeds"))`.
@ -2642,6 +2927,12 @@ Indicates the ~init.el~ file is provided by and ends here:
(report-time-since-load "Future") (report-time-since-load "Future")
#+END_SRC #+END_SRC
** TODO Decide about general keybindings.
The *general* package offers enhanced support for *evil* keybindings,
notably it integrates with *use-package* to define keybindings which
will load the package if not loaded yet.
It considerably streamlines managing evil bindings so it should offer
enough value but I just removed it, so it'll have to wait a bit.
** NEXT Add support for zola blogposts writing in org-mode ** NEXT Add support for zola blogposts writing in org-mode
:LOGBOOK: :LOGBOOK:
CLOCK: [2024-08-15 Thu 13:47]--[2024-08-16 Fri 00:57] => 11:10 CLOCK: [2024-08-15 Thu 13:47]--[2024-08-16 Fri 00:57] => 11:10