Shpigford
Shpigford

Reputation: 25358

How to add space after a colon in CSS with Sublime Text 2?

When working in CSS (or SCSS/SASS files) with Sublime Text 2, I'd like to automatically add a space after the colon. How can I do that?

What it currently does:

body {
   color:red;
}

What I want:

body {
   color: red;
}

Upvotes: 5

Views: 2883

Answers (1)

fraxel
fraxel

Reputation: 35289

Add this line:

{ "keys": [":"], "command": "insert", "args": {"characters": ": "}}

To your .config/sublime-text-2/Packages/User/Default (Linux).sublime-keymap (in menus: Preferences>Key bindings User) File. Now everytime you press :, :and a space will appear... :)

Upvotes: 6

Related Questions