Skip to content

Instantly share code, notes, and snippets.

@bradphelan
Created February 14, 2019 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradphelan/f3141cd1b2605ddb29ca50c61bd7e722 to your computer and use it in GitHub Desktop.
Save bradphelan/f3141cd1b2605ddb29ca50c61bd7e722 to your computer and use it in GitHub Desktop.
# Trigger fuzzy search
Set-PSReadlineKeyHandler `
-Chord 'Ctrl+s' `
-BriefDescription "InsertHeatseekerPathInCommandLine" `
-LongDescription "Run Heatseeker in the PWD, appending any selected paths to the current command" `
-ScriptBlock {
$choices = [IO.File]::ReadAllText($(Resolve-Path .hscache)) | hs
$ps::Insert($choices -join " ")
}
# Rebuild cache
Set-PSReadlineKeyHandler `
-Chord 'Ctrl+Alt+s' `
-BriefDescription "RebuildHeatseekerPathInCommandLineCache" `
-LongDescription "Rebuilds the heatseaker cache" `
-ScriptBlock {
Get-ChildItem -Name -Attributes !D -Recurse > .hscache
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment