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
5
votes
2 answers

Vim CommandT- like search for strings

Is there a way in vim to search (grep/ack etc..) for strings in files in a similar fashion like one would do in CommandT? So say that I invoke the search window. Possible matches for the string I wrote so far will start to show while I continue…
tUrG0n
  • 4,178
  • 3
  • 20
  • 26
5
votes
2 answers

Diagnosing a slow grep or ack search through a complex directory (code, files, php scripts, etc) for faster repeated use

I'm using ack (sometimes distributed as ack-grep) to search through a complex directory of code, images, who knows what else, and it's reacting pretty slowly. How can I diagnose what it is searching through that is making it slow, so that I can…
Kzqai
  • 22,588
  • 25
  • 105
  • 137
5
votes
2 answers

Search Jupyter notebook markdown cells from command line

I use ag to search through my notes. My notes are written down in Markdown files and Markdown cells contained within Jupyter notebooks. I can search the Markdown files conveniently with ag --markdown .... It would be very handy if something similar…
marnix
  • 1,210
  • 8
  • 12
5
votes
2 answers

ack|grep|whatnot special ignore folders pattern node_modules/dir/node_modules

I have recently discovered ack and ack -ir --ignore-dir={node_modules,dist,.git} works great for most things but this…
qballer
  • 2,033
  • 2
  • 22
  • 40
5
votes
3 answers

Using Ack.vim on visual selection

Currently I have this mapping in my ~/.vimrc noremap a :Ack which enables me to search for a word under the cursor. I would like to search for a current visual selection instead, because sometimes words are not enough. Is there…
shime
  • 8,746
  • 1
  • 30
  • 51
5
votes
2 answers

Unfamiliar shell syntax in ack-grep install script

From the ack installation page (http://betterthangrep.com/install/) there is a one-liner installation with curl: curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3 I understand that it's getting the file from the website…
sampson-chen
  • 45,805
  • 12
  • 84
  • 81
5
votes
1 answer

Best GNU Find Replacement

I'm looking for a better find. The reason is that the find user interface is unintuitive to me (in particular, the pruning / -print style) and difficult to wrap in a function due to strict requirements on argument ordering. locate / updatedb isn't…
Stephen Niedzielski
  • 2,497
  • 1
  • 28
  • 34
5
votes
3 answers

Bash - ack - limit length of matched line

Is there a way to limit the length of the line matched by ack? If ack matches, for example, a minified javascript file, the line it prints out can be very large. I still want it to show the highlighted match, but ideally with the line cut before and…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
4
votes
1 answer

ack - Binding an actual file name to a filetype

For me ack is essential kit (its aliased to a and I use it a million times a day). Mostly it has everything I need so I'm figuring that this behavior is covered and I just can't find it. I'd love to be able to restrict it to specific kinds of files…
sgargan
  • 12,208
  • 9
  • 32
  • 38
4
votes
2 answers

Search in all directories

I can't find out how to search in Vim in all directories with: grep ack findstring vimgrep p.e. search "search-item" in all .txt files in c:\ and d:\ (including sub directories) Can anyone help me?
Reman
  • 7,931
  • 11
  • 55
  • 97
4
votes
2 answers

Ack in shell mode in Emacs for Windows shows no output

After installing ack on Windows 7 64-bit (e.g. using StrawberryPerl), I can run ack from a cmd terminal in Windows. However, if I try using ack in Emacs in Shell mode (i.e. in a M-x shell buffer), I get not output (all other cmd commands print…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
4
votes
3 answers

How to escape double quotes and colon in ACK in PowerShell

I am using Ack version 2.04, in PowerShell. I want to search texts like "jsonClass":"Page" (quotes included) inside text files. I can't seem to get the quoting and escaping correct. ack -c --match '"jsonClass":"Page"' It doesn't work in PowerShell.…
sas1138
  • 338
  • 5
  • 16
4
votes
3 answers

Why do I get extra, unexpected results with my ack regex?

I'm finally learning regexps and training with ack. I believe this uses Perl regexp. I want to match all lines where the first non-blank characters are if ( !, with any number of spaces in between the elements. This is what I came up with: ^[…
Gauthier
  • 40,309
  • 11
  • 63
  • 97
4
votes
2 answers

How do I make ack ignore a file in a directory?

I have a file in a directory a/b/c.js I can't ignore c.js with --ignore-file=match:c.js because I want to match other file named c.js I can't ignore dir a/b with --ignore-dir=a/b because there are other files I care about in a/b I've…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
4
votes
3 answers

ack does not work when run from "grep-find" in Emacs on Windows

I'm trying to use ack-grep as a replacement for grep + find in Emacs on Windows, but ack-grep exits immediately (successfully) without printing any matches. I've tried just about every conceivable combination of command-line parameters to ack-grep,…
JesperE
  • 63,317
  • 21
  • 138
  • 197