最終更新日: 2026-08-02
TOP(About this memo)) > 一覧(VSCode) > 設定
setting と入力すると、上記のJSON、あるいはUIで開くことができる(もちろん直接ファイルを開いてもよい)。
.vscode/settings.json に入れている(IME)。必要に応じて以下の手順でワークスペース単位の設定ファイルを作成する。
mkdir .vscode && touch .vscode/settings.json
.gitignoreに.vscode以下を追加しておく。
{
"files.autoSave": "afterDelay", // 自動保存
// 開いたときのウィンドウの初期サイズ
"window.newWindowDimensions": "maximized",
"editor.fontSize": 14, // デフォルトの文字サイズが大きすぎるため変更
//"editor.cursorSurroundingLines":100,//カーソルが常に真ん中になる
"editor.wordWrap": "on", // 長い行を折り返して表示する
"editor.minimap.renderCharacters": false, // ミニマップに文字ではなく色のブロックを表示し、軽量化する
"diffEditor.ignoreTrimWhitespace": false, // 差分表示で行末等の空白差分も無視せず表示する
"security.workspace.trust.untrustedFiles": "open", // ワークスペースの信頼確認なしでファイルを開けるようにする
// ターミナルがデフォルトで1000行までしか保存しないための設定
"terminal.integrated.scrollback": 10000,
// デバッグ時のツールバーを固定表示するための設定
"window.commandCenter": true,
"debug.toolBarLocation": "commandCenter",
"zenMode.hideLineNumbers": false, // 行番号は隠さない
"extensions.ignoreRecommendations": true, // 拡張機能のおすすめ通知を表示しない
// Git
"git.openRepositoryInParentFolders": "never",
"git.ignoreLegacyWarning": true,
// translate
"vscodeGoogleTranslate.preferredLanguage": "Japanese",
"editor.rulers": [100], // 100文字目に縦のガイド線を表示する
// ターミナルパネルのデフォルト表示位置
"workbench.panel.defaultLocation": "right",
"[jsonc]": {
"editor.formatOnSave": true, // 保存時に自動フォーマット
"editor.formatOnType": true, // 入力時に自動フォーマット
"editor.codeActionsOnSave": {
"source.fixAll": "explicit", // 保存時にlintの自動修正を行う
"source.organizeImports": "explicit" // 保存時にimportを整理する
},
"editor.defaultFormatter": "esbenp.prettier-vscode" // フォーマッタにPrettierを指定
},
"javascript.preferGoToSourceDefinition": true, // 右クリックで「Go to Source Definition」を選ばなくても、デフォルトのジャンプ動作がソース定義になる
"typescript.preferGoToSourceDefinition": true, // TypeScriptでも同様にデフォルトのジャンプ動作をソース定義にする
"[javascript][typescript][typescriptreact]": {
// 保存時・タイプ時に自動的にフォーマットされる
"editor.formatOnSave": true,
"editor.formatOnType": true,
// 拡張のPrettierをインストールしている必要がある
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit", // 保存時にlintの自動修正を行う
"source.fixAll.eslint": "explicit", // 保存時にESLintの自動修正を行う
"source.organizeImports": "explicit", // 保存時にimportを整理する
"source.addMissingImports": "explicit" // 保存時に不足しているimportを自動追加する
}
}
// SQL
// 下記を指定してみたが、フォーマットされなかったため、エクステンション無しではできないと考えられる(IME)。
// "[sql]": {
// "editor.formatOnSave": true,
// "editor.codeActionsOnSave": {
// "source.fixAll": "explicit",
// },
// },
}
/Users/***/Library/Application Support/Code/logs/
.vscode/settings.jsonが開かれる。