Skip to content

Instantly share code, notes, and snippets.

@tommyilpazzo
Created March 8, 2017 13:43
Show Gist options
  • Save tommyilpazzo/7b05b17c4b6e906dc3876b107bc9334d to your computer and use it in GitHub Desktop.
Save tommyilpazzo/7b05b17c4b6e906dc3876b107bc9334d to your computer and use it in GitHub Desktop.
Sublime: RegReplace Rules
{
"replacements": {
"remove_empty_lines": {
"find": "^\\s*\n",
"replace": "",
"greedy": true,
"case": false
},
"add_empty_line_after_open_curly_bracket": {
"find": "\\{\n",
"replace": "{\n\n",
"greedy": true,
"case": false
},
"add_empty_line_before_elseif": {
"find": "\n(?=\\s*}.*else\\s+if)",
"replace": "\n\n",
"greedy": true,
"case": false
},
"replace_system_debug": {
"find": "system\\.debug",
"replace": "System.debug",
"greedy": true,
"case": false
},
"add_empty_line_before_methods1": {
"find": "}\n(?=\\s*(public|global|private)+\\s*(static)*.*\\)\\s*\\{)",
"replace": "}\n\n",
"greedy": true,
"case": false
},
"add_empty_line_before_methods2": {
"find": "}\n(?=.*\\/\\*\\*\n\\s*\\*)",
"replace": "}\n\n",
"greedy": true,
"case": false
},
"add_empty_line_before_methods3": {
"find": ";\n(?=\\s*(public|global|private)+\\s*(static)*.*\\)\\s*\\{)",
"replace": ";\n\n",
"greedy": true,
"case": false
},
"add_empty_line_before_annotation": {
"find": "}\n(?=\\s*\\@.*)",
"replace": "}\n\n",
"greedy": true,
"case": false
},
"add_empty_line_before_testmethods": {
"find": "}\n(?=\\s*static\\s*testMethod)",
"replace": "}\n\n",
"greedy": true,
"case": false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment