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
66
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
87
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
310
Writing Fast Ruby
sferik
628
61k
The Language of Interfaces
destraynor
156
24k
A Tale of Four Properties
chriscoyier
158
23k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
RailsConf 2023
tenderlove
29
1k
How STYLIGHT went responsive
nonsquared
98
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
GitHub's CSS Performance
jonrohan
1030
460k
Typedesign – Prime Four
hannesfritz
40
2.5k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
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 蘛蘛य़疑