ユーザー設定ファイルの保存場所

  • %AppData%/Code/User/

ユーザー設定

  • %AppData%/Code/User/settings.json
  • 1つのタブに相当するスペースの数

    "editor.tabSize": 2,
  • エディターで制御文字を表示する必要があるかどうかを制御します

    "editor.renderControlCharacters": true,
  • エディターで空白文字を表示する方法を制御します

    "editor.renderWhitespace": "all",
  • 自動整形(タイプ時, 貼り付け時, 保存時)

    "editor.formatOnType": false,
    "editor.formatOnPaste": false,
    "editor.formatOnSave": true,
  • 既定の文字セットエンコーディング

    "files.encoding": "utf8bom",
  • ファイルを開くときに文字セットエンコーディングを推測する

    "files.autoGuessEncoding": true,
  • 匿名関数の関数キーワードの後のスペース処理を定義します

    "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
  • pandoc .html output option template that you would like to use

    "pandoc.htmlOptString": "-s -t html5 -c <CSSファイル名> --toc",
  • PlantUML エクスポート先フォルダ

    "plantuml.exportOutDirName": ".",
  • PlantUML エクスポートフォーマット

    "plantuml.exportFormat": "svg",
  • Markdown-lint

    "markdownlint.config": {
      "no-trailing-spaces": {
        "br_spaces": 2
      },
      "line-length": false,
      "no-inline-html": {
        "allowed_elements": [
          "div",
          "span",
          "section",
        ]
      },
    },

キー設定

  • %AppData%/Code/User/keybindings.json
    [
      { /* タスクの実行 */
        "key": "shift+alt+t",
        "command": "workbench.action.tasks.runTask"
      },
      { /* 再帰的に折りたたむ */
        "key": "ctrl+shift+alt+[",
        "command": "editor.foldRecursively",
        "when": "editorTextFocus"
      },
      { /* 再帰的に展開する */
        "key": "ctrl+shift+alt+]",
        "command": "editor.unfoldRecursively",
        "when": "editorTextFocus"
      },
      { /* 対応する括弧へジャンプ (ctrl+shift+]) */
        "key": "ctrl+shift+oem_6",
        "command": "editor.action.jumpToBracket",
        "when": "editorTextFocus"
      },
    ]

グローバルタスク設定

  • %AppData%/Code/User/tasks.json
    {
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true,
        "panel": "shared"
      },
      "problemMatcher": [],
      "tasks": [
        {
          "label": "compile",
          "type": "shell",
          "group": "test",
          "command": "perl -c ${file}"
        },
        {
          "label": "test this",
          "type": "shell",
          "group": "test",
          "command": "perl ${file}"
        },
        {
          "label": "test all",
          "type": "shell",
          "group": "test",
          "command": "prove ${workspaceFolder}/t/"
        }
      ]
    }

ワークスペース設定

  • 各フォルダの .vscode/

Perl用

  • .vscode/tasks.json
    • 2.0.0
      {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "presentation": {
          "echo": true,
          "reveal": "always",
          "focus": true,
          "panel": "shared"
        },
        "problemMatcher": [],
        "tasks": [
          {
            "label": "compile",
            "type": "shell",
            "group": "test",
            "command": "perl -c ${file}"
          },
          {
            "label": "build",
            "type": "shell",
            "group": {
              "kind": "build",
              "isDefault": true
            },
            "command": "perl build/build.pl"
          }
        ]
      }
    • 0.1.0
      {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "0.1.0",
        "suppressTaskName": true,
        "showOutput": "silent",
        "tasks": [
          {
            "taskName": "compile",
            "command": "perl",
            "args": [
              "-c",
              "${file}"
            ]
          },
          {
            "taskName": "perltidy",
            "command": "perltidy",
            "args": [
              "${file}"
            ],
            "isShellCommand": true
          },
          {
            "taskName": "delete-bak",
            "command": "del",
            "args": [
              "*.bak"
            ],
            "isShellCommand": true
          }
        ]
      }

推奨拡張機能

  • .vscode/extensions.json
    {
      "recommendations": [
        "donjayamanne.githistory",
        "DotJoshJohnson.xml",
        "DougFinke.vscode-pandoc",
        "GrapeCity.gc-excelviewer",
        "ionutvmi.reg",
        "jebbs.plantuml",
        "joelday.docthis",
        "michelemelluso.code-beautifier",
        "mortenhenriksen.perl-debug",
        "ms-vscode.PowerShell",
        "sfodje.perltidy",
      ]
    }

メモ

拡張機能の保存場所

%UserProfile%/.vscode/extensions

PowerShell プロファイル

  • 統合ターミナルとなる PowerShell のプロファイルのパス
    %UserProfile%/Documents/WindowsPowerShell/Microsoft.VSCode_profile.ps1
  • 通常の PowerShell とプロファイルを共有
    cd %UserProfile%/Documents/WindowsPowerShell
    mklink Microsoft.VSCode_profile.ps1 Microsoft.PowerShell_profile.ps1

SSH-Agent

  • リモートリポジトリへのアクセスで毎回パスフレーズを要求されるのを回避する。

OpenSSH-Win64 を使用する

  • Chocolateyで OpenSSH をインストールする。
    > cinst -y -params /SSHAgentFeature openssh
  • git で使用する SSH を OpenSSH-Win64 に指定する。
    > git config --global core.sshCommand "'C:/Program Files/OpenSSH-Win64/ssh.exe'"
  • ユーザー設定で ssh コマンドのパスを指定する。(remote.SSH.path)
    Remote.SSH: Path
    C:/Program Files/OpenSSH-Win64/ssh.exe

Microsoft OpenSSH を使用する

  • SSH-Agent サービスの有効化
  • git で使用する SSH を Windows 版 OpenSSH に指定する。
    > git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
  • ユーザー設定で ssh コマンドのパスを指定する。(remote.SSH.path)
    Remote.SSH: Path
    C:/Windows/System32/OpenSSH/ssh.exe

*.vsix のダウンロード

リンク