是否可以更改Emmet中的默认lorem ipsum?

时间:2013-10-10 14:50:02

标签: sublimetext2 emmet

所有这些great lorem ipsum variations都浮在水面上,但是我还没有办法将它们复制并手工粘贴到Sublime Text 2中。我太喜欢Emmet的(lorem100)快捷方式了。

任何人都知道如何将默认ipsum更改为其中一个自定义ipsum,以便Emmet为我插入它?

2 个答案:

答案 0 :(得分:1)

您可以将自己的Lorem Ipsum文本添加到Emmet中:您应该将自己的虚拟单词注册为新语言。

要向Lorem Ipsum添加新语言,请在extensions folder中创建一个包含以下内容的JS文件:

emmet.require('lorem').addLand('my', 'collaboratively administrate empowered markets via plug-and-play networks')

第一个参数是一个语言名称(必须是一个双字母的单词),第二个参数是用空格分隔的单词,用于生成虚拟文本。

按如下方式使用此生成器:loremmy100

您还可以将虚拟文字语言设置为默认语言:只需覆盖preferences.json中的lorem.defaultLang设置,例如将其设置为"lorem.defaultLang": "my",这样您就可以简单地编写lorem100

答案 1 :(得分:0)

您可以编写自己的代码段。

<snippet>
    <content><![CDATA[
Fromage cheesy feet pecorino. Cheese and biscuits cut the cheese when the cheese comes out everybody's happy melted cheese jarlsberg cheesy feet dolcelatte goat. Cut the cheese cheesecake fondue halloumi dolcelatte cheese and wine macaroni cheese emmental. Halloumi port-salut hard cheese taleggio cheese strings.

Caerphilly who moved my cheese roquefort. Boursin brie chalk and cheese cheese triangles when the cheese comes out everybody's happy cottage cheese stinking bishop goat. Cheese on toast swiss taleggio feta goat queso bavarian bergkase edam. Cottage cheese smelly cheese cheesy grin cut the cheese fondue everyone loves.
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>lorem200</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>text.html</scope>
</snippet>

现在,如果您在HTML文件中编写lorem200并按 Tab ,您将获得定义的lorem ipsum。