Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime text support for Google style guide

I am using sublime text 3 for writing C++ code. We follow Google style guide for CPP.

I am looking for any plugins which provide auto-reindent and linter support using the style guide as reference.

like image 769
Kalyanaraman Santhanam Avatar asked Mar 25 '15 22:03

Kalyanaraman Santhanam


People also ask

Is Sublime Text good IDE?

If you step back and look at the bigger picture, Sublime Text and Visual Studio Code are two of the best multi-language, multi-OS programming editors—Sublime Text for its speed as much as its convenient editing features, and Visual Studio Code for even better features and speed that is almost as good.

Is Sublime Text an IDE or Text editor?

Sublime Text editor is used as an Integrated Development Editor (IDE) like Visual Studio code and NetBeans. The current version of Sublime Text editor is 3.0 and is compatible with various operating systems like Windows, Linux and MacOS.

What is Sublime Text used for?

Sublime Text editor is a sophisticated text editor which is widely used among developers. It includes wide features such as Syntax Highlight, Auto Indentation, File Type Recognition, Sidebar, Macros, Plug-in and Packages that make it easy for working with code base.


1 Answers

I just tried https://github.com/timonwong/SublimeAStyleFormatter and it seems to be working fine.

You will have to edit the user settings ("Sublime Text" > "Preferences" > "SublimeAStyleFormatter" > "Settings - User") to the following:

// This is a simplified settings file that only defines the coding style of your project
{
    "options_default": {
        // Default bracket style
        // Can be either "allman", "ansi", "bsd", "break", "java", "attach", "kr", "k&r",
        // "k/r" "stroustrup", "whitesmith", "banner", "gnu", "linux", "horstmann", 
        // "1tbs", "otbs ", "pico", "lisp", "python", or ""
        "style": "google"
    }
}

You can have interesting options like "autoformat_on_save", indentation stuff, etc.

like image 134
Victor D. Avatar answered Sep 21 '22 04:09

Victor D.