Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to limit the search in the current buffer? #12

Open
shakaxi opened this issue Sep 25, 2018 · 2 comments
Open

How to limit the search in the current buffer? #12

shakaxi opened this issue Sep 25, 2018 · 2 comments

Comments

@shakaxi
Copy link

shakaxi commented Sep 25, 2018

Thanks for your great effort for helm-rg, and I am trying to use rg instead of ag.

By default, the helm-rg provides interface to search in a directory. But I found it cannot limit the search in the current buffer yet, which could bring about great convenience. Do you have any intention or plan in the near future?

Thanks.

@codygman
Copy link

codygman commented Dec 6, 2018

I need this as well, in the meantime I'll use helm-ag I suppose.

Edit: it should be relatively easy to hack together our own helm-rg-this-file function, but it's late for me atm.

@liuzhishan
Copy link

liuzhishan commented Oct 29, 2022

hi, I found a way to specify the directory, just add these codes in config.el

(defun helm-rg-dir ()
   (interactive)
  (let ((helm-rg--current-dir
       (read-directory-name "rg directory: " helm-rg--current-dir nil t)))
       (helm-rg (helm-rg--get-thing-at-pt))))

It can also be binded to some key:
(map! :leader :desc "do rg under directory" :n "s a" #'helm-rg-dir)

And just press "SPC s a" to do the rg under some directory.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants