Skip to content

Instantly share code, notes, and snippets.

@poychang
Forked from doggy8088/settings.json
Last active August 29, 2019 09:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poychang/095621b4dfeb5cbd2b2ca210b0999be0 to your computer and use it in GitHub Desktop.
Save poychang/095621b4dfeb5cbd2b2ca210b0999be0 to your computer and use it in GitHub Desktop.
Poy Chang 的 VSCode 使用者設定檔

editor

  • "editor.minimap.enabled": true
    • 在捲軸上開啟 MiniMap 功能。
  • "editor.minimap.renderCharacters": false
    • 如果開啟 MiniMap 的話,預設會顯示實際字元 (字超小),根本看不清楚。
    • 將這個設定關閉,就會改顯示彩色區塊而已,這會讓 VSCode 反應速度更快。

files

  • "files.autoSave": "onWindowChange"
    • 離開視窗焦點時自動儲存
  • "files.autoGuessEncoding": true 猜測檔案編碼
    • 解決 VS Code 不支援判讀檔案是 ASCII 編碼的問題
  • "files.defaultLanguage": "markdown"
    • 設定預設文件語言類型
    • 想要把 VS Code 當作預設的 Markdown 編輯器,一定不能錯過這個設定
  • "files.insertFinalNewline": true 新增一行作為檔案結束
    • 開發 Python 時建議開啟(PEP 8)

others

  • "explorer.openEditors.visible": 0
    • 已開啟的編輯器會讓每次開檔/關檔的時候,檔案總管的檔案清單上下位置晃動,以致於眼球需要經常重新定位,分散注意力。
    • 由於已經有「頁籤」可以看已開啟的檔案,用 Ctrl+E 也可以快速找檔案,所以已開啟的編輯器就沒那麼有實用價值了。
  • "workbench.iconTheme": "vscode-simpler-icons"
    • 所以改用簡易版的檔案圖示佈景主題,讓畫面簡潔。
  • "window.titleBarStyle": "custom" 讓你的 VSCode 變得漂亮一點 :)

git

  • "git.autofetch": true
    • 讓 VSCode 在背景自動執行 git fetch
  • "git.enableSmartCommit": true
    • 如果所有變更都還沒有 git add ( Stage ) 的話,預設會自動全部 Commit,不會再先問過。
  • "git.confirmSync": false
    • 當要同步 Git 遠端儲存庫時,不需要再提問。

language

  • "typescript.referencesCodeLens.enabled": true
    • 開啟超好用的 Code Review 工具,CodeLens。
  • "tslint.autoFixOnSave": true
    • 自動修復所有能修復的 TSLint 問題
  • "html.suggest.angular1": false
  • "html.suggest.ionic": false
    • 不寫 AngularJS 1.x 與 Ionic 的人,建議可以把內建的 Code Snippets 關閉。
  • "[html]": { "editor.autoIndent": false }
    • 在 HTML 貼上 <pre> 區段時,這個設定會導致 <pre> 標籤內的內容也被自動縮排,導致格式亂掉。
    • 建議關閉 HTML 的自動縮排功能。

extension

  • "auto-rename-tag.activationOnLanguage": [ "html", "xml", "php" ]
    • 因為 Auto Rename Tag 擴充套件非常好用,但預設會自動套用在所有檔案格式,這會帶來一些麻煩。
    • 例如在 JS/TS 檔案中剛好改到有 < 的內容時,會導致程式被改壞,所以建議限制特定檔案才需要這個功能。
  • "csharp.format.enable": false
    • VSCode 內建的 C# Formatter 太弱,建議用 C# FixFormat 擴充套件。
  • "prettier.singleQuote": true
    • 這是使用 Prettier 擴充套件一定要設定的!
{
"editor.fontFamily": "'editor.fontFamily": "FiraCode, 'Source Code Pro', Consolas, 'Microsoft JhengHei', 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.renderIndentGuides": true,
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.formatOnSave": false,
"editor.wordWrap": "on",
"files.autoGuessEncoding": true,
"files.defaultLanguage": "markdown",
"files.insertFinalNewline": true,
"explorer.openEditors.visible": 0,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.experimentalTextureCachingStrategy": "dynamic",
"workbench.iconTheme": "vscode-simpler-icons",
"window.titleBarStyle": "custom",
"git.autofetch": true,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"typescript.referencesCodeLens.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"tslint.enable": true,
"tslint.autoFixOnSave": true,
"html.suggest.angular1": false,
"html.suggest.ionic": false,
"[html]": {
"editor.autoIndent": false
},
"files.associations": {
"*.csproj": "msbuild"
},
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags": true,
"todohighlight.include": [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.html",
"**/*.php",
"**/*.css",
"**/*.scss",
"**/*.cs"
],
"auto-rename-tag.activationOnLanguage": [
"html",
"xml",
"php"
],
"csharp.format.enable": false,
"csharpfixformat.style.enabled": true,
"csharpfixformat.style.spaces.beforeParenthesis": false,
"csharpfixformat.style.braces.onSameLine": false,
"csharpfixformat.style.newline.elseCatch": true,
"docker.languageserver.diagnostics.instructionJSONInSingleQuotes": "warning",
"prettier.singleQuote": true,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"movets.skipWarning": true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment