Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indent/format code in Visual Studio code on MAC

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!

like image 704
Steph8 Avatar asked Feb 02 '16 09:02

Steph8


People also ask

How do I indent code on VSCode?

I want to indent a specific section of code in Visual Studio Code: Select the lines you want to indent, and. use Ctrl + ] to indent them.

How do I indent multiple lines in VSCode Mac?

“how to indent multiple lines in vscode” Code Answer's you can also indent a whole section by selecting it and clicking TAB. and also indent backward using Shift + TAB.

How do I format a MAC code?

You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings. You can also display the Reformat File dialog with ⌥⇧⌘L (macOS), or Ctrl+Alt+Shift+L (Windows/Linux).


1 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:

  • MacOS
  • Windows
  • Linux

Another helpful command to achieve this might be: shift + option + f which is auto format.

like image 111
seN Avatar answered Oct 12 '22 19:10

seN