Skip to content

Instantly share code, notes, and snippets.

Forked from hernamesbarbara/.ackrc
Created February 10, 2013 13:54
What would you like to do?
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code
#to install ack, see
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>'
#ack will search all files in the current directory & sub-directories
#here's how I have my config file setup. this file is located on mac osx here
# ~/.ackrc
# Always sort the files
# Always color, even if piping to a another program
# Use "less −r" as my pager
# --pager
# less -r
#make sure ack knows how to search common filetypes used in rails projects
#make sure ack knows how to search common filetypes used in node.js projects
Copy link

Just a note re: type set or type add, ack --dump shows the format from the default ack rc file to be --type-set=json:ext:json (same as from the manual). I'm assuming the format you're using is an alternative format?

Copy link

This ackrc is valid for ack 1.x, ack 2 uses the --type-set=json:ext:json format

Copy link


Same for --ignore-dir – the new format seems to be --ignore-directory=is:node_modules.

Copy link

jezen commented May 24, 2015

@tomekwi Not according to the manual.

--[no]ignore-dir=DIRNAME, --[no]ignore-directory=DIRNAME
    Ignore directory (as CVS, .svn, etc are ignored). May be used multiple times to ignore multiple directories. For example, mason users may wish to include --ignore-dir=data.
    The --noignore-dir option allows users to search directories which would normally be ignored (perhaps to research the contents of .svn/props directories).

    The DIRNAME must always be a simple directory name. Nested directories like foo/bar are NOT supported. You would need to specify --ignore-dir=foo and then no files from any
           foo directory are taken into account by ack unless given explicitly on the command line.

    Ignore files matching FILTERTYPE:FILTERARGS.  The filters are specified identically to file type filters as seen in "Defining your own types".

Copy link

F1LT3R commented Dec 13, 2016

Thanks for posting this, it was really helpful @kevinold!!

I could get your --sort-files to work though :(

Any ideas why?

(I get Unknown option: sort−files in the CLI)

Copy link

@F1LT3R --sort-files should work just fine. If you still can't get it working, please submit a ticket here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment