Code Monkey home page Code Monkey logo

Comments (4)

petdance avatar petdance commented on June 5, 2024

You want the --type-add command. It sounds like you want something like this:

--type-add=qtproject:ext:pro,pri,qrc

Then you could do ack --qtproject widgets. I like to keep names longer than I need to, so I can abbreviate as --qtp most of the time but spell out --qtproject if I need to for clarity of someone else reading it. Of course, you can call the filetype whatever you want.

You can put that on the command line, but more likely you're going to want to put it in an .ackrc file. You can either put it in ~/.ackrc in your home directory, or in a .ackrc that will localize that specification only to that directory tree.

Please let me know how it goes. I'm currently working on the docs for the --type-add and --type-set options and also a chapter on them in my upcoming book about ack.


Also, the --files-from specifies a file that has a list of files to search. If you had a list of all the files to search in a file myfiles.txt you could say ack --files-from=myfiles.txt.

from ack2.

MartinDelille avatar MartinDelille commented on June 5, 2024

That sounds a nice feature!

What I don't understand is which effect has the --type-add command? Does it modify the default configuration? Where is it stored?

I would indeed prefer to add it to my ~/.ackrc file but what is the syntax then?

I'll be happy to help you to review the documentation by the way!

from ack2.

petdance avatar petdance commented on June 5, 2024

You store the --type-add command in your ~/.ackrc file. That file is checked every time you run ack. That basically makes it a default every time you run ack.

You can also put it in a public /etc/ackrc file and then everyone on that machine who runs ack will get that --type-add.

You can also put it in a project-level .ackrc that will only apply when you're in that directory tree.

from ack2.

MartinDelille avatar MartinDelille commented on June 5, 2024

Ok great thank you! I realized how .ackrc file work: it appends each line as a parameter to the ack command.

from ack2.

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.