3

I have Ack set up in Vim but at the moment it does not search in .handlebars files.

Does anyone know how I can add handlebars to the file list?

dagda1
  • 26,856
  • 59
  • 237
  • 450

2 Answers2

2

Adding the following line to my ~/.ackrc tells ack to search in the files I needed:

--type-add=html=.html.erb,.html.haml,.handlebars
dagda1
  • 26,856
  • 59
  • 237
  • 450
2

We one command:

cat >> ~/.ackrc
--type-add
html=.html.erb,.html.haml,.handlebars,.hbs

also you should add a type

cat >> ~/.ackrc
--type-set
mustache=.html.erb,.html.haml,.handlebars,.hbs

and use like this

ack --type mustache 'search'
atomsfat
  • 2,863
  • 6
  • 34
  • 36
  • Version 2 of ack has changed it's sintax for ackrc like `--type-add=html:ext:hbs` to add `.hbs` extension to html types – JC Teo Nov 02 '20 at 16:30