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 Stay Up To Date on Web Technology
chriscoyier
790
250k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Facilitating Awesome Meetings
lara
54
6.4k
Building Applications with DynamoDB
mza
95
6.5k
Building an army of robots
kneath
306
45k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
A Modern Web Designer's Workflow
chriscoyier
694
190k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Adopting Sorbet at Scale
ufuk
77
9.4k
The Cult of Friendly URLs
andyhume
79
6.5k
It's Worth the Effort
3n
185
28k
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 蘛蘛य़疑