mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
23 lines
693 B
Fish
23 lines
693 B
Fish
function gho
|
|||
|
|
set -l vaults ~/Documents/Obsidian/Personal ~/Documents/Obsidian/Walletbase ~/Documents/Obsidian/Research
|
||
|
|
|
||
|
|
set -l selection (ghq list | fzf --prompt="repo: " --tiebreak=end \
|
||
|
|
--bind "tab:transform:if test \"\$FZF_PROMPT\" = 'repo: '
|
||
|
|
echo 'change-prompt(vault: )+reload(printf %s\n $vaults)'
|
||
|
|
else
|
||
|
|
echo 'change-prompt(repo: )+reload(ghq list)'
|
||
|
|
end")
|
||
|
|
or return
|
||
|
|
|
||
|
|
# Vault entries are absolute paths; ghq entries are host/user/repo
|
||
|
|
if string match -q '/*' -- $selection
|
||
|
|
cd $selection
|
||
|
|
else
|
||
|
|
cd (ghq root)/$selection
|
||
|
|
end
|
||
|
|
|
||
|
|
clear
|
||
|
|
if test -d .git
|
||
|
|
onefetch
|
||
|
|
end
|
||
|
|
end
|