Questions tagged [ack]

ack is a tool like grep, designed for programmers with large trees of heterogeneous source code.

ack is a tool like grep, designed for programmers with large trees of heterogeneous source code. http://beyondgrep.com

262 questions
3
votes
1 answer

ack-grep Easter eggs - what is the meaning of ack-grep --cathy?

ack-grep has 3 easter eggs: ack-grep --thppt ack-grep --bar ack-grep --cathy While I am a huge fan of ack-grep --bar and I get ack-grep --thppt, could anyone explain the joke behind ack-grep --cathy?
RoachLord
  • 993
  • 1
  • 14
  • 28
3
votes
1 answer

Ack.vim with ag not using current directory?

I am at the moment trying to figure out vim and craft my own .vimrc. After some research about search-commands and plugins I decided to follow the advice of someone and try out Ack.vim with SilverSearcher/Ag for the actual searches. I encountered…
AvantiC
  • 367
  • 3
  • 17
3
votes
1 answer

Can you preserve the formatting of unmatched content in grep?

When you use grep twice, the highlight from the first is stripped. As far as I can tell, this helps avoid matching the formatting codes. (For contrast, "ack-grep" will highlight new matches while preserving formatting in old matches as long as the…
John P
  • 1,463
  • 3
  • 19
  • 39
3
votes
1 answer

How to save the output of ack to a file?

I'm trying to redirect the output of ack-grep to a file using the following command: ack-grep "some_regex" > file This command leads to an infinite loop (I guess), and the file keeps growing until the system runs out of disk space. Here's the…
Fábio Perez
  • 23,850
  • 22
  • 76
  • 100
3
votes
2 answers

Ack plugin inside the vim is not working

I'm getting following error inside vim while using Ack plugin: [ No Name] || ack-grep: Command not found. I have installed ack vim-plugin at the path ~/.vim/bundle/ack.vim. I have checked with :scriptnames, it shows me proper path. Added following…
Mandar Pande
  • 12,250
  • 16
  • 45
  • 72
3
votes
2 answers

How can I use ack to find files that contain two patterns?

I'm trying to search for files that contain 2 patterns. I'm guessing piping is the way to go but I'm doing something wrong, because the following doesn't work: ack -l "pattern1" | ack -l "pattern2" What am I missing?
mrtnmgs
  • 1,402
  • 14
  • 26
3
votes
1 answer

Vim: How to insert command into command history?

I have a mapping where I can select text and type (leader)av to ack for my visual selection with Ack.vim: " Visual ack, used to ack for highlighted text function! s:VAck() let old = @" norm! gvy let @z = substitute(escape(@", '\'), '\n',…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
3
votes
1 answer

ACK: Exclude specific paths (a dir and its subdirs) from search

With ACK 2.x, I can specify command line options to exclude certain dirs from showing up in results. For example, to exclude the directory 'test' I can use: ack -v -g 'test' | ack -x pattern ('test' can be a regex for dirs to exclude) I can also…
Gaia
  • 2,872
  • 1
  • 41
  • 59
3
votes
2 answers

Eclipse: Making Eclipse's "search in project" less unhelpful?

Eclipse's "find in project" took is, as far as I can tell, blindingly stupid. Let me illustrate. This is what I get when I run a "find in project": find in project http://img.skitch.com/20100312-qgpi9jwyyb6qudc656j1j1tne3.png And when I click to see…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
3
votes
4 answers

How can I use ack (preferably ack) or grep to search for a string in a list of files?

I want to search for a string "my-search-string" in any files called search-this-one.html In all subdirectories of my current working directory. I want a list of full paths of the files that contain this string. There are hundreds of files called…
chim
  • 8,407
  • 3
  • 52
  • 60
3
votes
3 answers

Using ack to search inside files with no extensions

I have some text "bar" contained in files FOO and foo.cc. Is there a way to tell ack-grep to search inside files with no extension (namely FOO)? I've tried something like this: ack-grep --type-set=foo=FOO bar which returns the text in foo.cc, but…
Felix
  • 2,064
  • 3
  • 21
  • 31
3
votes
1 answer

Ack: Using --add-type with v. 2.04

How do I add a new filetype to ack, with version 2.04 (ack-2.04-single-file). I am using the following command (Is there any way to search in filetypes not recognized by ack?), but I receive an error. $ ack --type-set=input=.i ack-2.04-single-file:…
slaughter98
  • 1,759
  • 14
  • 20
3
votes
1 answer

How can I exclude .min.css files from an ack-grep seach?

I've got the syntax of adding a new ack-grep filetype: $ ack-grep --type-add=min=.min.js,.min.css --help types | grep min --[no]min .min.js .min.css But the problem is that it doesn't seem to ever match any files, possibly because my…
Tom Viner
  • 6,655
  • 7
  • 39
  • 40
3
votes
3 answers

Why can't I run ack from the terminal after I switched from ubuntu to archlinux?

I just switch from ubuntu to archlinux and I installed ack-grep via pacman. However what I found is I can't run $ ack from terminal directy. I have to type $ perl ack , which is a pain...I wonder if anyone hve experienced similar situation and how…
pythoniku
  • 3,532
  • 6
  • 23
  • 30
3
votes
1 answer

Ack not recognizing resource file setting

I'm using ack to search through all source files including .c, .cpp, .h and another propriety format (lets call it .abc) and I've found that the following works fine: ack --type-add cc=abc text_to_look_for Which allows ack to treat .abc files as…
Component 10
  • 10,247
  • 7
  • 47
  • 64