SublimeAStyleFormatter
C/C++/C#/Java code formatter/beautifier with AStyle.
Details
Installs
- Total 156K
- Win 90K
- Mac 30K
- Linux 36K
Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 4 | 6 | 11 | 17 | 9 | 20 | 11 | 0 | 0 | 20 | 22 | 11 | 13 | 11 | 16 | 12 | 14 | 19 | 6 | 12 | 13 | 8 | 19 | 18 | 23 | 16 | 14 | 12 | 17 | 26 | 24 | 19 | 13 | 9 | 14 | 25 | 9 | 16 | 18 | 13 | 23 | 17 | 10 | 8 | 10 | 16 |
Mac | 2 | 0 | 1 | 2 | 5 | 3 | 4 | 0 | 0 | 3 | 6 | 5 | 6 | 0 | 5 | 6 | 4 | 4 | 4 | 6 | 3 | 1 | 7 | 4 | 5 | 4 | 5 | 5 | 3 | 5 | 2 | 6 | 7 | 4 | 3 | 4 | 3 | 8 | 14 | 6 | 3 | 3 | 3 | 8 | 6 | 3 |
Linux | 1 | 0 | 3 | 7 | 6 | 5 | 1 | 0 | 0 | 2 | 2 | 3 | 3 | 3 | 3 | 2 | 7 | 4 | 3 | 5 | 4 | 7 | 2 | 6 | 4 | 8 | 3 | 3 | 5 | 7 | 5 | 1 | 6 | 3 | 3 | 3 | 3 | 4 | 1 | 4 | 2 | 3 | 4 | 4 | 4 | 9 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text 2 & 3 AStyle Formatter Plugin
Description
SublimeAStyleFormatter is a simple code formatter plugin for Sublime Text. It provides ability to format C, C++, Cuda-C++, OpenCL, Arduino, C#, and Java files.
NOTE: Syntax files required to be installed separately for Cuda-C++ and OpenCL.
Donation
If you find my work useful, please consider buying me a cup of coffee, all donations are much appreciated :)
Installation
With the Package Control plugin
The easiest way to install SublimeAStyleFormatter is through Package Control.
Once you have Package Control installed, restart Sublime Text.
- Bring up the Command Palette (Ctrl+Shift+P on Windows and Linux. ⌘+⇧+P on OS X).
- Type “Install” and select “Package Control: Install Package”.
- Select “SublimeAStyleFormatter” from list.
The advantage of using Package Control is that it will keep SublimeAStyleFormatter up to date.
Manual Install
Without Git:
Download the latest source code, and extract it to the Packages directory.
With Git:
Type the following command in your Sublime Text 2 or Sublime Text 3 Packages directory:
git clone git://github.com/timonwong/SublimeAStyleFormatter.git
The “Packages” directory is located at:
Sublime Text 2
- Windows:
%APPDATA%\Sublime Text 2\Packages
- Linux:
~/.config/sublime-text-2/Packages/
- OS X:
~/Library/Application Support/Sublime Text 2/Packages/
Sublime Text 3
- Windows:
%APPDATA%\Sublime Text 3\Packages
- Linux:
~/.config/sublime-text-3/Packages/
- OS X:
~/Library/Application Support/Sublime Text 3/Packages/
Usage
Key Bindings
The default key bindings for this plugin:
Windows, Linux:
- Ctrl+Alt+F: Format current file.
- Ctrl+K, Ctrl+F: Format current selection.
OSX:
- Ctrl+Alt+F: Format current file.
- ⌘+K, ⌘+F: Format current selection.
Command Palette
Open the command palette, it appears as SublimeAStyleFormatter: Format Current File
and
SublimeAStyleFormatter Format Current Selection
.
Settings
Per-project Settings
Before starting, you may want to have a look at SublimeAStyleFormatter.sublime-settings.
To edit your project setting, select Project/Edit Project
from main menu. A project setting contains
per-project settings for SublimeAStyleFormatter should look like this:
{
"settings":
{
"AStyleFormatter":
{
}
}
}
For example, if you don't want to inherit the default settings, instead, use your own astylerc file for C and C++ individually, then your project setting might look like this:
{
// project folders, etc
// ...
// project settings
"settings":
{
"AStyleFormatter":
{
"options_default":
{
// Use 2 spaces for indentation
"indent": "spaces",
"indent-spaces": 2
},
"options_c":
{
"use_only_additional_options": true,
"additional_options_file": "/path/to/your/astylerc/for/c"
},
"options_c++":
{
"use_only_additional_options": true,
"additional_options_file": "/path/to/your/astylerc/for/c++"
}
}
}
}
What's New
License
This plugin is using MIT License:
Copyright (c) 2012-2015 Timon Wong
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Credits
Artistic Style - A Free, Fast and Small Automatic Formatter for C, C++, C#, and Java Source Code.
Licensed under GNU Lesser General Public License version 3.0