diff --git a/fish/functions/ghpr.fish b/fish/functions/ghpr.fish new file mode 100644 index 0000000..f3f8b78 --- /dev/null +++ b/fish/functions/ghpr.fish @@ -0,0 +1,5 @@ +# Search and preview GitHub pull requests +function ghpr + set -l GH_FORCE_TTY 100% + gh pr list | fzf --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down --header-lines 3 | awk '{print $1}' | xargs gh pr checkout +end diff --git a/zsh/zshrc b/zsh/zshrc index db7648a..5c37183 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -115,6 +115,11 @@ function update () { sudo softwareupdate -i -a } +# Search and preview GitHub pull requests +function ghpr () { + GH_FORCE_TTY=100% gh pr list | fzf --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down --header-lines 3 | awk '{print $1}' | xargs gh pr checkout +} + # Set a different icon for Kitty terminal function replaceKittyLogo () { cp ~/Dropbox/Software/Kitty/kitty-icon/kitty-dark.icns /Applications/kitty.app/Contents/Resources/kitty.icns