i'm trying to indent my code in visual studio code. I searched and i found that ctrl + F + K should be work, but it doesn't. I tried cmd + k + f too, but it still not working. I hope you can help me!
18 Answers
Updated December 21, 2017: as pointed out by Fabio, on mac it should be: ⌘ + ]
On Windows: indent control is ctrl + ]
A good way to find commands is by navigating to: Code -> Preferences -> Keyboard Shortcuts
Also, the Visual Studio Code team provided those handy shortcut pdfs:
Another helpful command to achieve this might be: shift + option + f which is auto format.
5 Comments
⌘ ] (not control)] on my Macbook (16" M1 Pro, Monterey 12.3). But Shift+Option+F worked.The shortcut to format code on Visual Studio for Mac Community Edition is Ctrl + i
3 Comments
Ctrl + i, nothing happens.(edited on 4th Jan 2023: the answer below still remains the same, in version 1.74.2, Nov 2022)
For visual studio code version 1.36.1 (2019)

To auto-format the selection, use ⌘K ⌘F (the trick is that this is to be done in sequence, ⌘K first, followed by ⌘F).

To just indent (shift right) without auto-formatting, i.e., blindly indent, use ⌘]

As indicated in Visual Studio Code's Keyboard Shortcuts (⌘K ⌘S, or from the menu as shown below)

4 Comments
The shortcut is:
Option Shift F 1 Comment
For me, the Input Source was English India.
So, Option + Shift + F resulted in showing ̰
After changing the Input Source to English I was able to format the code using the above shortcut.
2 Comments
cmd + A + cmd + K + cmd + F
this worked for me.
All I do is to hold "cmd" and then press A, K, and F one by one.
1 Comment
Only Ctrl + I for me worked. Everything else hasn't worked.
1 Comment
By below steps you can update your preference (2024)
- Click on code > settings > Keyboard Shortcuts
- On the search box write the format and add key binding for the "Format Document" row



Control + i, but if you had VS for Windows scheme selected, it won't work (then I think the shortcut isControl + Shift + F).