Update:
Not sure what happened to my Visual Studio Code installation, but removing and re-installing the application (via homebrew) fixed the problem. Shift - Option - F once again formats code!
I'm struggling to format code in Visual Studio Code on MAC OSX El Capitan.
For some reason the default key binding ('Shift + Option + F') does not work. I also no longer have the option to format code via the 'Command + Shift + P', and entering '>format code'. In fact, '>format code' isn't even an option in the list anymore.
This used to work, but I am not sure what changed.
'Shift + Option + F' does do something though, it makes a ' ̰' character appear that results in some weird cursor behaviour (not sure how else to describe it) when moving over characters adjacent to the ' ̰' character.
Additional information:
VSCode – Code Formatting Shortcuts The code formatting is available in Visual Studio Code (VSCode) through the following shortcuts or key combinations: On Windows Shift + Alt + F. On macOS Shift + Option + F. On Linux Ctrl + Shift + I.
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.
I came from Windows to Mac as a newbie, expecting the most basic things like code formatting would work with Shift+ALt+F as it does on Windows. But naturally, it didn't. The problem was, Keyboard - Input Source (Default in India - [ABC - India]) doesn't capture Shift+Alt+F, which was evident in the "Command Palette: Developer: Toggle Keyboard Shortcuts Troubleshooting"
Solution:
It's happening from time to time in my mac and if I just restart VScode it works again. Give it a try before reinstalling it the next time
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With