Visual Studio Code設定メモ

## Extensions
- PHP
 - [PHP Extension Pack](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-pack)
 - [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug)
 - [PHP Intelisence](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense)

- View側
 - [Smarty](https://marketplace.visualstudio.com/items?itemName=imperez.smarty)
 - [Sass](https://marketplace.visualstudio.com/items?itemName=robinbentley.sass-indented)
 - [SVG Viewer](https://marketplace.visualstudio.com/items?itemName=cssho.vscode-svgviewer)

- 多言語ファイル
 - [gettext](https://marketplace.visualstudio.com/items?itemName=mrorz.language-gettext)

- インデント、改行コード、全角スペース他
 - [Whitespace+](https://marketplace.visualstudio.com/items?itemName=davidhouchin.whitespace-plus)
 - [indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)
 - [zenkaku](https://marketplace.visualstudio.com/items?itemName=mosapride.zenkaku)
 - [code-eol 2019](https://marketplace.visualstudio.com/items?itemName=jeff-hykin.code-eol)

- エディタの機能追加・設定
 - [Japanese Language Pack for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=MS-CEINTL.vscode-language-pack-ja)
 - [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager)
 - [Local History](https://marketplace.visualstudio.com/items?itemName=xyz.local-history)
 - [vscode-icons](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons)
 - [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)

- コードフォーマッター
 - [Beautify](https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify)
 - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)



## 改行コードを変更する
```JSON:settings.json設定例
{
   "files.eol": "\n"
}
```
### 参考 : 
- VS Codeで改行コードを変更するには
 - https://www.atmarkit.co.jp/ait/articles/1809/14/news025.html


## タブインデント、空白を表示させる設定
```JSON:settings.json設定例
{
    "editor.insertSpaces": false,
    "editor.renderWhitespace": "all"
}
```
### 参考 : 
- VS Codeで空白文字を一目で分かるように表示するには
 - https://www.atmarkit.co.jp/ait/articles/1809/21/news024.html
- VS Code でドキュメントの空白文字を見やすくしてみる
 - https://qiita.com/satokaz/items/cb45d82f6f8f1e24c0d6

## インデント幅を言語毎に指定する
```JSON:settings.json設定例
{
    "[javascript]": {
      "editor.tabSize": 2
    },
    "[html]": {
        "editor.tabSize": 4
    }
}
```
### 参考 : 
- VSCodeでプログラム言語ごとの設定を行う
 - https://blog.katsubemakito.net/vscode/change-indent-width-by-language
- Visual Studio Codeで言語ごとにインデント設定を行う方法
 - https://webbibouroku.com/Blog/Article/vsc-lang-setting


## Smartyのデリミタを変更

*やったこと*
*blockComment*  `["{", "}"],`  =>  `[ "<{*", "*}>" ]` へ修正
*brackets* `["{", "}"],` =>   `["<{", "}>"],` へ修正
*autoClosingPairs* , *surroundingPairs* に `["<{", "}>"],` を追加


`C:\Users\<USER NAME>\.vscode\extensions\imperez.smarty-0.3.0\smarty.configuration.json`

```json:smarty.configuration.json設定例
{
	"comments": {
		// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
		"blockComment": [ "<{*", "*}>" ]  // [ "{*", "*}" ]から変更
	},
	// symbols used as brackets
	"brackets": [
		["<{", "}>"],  // ["{", "}"],から変更
		["[{", "}]"],
		["[", "]"],
		["(", ")"]
	],
	"autoClosingPairs": [
+		["<{", "}>"],
		["{", "}"],
		["[", "]"],
		["(", ")"],
		["\"", "\""],
		["'", "'"],
		["`", "`"]
	],
	"surroundingPairs": [
+		["<{", "}>"],
		["{", "}"],
		["[", "]"],
		["(", ")"],
		["\"", "\""],
		["'", "'"],
		["`", "`"]
	]
}
```

### 参考 : 
- VSCode(Visual Studio Code)のSmarty拡張機能でデリミタを変更する方法
 - http://ghost.ug6.jp/vscodenosmarty-extensiondederimitawobian-geng-surufang-fa/
- VS Code 1.27 の新機能 - 自動閉じ括弧、自動括弧囲い機能の設定追加
 - https://qiita.com/12345/items/f10cca3cbfe4ba2f05f8

## *.tplなどでEmmet(Html/CSSの入力補完)を効かせる

```JSON:settings.json設定例
    "emmet.includeLanguages": {
        "smarty": "html"
    },
```
### 参考 : 
- [VSCode]HTMLファイル以外でもEmmetを使えるようにしたい！
 - https://qiita.com/nisihunabasi/items/a8bdd01ab7fababf845c

## 自動アップデートを無効化する方法

`C:\Users\<ユーザー名>\AppData\Roaming\Code\User\settings.json`

```json:settings.json設定例
{
    "update.channel": "none"
}
````
### 参考 :
- VS Codeの自動更新を有効化／無効化するには
  - https://www.atmarkit.co.jp/ait/articles/1810/05/news016.html