VS Code の拡張機能・設定 (2023/12/06 時点)
現時点での VS Code (Visual Studio Code) で利用している拡張機能や設定をメモしておきます。 以下の環境を前提にしています。
- macOS Sonoma 14.2
- VSCode 1.84.2
拡張機能¶
- Code Spell Checker
- Draw.io Integration
- GitHub Theme
- Markdown Preview Github Styling
- Material Icon Theme
- Python
- Ruff
- XML
- YAML
- indent-rainbow
- markdownlint
- vscode-input-sequence
markdownlint で無視したいルール¶
以前に書いた VSCode の markdownlint プラグインを特定ルールを無視する設定を行う でも触れていますが、markdownlint では「チェック対象外にしたいルール」を設定することが可能です。
私の場合は で下記のルールはチェックさせない方が使い勝手が良く感じます。
その為、これらを無視するように設定します。
Code Spell Checker で日本語を無視する¶
Code Spell Checker を使うことで「英単語のスペルミス」をチェックすることが出来ます。 ですが、日本語などの 2 バイト文字を処理させると意図した通りに動作しないケースがあるようです。 その為、以下のように「2 バイト文字は無視し、チェック対象にしない」ように設定します。
vscode-input-sequence で連番入力する¶
連番を入力する際は vscode-input-sequence が便利です。 しかし、気がついたら「式を入力しても意図した連番が生成されない」ようになってしまいました… この問題は以下を設定することで解決しました。
連番を入力したい場合、「値を入力した部分」をマルチカーソルで選択してから Cmd+Option+0 を押し、式を入力します。 式は以下の通りです。
<start> <operator> <step> : <digit> : <radix>
| 値 | 必須 | 任意 | デフォルト値 | 説明 |
|---|---|---|---|---|
| start | ◯ | "" |
開始する数字を指定します。 | |
| operator | ◯ | + |
連番を生成する際の演算子を指定します。 + または - を指定します。 |
|
| step | ◯ | 1 |
増減値を指定します。 | |
| digit | ◯ | 0 |
桁数を指定します。 桁数に足りない場合はゼロ詰め表示されます。 | |
| radix | ◯ | 10 |
基数を指定します。 例えば 2 を指定すると 2 進数で表示します。 |
設定サンプル¶
settings.json¶
{
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint",
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true
}
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll.ruff": true,
"source.organizeImports.ruff": true
}
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"cSpell.ignoreRegExpList": [
"[0-9A-Za-zぁ-んァ-ヶ亜-熙纊-黑]+"
],
"editor.copyWithSyntaxHighlighting": false,
"editor.cursorBlinking": "phase",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorStyle": "block",
"editor.cursorWidth": 3,
"editor.detectIndentation": false,
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.guides.bracketPairs": true,
"editor.guides.bracketPairsHorizontal": true,
"editor.insertSpaces": false,
"editor.minimap.enabled": false,
"editor.wordWrap": "on",
"explorer.compactFolders": false,
"files.defaultLanguage": "markdown",
"hediet.vscode-drawio.resizeImages": null,
"markdown-preview-github-styles.darkTheme": "dark_high_contrast",
"markdownlint.config": {
"MD034": false,
"MD040": false
},
"redhat.telemetry.enabled": false,
"security.workspace.trust.untrustedFiles": "open",
"sequence.replaceSelection": true,
"workbench.colorTheme": "GitHub Dark Default",
"workbench.iconTheme": "material-icon-theme",
"workbench.reduceMotion": "on"
}
keybindings.json¶
以前に書いた VS Code で「単語削除」にショートカットを割り当てる で触れていますが、Cmd+W で単語を削除出来るように設定します。