This content originally appeared on CodeSource.io and was authored by Anik Kanti Sikder Mithu
Indentation in vs code is used to format your code. In this tutorial, you are going to learn how to fix indentation in Vscode.
The code formatting is available in Visual Studio Code through the following shortcuts:
On Windows: Shift + Alt + F
On Mac: Shift + Option + F
On Linux: Ctrl + Shift + I
Alternatively, you can find the shortcut, as well as other shortcuts, through the ‘Command Palette’ provided in the editor with Ctrl +Shift+ P (or Command + Shift + P on Mac), and then search for format document. On windows-
You can format the code in vscode using the tabs and using the spaces. To do that, vscode shows the indentation settings of your current file in the status bar at the bottom. Like this-
If you click on the Tab Size, this will show-
If you want indentation using tabs, just click on it and specify the number of tabs.
By default, it is configured to 4 means each tab is being treated as four characters wide.
You can do the same for using the indentation using spaces.
The other way to convert indentations manually is, to click into the status bar again and you can use two options. Convert Indentation to Spaces and Convert Indentation to Tabs.
This will convert your indentation directly. So, these are the ways, you can fix indentation in vscode.
This content originally appeared on CodeSource.io and was authored by Anik Kanti Sikder Mithu
Anik Kanti Sikder Mithu | Sciencx (2022-02-02T17:57:43+00:00) How to fix Vscode indentation. Retrieved from https://www.scien.cx/2022/02/02/how-to-fix-vscode-indentation/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.