Created
June 10, 2015 11:20
-
-
Save susieyy/3c4da08358c0f47f63cf to your computer and use it in GitHub Desktop.
dotfiles/home/.config/fish/functions/peco_select_repository.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_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