开发者

How to let ack support more filetypes?

开发者 https://www.devze.com 2023-01-19 08:36 出处:网络
in ack\'s home page, there lists a lot of file type, but without aspx, is it possible to let ack support 开发者_Go百科it?On window,add .ackrc file under C:\\Documents and Settings\\yourname,with conte

in ack's home page, there lists a lot of file type, but without aspx, is it possible to let ack support 开发者_Go百科it?


On window,add .ackrc file under C:\Documents and Settings\yourname,with content

--type-set=aspx=.aspx

you can set a type to multi file extension,seperate by ","

--type-set=aspx=.aspx,.ascx
Note

ack syntax and behaviour has changed significantly with version 2. The equivalent of the above in version 2 would be:

--type-set=aspx:ext:aspx,ascx

Where the syntax is --type-set TYPE:FILTER:FILTERARGS and FILTER can be any of ext, is, match, firstlinematch. You should definitely read the man page for detailed explanation.

see

  • The .ackrc file
  • Defining your own types
  • ack version 2 man page


--type-add TYPE=.EXTENSION[,.EXT2[,...]]
                    Files with the given EXTENSION(s) are recognized as
                    being of (the existing) type TYPE

from http://betterthangrep.com/

You can add this to .ackrc in your homedirectory.

0

精彩评论

暂无评论...
验证码 换一张
取 消