Skip to content

Instantly share code, notes, and snippets.

@Aaron-212
Created December 25, 2024 09:15
Show Gist options
  • Select an option

  • Save Aaron-212/abf9f5d9e7f2bcecc00b3ffb16e85f3e to your computer and use it in GitHub Desktop.

Select an option

Save Aaron-212/abf9f5d9e7f2bcecc00b3ffb16e85f3e to your computer and use it in GitHub Desktop.
Nushell config for homebrew/homebrew-command-not-found
$env.config = {
# ...other config...
hooks: {
# ...other hooks...
command_not_found: {
|cmd_name| (
try {
let cmds = (brew which-formula $cmd_name)
if ($cmds | is-empty) {
return null
} else {
return (
$"(ansi $env.config.color_config.shape_external)($cmd_name)(ansi reset) " +
$"may be found in the following brew formulae:\n($cmds)"
)
}
}
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment