Skip to content

Instantly share code, notes, and snippets.

@maiko-ampersand
Created April 30, 2013 09:08
Show Gist options
  • Select an option

  • Save maiko-ampersand/5487551 to your computer and use it in GitHub Desktop.

Select an option

Save maiko-ampersand/5487551 to your computer and use it in GitHub Desktop.
SublimeText2のプラグインを作ってみた ref: http://qiita.com/items/cd4509cbfd73e8ef591c
[
{
"keys": ["ctrl+b"], "command": "reple"
}
]
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