My VS Code setup - Making the most out of VS Code

Originally published at deepu.tech.

Please follow me on Twitter for updates.

Visual Studio Code(I like the sound of VS Code better), I just love it. It is my primary IDE.

I always loved lightweight editors over IDEs. Many years ago I was using Eclipse for development and Notepad++ with some plugins for all other lightweight stuff. Then I discovered sublime text and was using it for a while. I still was finding Eclipse too heavyweight when I was doing web development. Then came Brackets from Adobe. It was a fairly nice editor especially for web development and I started using it heavily for web development. But Brackets was bit slow back then on a large codebase. Then came Atom which revolutionized the NodeJS desktop application landscape by introducing the Atom shell which ultimately became Electron. So I switched to Atom and loved its slick interface and nice pluggable features. It became my primary editor for all web development.

So Electron paved the way for VS Code and though at first, I was skeptical due to the association with Visual Studio, I tried it out and was amazed by its speed and user experience. There was no turning back now. I slowly started using VS Code for most of my day to day development, except for Java which I was using IntelliJ by now. Fast forward now below are the editor/IDE I use for development.

VS Code : JavaScript, TypeScript, EJS, HTML, CSS, Golang, Python, Ruby, Shell, Docker, Kubernetes, Terraform and everything in between including writing this blog post.

: JavaScript, TypeScript, EJS, HTML, CSS, Golang, Python, Ruby, Shell, Docker, Kubernetes, Terraform and everything in between including writing this blog post. IntelliJ Idea : Java, Scala, Kotlin (Though I use VS Code for minor edits and to read the code, etc)

: Java, Scala, Kotlin (Though I use VS Code for minor edits and to read the code, etc) VIM: For quick edits from the command line.

Plugins

Of course VS Code makes all this possible by allowing the use of plugins and there is a lot to choose from. Here are the plugins that I personally use to work on the above-said languages. You can use the code --install-extension command to install them from the terminal.

Language support

Based on the Languages you work with you can add syntax, utility and language support plugins for those. I use the below

Go

Go - Adds rich language support for Golang. > code --install-extension ms-vscode.Go

JVM

Language Support for Java - Adds Java language support. > code --install-extension redhat.java

Debugger for Java - Adds lightweight Java debugging support. > code --install-extension vscjava.vscode-java-debug

JHipster JDL - Adds syntax support for JHipster JDL files. > code --install-extension jhipster-ide.jdl

The Java support indeed is getting better and better, so I hope one day I can completely switch to VS Code.

Python

Language Support for Python - Adds Python language support, linting and debugging support. > code --install-extension ms-python.python

Cloud, Container & others

Theme

My default theme. Similar to VS Code default dark theme but has support for FiraCode and Operator Mono fonts. I personally use FiraCode.

code --install-extension idbartosz.darkpp-italic

A nice icon theme based on material icons.

code --install-extension PKief.material-icon-theme

Subtly changes the workspace color of your workspace. Helpful to identify when you have many windows open.

code --install-extension johnpapa.vscode-peacock

Tools

Automatically rename paired HTML/XML tags

code --install-extension formulahendry.auto-rename-tag

Marks matching bracket pairs with unique colors. This really makes reading code nicer

code --install-extension CoenraadS.bracket-pair-colorizer-2

Convert between different cases. Trust me this is so handy

code --install-extension wmaurer.change-case

Fairly useful for spell checking within code. Takes cameCase etc into account

code --install-extension streetsidesoftware.code-spell-checker

Useful to store re usable snippets.

code --install-extension tariky.easy-snippet-maker

Add support for EditorConfig.

code --install-extension EditorConfig.EditorConfig

Enable viewing Git history within VS Code.

code --install-extension donjayamanne.githistory

Makes it easy to work with .gitignore files.

code --install-extension codezombiech.gitignore

Hides patterns defined in .gitignore from the editors explorer.

code --install-extension npxms.hide-gitignored

Exclude stuff right from the explorer tree.

code --install-extension jcmordan.mark-as-excluded

Easily toggle between showing and hiding excluded files/folders.

code --install-extension eamodio.toggle-excluded-files

I have bad muscle memory so wanted to use the same keyboard shortcuts as IntelliJ. There are mappings available for Sublime, Atom and so on.

code --install-extension k--kato.intellij-idea-keybindings

Sorts JSON object keys.

code --install-extension richie5um2.vscode-sort-json

Adds an explorer panel for running tests. Supports multiple languages and testing frameworks.

code --install-extension hbenl.vscode-test-explorer

Aggregate TODO, FIXME, etc in a tree view in explorer.

code --install-extension Gruntfuggly.todo-tree

Terminal setup

If you are using Zsh shell with Oh-my-zsh like me as explained here, you might want to do the below to get the same terminal experience in the integrated VSCode terminal as well.

Follow these steps

Download and install a patched font.

On Linux, run fc-cache -f -v to refresh font cache.

to refresh font cache. On VSCode, open Preferences → Settings and click on the {} icon to open JSON mode and set the below

"terminal.integrated.shell.linux" : "/usr/bin/zsh" , "terminal.integrated.fontFamily" : "'SauceCodePro Nerd Font Mono','Source Code Pro'" , "terminal.integrated.rightClickCopyPaste" : true , "terminal.integrated.fontSize" : 14 , "terminal.integrated.cursorStyle" : "underline" , "terminal.integrated.cursorBlinking" : true

Replace linux with osx if you are on a Mac.

Conclusion

This might seem like too many plugins but on my configuration VS Code is lightning fast and loads up immediately and is faster then IntelliJ to load and work with. The beauty of VS Code is that you don't need all the plugin all the time, you can disable the ones not required per workspace to make it even faster.

Many people ask me why I use VS Code when I have IntelliJ and my answer have been always the same. IntelliJ is great but its also quite heavy. While all those advanced features are needed for Java, Scala or Kotlin development, VS Code is perfectly capable of giving a nice developer experience for lightweight languages like JS, TS, Go, Python, Rust, Ruby, etc.

As a regular user of both IntelliJ and VS Code, I prefer VS Code as much as possible. The user experience is much nicer for my taste. In fact, I like the developer experience in VS Code better for JavaScript, TypeScript, Web, Python, and Golang. Also switching between them for JVM projects and others don't feel weird for me as I have the same keyboard mappings for both. The only time I fire up IntelliJ these days is when I want to do full-fledged Java development. For everything else, I use VS Code.

I hope you find this useful. If you have any questions or if you think I missed something please add a comment.

If you like this article, please leave a like or a comment.

You can follow me on Twitter and LinkedIn.