Created
June 5, 2020 12:56
-
-
Save KageShiron/3b97d0b0af08acac392df8d376e83865 to your computer and use it in GitHub Desktop.
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_ghq | |
set selected_repository (ghq list -p | peco --query "$LBUFFER") | |
if [ -n "$selected_repository" ] | |
cd $selected_repository | |
echo " $selected_repository " | |
commandline -f repaint | |
end | |
end | |
function peco_select_ghq_online | |
if test (count $argv) = 0 | |
set peco_flags --null --layout=bottom-up | |
else | |
set peco_flags --null --layout=bottom-up --query "$argv" | |
end | |
set token (cat ~/.config/hub | yq -r '.[][0].oauth_token') | |
curl -u KageShiron:$token "https://api.github.com/user/repos" | | |
jq -r '.[] | if .private then "[🔑]\(.full_name)NULL-DELIMITER\(.full_name)" else .full_name end' | gsed "s/NULL-DELIMITER/\x0/g" | | |
peco $peco_flags | read foo | |
if [ $foo ] | |
ghq get $foo | |
end | |
end | |
function fish_user_key_bindings | |
bind \cr peco_select_history # Bind for prco history to Ctrl+r | |
bind \c] peco_select_ghq # Bind for prco history to Ctrl+] | |
alias cdg peco_select_ghq_online | |
end | |
source /usr/local/opt/asdf/asdf.fish | |
set -x GOPATH ~/s/ | |
set -x PATH $GOPATH/bin $PATH | |
set -x GO111MODULE on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment