From e0f9efabd27e9ba7025f9daceff230708fb32895 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 4 Jun 2024 11:47:54 -0700 Subject: [PATCH] Add the hl-todo and consult-todo Along with fixing the cursor color on the form. --- ha-config.org | 2 +- ha-display.org | 41 +++++++++++++++++++++++++++++++++++++---- initialize | 29 ++++++++++++++++++----------- 3 files changed, 56 insertions(+), 16 deletions(-) diff --git a/ha-config.org b/ha-config.org index ba64979..e3cd43a 100644 --- a/ha-config.org +++ b/ha-config.org @@ -359,7 +359,7 @@ For this feature, I may want to pull it out into its own file, so as to keep all #+end_src -** Additional Global Packages +** Text Expanders and Completion The following defines my use of the Emacs completion system. I’ve decided my /rules/ will be: - Nothing should automatically appear; that is annoying and distracting. - Spelling in org files (abbrev or hippie expander) and code completion are separate, but I’m not sure if I can split them diff --git a/ha-display.org b/ha-display.org index 1f1ece9..37c3b09 100644 --- a/ha-display.org +++ b/ha-display.org @@ -346,18 +346,20 @@ One does get used to a particular collection of colors. After happily using Stev (if (eq flexoki-themes-set-theme 'dark) (progn (set-face-attribute 'default nil :background "#161514") - (set-face-attribute 'region nil :background "#bc5215") + (set-face-attribute 'cursor nil :background "#ce5d97") ; dark-version of magenta + (set-face-attribute 'region nil :background "#bc5215") ; light-version of orange (set-face-attribute 'org-block nil :background "#1b1a19") (set-face-attribute 'org-block-begin-line nil :background "#1d1c1b") (set-face-attribute 'org-block-begin-line nil :background "#1d1c1b")) - (set-face-attribute 'region nil :background "#da702c") + (set-face-attribute 'cursor nil :background "#a02f6f") ; dark-version of orange + (set-face-attribute 'region nil :background "#da702c") ; dark-version of orange (set-face-attribute 'org-block-begin-line nil :foreground "#fffcf0"))) :custom (flexoki-themes-set-theme 'dark) - (flexoki-themes-use-bold-keywords t) - (flexoki-themes-use-bold-builtins t) + (flexoki-themes-use-bold-keywords nil) + (flexoki-themes-use-bold-builtins nil) (flexoki-themes-use-italic-comments t) :hook (flexoki-themes-after-load-themes . ha-flexoki-themes-update)) @@ -402,6 +404,37 @@ And of course, the default is /inside/ where it is dark and safe: #+begin_src emacs-lisp (laptop-inside) #+end_src +*** Highlight TODOs +In code, if you drop a specific /text/ labels, we can highlight them with [[https://github.com/tarsius/hl-todo][hl-todo package]]: + +#+begin_src emacs-lisp + (use-package hl-todo + :straight (:host github :repo "tarsius/hl-todo") + :init + (setq hl-todo-keyword-faces + '(("TODO" . (face-foreground 'flexoki-themes-orange)) + ("FIXME" . (face-foreground 'flexoki-themes-red)) + ("DEBUG" . (face-foreground 'flexoki-themes-green)) + ("NOTE" . (face-foreground 'flexoki-themes-blue)))) + (global-hl-todo-mode 1)) +#+end_src + +This means that comments like the following visually standout: +TODO: Attempt to validate that this shows something I need to do. + +Suggests to bind some keys to =hl-todo-next= in order to jump from tag to tag, but the [[https://github.com/liuyinz/consult-todo][consult-todo]] implements that in a more visual way: + +#+begin_src emacs-lisp + (use-package consult-todo + :init + (defconst consult-todo--narrow + '((?t . "TODO") + (?f . "FIXME") + (?d . "DEBUG") + (?n . "NOTE")) + "Mapping of narrow and keywords.") + :general (:states 'normal "g t" '("jump todos" . consult-todo))) +#+end_src * Full Size Frame Taken from [[https://emacsredux.com/blog/2020/12/04/maximize-the-emacs-frame-on-startup/][this essay]], I figured I would start the initial frame automatically in fullscreen, but not any subsequent frames (as this could be part of the capturing system). #+begin_src emacs-lisp diff --git a/initialize b/initialize index c2d90b9..ddecf90 100755 --- a/initialize +++ b/initialize @@ -3,20 +3,24 @@ # INITIALIZE the HAMACS SYSTEM # ---------------------------------------------------------------------- +# shellcheck disable=SC2164 HAMACS_DIR=$(cd "$(dirname "$0")"; pwd) HAMACS_DEST=$HOME/.emacs.d -cd $HAMACS_DIR -mkdir -p $HAMACS_DEST +cd "$HAMACS_DIR" +mkdir -p "$HAMACS_DEST" for LINK in snippets templates elisp do - echo Symlinking $HAMACS_DEST/$LINK to $HAMACS_DIR/$LINK ... - rm -rf $HAMACS_DEST/$LINK - ln -s $HAMACS_DIR/$LINK $HAMACS_DEST + echo "Symlinking $HAMACS_DEST/$LINK to $HAMACS_DIR/$LINK ..." + rm -rf "${HAMACS_DEST:-~}/$LINK" + ln -s "$HAMACS_DIR/$LINK" "$HAMACS_DEST" done -cat > $HAMACS_DEST/early-init.el < "$HAMACS_DEST/early-init.el" <> $HAMACS_DEST/early-init.el + echo "(add-to-list 'exec-path \"${P}\")" >> "$HAMACS_DEST/early-init.el" done -cat >> $HAMACS_DEST/early-init.el <> "$HAMACS_DEST/early-init.el" <> $HAMACS_DEST/early-init.el < $HAMACS_DEST/init.el < "$HAMACS_DEST/init.el" < $HAMACS_DEST/init.el < $HAMACS_DEST/init.el <