ThoomEmacs update

- Indent with spaces
- Single space after period for sentences
- Remove thoom/repeat-map macro
- Add SPC f r binding for consult-recent-file
- Add g d and g u bindings for meow
- add q binding for meow to cancel selection
- add dumb-jump
- add ttm-org-clear-all function
This commit is contained in:
2022-11-01 16:34:22 -07:00
parent 949214603f
commit cbf725d16f
2 changed files with 251 additions and 232 deletions

View File

@@ -112,6 +112,7 @@ Set some common settings, like global-auto-revert-mode.
;; tabs are for monsters
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default sentence-end-double-space nil)
#+END_SRC
** hl-todo
#+begin_src emacs-lisp
@@ -121,24 +122,10 @@ Set some common settings, like global-auto-revert-mode.
(global-hl-todo-mode))
#+end_src
** Repeat Mode
Repeat-mode just needs to be enabled. Keymaps are defined through use-package's ~:repeat-map~ directive.
#+begin_src emacs-lisp
(repeat-mode 1)
(defmacro thoom/repeat-map (keymap-sym &rest bindings)
"A helper macro for defining repeat maps. keymap-sym is a symbol to name the keymap with.
bindings are a sequence of cons cells containing a string to be passed to kbd and a function
for that key to be mapped to."
(declare (indent 1))
`(progn
(defvar ,keymap-sym
(let ((map (make-sparse-keymap)))
,@(mapcar (lambda (binding) `(define-key map (kbd ,(car binding)) ',(cdr binding))) bindings)
map))
(map-keymap
(lambda (_key cmd)
(when (symbolp cmd)
(put cmd 'repeat-map ',keymap-sym)))
,keymap-sym)))
#+end_src
** Tab Bar
@@ -203,6 +190,7 @@ Set a location for the custom file so it doesn't pollute this file.
;; File management
("C-c f f" . find-file)
("C-c f r" . consult-recent-file)
("C-c f j" . dired-jump)
;; TODO - C-c g p for open project in magit
@@ -321,6 +309,7 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
'("." . meow-bounds-of-thing)
'("[" . meow-beginning-of-thing)
'("]" . meow-end-of-thing)
;; Potential addition <, >
'("a" . meow-append)
'("A" . meow-open-below)
@@ -334,7 +323,9 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
'("E" . meow-next-symbol)
'("f" . meow-find)
`("F" . ,(thoom/meow-negate 'meow-find))
'("g" . meow-cancel-selection)
'("g g" . meow-cancel-selection)
'("g d" . xref-find-definitions)
'("g u" . xref-find-references)
'("G" . meow-grab)
'("h" . meow-left)
'("H" . meow-left-expand)
@@ -354,7 +345,7 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
'("O" . meow-to-block)
'("p" . meow-yank)
'("P" . consult-yank-pop)
;; Potential addition - q
'("q" . meow-cancel-selection)
;; Potential addition - Q
'("r" . meow-replace)
'("R" . meow-swap-grab)
@@ -414,28 +405,50 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
:init
(setq tab-always-indent 'complete))
#+end_src
** Dumb-Jump
#+begin_src emacs-lisp
(use-package dumb-jump
:straight t
:config
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
(setq xref-show-definitions-function #'xref-show-definitions-completing-read))
#+end_src
* Org
#+begin_src emacs-lisp
(use-package org
:hook (org-mode . visual-line-mode)
:bind (:map
org-mode-map
("C-x C-o c" . thoom-org-clear-all)
:repeat-map
thoom/org-previous-next-visible-heading-repeat-map
("n" . org-next-visible-heading)
("C-n" . org-next-visible-heading)
("p" . org-previous-visible-heading)
("C-p" . org-previous-visible-heading))
:config
;; Add structure templates
(add-to-list 'org-modules 'org-tempo t)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(setq org-edit-src-content-indentation 0)
;; Repeat map for previous/next heading
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
("n" . org-next-visible-heading)
("C-n" . org-next-visible-heading)
("p" . org-previous-visible-heading)
("C-p" . org-previous-visible-heading)))
(setq org-edit-src-content-indentation 0))
(use-package org-bullets
:straight t
:hook org-mode)
#+end_src
** Groceries
#+begin_src emacs-lisp
(defun thoom-org-clear-all ()
(interactive)
(goto-char 0)
(org-map-entries
(lambda ()
(org-todo "")))
(flush-lines "CLOSED")
(message "Entries cleared."))
#+end_src
* VMOCE
** Vertico

View File

@@ -85,6 +85,7 @@
;; tabs are for monsters
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default sentence-end-double-space nil)
(use-package hl-todo
:straight t
@@ -93,22 +94,6 @@
(repeat-mode 1)
(defmacro thoom/repeat-map (keymap-sym &rest bindings)
"A helper macro for defining repeat maps. keymap-sym is a symbol to name the keymap with.
bindings are a sequence of cons cells containing a string to be passed to kbd and a function
for that key to be mapped to."
(declare (indent 1))
`(progn
(defvar ,keymap-sym
(let ((map (make-sparse-keymap)))
,@(mapcar (lambda (binding) `(define-key map (kbd ,(car binding)) ',(cdr binding))) bindings)
map))
(map-keymap
(lambda (_key cmd)
(when (symbolp cmd)
(put cmd 'repeat-map ',keymap-sym)))
,keymap-sym)))
(tab-bar-mode)
;; TODO - keybindings
@@ -157,6 +142,7 @@
;; File management
("C-c f f" . find-file)
("C-c f r" . consult-recent-file)
("C-c f j" . dired-jump)
;; TODO - C-c g p for open project in magit
@@ -265,6 +251,7 @@
'("." . meow-bounds-of-thing)
'("[" . meow-beginning-of-thing)
'("]" . meow-end-of-thing)
;; Potential addition <, >
'("a" . meow-append)
'("A" . meow-open-below)
@@ -278,7 +265,9 @@
'("E" . meow-next-symbol)
'("f" . meow-find)
`("F" . ,(thoom/meow-negate 'meow-find))
'("g" . meow-cancel-selection)
'("g g" . meow-cancel-selection)
'("g d" . xref-find-definitions)
'("g u" . xref-find-references)
'("G" . meow-grab)
'("h" . meow-left)
'("H" . meow-left-expand)
@@ -298,7 +287,7 @@
'("O" . meow-to-block)
'("p" . meow-yank)
'("P" . consult-yank-pop)
;; Potential addition - q
'("q" . meow-cancel-selection)
;; Potential addition - Q
'("r" . meow-replace)
'("R" . meow-swap-grab)
@@ -356,26 +345,43 @@
:init
(setq tab-always-indent 'complete))
(use-package dumb-jump
:straight t
:config
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
(setq xref-show-definitions-function #'xref-show-definitions-completing-read))
(use-package org
:hook (org-mode . visual-line-mode)
:bind (:map
org-mode-map
("C-x C-o c" . thoom-org-clear-all)
:repeat-map
thoom/org-previous-next-visible-heading-repeat-map
("n" . org-next-visible-heading)
("C-n" . org-next-visible-heading)
("p" . org-previous-visible-heading)
("C-p" . org-previous-visible-heading))
:config
;; Add structure templates
(add-to-list 'org-modules 'org-tempo t)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(setq org-edit-src-content-indentation 0)
;; Repeat map for previous/next heading
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
("n" . org-next-visible-heading)
("C-n" . org-next-visible-heading)
("p" . org-previous-visible-heading)
("C-p" . org-previous-visible-heading)))
(setq org-edit-src-content-indentation 0))
(use-package org-bullets
:straight t
:hook org-mode)
(defun thoom-org-clear-all ()
(interactive)
(goto-char 0)
(org-map-entries
(lambda ()
(org-todo "")))
(flush-lines "CLOSED")
(message "Entries cleared."))
(use-package vertico
:straight (:files (:defaults "extensions/*"))
:init