Skip to content

Instantly share code, notes, and snippets.

@susieyy
Created June 10, 2015 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save susieyy/3c4da08358c0f47f63cf to your computer and use it in GitHub Desktop.
Save susieyy/3c4da08358c0f47f63cf to your computer and use it in GitHub Desktop.
dotfiles/home/.config/fish/functions/peco_select_repository.fish
function peco_select_repository
if test (count $argv) = 0
set peco_flags --layout=bottom-up
else
set peco_flags --layout=bottom-up --query "$argv"
end
ghq list -p | peco $peco_flags | perl -pe 's/([ ()])/\\\\$1/g'| read foo
if [ $foo ]
eval cd "$foo"
else
commandline ''
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment