強弱と高低

Python3をメインに

超ド級のポイントを突くSublime3 スニペットの作成方法

Sublimetext3のスニペットの作り方

既に解説されたサイトはたくさんあります(汗)

webdesign-workbook.com

nelog.jp

sublimetextのスニペットのメモ · GitHub

liginc.co.jp

ここにある素晴らしい記事を読めばスニペットがいかに使えるかは、わかります。

スニペットを作成するフローに着目したい

<snippet>
    <content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <!-- <tabTrigger>hello</tabTrigger> -->
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>

こういうものが出てくる。の中身を書き換えればよいのはご承知の通り。しかし、なぜかの中身を変えてもうまくいかない。

簡単なことで、コメントアウトが外れていないからだw

みな、常識のようにしているけれど、<!-- -->コメントアウト

<snippet>
    <content><![CDATA[
print("hello")
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>hello</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>

こうしなければTab補完がきかない