Skip to content

Commit

Permalink
feat: new command hl-todo-rg-project.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Sep 20, 2023
1 parent 6470da3 commit 0097377
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lisp/init-highlight.el
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ FACE defaults to inheriting from default and highlight."
("C-c t p" . hl-todo-previous)
("C-c t n" . hl-todo-next)
("C-c t o" . hl-todo-occur)
("C-c t r" . hl-todo-rg)
("C-c t r" . hl-todo-rg-project)
("C-c t i" . hl-todo-insert))
:hook ((after-init . global-hl-todo-mode)
(hl-todo-mode . (lambda ()
Expand All @@ -225,7 +225,14 @@ FACE defaults to inheriting from default and highlight."
(list regexp
(rg-read-files)
(read-directory-name "Base directory: " nil default-directory t)))))
(rg regexp files dir)))
(rg regexp files dir))

(defun hl-todo-rg-project ()
"Use `rg' to find all TODO or similar keywords in current project."
(interactive)
(unless (require 'rg nil t)
(error "`rg' is not installed"))
(rg-project (replace-regexp-in-string "\\\\[<>]*" "" (hl-todo--regexp)) "everything")))

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

0 comments on commit 0097377

Please sign in to comment.