02c46ebea7
Folds the examples Section 5 carried but the headers did not into each function's `# EXAMPLE`, and moves the three lines that only looked like examples -- the two typo-abbreviation notes and rm's /usr/bin/rm fallback -- into `# NOTES`, the label already in use. Also corrects gi's synopsis, which omitted -l, and documents yt-dlp's --no-embed-thumbnail in `# ARGUMENTS`.
35 lines
892 B
Fish
35 lines
892 B
Fish
# Copyright (C) 2026 Rootiest
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# CATEGORY
|
|
# 01-file-and-directory
|
|
#
|
|
# SYNOPSIS
|
|
# rg [args...]
|
|
#
|
|
# DESCRIPTION
|
|
# Wraps ripgrep with --hyperlink-format=kitty when running inside Kitty
|
|
# terminal, enabling clickable file links in search results. Falls back
|
|
# to plain rg on other terminals.
|
|
#
|
|
# ARGUMENTS
|
|
# args... Arguments forwarded to ripgrep
|
|
#
|
|
# EXAMPLE
|
|
# rg "TODO" src/
|
|
# rg "fish_greeting" ~/.config/fish/
|
|
# rg -l "TODO" ~/projects/myapp
|
|
function rg --description 'alias rg=rg --hyperlink-format=kitty'
|
|
# Opinionated guard (C1): fall back to bare command rg when disabled.
|
|
if not __fish_config_op_enabled __fish_config_op_aliases
|
|
command rg $argv
|
|
return $status
|
|
end
|
|
|
|
if test "$TERM" = xterm-kitty
|
|
command rg --hyperlink-format=kitty $argv
|
|
else
|
|
command rg $argv
|
|
end
|
|
end
|