2015/10/29

How to format C and C++ code in Sublime Text

How to format C and C++ code in Sublime Text

I am writing some C code on my mac using Sublime Text and I needed a quick way to format the code for better readability.

I found this package for Sublime Text named SublimeAStyleFormatter:

https://packagecontrol.io/packages/SublimeAStyleFormatter

I’ve installed it with git by going on the packages folder and cloning the git repo:

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone git://github.com/timonwong/SublimeAStyleFormatter.git


And that was it! I can format my C code by pressing Ctrl + Alt + F.

没有评论: