Sublime Text 2 AStyle Formatter Plugin
SublimeAStyleFormatter is a simple code formatter plugin for Sublime Text 2. It provides ability to format C, C++, C#, and Java files.
Prerequisites (Linux Only)
- ctypes can't be imported in Linux right now in the Linux versions of Sublime Text 2, However, a workaround is provided by mnus.
- The Linux libastyle.so is not provided right now:
- Download and compile astyle: cd astyle/build/gcc; make shared
- Copy libastyle.so to SublimeAStyleFormatter directory: cp ../../bin/libastyle.so "~/.Sublime Text 2/Packages/SublimeAStyleFormatter"
With the Package Control plugin
The easiest way to install SublimeAStyleFormatter is through Package Control.
Once you have Package Control installed, restart Sublime Text 2.
- Bring up the Command Pattle (Ctrl+Shift+P on Windows and Linux. Command+Shift+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.
Without Git: Download the latest source code, and extract to the Packages directory.
With Git: Type the following command in your Sublime Text 2 Packages directory:
git clone git://github.com/timonwong/SublimeAStyleFormatter.git
The "Packages" directory is located at:
|Windows||%APPDATA%\Sublime Text 2\Packages\|
|Linux||~/.Sublime Text 2/Packages/|
|OS X||~/Library/Application Support/Sublime Text 2/Packages/|
The default key bindings for this plugin:
|ctrl+alt+f||Format current file|
|super+alt+f||Format current file|
- Add support for OS X.
- More comprehensive options.
This plugin is using MIT License
Copyright (c) 2012 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.
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