DEV Community

Cover image for 💻My Web Development VS Code Settings, theme, Extensions, tips and tricks
Michael "lampe" Lazarski
Michael "lampe" Lazarski

Posted on • Edited on

💻My Web Development VS Code Settings, theme, Extensions, tips and tricks

I have been using a lot of editors and IDE's since I began programming.
Eclipse, Netbeans, Notepade++, Brackets Editor, Sublime Text 2, Sublime Text 3, Webstorm, Atom Editor and probably some more I forgot.

Currently, I'm using Visual Studio Code. According to google trends, it is also the most searched editor. There are some excellent reasons for that.

  • vs code feels fast. It is tough to get vs code to slow down. Usually, it is not the fault of vs code but a poorly implemented extension.

  • File search is super fast. It feels instant. Like there is no wait time.

  • It is lightweight but also has most of the things you need pre-installed. Search files, debugging, basic git GUI.

  • Nice theme support and customization support. You can pretty much change everything in vs code.

  • Excellent extensions! Think of an extension you need? Yeah vs code has that!

Okay, enough of praising. An editor is as good as the user that knows that editor! I assume you have installed vs code.

Theme, File icons, and Font-family

You will look at vs code for several hours every day.

Theme

I don't have the glow enabled and I did not add the custom CSS.

File icons

Simple icons is a minimalistic clean icon theme that has strong colors and clear icons so you can find the file you need even faster.

Font

It looks clean to me and has ligatures support.
My config (we will learn later how to set this config):

    "editor.fontFamily": "Hasklig, Consolas, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "editor.fontSize": 15,
Enter fullscreen mode Exit fullscreen mode

Extensions

This should be built-in into every editor! Have you ever had code where you didn't know where your { started and it then } ended?
Then this extension is what you need! It will give every { or ( a different color, so it is easier to look at the code.

This adds diffrent colors to every indent tab or space you do.
This also helps you to navigate your code faster.

.env Files are common these days and are used in a lot of projects. vs code out of the box does not have syntax highlighting support for these file type. This extension adds support for that.

Also, a must-have for every developer that has performance and speed in mind. It shows you how much in kb it would cost you to import this npm module or anything you can import.

This, for me, is a killer feature! Do you connect to your development environment over SSH? Do you use a docker container? Or do you use WSL? This extension makes it extremely easy to use all of them. The best part, even over SSH the search and opening of a file are not slower! This is like magic! I love this extension!

This replaces Intellisense. It is like Intellisense with AI-backed in. The tab-completion shows you the most used functions or parameters that other people use, so you have the most used on the right on top. This makes you more efficient!

This adds direct eslint support into vs code, and it helps you to fix your eslint problems. Also a must-have.

Settings

I'm not using the UI version of the settings interface. I rather like to use the JSON version. To open that press CTRL+SHIFT+P and then type open settings JSON. This will open the settings.json file, and you can edit it like any other JSON file.

Making the cursor stylish

    "editor.cursorBlinking": "smooth",
    "editor.cursorSmoothCaretAnimation": true,
    "editor.cursorStyle": "block",
Enter fullscreen mode Exit fullscreen mode

The first line will make the cursor blink a little bit mor smooth with a fade-in-out animation.
The second line will animate the movement of the course, so it feels a little bit more natural.
The thrid line will change the appearance of the cursor to a block so you can find it more comfortable.
Now your cursor looks way better!

Making the font more readable

    "editor.fontFamily": "Hasklig, Consolas, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "editor.fontSize": 15,
Enter fullscreen mode Exit fullscreen mode

As described before I'm using the Hasklig font. Also, I like to have Ligatures; it makes the code more readable. I don't have perfect eyesight. So I like the font to be a little bit bigger.

Copy and Paste code

    "editor.formatOnPaste": true,
Enter fullscreen mode Exit fullscreen mode

We all copy and paste some code from the internet. So this setting will also format it on paste.

Make the vertical guidelines visible

    "editor.renderIndentGuides": true,
Enter fullscreen mode Exit fullscreen mode

If you have a long function with a lot of indentation, this will help you to navigate your code easier.

Disable telemetery

    "telemetry.enableTelemetry": false,
Enter fullscreen mode Exit fullscreen mode

Even when I use vscode-insiders, I don't need to send my data to Microsoft. So I disable that

See tabs that have been modified

    "workbench.editor.highlightModifiedTabs": true,
Enter fullscreen mode Exit fullscreen mode

Unsaved files have that big dot where the x if you did not save. This will also add a line on the top of the tab.

Tipps and Tricks

Using WSL

WSL or windows subsystem for Linux is a fantastic way to run Linux on Windows and have access to the Linux development experience that for me is way better than the one on windows.
I don't want to install git under windows and also not things like nodejs. There is a pretty nice way to integrate the git version of your wsl Linux into vs code. You need to download WSLGIT and then put the exe file in a nice place and add the following line to your vs code settings:

    "git.path": "D:\\dev\\wslgit.exe",
Enter fullscreen mode Exit fullscreen mode

Also vs code has an integrated terminal. You can open that terminal with ctrl+\`. We also want to have a bash in vs code so we can add the following line:

    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
Enter fullscreen mode Exit fullscreen mode

This tells vs code to use the default wsl linux shell. In my case, it is Ubuntu, which comes with bash.

Use the command pallet

I often see people clicking around to find settings or other features in vs code. Usually, it is easier just to type what you want. For this vs code has the command pallet. Just press CTRL+SHIFT+P. This will open the command pallet, and you can just type what you want!
If you don't want to press SHIFT, then you can just press CTRL+P and type a >, if this is faster for you. CTRL+P is also useful to find a file you need.

Reopen your latest closed file

Just press CTL+SHIFT+T. This will reopen the latest closed window. You can press this is multiple times to open multiple windows. This also works in your browser if you closed a tab that you don't want to ;)

Delete a complete word

This is not vs code specific, but sometimes I can hear people pressing the backspace key as fast as they can to delete a word. Please just press CTRL+BACKSPACE. This will delete the whole word.

Delete a complete line

Sometimes you want to delete the complete line. Just press CTRL+X. This will delete the currently selected line completely.

The end

Do you use vs code? What is your must-have extension?
Did I miss some crucial settings? Is some shortcut missing? Please comment down below!

Thanks for reading!

Say Hallo! Instagram | Twitter | LinkedIn | Medium | Twitch | YouTube

Oldest comments (104)

Collapse
 
unknownfea profile image
Daniel Millier

Great tips! My top extension would be AutoSync. Makes a backup gist of your settings & extensions on GitHub, so it's easy to download to a fresh install of VS Code!

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Yeah, I used that too.

The interface and the UX of that extension is just a pain for me 🤣.

I would love to see something nicer and easier to use.

Collapse
 
crewsycrews profile image
🎲Danil Rodin🎲

It's already got user friendly interface with last updates, check it!) You won't be disappointed. Creating a new backup on clean installation can be done in two clicks

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

Okay, I will then check it out!

Collapse
 
whatjackhasmade profile image
Jack Pritchard

This is a dope setup, thanks for sharing!

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Thank you very much :)

Collapse
 
pantsme profile image
Antonio Savage

I'd like to add that ctrl+X is actually the keyboard shortcut for Cut. You can then use crtl+V to paste the line you just cut somewhere else.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Yeah, but in vs code if you don't have anything selected it will cut the complete line!

Collapse
 
pantsme profile image
Antonio Savage

ahh cool, good to know.

Collapse
 
craigaholliday profile image
Craig Holliday

Great post! I’m definitely going to try these out later 👌👌

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Thank you!
Tell me what you liked the most and what you didn't liked?

Collapse
 
craigaholliday profile image
Craig Holliday

The cursor style is subtle but great!

I'll be trying Synthwave theme though I've been using and enjoying Night Owl for a while now.

Disabling telemetry is smart. Didn't know this was an option and I always like sending my data 👍

I'll have to check out Remote Development sometime but I don't do much remote file editing with any of my projects.

Also mentioning ESLint I use WesBos' config and I can't give it enough praise.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

Usually I add eslint to the project and then go with the style of the project. 😊👍

Collapse
 
adusoft profile image
Geofrey Aduda

I love it

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Thank you very much :)

Collapse
 
petecapecod profile image
Peter Cruckshank

I've got to have Code Spell Checker, and Auto-Close & Auto-Rename.
Plus I've been using Fira Code iScript as my font. And I'm loving it It's on GitHub at Fira Code iScript

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Looks nice I will try it!

Collapse
 
bybruno profile image
Bruno A.

Wow, I use many of these extensions and settings quoted in the article. There are some that I did not know and will be useful to me. Thanks for sharing.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Your welcome!

Which on you didn't know?

Collapse
 
juanitomint profile image
Juan Ignacio Borda

Nice article! Don't forget git graph!

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I'm old school when it comes to git. I use it in the terminal 🤣

Collapse
 
dietertroy profile image
Troy

Love that theme, almost as much as .. SOLARIZED DARK <3

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

But just almost 🤣🤣

Collapse
 
masticore252 profile image
Albert Vásquez • Edited

Great guide!

here is another tip: to delete a line on VS Code you can also use ctrl+shift+k

ctrl + x cuts the line, this might be a problem if you have text in your clipboad that you want to paste later, which happens to me often enough to make a change to a 3-key shortcut

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

There are so many more shortcuts. Maybe I should write just a post about how to use vs code with keyboard shortcuts 🤔

Collapse
 
nazmifeeroz profile image
Nazmi

or dd in Vim Mode!

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

yeah, vim mode is in vs code by default!

My problem is I never got used to it :)