From e47f57371966a2c1eabadfca67c9971a6ddd4aad Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 19 Mar 2020 15:31:34 -0400 Subject: [PATCH] Added functions for tab sorting and tab dedup. Lifted from https://github.com/glacambre/.dotfiles/blob/master/default/.config/tridactyl/tridactylrc --- tridactyl/tridactylrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tridactyl/tridactylrc b/tridactyl/tridactylrc index 685b503..dcc5201 100644 --- a/tridactyl/tridactylrc +++ b/tridactyl/tridactylrc @@ -6,6 +6,9 @@ "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ " +alias tabsort jsb browser.tabs.query({}).then(tabs => tabs.sort((t1, t2) => t1.url.localeCompare(t2.url)).forEach((tab, index) => browser.tabs.move(tab.id, {index}))) +alias tabuniq jsb browser.tabs.query({}).then(tabs => browser.tabs.remove(tabs.filter((tab, index) => tabs.slice(index + 1).find(t => t.url == tab.url)).map(tab => tab.id))) + " Toggle expand/collapse for comments. bind ;c hint -c [class*="expand"],[class="togg"]