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
65
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
140
xdebug remote debugging
oscar3x39
1
85
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Producing Creativity
orderedlist
PRO
341
39k
Happy Clients
brianwarren
98
6.7k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
We Have a Design System, Now What?
morganepeng
50
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Designing for Performance
lara
604
68k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
How to Ace a Technical Interview
jacobian
276
23k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Speed Design
sergeychernyshev
24
610
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 蘛蘛य़疑