Skip to content

Instantly share code, notes, and snippets.

@m-nakamura145
Created September 6, 2017 06:39
Show Gist options
  • Save m-nakamura145/b55d51be8dee05cb9126d3c6dc7bba22 to your computer and use it in GitHub Desktop.
Save m-nakamura145/b55d51be8dee05cb9126d3c6dc7bba22 to your computer and use it in GitHub Desktop.
peco_change_directory.fish
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