From e1240c188e631b87d27864646156c952bf7374b9 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 5 Apr 2021 13:22:53 +0000 Subject: [PATCH] home: firefox: add tridactyl --- home/firefox/default.nix | 1 + home/firefox/tridactyl.nix | 9 +++++ home/firefox/tridactylrc | 72 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 home/firefox/tridactyl.nix create mode 100644 home/firefox/tridactylrc diff --git a/home/firefox/default.nix b/home/firefox/default.nix index 1391052..fd7d5ba 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -15,5 +15,6 @@ imports = [ ./firefox.nix + ./tridactyl.nix ]; } diff --git a/home/firefox/tridactyl.nix b/home/firefox/tridactyl.nix new file mode 100644 index 0000000..fd8e3fb --- /dev/null +++ b/home/firefox/tridactyl.nix @@ -0,0 +1,9 @@ +{ config, lib, ... }: +let + cfg = config.my.home.firefox.tridactyl; +in +{ + config = lib.mkIf cfg.enable { + xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc; + }; +} diff --git a/home/firefox/tridactylrc b/home/firefox/tridactylrc new file mode 100644 index 0000000..edb595e --- /dev/null +++ b/home/firefox/tridactylrc @@ -0,0 +1,72 @@ +" Shamelessly taken from bovine3dom's example configuration file from the docs + +" Basics {{{ +" Use dark color scheme +colorscheme dark + +" Make tridactyl open Vim in my prefered terminal +" FIXME: make it follow my prefered terminal +set editorcmd termite --class tridactyl_editor -e 'vim %f' +" }}} + +" Binds {{{ +" Reddit et al. {{{ +" Toggle comments on Reddit, Hacker News, Lobste.rs +bind ;c hint -c [class*="expand"],[class="togg"],[class="comment_folder"] + +" Make `gu` take me back to subreddit from comments +bindurl reddit.com gu urlparent 4 + +" Only hint search results on Google +bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a +bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a + +" Only hint search results on DuckDuckGo +bindurl ^https://duckduckgo.com f hint -Jc [class=result__a] +bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a] + +" Only hint item pages on Hacker News +bindurl news.ycombinator.com ;f hint -Jc .age > a +bindurl news.ycombinator.com ;f hint -Jtc .age > a +" }}} + +" Better bindings {{{ +" Handy multiwindow binds +bind gd tabdetach +bind gD composite tabduplicate; tabdetach + +" Make yy use canonical links on the few websites that support them +bind yy clipboard yankcanon +" }}} + +" Search {{{ +" Case insensitive only if fully lowercase +set findcase smart + +" Search forward/backward +bind / fillcmdline find +bind ? fillcmdline find -? + +" Go to next/previous match +bind n findnext 1 +bind N findnext -1 + +" Because :nohls never works +bind nohlsearch + +" Use browser's native find when using Ctrl-F +unbind +" }}} +" }}} + +" Redirections {{{ +" Always redirect Reddit to the old site +autocmd DocStart ^http(s?)://www.redit.com js tri.excmds.urlmodify("-t", "www", "old") +" }}} + +" Disabled websites {{{ +blacklistadd netflix.com +blacklistadd jellyfin.belanyi.fr +" }}} + +" vim: set filetype=vim foldmethod=marker: