![]() Much better yet would still be interactive usage though and having the output in a nice vertico buffer like with consult-ripgrep. It would be much better to have it output actual file links so that they are clickable, of course, but I donât have too much elisp-fu. # call: get-backlinks-a-b(termone="Emacs", termtwo="science") ignore-file Specifies a path to one or more.# begin_src sh :var termone="Emacs" termtwo="science" Includes or excludes files and directories for searching that match given the glob. So far, I got it working on the shell for two terms and I can use that to output an org table of file names now: # name: get-backlinks-a-b If thatâs true, it would be more complicated. However, I think I read somewhere that the # splitting the search string signifies that the first part is provided by ripgrep, the second part is a second filter step done within Emacs. My first impression was that one would need to pass flags to (consult-)ripgrep to make it match on the file- rather than line-level. (let ((consult-ripgrep-command "rg -multiline -null -ignore-case -type org -line-buffered -color=always -max-columns=500 -no-heading -line-number. I tried modifying your code from above and added the -multiline flag, but it doesnât work: (defun bms/org-roam-rg-search () ![]() I donât know how you can pass flags to the command. However, I havenât managed to get this done within Emacs using consult-ripgrep. Is this possible, too? I found that you can use (rip)grep like that using the -U flag ^1 and that works fine for me from the terminal: rg -Ul '(?s)foo.*?\n.*?bar|bar.*?\n.*?foo' To be really useful, I would like it to return all notes where thereâs a match in the same file. returning only those files in which foo and bar appear in the same line. The thing is that this operates on lines though, i.e. Oh wow, how could I miss that, so easy! Thanks! (global-set-key (kbd "C-c rf") 'bms/org-roam-rg-file-search) (bms/consult-ripgrep-files-with-matches org-roam-directory)) "Search org-roam directory using consult-find with \"rg -file-with-matches \". (let ((consult-find-command "rg -ignore-case -type org -files-with-matches. "Use consult-find style to return matches with \"rg -file-with-matches \". It doesnât have the nice live-preview of the above function though: (defun bms/consult-ripgrep-files-with-matches (
0 Comments
Leave a Reply. |