tridactyl/.tridactylrc

99 lines
3.5 KiB
Text
Raw Normal View History

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