---
title: "Indent/format code in Visual Studio code on MAC"  
description: "Indent/format code in Visual Studio code on MAC"  
author: "Steilla Mitchel"  
published: 2023-07-19  
updated: 2023-07-19  
canonical: https://www.mindstick.com/forum/159163/indent-format-code-in-visual-studio-code-on-mac  
category: "visual studio"  
tags: ["visual studio", "mac", "format"]  
reading_time: 2 minutes  

---

# Indent/format code in Visual Studio code on MAC

Indent/[format code in Visual](https://www.mindstick.com/forum/159160/how-do-you-auto-format-code-in-visual-studio) [Studio code](https://www.mindstick.com/forum/159438/how-to-connect-tfs-in-visual-studio-code) on [MAC](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer)

## Replies

### Reply by Aryan Kumar

Sure, here are the steps on how to indent/[format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) in [Visual Studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) Code on Mac:

1. Open the Visual Studio Code app.
2. Open the code file you want to indent/format.
3. Select the lines of code you want to indent/format.
4. Press **Shift + Option + F**.

This will indent the selected lines of code according to the default settings. You can also use the following keyboard shortcuts to indent/format code in Visual Studio Code:

- **Ctrl + ]** to indent the selected lines of code one level.
- **Ctrl + [** to unindent the selected lines of code one level.
- **Shift + Alt + F** to auto-format the selected lines of code.

You can also use the following commands to indent/format code in Visual Studio Code:

- **Command Palette** > **Format Document**
- **Right-click** > **Format Selection**

If you want to change the default indentation settings, you can do so in the Visual Studio Code settings. To do this, open the **Settings** menu and select **Preferences** > **Settings**. In the settings editor, search for the "editor.tabSize" and "editor.insertSpaces" settings. The "editor.tabSize" setting controls the number of spaces that are inserted when you press the Tab key. The "editor.insertSpaces" setting controls whether Visual Studio Code should insert spaces or tabs when you indent code.


---

Original Source: https://www.mindstick.com/forum/159163/indent-format-code-in-visual-studio-code-on-mac

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
