Skip to content

Instantly share code, notes, and snippets.

@tong
Last active July 25, 2018 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tong/3a6e41592324dfc91667f55dac814f04 to your computer and use it in GitHub Desktop.
Save tong/3a6e41592324dfc91667f55dac814f04 to your computer and use it in GitHub Desktop.
Haxelib plugin for the terminator terminal emulator
#!/usr/bin/env python2
# Terminator haxelib url handler
import re
import terminatorlib.plugin as plugin
AVAILABLE = ['HaxelibURLHandler']
class HaxelibURLHandler(plugin.URLHandler):
capabilities = ['url_handler']
handler_name = 'haxelib'
match = '\\b(haxelib):?\s?([A-Za-z]+[a-z0-9\._]*)\\b'
def callback(self, url):
if url.startswith('haxelib:'):
url = url[8:]
return('https://lib.haxe.org/p/%s' % url)
@tong
Copy link
Author

tong commented Jul 23, 2018

Understands haxelib:anylib uri and opens up https://lib.haxe.org/p/anylib/ with ctrl+click.
To install copy the script to ~/.config/terminator/plugins/, restart terminator and activate in Prefernces/Plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment