VSCode Change Vertical Guide Line Indentation

Viewed 1491

I changed my VSCode settings to define a tab as 4 spaces, as opposed to the default 2 spaces. How do I make the vertical guide lines appear on every 4 spaces, as opposed to 2? Please see screenshot below.

enter image description here

2 Answers

Open a .js file and in the status bar (at the bottom of the screen) you will find a button that says

Spaces: 2

Once you click on it, you get a menu at the top of the screen which has a button

change view

Click on it and you will be able to select the tab size for the file.

To change the setting globally, go to File -> Preferences -> Settings, search for 'tabSize' and click on Edit in settings.json. Then in the settings.json file set "editor.tabSize" to 4 and save.

I'm using VSCode and that's what solved the issue here

1- create a prettier.config.js file and among the options, make sure to have these here:

module.exports = {
    tabWidth: 4,
    tabs: true,
    // other options...
}

2- Open the options bar (cmd + shift + P) and select "Developer: Reload window" to reload the IDE.

Related