Skip to content

Commit

Permalink
Add hl-todo-rg.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Aug 28, 2023
1 parent 2749894 commit c9b928c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lisp/init-highlight.el
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,19 @@ FACE defaults to inheriting from default and highlight."
(dolist (keyword '("TRICK" "WORKAROUND"))
(add-to-list 'hl-todo-keyword-faces `(,keyword . "#d0bf8f")))
(dolist (keyword '("DEBUG" "STUB"))
(add-to-list 'hl-todo-keyword-faces `(,keyword . "#7cb8bb"))))
(add-to-list 'hl-todo-keyword-faces `(,keyword . "#7cb8bb")))

(defun hl-todo-rg (regexp &optional files dir)
"Use `rg' to find all TODO or similar keywords."
(interactive
(progn
(unless (require 'rg nil t)
(error "`rg' is not installed"))
(let ((regexp (replace-regexp-in-string "\\\\[<>]*" "" (hl-todo--regexp))))
(list regexp
(rg-read-files)
(read-directory-name "Base directory: " nil default-directory t)))))
(rg regexp files dir)))

;; Highlight uncommitted changes using VC
(use-package diff-hl
Expand Down

0 comments on commit c9b928c

Please sign in to comment.