Last Updated: February 25, 2016
·
762
· errm

Search sass with ack

I use ack all the time for searching source code, however when I started using sass it stopped working.

Here's the fix:

cat >> ~/.ackrc
--type-add
css=.sass,.scss

This show you all the file types ack will recognise and the extensions they are mapped to:

ack --help types

There are lots:

--[no]actionscript .as .mxml
--[no]ada          .ada .adb .ads
--[no]asm          .asm .s
--[no]batch        .bat .cmd
--[no]binary       Binary files, as defined by Perl's -B op (default: off)
--[no]cc           .c .h .xs
--[no]cfmx         .cfc .cfm .cfml
--[no]clojure      .clj
--[no]cpp          .cpp .cc .cxx .m .hpp .hh .h .hxx
--[no]csharp       .cs
--[no]css          .css .sass .scss
--[no]delphi       .pas .int .dfm .nfm .dof .dpk .dproj .groupproj .bdsgroup .bdsproj
--[no]elisp        .el
--[no]erlang       .erl .hrl
--[no]fortran      .f .f77 .f90 .f95 .f03 .for .ftn .fpp
--[no]go           .go
--[no]groovy       .groovy .gtmpl .gpp .grunit
--[no]haskell      .hs .lhs
--[no]hh           .h
--[no]html         .htm .html .shtml .xhtml
--[no]java         .java .properties
--[no]js           .js
--[no]jsp          .jsp .jspx .jhtm .jhtml
--[no]lisp         .lisp .lsp
--[no]lua          .lua
--[no]make         Makefiles (including *.mk and *.mak)
--[no]mason        .mas .mhtml .mpl .mtxt
--[no]objc         .m .h
--[no]objcpp       .mm .h
--[no]ocaml        .ml .mli
--[no]parrot       .pir .pasm .pmc .ops .pod .pg .tg
--[no]perl         .pl .pm .pm6 .pod .t
--[no]php          .php .phpt .php3 .php4 .php5 .phtml
--[no]plone        .pt .cpt .metadata .cpy .py
--[no]python       .py
--[no]rake         Rakefiles
--[no]ruby         .rb .rhtml .rjs .rxml .erb .rake .spec
--[no]scala        .scala
--[no]scheme       .scm .ss
--[no]shell        .sh .bash .csh .tcsh .ksh .zsh
--[no]skipped      Files, but not directories, normally skipped by ack (default: off)
--[no]smalltalk    .st
--[no]sql          .sql .ctl
--[no]tcl          .tcl .itcl .itk
--[no]tex          .tex .cls .sty
--[no]text         Text files, as defined by Perl's -T op (default: off)
--[no]tt           .tt .tt2 .ttml
--[no]vb           .bas .cls .frm .ctl .vb .resx
--[no]verilog      .v .vh .sv
--[no]vhdl         .vhd .vhdl
--[no]vim          .vim
--[no]xml          .xml .dtd .xsl .xslt .ent
--[no]yaml         .yaml .yml