Giter VIP home page Giter VIP logo

Comments (12)

amosbird avatar amosbird commented on August 16, 2024 1

Um, can we just reuse the pattern of .projectile? I have this ignore list but it doesn't affect counsel-projectile-ag/rg's behavior.

-/contrib
-/c6
-/c6build
-/chdbg
-/clickhouse
-/dbg
-/rel
-compile_commands.json
-/debian

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

Yes, there is an optional argument OPTIONS to pass any option you like to ag. For instance:

(counsel-projectile-ag "--ignore some/path")

You can call counsel-projectile-ag with a C-u prefix to input the options string interactively.

If you want to setup counsel-projectile-ag to systematically ignore certain paths, you could instead add these paths to the variables projectile-ignored-files-rel and/or projectile-ignored-directories-rel.

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

from counsel-projectile.

amosbird avatar amosbird commented on August 16, 2024

the output of projectile-ag is quite weird. I cannot see any file names. The ag command is ag --ignore \*.elc --ignore \*.pyc --ignore \*.o --literal --group --line-number --column --color --color-match 30\;43 --color-path 1\;32 --smart-case --stats -- BackgroundProcessingPool .

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

Doesn't seem to obey your .projectile file either.

Can you call these three functions from a project buffer and copy the output?

(projectile-project-vcs)
(projectile-ignored-files-rel)
(projectile-ignored-directories-rel)

from counsel-projectile.

amosbird avatar amosbird commented on August 16, 2024

they are

git
(".DS_Store" "Icon" "TAGS")
(".idea/" ".ensime_cache/" ".eunit/" ".git/" ".hg/" ".fslckout/" "_FOSSIL_/" ".bzr/" "_darcs/" ".tox/" ".svn/" ".stack-work/" "../../.emacs.d/.local/" ".sync/" "contrib/" "c6/" "c6build/" "chdbg/" "clickhouse/" "dbg/" "rel/" "debian/")

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

So, projectile-ignored-directories-rel correctly parses your .projectile file, but projectile-ag and counsel-projectile-ag do not pay attention to the .projectile file for git projects. This is because git has its own .gitignore file and ag parses it natively. I would suggest to use .gitignore instead of .projectile for such projects.

from counsel-projectile.

amosbird avatar amosbird commented on August 16, 2024

Hmm, some directories are not suitable for gitignore, such as test and contrib folders.

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

Can you update to latest commit, set counsel-projectile-ag-use-gitignore-only to nil and let me know if it works?

from counsel-projectile.

amosbird avatar amosbird commented on August 16, 2024

@ericdanan thanks! it works perfectly.

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

I just pushed another commit and that variable is no longer there, the behavior you want is now the default.

This means counsel-projectile-ag and counsel-projectile-rg work a bit differently from their projectile analogues, but I think it is more consistent with counsel-projectile-find-file (or equivalently projectile-find-file) in the sense that all these functions (hopefully) now look at the same set of files in a project.

When you call counsel-projectile-ag or counsel-projectile-rg with a prefix arg you have full control on the options to be passed to ag or rg including which paths are ignored.

from counsel-projectile.

ericdanan avatar ericdanan commented on August 16, 2024

Please open a new issue if needed.

from counsel-projectile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.