Skip to content

Instantly share code, notes, and snippets.

@awilkins
Created July 5, 2024 09:38
Show Gist options
  • Save awilkins/ffa58988e6af6f8ab9e27c7fa1b74655 to your computer and use it in GitHub Desktop.
Save awilkins/ffa58988e6af6f8ab9e27c7fa1b74655 to your computer and use it in GitHub Desktop.

Tools for Finding Natural Stuff

General Text Finding

rzf script

This is a helper script that uses fzf and bat as preview tools for rg

This is the script here in the fzf docs ; I've put this at ~/.local/bin/rzf but anywhere on your path will do.

Natural Specific

  • Natural.sublime-syntax
    • This will let bat syntax highlight Natural sourcecode files
    • Put this in $(bat --config-dir)/syntaxes
    • Then do bat cache --build

Examples

Finding Transaction Codes

You want to find them with a word-break either side, so we'll use the Regex \b sequence, which finds zero-width breaks between runs of "word" characters.

e.g.

rzf '\bTCR\b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment