Skip to content

Instantly share code, notes, and snippets.

@hyuki

hyuki/yet Secret

Last active February 18, 2022 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki/8752f17882b563034e4d89526a5a757e to your computer and use it in GitHub Desktop.
Save hyuki/8752f17882b563034e4d89526a5a757e to your computer and use it in GitHub Desktop.
yet - VS Codeで未処理ファイル中を検索するためのファイルをカレントディレクトリに作るコマンド
#!/usr/bin/env ruby
YET_FILE = 'yet.code-search'
pwd = Dir.pwd.sub(/^#{Dir.home}/, '~')
if not File.exists?(YET_FILE)
open(YET_FILE, "w") do |f|
f.puts <<-"EOD"
# Query: 未処理ファイル中の検索文字列
# Including: #{pwd}/*-yet-*
# ContextLines: 1
EOD
end
end
system("code #{YET_FILE}")
@hyuki
Copy link
Author

hyuki commented Feb 18, 2022

yetを実行するとyet.code-searchをVS Codeで表示する。なければ作る。

未処理ファイルのファイル名には-yet-を含めておく(123-mathgirl-yet-euler.txtのように)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment