Skip to content

Instantly share code, notes, and snippets.

@Wizek
Forked from jturcotte/gist:3912465
Last active December 15, 2016 17:19
Show Gist options
  • Save Wizek/a23d3ee6b79e57dfb17f8e5b5a88f43b to your computer and use it in GitHub Desktop.
Save Wizek/a23d3ee6b79e57dfb17f8e5b5a88f43b to your computer and use it in GitHub Desktop.
Terminator plugin to open paths in Sublime Text
import re
import terminatorlib.plugin as plugin
import subprocess
# Every plugin you want Terminator to load *must* be listed in 'AVAILABLE'
AVAILABLE = ['FileURLHandler']
class FileURLHandler(plugin.URLHandler):
capabilities = ['url_handler']
handler_name = 'file_path'
# Match any non-space string starting with an alnum or a slash and ending with a line number
match = r'[a-zA-Z0-9\/][^ ]+:[[:digit:]]+|[a-zA-Z0-9\/][^ ]+\([[:digit:]]+\)'
def callback(self, url):
subprocess.call(["subl", url])
return ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment