Last active
March 28, 2019 03:37
-
-
Save tamuhey/0b7e3fc1c428c9acb983d066cd747b63 to your computer and use it in GitHub Desktop.
cd with peco for PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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