Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics Using Templates with Express Breaking Your Project’s Templates into Partials

Size of indentation

This is very random question, but on the video in VSCode he has indentation set as "Spaces:4". I have it set the same and in my document there are 4 spaces and in the video it looks rather like 2 spaces which is more readable and saves some space. How can I have a same look as in the video?

Just replace in VSCode preferences 4 with 2.

@Oksana Koyfman that is exactly what I am asking not to do as this is clearly not a solution, I want to keep my 4 spaces as he in the video. I thought there is some option to have indent shorter optically having 4 spaces.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Marcin,

Oksana is correct. The only way to do this is to change the tab size from 4 to 2.

This is overwritten when a file is opened or code is copy/pasted into the editor by the Detect Indentation flag in the settings. You can see in This Video that Andrew Drags-n-Drops code into the editor that has only 2 spaces indents, so 2 spaces is what will be used, regardless of what his editor is set to.

But simply, Oksana is right. If you want to only use 2 spaces, you are going to have to change the 4 to a 2 in your local editor. There is no "optically" option.

Keep coding! :) :dizzy:

ok, then I was wrong, thanks for explanation