2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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で叩く

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

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

.sh
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?