Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adamwalter/5977895 to your computer and use it in GitHub Desktop.
Save adamwalter/5977895 to your computer and use it in GitHub Desktop.
Sublime Text 2 Plugin - Copy scope selector to clipboard. Source: http://www.sublimetext.com/forum/viewtopic.php?f=2&p=20665#p20670
// New plugin file:
import sublime, sublime_plugin
class ScopeToClipboardCommand(sublime_plugin.TextCommand):
def run(self, edit):
sublime.set_clipboard(self.view.syntax_name(self.view.sel()[0].b))
// Set key binding:
{ "keys": ["shift+alt+command+p"], "command": "scope_to_clipboard" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment