Last active
July 25, 2018 11:16
-
-
Save tong/3a6e41592324dfc91667f55dac814f04 to your computer and use it in GitHub Desktop.
Haxelib plugin for the terminator terminal emulator
This file contains 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
#!/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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.