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
Context Engineering - Making Every Token Count
addyosmani
3
58
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Rails Girls Zürich Keynote
gr2m
95
14k
Agile that works and the tools we love
rasmusluckow
330
21k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Practical Orchestrator
shlominoach
190
11k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Site-Speed That Sticks
csswizardry
10
820
Git: the NoSQL Database
bkeepers
PRO
431
66k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
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 蘛蘛य़疑