Skip to content

Instantly share code, notes, and snippets.

@CouldBeThis
Last active October 31, 2021 08:55
Show Gist options
  • Save CouldBeThis/85b1ce6d2fbaab889567a0cf48817c62 to your computer and use it in GitHub Desktop.
Save CouldBeThis/85b1ce6d2fbaab889567a0cf48817c62 to your computer and use it in GitHub Desktop.
🐌 file search

🐌 file search

interactive regex of file(s) contents

could use fzf to similar effect; I do not have it installed.

open interactive regex file contents search in current directory:

rg . | sk --regex

as above, adding the ability to select multiple (using shift + tab in interactive mode), then when finished, add selected files/lines to results.txt, preceeded by the final query:

rg . | sk --regex --multi --print-query >> results.txt

as above, but the search is already started with the text (?i)Categories.*. The (?i) preceeding the text makes it entirely case in-sensitive:

rg . | sk --regex --multi --print-query --query "Categories.*(?i)" >> results.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment