minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

I can't get consult-ripgrep to show only matching files, as with the "-l" command line option #917

Closed pdxmph closed 4 months ago

pdxmph commented 4 months ago

I have this (cribbed) function:

(defun mph/denote-rg-search ()
  "Search denote directory using consult-ripgrep. With live-preview."
  (interactive)
  (let ((consult-ripgrep-command "rg -l --smart-case --type org  --line-buffered --color=always --no-heading --line-number . -e ARG OPTS"))
    (consult-ripgrep denote-directory)))

I have the "-l" in there to suppress the matching content in the results and show only the matching file.

If I run rg -l on the command line, all I'll get is the files, e.g.

sitemap.org
20230611T161850--oni-metanote__iterable_metanote_oni.org
writing/20230522T104531--state-of-the-mike__drafts.org
career/20230528T171926--alex-lopez-coo__eleven.org
career/20230429T104553--it-mindset__bio_it_management.org
work/index.org
work/20230612T110043--1on1-with-oni__1on1_oni.org
work/20230615T154217--oni-followup-on-legal-hold__legal_oni_oona.org
work/20230613T113719--rfc-heatmapping-exercise__management_rfc.org
work/20231112T192649--bricking-macbook-questions__emacs_it_oni.org
work/20230601T175625--it-planning__iterable_work.org
work/20230523T104522--management-topics__first30_iterable_management_work.org```

Using that command with my function, there is a ton of visual clutter from metanotes, index files, etc. It's not hard to skip them when skimming up a list of just filenames, esp. since I am using Denote's naming conventions for files. It is very hard to do that when there are multiple lines from the same file.