kota's memex

Ripgrep (or rg) recursively searches directories for a regex pattern while respecting your .gitignore.

It's much faster than git grep, ack, or gnu grep.

partial line context

Unfortunately, when searching files with super long lines (minified web shit) you get the whole line which isn't super useful. There's work on this: https://github.com/BurntSushi/ripgrep/issues/1352

In the meantime this works:

rgnc(){ Q="$1"; shift; rg --pretty --colors match:none -o ".{0,50}$Q.{0,50}" "$@" | rg --passthru "$Q" ;}