1
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?

VS Code Markdown で貼り付け画像をファイルごとに整理する設定(2025年5月)

Last updated at Posted at 2025-05-06

VS Code Markdown で貼り付け画像をファイルごとに整理する設定(2025年5月)

はじめに

VS Code(バージョン: 1.99.3)の Markdown ノートで画像をコピペしたとき、ルートに画像の散乱が地味にストレス…
pasteImageの設定をしても、カレントに画像が保存されてしまうなど、プチハマりしていました:thinking:
拡張機能「pasteImage」は使わず、VS Code標準の設定だけでノートごとのフォルダに画像を整理


✔️ 手順

  1. 「pasteImage」拡張を無効化する

    • 拡張機能タブで「pasteImage」を検索 → 無効化
  2. VS Codeの設定を開く

    • macOS: ⌘ + ,
    • Windows: Ctrl + ,
  3. settings.json を編集
    以下を追加します👇

    "markdown.copyFiles.destination": {
      "**/*": "Assets/${documentBaseName}/${fileName}"
    }
    
    
    
  4. Markdown上で画像をコピペ → 自動で
    Assets/ノート名/画像ファイル名 に保存されるように🎉

✔️ 各パラメータの意味
• "**/*":全てのファイルを対象にする glob パターン
• ${documentBaseName}:拡張子を除いた Markdown ファイル名
• ${fileName}:貼り付けた画像のファイル名

おわりに

  • 代表的な機能拡張つかえばいいやって思ってしまったけど、VS Codeの標準機能もユーザニーズに合わせて追加させている!
    • 本体のアップデートは適時確認。プラグインが競合してたかも :speak_no_evil:
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?