Aadarsh Patel
Aadarsh Patel

Reputation: 318

How to increase size of spaces in indentation?

My indentation are too thin. But I also don't want to use more than 2 spaces for indentation. Is there a way to increase the size?

Current view,

enter image description here

Expected View,

enter image description here

Upvotes: 2

Views: 1006

Answers (2)

Matt
Matt

Reputation: 1

Use the Stretchy Spaces extension.

Do you hate your project's indentation level and have a hard time reading your code? Then just stretch it to be what you want! You can expand or contract your indentation using this extension.

Note: This only works on files that are indented using spaces. If a file is indented using tabs, vscode can already change your tab size! It's built into the editor!

Upvotes: 0

tHeSiD
tHeSiD

Reputation: 5333

Since you aren't using any formatter type extension

You can set your indentation easily by selecting the indenting option in the status bar.

Indenting status bar

Indenting options

and then select the size you want.

If you want to globally have the same settings.

add these values to your settings.json

    "editor.tabSize": 4, //4 = 4 spaces
    "editor.detectIndentation": true, // this will auto detect whether your file is using spaces or tabs to indent. 
    "editor.insertSpaces": true, // Insert spaces when pressing Tab. This setting is overridden based on the file contents when #editor.detectIndentation# is on.

Upvotes: 1

Related Questions