Set auto complete on exalted text 3 for custom html elements

Good day,

how can I set auto complete on exalted text 3 for custom html elements, for example, if I type: dogand then click the tab, it will become <dog></dog>.. thanks for your answer.

+4
source share
1 answer

You can create a file for this .sublime-completions. Create a new file with JSON syntax in Sublime using the following content (of course, customized for your needs):

{
    "scope": "text.html - source, punctuation.definition.tag.begin",

    "completions":
    [
        { "trigger": "foo", "contents": "<foo>$0</foo>" },
        { "trigger": "bar", "contents": "<bar class=\"$1\">$0</bar>" },
        { "trigger": "baz", "contents": "<baz class=\"${1:myclass}\">$0</baz>" }
    ]
}

In the first example, typing fooand pressing Tabwill insert <foo>|</foo>, where |is the cursor position.

bar Tab <bar class="|"></bar>. , class=, . Tab </bar>.

, , , class . baz Tab - Tab, , Tab .

, , Packages/User/HTML.sublime-completions, Packages - , Preferences -> Browse Packages....

. , .

!

+7

Source: https://habr.com/ru/post/1530161/


All Articles