Created
September 6, 2017 06:39
-
-
Save m-nakamura145/b55d51be8dee05cb9126d3c6dc7bba22 to your computer and use it in GitHub Desktop.
peco_change_directory.fish
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 peco_change_directory | |
set -l query (commandline) | |
if test -n $query | |
set peco_flags --query "$query" | |
end | |
z -l | peco $peco_flags | awk '{ print $2 }' | read recent | |
if [ $recent ] | |
cd $recent | |
commandline -r '' | |
commandline -f repaint | |
end | |
end⏎ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment