feat(tazjin/emacs): Add #'rg-in-project
Uses project.el to anchor the ripgrep search. In combination with my project detection logic, this means that grepping in TVL subprojects works automatically. Change-Id: I2705466d1de156c08ff0401a71112864aa24f976 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2542 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
This commit is contained in:
parent
83e81def23
commit
bef01b1419
3 changed files with 12 additions and 2 deletions
|
|
@ -317,4 +317,12 @@ the GPG agent correctly."
|
|||
(url-retrieve "https://songwhip.com/api/" #'songwhip--handle-result nil t t)
|
||||
(message "Requesting Songwhip URL ... please hold the line.")))
|
||||
|
||||
(defun rg-in-project (&optional prefix)
|
||||
"Interactively call ripgrep in the current project, or fall
|
||||
back to ripgrep default behaviour if prefix is set."
|
||||
(interactive "P")
|
||||
(counsel-rg nil (unless prefix
|
||||
(if-let ((pr (project-current)))
|
||||
(project-root pr)))))
|
||||
|
||||
(provide 'functions)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue