Sublime Text as the text editor of my choice for Front End Web Dev work (and to draft these blog posts). I wanted to try a different text editor (FOMO, next cool thing, need more fun … whatever) and decided to try Visual Studio Code or VS Code. This post is my VS Code setup guide.
VS Code is made by the makers of OneNote (which I adore), and it has good reviews from other dev folks. It is also free and has an extensive extensions market. In addition to the installation, in this guide, I list some of the many extensions to improve productivity from the get go and to try to replicate some features I loved in Sublime Text.
Here is the set of links I followed for setup, configuration and customization.
ES Lint: ESLint Integrates ESLint into VS Code. You need to have installed ESLint first.
npm install eslint
CSS Auto Prefix: Auto-prefixes certain attributes in CSS.
Style Lint: Modern CSS/SCSS/Less linter.Enable the linter, while disabling the built-in CSS and SCSS linter. Go to File > Preferences > Settings and add the following to settings.json:
{ "stylelint.enable": true, "css.validate": false, "scss.validate": false }
HTML CSS Support: CSS support for HTML documents.
HTML Snippets: Full HTML tags including HTML5 Snippets.
HTML Boilerplate: A basic HTML5 boilerplate snippet generator.
Gulp Snippets: Gulp JS Snippets for Visual Studio Code.
Git Extension Pack: Popular Visual Studio Code extensions for Git. Contains the following extensions:
information, file & blame history explorers, and commands to compare changes.
These extensions are specific to Polymer – a JavaScript library that helps you create custom reusable HTML elements, and use them to build performant, maintainable
apps.
These are additional changes to the editor settings to make life easier. Go to File > Preferences > Settings and add the following lines to your settings.json file
Change tab size from 4 spaces (default) to 2 spaces.
{ "editor.tabSize": 2 }
Enable word-wrap – if you are crazy like me.
{ "editor.wordWrap": "on" }
Enable the minimap to quickly navigate long files.
{ "editor.minimap.enabled": true }
Show white spaces outside words
{ "editor.renderWhitespace": "boundary" }
Enable formatting on typing and pasting.
{ "editor.formatOnType": true, "editor.formatOnPaste": true }
Enable copying the current line when Ctrl+C is pressed without any selection. – Enabled by default!
Enable Files Auto-Save
{ "files.autoSave": "afterDelay", "files.autoSaveDelay": 8000 }
Enable Polymer to analyze the whole package, though it’s slower:
{ "polymer-ide.analyzeWholePackage": true }
The settings.json file now looks like
// Place your settings in this file to overwrite the default settings
{
"workbench.iconTheme": "vs-nomo-dark",
"workbench.colorTheme": "Kary Foundation - Light",
"editor.fontFamily": "Hasklig, Menlo, Monaco, 'Courier New', monospace",
"editor.fontWeight": "500",
"editor.fontSize": 15,
"editor.fontLigatures": true,
"terminal.integrated.fontLigatures": true,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.minimap.enabled": true,
"editor.renderWhitespace": "boundary",
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"terminal.integrated.fontFamily": "Hasklig, Menlo, Monaco, 'Courier New', monospace",
"stylelint.enable": true,
"css.validate": false,
"scss.validate": false,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 8000,
"polymer-ide.analyzeWholePackage": true
}
May 10, 2017