Make ack recognize custom file types
ack
is a great replacement for grep
when working with source code.
It allows to search by all source files in current directory recursively using just: ack funcName
. It automatically ignores .svn dirs and other files, which are not sources. Unfortunately, ack
will also ignore some useful files, like .less
, .coffee
and others.
Turns out, you can easily learn it new types of files by creating ~/.ackrc
with content similar to:
--type-set=less=.less
--type-set=scss=.scss
--type-set=sass=.sass
--type-set=coffee=.coffee
Now you can search those types with ack and even use flags like ack --less
Written by Vladimir Sidorenko
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ack
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#