html - Can i add css property shortcuts to sublime text? -
can add more shortcuts 1 sublimetext?
like 1 "m-a"
expand margin: 0 auto;
?
i apologize if has been asked. couldn't find answer.
these called snippets. particular example, open tools
menu , select new snippet...
, paste in following:
<snippet> <content><![cdata[margin: 0 auto;]]></content> <tabtrigger>m-a</tabtrigger> <scope>source.css</scope> </snippet>
save file packages/user/css/margin auto.sublime-snippet
, should go. open css file, type m-a
, hit tab, , you're set. snippets pretty powerful, , allow tab stops enter customized data. example, set boilerplate code requires colors customized so:
<snippet> <content><![cdata[body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; border: 1px solid ${1:#b3b3b3}; border-radius: 4px; margin: 0 auto; box-shadow: 0 1px 10px ${2:#a7a7a7}, inset 0 1px 0 ${3:#fff}; background: ${4:#fcfcfc}; } $5 ]]></content> <!-- optional: set tabtrigger define how trigger snippet --> <tabtrigger>setbody</tabtrigger> <!-- optional: set scope limit snippet trigger --> <scope>source.css</scope> </snippet>
when hit tab trigger snippet, #b3b3b3
in border
property highlighted, ready edited. when you're done, hit tab again go first color definition in box-shadow
, etc. final tab leaves outside brackets, ready next selector.
Comments
Post a Comment