[STP08] Supercharging Sublime snippets using plugins!

preview_player
Показать описание
Snippets are an awesome way to inject precreated text into your files, but if you have many, it can be hard to find the right one. Sublime Text lets us not only bind snippets to keys, we can also simplify and supercharge our snippets by using plugins as well.

This video is part tutorial, teaching you how to bind snippets to keys and work with snippet variables and the selected text inside of smippets, as well as being a step by step walkthrough of creating a plugin to work with snippets.

00:00 - Introduction
03:02 - Binding Snippets to keys
09:33 - Using Inline Snippet Content
12:28 - Plugin Example 1
20:29 - Disabling a command
23:03 - Advanced plugin sample
26:55 - Custom command methods
27:56 - Determining where the cursor is
32:01 - Final Thoughts

#SublimeText #Plugin #Tutorial

Рекомендации по теме
Комментарии
Автор

Thanks! Great as always. One quick side question: What command creates the JavaScript scratch file at 9:00? Is that a package?

KommissarBoelles
Автор

I want to have a snippet which opens up with a part of it Folded as in the Code Folding feature of Sublime. (Basically I code in C++ and have a lot of header files that I used snippet to auto write, but I don't want to look at these files, and rather start coding in the main function. Thus I have to manually select that part of the snippeted code and Fold it using Cmd+Shift+[.) Is there a way so that this happens automatically when snippet opens up. Thanks ;)

abhijeetsrivastava