-
August 30th, 2021, 11:41 #1
Useful snippets for SWEL in Sublime
Go to Tools-Developer-New Snippet and paste this, save as a familiar name, then set a new keybind in preferences to activate.
This one lets you dump a bunch of text into sublime, highlight it, then press a keybind to wrap that text in a new page. You can modify it to taste based on the project you are working on. The $1 does two things, the cursor will appear there when you add the page, and anywhere $1 is placed, the text you add to title will also appear there. You can also add $1, $2, $3...if you want to tab through a lot of fields such as a new piece of gear - and you want to add that manually.
<snippet>
<content><![CDATA[
[[###$1
@@chapter::Crown of the Kobold King
@@subchapter::
@@blocks.*.blocktype::header
@@blocks._.frame:icture
@@blocks._.text::$1
@@blocks.*.text::"""
$TM_SELECTED_TEXT
"""
]]
-------------------------------------------
]]></content>
<description>###Page</description>
<scope>text.html.basic</scope>
</snippet>
Example KeyBind:
// These are SWEL snippet commands, change NewPageSWEL to your chosen familiar name, and choose a key to bind.
[
{ "keys": ["ctrl+2"], "command": "insert_snippet", "args": { "name": "Packages/User/NewPageSWELL.sublime-snippet" } },
]
-
August 30th, 2021, 11:52 #2
This one just wraps a selected phrase or word in puts the bold asterisks around it. Easily modified for italics and underline. For these I use the same key bindings as fantasy grounds, ctrl+b for example.
<snippet>
<content><![CDATA[
**$TM_SELECTED_TEXT**
]]></content>
<description>bold</description>
<scope>text.html.basic</scope>
</snippet>Last edited by Hlynrian; August 30th, 2021 at 11:55.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks