環境
windows 10
Visual Stadio Code 1.40.2
内容
社内開発用と自宅開発用のVScodeを同期する方法とかあるのかな?
とりあえず方法を知らないので自分の環境を晒して自力で同じ状態にする
Settings
File→Preferences→Settings→右上のOpen Settings(JSON)をクリック
{
"editor.fontSize": 11,
"editor.renderWhitespace": "boundary",
"php.validate.executablePath": "C:\\php-7.3.11\\php.exe",
"php.validate.run": "onType",
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
"diffEditor.ignoreTrimWhitespace": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.fontFamily": "monospace",
"editor.cursorBlinking": "smooth",
"editor.fontFamily": "'Fira Code','Meiryo UI'",
"editor.fontLigatures": true,
"terminal.integrated.rendererType": "dom",
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"php.suggest.basic": false
}
"editor.fontSize": 11,
"editor.renderWhitespace": "boundary",
"php.validate.executablePath": "C:\\php-7.3.11\\php.exe",
"php.validate.run": "onType",
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
"diffEditor.ignoreTrimWhitespace": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.fontFamily": "monospace",
"editor.cursorBlinking": "smooth",
// プログラミング用フォント「Fira Code」を設定
"editor.fontFamily": "'Fira Code','Meiryo UI'",
// 合字(リガチャ)を有効化
"editor.fontLigatures": true,
// レンダタイプをDOMに変更(環境によっては早くなる)
"terminal.integrated.rendererType": "dom",
// ファイルのデフォルト改行コードをlfに指定
"files.eol": "\n",
// 不要スペースの削除
"files.trimTrailingWhitespace": true,
// 保存時にファイル最終行に空白行を付加
"files.insertFinalNewline": true,
// VSCodeデフォルトのサジェストを無効化(説明が衝突するため)
"php.suggest.basic": false
Extensions
Bracket Pair Colorizer 2
https://github.com/CoenraadS/Bracket-Pair-Colorizer-2
()や[]や{}を色分けして直感的にわかりやすくしてくれる
これが入っているとかっこ関連のsyntax errorが視認できる
Bracket Pair Colorizerの動作改良版
code-eol
https://github.com/sohamkamani/code-eol
改行コードがlfなら「↓」、crlfなら「↲」で表示されるようになる
ソースの改行コード統一はマナー
HTMLHint
https://github.com/Microsoft/vscode-htmlhint
HTMLを静的解析し要修正箇所を指示してくれます
indent-rainbow
https://github.com/oderwat/vscode-indent-rainbow
テンプレートなどはネストが深くなるので色ついていないとわかりづらいが
これでインデントが薄い虹色に色付けされて視認可能になります
Material Icon Theme
https://github.com/PKief/vscode-material-icon-theme
デフォルトのアイコンよりも特徴的なテーマ
ディレクトリも名称でアイコンが付くのでフォルダだらけの環境でも区別しやすい
PHP DocBlocker
https://github.com/neild3r/vscode-php-docblocker
「/**」入力で追記されるアノテーションの記述を補助してくれる
タイプヒンティングや返り値指定も自動で書いてくれる
PHP Intelephense
Trailing Spaces
行末やスペースのみやインデントの違うスペースが赤く表示されて目立つようになります