Created
April 30, 2013 09:08
-
-
Save maiko-ampersand/5487551 to your computer and use it in GitHub Desktop.
SublimeText2のプラグインを作ってみた ref: http://qiita.com/items/cd4509cbfd73e8ef591c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| [ | |
| { | |
| "keys": ["ctrl+b"], "command": "reple" | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime, sublime_plugin | |
| class RepleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| clip = sublime.get_clipboard() | |
| for sel in self.view.sel(): | |
| if not sel.empty(): | |
| rep = clip % self.view.substr(sel) | |
| self.view.replace(edit, sel, rep) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment