tridactylrc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. " bovine3dom's dogfood
  2. " Provided only as an example.
  3. " Do not install/run without reading through as you may be surprised by some
  4. " of the settings.
  5. " May require the latest beta builds.
  6. " Move this to $XDG_CONFIG_DIR/tridactyl/tridactylrc (that's
  7. " ~/.config/tridactyl/tridactylrc to mere mortals) or ~/.tridactylrc and
  8. " install the native messenger (:installnative in Tridactyl). Run :source to
  9. " get it in the browser, or just restart.
  10. " NB: If you want "vim-like" behaviour where removing a line from
  11. " here makes the setting disappear, uncomment the line below.
  12. "sanitise tridactyllocal tridactylsync
  13. "
  14. " Binds
  15. "
  16. " Comment toggler for Reddit and Hacker News
  17. bind ;c hint -c [class*="expand"],[class="togg"]
  18. " GitHub pull request checkout command to clipboard (only works if you're a collaborator or above)
  19. bind yp composite js document.getElementById("clone-help-step-1").textContent.replace("git checkout -b", "git checkout -B").replace("git pull ", "git fetch ") + "git reset --hard " + document.getElementById("clone-help-step-1").textContent.split(" ")[3].replace("-","/") | yank
  20. " Git{Hub,Lab} git clone via SSH yank
  21. bind yg composite js "git clone " + document.location.href.replace(/https?:\/\//,"git@").replace("/",":").replace(/$/,".git") | clipboard yank
  22. " I like wikiwand but I don't like the way it changes URLs
  23. bindurl wikiwand.com yy composite js document.location.href.replace("wikiwand.com/en","wikipedia.org/wiki") | clipboard yank
  24. " Make gu take you back to subreddit from comments
  25. bindurl reddit.com gu urlparent 4
  26. " Only hint search results on Google
  27. bindurl www.google.com f hint -Jc .rc > .r > a
  28. bindurl www.google.com F hint -Jtc .rc>.r>a
  29. " Allow Ctrl-a to select all in the commandline
  30. unbind --mode=ex <C-a>
  31. " Allow Ctrl-c to copy in the commandline
  32. unbind --mode=ex <C-c>
  33. " Handy multiwindow/multitasking binds
  34. bind gd tabdetach
  35. bind gD composite tabduplicate | tabdetach
  36. " Make yy use canonical / short links on the 5 websites that support them
  37. bind yy clipboard yankshort
  38. " Stupid workaround to let hint -; be used with composite which steals semi-colons
  39. command hint_focus hint -;
  40. " Open right click menu on links
  41. bind ;C composite hint_focus; !s xdotool key Menu
  42. " Julia docs' built in search is bad
  43. set searchurls.julia https://www.google.com/search?q=site:http://docs.julialang.org/en/v1.0%20
  44. "
  45. " Misc settings
  46. "
  47. " set editorcmd to suckless terminal, or use the defaults on other platforms
  48. js tri.browserBg.runtime.getPlatformInfo().then(os=>{const editorcmd = os.os=="linux" ? "st vim" : "auto"; tri.config.set("editorcmd", editorcmd)})
  49. " set profile dir on Windows
  50. jsb browser.runtime.getPlatformInfo().then(os=>{const profiledir = os.os=="win" ? "C:\\Users\\olie\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\gwm76nmk.default" : "auto"; tri.config.set("profiledir", profiledir)})
  51. " Sane hinting mode
  52. set hintfiltermode vimperator-reflow
  53. set hintnames numeric
  54. set searchurls.unblink https://search.unbl.ink/?q=
  55. set searchengine unblink
  56. " Defaults to 300ms but I'm a 'move fast and close the wrong tabs' kinda chap
  57. set hintdelay 100
  58. " Make Tridactyl work on more sites at the expense of some security
  59. set csp clobber
  60. fixamo_quiet
  61. " Make quickmarks for the sane Tridactyl issue view
  62. quickmark t https://github.com/tridactyl/tridactyl/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+
  63. "
  64. " URL redirects
  65. "
  66. " New reddit is bad
  67. autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
  68. " Mosquito nets won't make themselves
  69. autocmd DocStart ^http(s?)://www.amazon.co.uk js tri.excmds.urlmodify("-t", "www", "smile")
  70. " This will have to do until someone writes us a nice syntax file :)
  71. " vim: set filetype=vim: