SublimeAStyleFormatter 配置
LOJ 码风
{
// Print debug message
"debug": false,
// Auto format on file save
"autoformat_on_save": false,
// The mapping key is `syntax name`, and the value is `formatting mode`.
// Note that the value for each mapping should be "c", "java" or "cs".
"user_defined_syntax_mode_mapping": {
// For example:
/*
"arduino": "c",
"pde": "java",
"apex": "java"
*/
},
// Please visit http://astyle.sourceforge.net/astyle.html for more information
"options_default": {
"style": "java",
"attach-namespaces": true,
"attach-classes": true,
"attach-inlines": true,
"attach-extern-c": true,
"attach-closing-while": true,
"indent-col1-comments": true,
"break-blocks": "default",
"pad-oper": true,
"pad-comma": true,
"pad-header": true,
"unpad-paren": true,
"align-pointer": "name",
"break-one-line-headers": true,
"attach-return-type": true,
"attach-return-type-decl": true,
"convert-tabs": true,
"close-templates": true,
"max-code-length": 100,
"break-after-logical": true,
"keep-one-line-statements": false,
},
//
// Language Specific Options
//
// You can override default options in language-specific options here.
// Addtional options are also provided:
//
// "additional_options": Addtional options following astyle options file style
// (http://astyle.sourceforge.net/astyle.html).
// e.g.: "additional_options": ["--indent=spaces=2", "--convert-tabs"]
//
// "additional_options_file": Addtional options file for astyle (aka astylerc), you must specify
// a full path for that file, environment variable may be included.
// e.g.: "additional_options_file": "%USERPROFILE%/astylerc" // (Windows)
// e.g.: "additional_options_file": "$HOME/.astylerc" // (Linux)
// === Additional variables that you may use ===
// $file_path The directory of the current file, e.g., C:\Files.
// $file The full path to the current file, e.g., C:\Files\Chapter1.txt.
// $file_name The name portion of the current file, e.g., Chapter1.txt.
// $file_extension The extension portion of the current file, e.g., txt.
// $file_base_name The name-only portion of the current file, e.g., Document.
// $packages The full path to the Packages folder.
// The following requires "Sublime Text 3"
// $project The full path to the current project file.
// $project_path The directory of the current project file.
// $project_name The name portion of the current project file.
// $project_extension The extension portion of the current project file.
// $project_base_name The name-only portion of the current project file.
//
// "use_only_additional_options": While true, SublimeAStyleFormatter will *only* process
// options in *both* "additional_options" and "additional_options_file".
// Language-specific options for C
"options_c": {
"use_only_additional_options": false,
"additional_options_file": "",
"additional_options": []
},
// Language-specific for C++
"options_c++": {
"use_only_additional_options": false,
"additional_options_file": "",
"additional_options": []
},
// Language-specific for Java
"options_java": {
"style": "java",
"use_only_additional_options": false,
"additional_options_file": "",
"additional_options": []
},
// Language-specific for C#
"options_cs": {
"use_only_additional_options": false,
"additional_options_file": "",
"additional_options": []
}
}