なんというか cat ~/.bash_history | rg hello みたいなことをやりたかっただけ。 ripgrep 前提。
function Search-History($query)
{
Get-Content (Get-PSReadLineOption).HistorySavePath | rg $query
}
これで Search-History next とかですると、 next を含んだコマンドが表示される。
おしまい。
なんというか cat ~/.bash_history | rg hello みたいなことをやりたかっただけ。 ripgrep 前提。
function Search-History($query)
{
Get-Content (Get-PSReadLineOption).HistorySavePath | rg $query
}
これで Search-History next とかですると、 next を含んだコマンドが表示される。
おしまい。