mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
13
.emacs.d/modules/ui/hl-todo/README.org
Normal file
13
.emacs.d/modules/ui/hl-todo/README.org
Normal file
@@ -0,0 +1,13 @@
|
||||
#+TITLE: :ui hl-todo
|
||||
|
||||
This module adds syntax highlighting for TODO/FIXME/NOTE tags in programming major-modes.
|
||||
|
||||
What keywords are highlighted (and their color) can be customized through ~hl-todo-keyword-faces~.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;; the default
|
||||
(setq hl-todo-keyword-faces
|
||||
`(("TODO" . ,(face-foreground 'warning))
|
||||
("FIXME" . ,(face-foreground 'error))
|
||||
("NOTE" . ,(face-foreground 'success))))
|
||||
#+END_SRC
|
||||
28
.emacs.d/modules/ui/hl-todo/config.el
Normal file
28
.emacs.d/modules/ui/hl-todo/config.el
Normal file
@@ -0,0 +1,28 @@
|
||||
;;; ui/hl-todo/packages.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! hl-todo
|
||||
:hook (prog-mode . hl-todo-mode)
|
||||
:config
|
||||
(setq hl-todo-highlight-punctuation ":"
|
||||
hl-todo-keyword-faces
|
||||
`(("TODO" warning bold)
|
||||
("FIXME" error bold)
|
||||
("HACK" font-lock-constant-face bold)
|
||||
("REVIEW" font-lock-keyword-face bold)
|
||||
("NOTE" success bold)
|
||||
("DEPRECATED" font-lock-doc-face bold)))
|
||||
|
||||
;; Use a more primitive todo-keyword detection method in major modes that
|
||||
;; don't use/have a valid syntax table entry for comments.
|
||||
(add-hook! '(pug-mode-hook haml-mode-hook)
|
||||
(defun +hl-todo--use-face-detection-h ()
|
||||
"Use a different, more primitive method of locating todo keywords."
|
||||
(set (make-local-variable 'hl-todo-keywords)
|
||||
'(((lambda (limit)
|
||||
(let (case-fold-search)
|
||||
(and (re-search-forward hl-todo-regexp limit t)
|
||||
(memq 'font-lock-comment-face (doom-enlist (get-text-property (point) 'face))))))
|
||||
(1 (hl-todo-get-face) t t))))
|
||||
(when hl-todo-mode
|
||||
(hl-todo-mode -1)
|
||||
(hl-todo-mode +1)))))
|
||||
4
.emacs.d/modules/ui/hl-todo/packages.el
Normal file
4
.emacs.d/modules/ui/hl-todo/packages.el
Normal file
@@ -0,0 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/hl-todo/packages.el
|
||||
|
||||
(package! hl-todo)
|
||||
Reference in New Issue
Block a user