Skip to content

Commit

Permalink
Add shortcut to launch ghq repository selection
Browse files Browse the repository at this point in the history
  • Loading branch information
yuk1ty committed Jan 10, 2024
1 parent 7d08877 commit db044b1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dot_zshrc
Expand Up @@ -72,6 +72,19 @@ function select-history() {
zle -N select-history
bindkey '^r' select-history

# Search GitHub repositories

fzf-src () {
FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS} --reverse --height=50%"
local repo="$(ghq list --full-path --exact | fzf --preview="exa --tree --level=2 {1}")"}
local dir=${repo}
[ -n "${dir}" ] && cd "${dir}"
zle clear-screen
}

zle -N fzf-src
bindkey '^g' fzf-src

# Load machine-specific config
if [[ -f ~/.zshrc.local ]]; then
source ~/.zshrc.local
Expand Down

0 comments on commit db044b1

Please sign in to comment.