LoginSignup
2
0

More than 3 years have passed since last update.

git grep -l 'hoge' して取得した対象ファイルをvscodeで一気に開くワンライナー

Posted at

コマンドを叩く前に必要なこと

  1. vscodeのダウンロード
  2. code のインストール

1. vscodeのダウンロード

vscode持ってない人はダウンロード(そもそもvscodeユーザー向けの内容だけど一応)

2. code のインストール

この記事が参考になりそう。
便利なので入れましょう。

コマンド

以下をCLIで叩く

git grep -l 'hoge' | xargs -I % code %

自分はgrep結果をさらにgrepしたりしたかったので

git grep -l 'hoge' | grep 'hoge' | xargs -I % code %

のようにして開いた。超便利。

2
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
2
0