quocvuongdn

#sublimetext: codeformatter configuration

Nov 23rd, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 11.55 KB | None | 0 0
  1. {
  2.   "codeformatter_debug": false,
  3.  
  4.   "codeformatter_php_options":
  5.   {
  6.     "syntaxes": "php", // Syntax names which must process PHP formatter
  7.     "php_path": "C:/xampp/php/php.exe", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
  8.     "format_on_save": false, // Format on save
  9.     "php55_compat": true, // PHP 5.5 compatible mode
  10.     "psr1": true, // Activate PSR1 style
  11.     "psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
  12.     "psr2": false, // Activate PSR2 style
  13.     "indent_with_space": 4, // Use spaces instead of tabs for indentation
  14.     "indent_size": 4, // indentation size
  15.     "enable_auto_align": false, // Enable auto align of = and =>
  16.     "visibility_order": true, // Fixes visibility order for method in classes - PSR-2 4.2
  17.     "smart_linebreak_after_curly": true, // Convert multistatement blocks into multiline blocks
  18.  
  19.     // Enable specific transformations. Example: ["ConvertOpenTagWithEcho", "PrettyPrintDocBlocks"]
  20.     // You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations
  21.     "passes": ["AddMissingParentheses", "AliasToMaster", "ClassToSelf", "ClassToStatic", "DoubleToSingleQuote", "JoinToImplode", "TrimSpaceBeforeSemicolon"],
  22.  
  23.     // Disable specific transformations
  24.     "exclude": ["AlignDoubleArrow", "AlignConstVisibilityEquals", "AlignDoubleSlashComments"]
  25.   },
  26.  
  27.   "codeformatter_js_options":
  28.   {
  29.     "syntaxes": "javascript,json", // Syntax names which must process JS formatter
  30.     "format_on_save": false, // Format on save
  31.     "indent_size": 2, // indentation size
  32.     "indent_char": " ", // Indent character
  33.     "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
  34.     "eol": "\n", // EOL symbol
  35.     "preserve_newlines": false, // whether existing line breaks should be preserved,
  36.     "max_preserve_newlines": 10, // maximum number of line breaks to be preserved in one chunk
  37.     "space_in_paren": false, // Add padding spaces within paren, ie. f( a, b )
  38.     "space_in_empty_paren": false, // Add padding spaces within paren if parent empty, ie. f(  )
  39.     "e4x": false, // Pass E4X xml literals through untouched
  40.     "jslint_happy": false, // if true, then jslint-stricter mode is enforced. Example function () vs function()
  41.     "brace_style": "collapse", // "collapse" | "expand" | "end-expand". put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
  42.     "keep_array_indentation": false, // keep array indentation.
  43.     "keep_function_indentation": false, // keep function indentation.
  44.     "eval_code": false, // eval code
  45.     "unescape_strings": false, // Decode printable characters encoded in xNN notation
  46.     "wrap_line_length": 0, // Wrap lines at next opportunity after N characters
  47.     "break_chained_methods": false, // Break chained method calls across subsequent lines
  48.     "end_with_newline": false, // Add new line at end of file
  49.     "comma_first": false // Add comma first
  50.   },
  51.  
  52.  
  53.   "codeformatter_css_options":
  54.   {
  55.     "syntaxes": "css,less", // Syntax names which must process CSS formatter
  56.     "format_on_save": false, // Format on save
  57.     "indent_size": 2, // Indentation size
  58.     "indent_char": " ", // Indentation character
  59.     "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
  60.     "selector_separator_newline": false, // Add new lines after selector separators
  61.     "end_with_newline": false, // Add new line of end in file
  62.     "newline_between_rules": false, // Add new line between rules
  63.     "eol": "\n" // EOL symbol
  64.   },
  65.  
  66. "codeformatter_scss_options":
  67. {
  68.   "syntaxes": "scss", // Indentation size
  69.   "format_on_save": false, // Format on save
  70.   "indent_size": 2, // Indentation size
  71.   "indent_char": " ", // Indentation character
  72.   "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
  73.   "selector_separator_newline": true, // Add new lines after selector separators
  74.   "end_with_newline": true // Add new line of end in file
  75. },
  76.  
  77.   "codeformatter_html_options":
  78.   {
  79.     "syntaxes": "html,blade,asp,xml", // Syntax names which must process HTML formatter
  80.     "format_on_save": false, // Format on save
  81.     "indent_size": 2, // indentation size
  82.     "indent_char": " ", // Indentation character
  83.     "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
  84.     "exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
  85.     "expand_javascript": false, // Expand JavaScript inside of <script> tags (also affects CSS purely by coincidence)
  86.     "expand_tags": false, // Expand tag attributes onto new lines
  87.     "minimum_attribute_count": 2, // Minimum number of attributes needed before tag attributes are expanded to new lines
  88.     "first_attribute_on_new_line": false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)
  89.     "reduce_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
  90.     "custom_singletons": "" // Custom singleton tags for various template languages outside of the HTML5 spec
  91.   },
  92.   "codeformatter_python_options":
  93.   {
  94.     "syntaxes": "python", // Syntax names which must process Python formatter
  95.     "format_on_save": false, // Format on save
  96.     "indent_size": 2, // indentation size
  97.     "indent_with_tabs": true, // Indent with tabs or spaces
  98.     "max_char": 80, // Width of output lines in characters.
  99.     "assignment": " = ", // This is how the assignment operator is to appear.
  100.     "function_param_assignment": "=", // This is how function-parameter assignment should appear.
  101.     "function_param_sep": ", ", // This is how function parameters are separated.
  102.     "list_sep": ", ", // This is how list items are separated.
  103.     "subscript_sep": "=", // This is how subscripts are separated.
  104.     "dict_colon": ": ", // This separates dictionary keys from values.
  105.     "slice_colon": ":", // this separates the start:end indices of slices.
  106.     "comment_prefix": "# ", // This is the sentinel that marks the beginning of a commentary string.
  107.     "shebang": "#!/usr/bin/env python", // Hashbang, a line-one comment naming the Python interpreter to Unix shells.
  108.     "boilerplate": "", // Standard code block (if any). This is inserted after the module doc string on output.
  109.     "blank_line": "", // This is how a blank line is to appear (up to the newline character).
  110.     "keep_blank_lines": true, // If true, preserve one blank where blank(s) are encountered.
  111.     "add_blank_lines_around_comments": true, // If true, set off comment blocks with blanks.
  112.     "add_blank_line_after_doc_string": true, // If true, add blank line after doc strings.
  113.     "max_seps_func_def": 3, // Split lines containing longer function definitions.
  114.     "max_seps_func_ref": 5, // Split lines containing longer function calls.
  115.     "max_seps_series": 5, // Split lines containing longer lists or tuples.
  116.     "max_seps_dict": 3, // Split lines containing longer dictionary definitions.
  117.     "max_lines_before_split_lit": 2, // Split string literals containing more newline characters.
  118.     "left_margin": "", // This is how the left margin is to appear.
  119.     "normalize_doc_strings": false, // If true, normalize white space in doc strings.
  120.     "leftjust_doc_strings": false, // If true, left justify doc strings.
  121.     "wrap_doc_strings": false, // If true, wrap doc strings to max_char.
  122.     "leftjust_comments": false, // If true, left justify comments.
  123.     "wrap_comments": false, // If true, wrap comments to max_char.
  124.     "double_quoted_strings": false, // If true, use quotes instead of apostrophes for string literals.
  125.     "single_quoted_strings": false, // If true, use apostrophes instead of quotes for string literals.
  126.     "can_split_strings": false, // If true, longer strings are split at the max_char.
  127.     "doc_tab_replacement": "....", // This literal replaces tab characters in doc strings and comments.
  128.  
  129.     // Optionally preserve unassigned constants so that code to be tidied
  130.     // may contain blocks of commented-out lines that have been no-op'ed
  131.     // with leading and trailing triple quotes.  Python scripts may declare
  132.     // constants without assigning them to a variables, but CodeFormatter
  133.     // considers this wasteful and normally elides them.
  134.     "keep_unassigned_constants": false,
  135.  
  136.     // Optionally omit parentheses around tuples, which are superfluous
  137.     // after all.  Normal CodeFormatter behavior will be still to include them
  138.     // as a sort of tuple display analogous to list displays, dict
  139.     // displays, and yet-to-come set displays.
  140.     "parenthesize_tuple_display": true,
  141.  
  142.     // When CodeFormatter splits longer lines because max_seps
  143.     // are exceeded, the statement normally is closed before the margin is
  144.     // restored.  The closing bracket, brace, or parenthesis is placed at the
  145.     // current indent level.  This looks ugly to "C" programmers.  When
  146.     // java_style_list_dedent is True, the closing bracket, brace, or
  147.     // parenthesis is brought back left to the indent level of the enclosing
  148.     // statement.
  149.     "java_style_list_dedent": false
  150.   },
  151.  
  152.   "codeformatter_vbscript_options":
  153.   {
  154.     "syntaxes": "vbscript", // Syntax names which must process VBScript formatter
  155.     "format_on_save": false, // Format on save
  156.     "indent_size": 2, // indentation size
  157.     "indent_char": "\t", // Indentation character
  158.     "indent_with_tabs": true, // Indent with one tab (overrides indent_size and indent_char options)
  159.     "preserve_newlines": true, // Preserve existing line-breaks
  160.     "max_preserve_newlines": 10, // Maximum number of line-breaks to be preserved in one chunk
  161.     "opening_tags": "^(Function .*|Sub .*|If .* Then|For .*|Do While .*|Select Case.*)", // List of keywords which open a new block
  162.     "middle_tags": "^(Else|ElseIf .* Then|Case .*)$", // List of keywords which divide a block, but neither open or close the block
  163.     "closing_tags": "(End Function|End Sub|End If|Next|Loop|End Select)$" // List of keywords which close an open block
  164.   },
  165.  
  166.   "codeformatter_coldfusion_options":
  167.   {
  168.     "syntaxes": "coldfusion,cfm,cfml", // Syntax names which must process Coldfusion Markup Language formatter
  169.     "format_on_save": false, // Format on save
  170.     "indent_size": 2, // indentation size
  171.     "indent_char": " ", // Indentation character
  172.     "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
  173.     "exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
  174.     "expand_javascript": false, // Expand JavaScript inside of <script> tags (also affects CSS purely by coincidence)
  175.     "expand_tags": false, // Expand tag attributes onto new lines
  176.     "minimum_attribute_count": 2, // Minimum number of attributes needed before tag attributes are expanded to new lines
  177.     "first_attribute_on_new_line": false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)
  178.     "reduce_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
  179.     "custom_singletons": "" // Custom singleton tags for various template languages outside of the HTML5 spec
  180.   }
  181. }
Advertisement
Add Comment
Please, Sign In to add comment