Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to make sublime plugin
Search
oscar.lee
November 26, 2015
0
70
How to make sublime plugin
oscar.lee
November 26, 2015
Tweet
Share
More Decks by oscar.lee
See All by oscar.lee
web2.0 attack & defence
oscar3x39
0
150
xdebug remote debugging
oscar3x39
1
88
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
25
1.7k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Building Adaptive Systems
keathley
43
2.7k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Done Done
chrislema
184
16k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
It's Worth the Effort
3n
185
28k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
340
Transcript
How to make sublime plugin. @oscar3x39
WHY? অ蒂?
✓ 盠蝧樄咳 ✓ 仂膊恝 ✓ 墋㻌Ӥಋ ✓ ✓ ✓ 盄ᄤ
盠蝧樄咳 • emmet • Base Encode • Livereload • sftp
• Diff Files • DataConverter
仂膊恝 • Alignment • Pretty Json • GitGutter • Trailling
Space • PHP Code Sniffer • Xdebug
墋㻌Ӥಋ & ٌਙঅ蒂 ✓ 虻რ掘 https://packagecontrol.io ✓ 樄რ,犋䨝䌃螭ݢ犥፡獨Ոጱ ✓ 殼娞聜python
✓ 硯ࣁgithub盄ᄤ
吚簁螭ฎ磪襊
None
None
None
奾抷 Z > B
Ԫ獮伛猋 ✓ Ӟݣ襎脲 (ฎMac磧অ) ✓ 磪ਞ蕕 Sublime Text 3 ✓
磪蕕python ᘒӬ䨝Ӟ讨讨
य़姛 1. 墋㻌Օ奧Plugin奾䯤 2. 礚፡Sublime API 3. 砰䌃Hello World 4.
DEMO
✓ Plugin奾䯤
plugin ᪠䕩 • OS X: ~/Library/Application Support/Sublime Text 3/ Packages/
• Windows: %APPDATA%\Sublime Text 3/Packages/ • Linux: ~/.config/sublime-text-3/Packages/
{plugin-name}.py Context.sublime-menu Default (OSX).sublime-keymap Default.sublime-commands Main.sublime-menu Side Bar.sublime-menu Tab Context.sublime-menu
{package-name}.py
Context.sublime-menu ݦ棎螡㻌
Context.sublime-menu ݦ棎螡㻌 caption 氥纈ਁ command 䁆ᤈ獢ୗݷ圸 args 癲蝱獢ୗጱ㷢碍
Default (OSX).sublime-keymap 籆棎戔ਧ keys 奲ݳ籆棎 command 䁆ᤈ獢ୗݷ圸 args 癲蝱獢ୗጱ㷢碍
Default.sublime-commands 犤䁆ᤈ戔ਧ caption 犤ݷ圸 command 䁆ᤈ獢ୗݷ圸 args 癲蝱獢ୗጱ㷢碍
✓ Sublime API
https://www.sublimetext.com/docs/3/api_reference.html
View • view.sel 糷ग़㮆玱ጮਁԀ֖ᗝ • view.substr 䢺玲翥蜉瑊Ӿਁ • view.replace 磦矦ਁ
• view.file_name 吚獮䲆礯ਠ碉᪠䕩
EventListener • on_new() • on_load() • on_close() • on_pre_save() •
…
message • sublime.message_dialog() • sublime.status_message() • sublime.error_message()
✓ 砰䌃Hello World
plugin basic import sublime, sublime_plugin class ExampleCommand(sublime_plugin.TextCommand): def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
Tools > New Plugin
view.run_command(‘example’)
✓ 砰䌃ᛔ૩ጱplugin
✓ DEMO
Sublimeঅ༉༉ 藨ݶ藶獤Ձ
1.2.3.4.5.6.7.8.9.10 蘛蘛य़疑