BATGREP(1)

πŸ“¦ version 2024.08.24, in arch rolling

πŸ’– NAME πŸ’–

batgrep β€” Quickly search through and highlight files using ripgrep. That's the whole vibe, bestie. This is BATGREP(1) from the General Commands Manual, and we're about to break it all the way down. 🫢

✨ DESCRIPTION ✨

Okay so here's the tea: batgrep searches through files or directories looking for matching regular expressions (or fixed strings with -F), and prints the output using bat for an easy and syntax-highlighted experience. πŸ’…βœ¨

It's giving "search but make it pretty," and honestly? Obsessed. πŸŽ€

🫢 USAGE 🫢

batgrep [OPTIONS] PATTERN [PATH...]

That's the shape of it: options first, then the pattern, then the paths. Slay. 🌸

πŸ’… OPTIONS πŸ’…

🌸 Options this script handles itself 🌸

  • -i, --ignore-case β€” use case insensitive searching. It's not gonna be picky about uppercase vs. lowercase, bestie. πŸ¦‹
  • -s, --case-sensitive β€” use case sensitive searching. Exact-case energy only. πŸ’…
  • -S, --smart-case β€” use smart case searching. The smartest little search vibe. ✨
  • -A, --after-context=[LINES] β€” display the next n lines after a matched line. Peek after the match, periodt. πŸ‘€
  • -B, --before-context=[LINES] β€” display the previous n lines before a matched line. Peek before the match, no cap. πŸŽ€
  • -C, --context=[LINES] β€” a combination of --after-context and --before-context. Both sides, bestie. 🫢
  • -p, --search-pattern β€” tell pager to search for PATTERN. Currently supported pagers: less. 🧚
  • --no-follow β€” do not follow symlinks. Leave those links where they are. 🚫
  • --no-snip β€” do not show the snip decoration. This is automatically enabled when --context=0 or when bat --version is less than 0.12.x. πŸŽ€
  • --no-highlight β€” do not highlight matching lines. This is automatically enabled when --context=0. πŸ’…
  • --color β€” force color output. Make it pop. 🌈
  • --no-color β€” force disable color output. Monochrome mode activated. πŸ–€
  • --paging=["never"/"always"] β€” enable/disable paging. You either page or you don't, bestie. πŸ“–
  • --pager=[PAGER] β€” specify the pager to use. Put your fave in charge. 🫢
  • --terminal-width=[COLS] β€” generate output for the specified terminal width. Fit the vibe to your window. πŸ“
  • --no-separator β€” disable printing separator between files. No little divider moment. βœ‚οΈ
  • --rga β€” use ripgrep-all instead of ripgrep. A whole different search bestie. πŸ”₯

πŸ¦‹ Options passed directly to ripgrep πŸ¦‹

The following options are passed directly to ripgrep, and are not handled by this script. That's the rule, no cap. 🫢

  • -F, --fixed-strings β€” passed straight through to ripgrep; no extra note in the table. πŸ¦‹
  • -U, --multiline β€” passed straight through to ripgrep; no extra note in the table. 🌸
  • -P, --pcre2 β€” passed straight through to ripgrep; no extra note in the table. ✨
  • -z, --search-zip β€” passed straight through to ripgrep; no extra note in the table. πŸŽ€
  • -w, --word-regexp β€” passed straight through to ripgrep; no extra note in the table. πŸ’…
  • --one-file-system β€” passed straight through to ripgrep; no extra note in the table. 🌈
  • --multiline-dotall β€” passed straight through to ripgrep; no extra note in the table. ⭐
  • --ignore / --no-ignore β€” passed straight through to ripgrep; no extra note in the table. πŸ™ˆ
  • --crlf / --no-crlf β€” passed straight through to ripgrep; no extra note in the table. πŸ“
  • --hidden / --no-hidden β€” passed straight through to ripgrep; no extra note in the table. πŸ‘€
  • -E, --encoding β€” passed straight through to ripgrep. ⚠️ This is unsupported by bat, and may cause issues when trying to display unsupported encodings. 😭
  • -g, --glob β€” passed straight through to ripgrep; no extra note in the table. 🧚
  • -t, --type β€” passed straight through to ripgrep; no extra note in the table. πŸ’œ
  • -T, --type-not β€” passed straight through to ripgrep; no extra note in the table. πŸ¦‹
  • -m, --max-count β€” passed straight through to ripgrep; no extra note in the table. πŸ”₯
  • --max-depth β€” passed straight through to ripgrep; no extra note in the table. 🌸
  • --iglob β€” passed straight through to ripgrep; no extra note in the table. πŸŽ€
  • --ignore-file β€” passed straight through to ripgrep; no extra note in the table. ✨

πŸŽ€ CAVEATS πŸŽ€

Differences from ripgrep, bestie:

  • --follow is enabled by default for batgrep. πŸ‘€
  • Not all the ripgrep options are supported. Periodt. πŸ’…

That's the whole BATGREP(1) page from the General Commands Manual, bestie. 🫢 The footer vibe is just BATGREP(1) again, and there's no separate source/version/date line to copy in the original, so we're not inventing one β€” periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from