Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ack and grep should include .projectile ignores #97

Closed
arianitu opened this issue Apr 26, 2013 · 7 comments · Fixed by #1371
Closed

ack and grep should include .projectile ignores #97

arianitu opened this issue Apr 26, 2013 · 7 comments · Fixed by #1371

Comments

@arianitu
Copy link

It would be really nice if there was an option to include your .projectile ignores when using ack and grep.

@bbatsov
Copy link
Owner

bbatsov commented Apr 26, 2013

It works for grep even now (with a few caveats - have a look at older issues on the subject). Proper support for ack is in my agenda.

Cheers,
Bozhidar

On Friday, April 26, 2013 at 5:29 PM, arianitu wrote:

It would be really nice if there was an option to include your .projectile ignores when using ack and grep.


Reply to this email directly or view it on GitHub (#97).

@arianitu
Copy link
Author

Hmm, perhaps I've setup my ignore file a bit incorrectly.

I'm under the impression if I don't use a forward slash, it'll ignore that specific directory wherever it finds it. I have a lot of .sass_cache in subdirectories, and node_modules in subdirectories, so I've done:

-.sass-cache
-node_modules

instead of:

-/directory/.sass_cache
-/another/directory/.sass_cache

and it seemed to ignore them. Looking back at past issues, it seems if you use forward slashes, it will work correctly? (perhaps this is the caveat?)

@arianitu
Copy link
Author

Indeed, that is the caveat! grep works fine now, but ack would still be really nice!

@petdance
Copy link

Create an issue at https://github.com/petdance/ack2 explaining what it is you're wanting us to ignore and we'll look into it.

ack isn't going to ignore .projectile contents directly, but probably .sass_cache makes sense, and we just added a change to ignore node_modules.

@zerko
Copy link

zerko commented May 29, 2013

Cant ignore specific file when greping via .projectile.

@bbatsov
Copy link
Owner

bbatsov commented Apr 11, 2014

projectile-ack should now be respecting .projectile.

@bbatsov bbatsov closed this as completed Apr 11, 2014
@jacksonrayhamilton jacksonrayhamilton mentioned this issue Jan 12, 2019
5 tasks
@nordlow
Copy link

nordlow commented Feb 12, 2020

I'm using counsel-projectile-rg currently defined as

(defun counsel-projectile-rg (&optional options)
  "Search the current project with rg.

OPTIONS, if non-nil, is a string containing additional options to
be passed to rg. It is read from the minibuffer if the function
is called with a prefix argument."
  (interactive)
  (if (and (eq projectile-require-project-root 'prompt)
           (not (projectile-project-p)))
      (counsel-projectile-rg-action-switch-project)
    (let* ((ivy--actions-list (copy-sequence ivy--actions-list))
           (path
            (mapconcat 'shell-quote-argument
                       (or (projectile-normalise-paths
                            (car (projectile-parse-dirconfig-file)))
                           '("."))
                       " "))
           (ignored
            (mapconcat (lambda (i)
                         (concat "--glob !" (shell-quote-argument i)))
                       (append
                        (projectile--globally-ignored-file-suffixes-glob)
                        (projectile-ignored-files-rel)
                        (projectile-ignored-directories-rel))
                       " "))
           (counsel-rg-base-command
            (format (counsel-projectile--string-trim-right counsel-rg-base-command " \\.")
                    (concat ignored " %s " path))))
      (ivy-add-actions
       'counsel-rg
       counsel-projectile-rg-extra-actions)
      (counsel-rg (eval counsel-projectile-rg-initial-input)
                  (projectile-project-root)
                  options
                  (projectile-prepend-project-name
                   (concat (car (split-string counsel-rg-base-command)) ": "))))))

Does this change affect counsel-projectile-rg aswell?

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

Successfully merging a pull request may close this issue.

5 participants