Last active
August 29, 2015 14:22
-
-
Save evoactivity/1bc82f822cd3508f64a4 to your computer and use it in GitHub Desktop.
Key Bindings to help write well formed css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": [":"], | |
"command": "insert", | |
"args": {"characters": ": "}, | |
"context": [ | |
{ | |
"key": "selector", | |
"operator":"equal", | |
"operand":"source.scss" | |
}, | |
{ | |
"key": "preceding_text", | |
"operator": "regex_match", | |
"operand": "^(?<!.|@|#|&)(\\s*)([a-zA-Z0-9\\-_]*)", | |
"match_all": true | |
} | |
] | |
}, | |
{ | |
"keys": ["{"], | |
"command": "insert_snippet", | |
"args": {"contents": " \\{\n\t$0\n\\}\n"}, | |
"context": [ | |
{ | |
"key": "selector", | |
"operator":"equal", | |
"operand":"source.scss" | |
}, | |
{ | |
"key": "preceding_text", | |
"operator": "regex_contains", | |
"operand": "[a-zA-Z0-9)]$", | |
"match_all": true | |
} | |
] | |
} | |
] |
Updated to better match when to add a space after :
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add these to your user keybindings file in sublime, currently they only work in an .scss file so if you write plain css or use a different preprocessor, change source.scss to be what you need.