LoginSignup
0
0

More than 3 years have passed since last update.

🆚【VScode】設定と拡張機能でPHP開発用に便利なやつ

Last updated at Posted at 2019-12-11

環境

windows 10
Visual Stadio Code 1.40.2

内容

社内開発用と自宅開発用のVScodeを同期する方法とかあるのかな?
とりあえず方法を知らないので自分の環境を晒して自力で同じ状態にする

Settings

File→Preferences→Settings→右上のOpen Settings(JSON)をクリック

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

}

↑の説明.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",
    // プログラミング用フォント「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

行末やスペースのみやインデントの違うスペースが赤く表示されて目立つようになります

0
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
0
0