Skip to content

Commit

Permalink
feat(pr): add alt-y keybinding to copy branch name
Browse files Browse the repository at this point in the history
Resolves #24
  • Loading branch information
benelan committed Jun 11, 2024
1 parent 534ee01 commit 07a85db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ that can be used with any `gh fzf` command:
- `alt-d`: Show the diff for the selected PR (see `gh pr diff --help`)
- `alt-r`: Start/continue/finish a review for the selected PR
(see `gh pr review --help`)
- `alt-y`: Copy the branch name of the selected PR
- `alt-l`: Open `gh fzf label` and add the selected label(s) to the PR
- `alt-L`: Open `gh fzf label` and remove the selected label(s) from the PR
- `alt-R`: Mark the selected draft PR as "ready for review"
Expand Down
5 changes: 4 additions & 1 deletion gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pr_cmd() {

# keybinding hints {{{2
pr_header="Actions > (enter: edit) (alt-o: checkout) (alt-d: diff) (alt-c: comment) (alt-r: review) (alt-l: add labels)
> (alt-C: checks) (alt-M: merge) (alt-R: ready) (alt-X: close) (alt-O: reopen) (alt-L: remove labels)
> (alt-C: checks) (alt-M: merge) (alt-R: ready) (alt-y: copy branch) (alt-X: close) (alt-O: reopen) (alt-L: remove labels)
Filters > (alt-a: assignee) (alt-A: author) (alt-b: branch) (alt-s: state=all)
$global_binds
Expand All @@ -295,6 +295,9 @@ $global_binds
--bind="start:$on_start" \
--bind="ctrl-o:execute-silent(gh pr view --web {1} $repo_flag &)+refresh-preview" \
--bind="ctrl-y:execute-silent(gh fzf util copy-url pr {1})+refresh-preview" \
--bind="alt-y:execute-silent(
gh pr view --json 'headRefName' -q '.headRefName' {1} $repo_flag | $GH_FZF_COPY_CMD
)+refresh-preview" \
--bind="enter:execute(gh pr edit {1} $repo_flag)+refresh-preview" \
--bind="alt-c:execute(gh pr comment {1} $repo_flag)+refresh-preview" \
--bind="alt-d:execute(gh pr diff {1} $repo_flag)+refresh-preview" \
Expand Down

0 comments on commit 07a85db

Please sign in to comment.