1
0

ghqを使ったリポジトリ移動を高速化する

Last updated at Posted at 2023-12-12

fishを使っており、decors/fish-ghq をinstallしてリポジトリ移動をしていました。
ただ使っていて重いなあと感じていたので、下記の関数を使うようにして高速化しました。
Ctrl+gで呼び出す想定です。

function peco_select_ghq_repository
  set -l query (commandline)

  if test -n $query
    set peco_flags --query "$query"
  end

  find $(ghq root)/github.com/*/* -type d -prune | sed -e 's#'$(ghq root)'/##' | peco $peco_flags | read line

  if [ $line ]
    cd $(ghq root)/$line
    commandline -f repaint
  end
end

bind \cg peco_select_ghq_repository

参考: ghq + pecoが重くなったら

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0