Skip to content

Instantly share code, notes, and snippets.

@tamuhey
Last active March 28, 2019 03:37
Show Gist options
  • Save tamuhey/0b7e3fc1c428c9acb983d066cd747b63 to your computer and use it in GitHub Desktop.
Save tamuhey/0b7e3fc1c428c9acb983d066cd747b63 to your computer and use it in GitHub Desktop.
cd with peco for PowerShell
function _cd (){
pushd $args[0]
echo $(resolve-path $args[0]) >> ~\.cd-hist
echo $(gc ~\.cd-hist -tail 300) > ~\.cd-hist
}
set-alias -n cd -v _cd -Option AllScope
function peco-cd () {
_cd $(cat $HOME\.cd-hist | peco --initial-filter Fuzzy --layout bottom-up)
}
set-psreadlinekeyhandler -key ctrl+f -scriptblock { peco-cd }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment