new commands
This commit is contained in:
@@ -14,3 +14,10 @@ alias dk=docker_kill_fzf
|
|||||||
alias zs='nvim ~/.zshrc'
|
alias zs='nvim ~/.zshrc'
|
||||||
alias sz='source ~/.zshrc'
|
alias sz='source ~/.zshrc'
|
||||||
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
|
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
|
||||||
|
alias ghb='gh browse'
|
||||||
|
alias ghs='gh status'
|
||||||
|
alias ghl='gh pr list'
|
||||||
|
alias ghw='gh pr view --web'
|
||||||
|
alias prs='select_and_open_pr'
|
||||||
|
alias pr='select_and_open_pr_web_only'
|
||||||
|
alias e='exit
|
||||||
|
|||||||
@@ -30,4 +30,27 @@ fzf-cd-widget() {
|
|||||||
local dir
|
local dir
|
||||||
dir=$(find ${1:-.} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir"
|
dir=$(find ${1:-.} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir"
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select_and_open_pr() {
|
||||||
|
local pr_info=$(gh pr list --state open --json number,title | jq -r '.[] | "\(.number) \(.title)"' | fzf -1)
|
||||||
|
|
||||||
|
if [[ -n "$pr_info" ]]; then
|
||||||
|
local pr_number=$(echo "$pr_info" | awk '{print $1}')
|
||||||
|
gh pr checkout "$pr_number"
|
||||||
|
gh pr view --web
|
||||||
|
else
|
||||||
|
echo "No PR selected."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
select_and_open_pr_web_only() {
|
||||||
|
local pr_info=$(gh pr list --state open --json number,title | jq -r '.[] | "\(.number) \(.title)"' | fzf -1)
|
||||||
|
|
||||||
|
if [[ -n "$pr_info" ]]; then
|
||||||
|
local pr_number=$(echo "$pr_info" | awk '{print $1}')
|
||||||
|
gh pr view --web
|
||||||
|
else
|
||||||
|
echo "No PR selected."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user