Code editors have evolved over the years. A few years ago, there was no Visual Studio Code (VS Code). You were probably using Sublime Text, Atom, Bracket, etc. But with the release of VS Code, it has become the favourite code editor of most developers. Why VS Code?Developers love it because
Now that you’ve seen the advantages of using VS Code, this article will cover VS Code setup and extensions needed when using VS Code for maximum productivity. TerminalYou can set up your terminal to use iTerm2 and ZSh and have your VS Code terminal setup to use that. After configuring Zsh, launch the VS Code integrated terminal 1naland run the command
or
to execute the content of the .zshrc configuration file in the shell. FontFiraCode looks cool because of the support for ligatures. Download and install FiraCode, then add it to your 2 file.
Launching from the command lineLaunching VS Code from the terminal looks cool. To do this, press CMD + SHIFT + P, type shell command and select Install code command in path. Afterwards, navigate to any project from the terminal and type 3from the directory to launch the project using VS Code.ConfigurationVS Code configurations not specific to a workspace are housed within the settings.json. You can configure VS Code to suit your preferences. To launch the settings.json, press
Copy and paste the code below within the settings.json file:
ExtensionsBelow are useful extensions that can improve your developer experience when working on a codebase. To access these extensions,
1. Auto ImportWith this extension, you don’t need to manually import files. If you are working on a component-based project, just go ahead and type the component name and it will be automatically imported. 2. Add jsdoc commentsThis adds a comments block to the code. To use it, highlight the first line of the function, press 5 and select Add Doc Comments.3. ESDoc MDNIn certain scenarios, we tend to forget how a particular thing works. This is where this extension becomes useful. You don’t need to launch your web browser to find out the syntax. All you need is to type
4. CSS PeekAs the name implies, this helps you peek on rules applied by a defined style within a codebase and its specificity. It comes in handy when working on legacy codebases. 5. GitLensGitLens boosts what you can achieve with Git. It helps you to do a lot more, such as seamlessly exploring Git repositories, peeking into code revisions, authorship and much more. 6. ESLintThis integrates ESLint into VS Code to lint your codes. The project you are working on needs to have ESLint installed either locally or globally to take advantage of the features this extension offers. To install ESLint locally, run
or globally using
You would also need to create 6 configuration file. If you installed ESLint locally, run
or
for global installation. 7. Debugger for ChromeThis lets you debug your JavaScript code right from the Google Chrome browser 8. Google FontsAdding Google fonts just got easier with this extension. You no longer need to search for fonts in the browser. To access a list of fonts, press 5 and search for Google fonts to proceed.9. TODO HighlightWith a lot to work on which needs to be prioritized, sometimes you may tend to forget tasks yet to be completed. TODO highlight makes these easily seen by highlighting them. 10. DockerYou can create Dockerfiles on the fly with this extension. It also provides syntax highlighting, intellisense and much more. Press CMD + SHIFT + P and search for Add Docker files to workspace. 11. Code SpellcheckerThis comes in handy to identify typographical errors within the codebase. 12. Import CostImport Cost shows the impact of imported packages within the code. It helps measure performance bottlenecks. 13. HTMLHintThis extension validates your HTML helping you to write standards-compliant code. 14. PeacockThis extension gives you the ability to change the colour of your workspace. It is ideal when you have multiple VS Code instances and you want to quickly identify a particular instance. After installing Peacock, click on the settings icon > settings, select workspace settings tab, click on {} and paste the code below. 0You can also add 8 and 9 to the affectedElements and add color customizations for them within the colorCustomizations section.To use one of the default colors, press CMD + SHIFT + P, type peacock and select your preferred theme. This overrides the color settings within the settings.json file defined for that workspace. 15. PrettierDo you always press the spacebar or tab key when coding? Here comes Prettier to the rescue. It formats lines of code and makes it readable. Check out the awesome things you can do with Visual Studio Code here. Feel free to drop what works for you in the comment section and share this article. Also, check out my blog for more articles. ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT If this article was helpful, tweet it. Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started |