Unable to format code in VSCode on MacOS using shortcut (solved)

I use VSCode as the preferred IDE always. I usually use the keyboard shortcut Option + Shift + F to format the code.

I recently installed VSCode on a new Mac and this shortcut to format code in VSCode was not formatting the code but instead entering a weird character  ̰

I tried many things to fix this issue by tweaking the shortcut preferences but nothing worked. Finally I found the solution to this issue!

The issue was that I had set English – India as the input language while setting up Mac. Apparently English – India [ABC – India] doesn’t capture Option + Shift + F command so it wasn’t formatting the document.

So I had to change the language to English – US and then the keboard shortcut to format document in VSCode started working.

System Preferences -> Keyboard -> Input Sources (tab) -> Change to English – US

unable to format code in vscode using shortcut

If it still doesn’t work even after changing the language to English – US then remove English – India from the list completely in Input sources of keyboard preferences.

Cheers!

Ranjith kumar
5 4 votes
Article Rating
Subscribe
Notify of
guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Nancy
Nancy
2 years ago

great it helped me

3nz0
3nz0
2 years ago

thankss!!, worked so well