Index

Variables

CONFIGNAME

CONFIGNAME: "userconfig" = "userconfig"

Tridactyl Configuration

We very strongly recommend that you pretty much ignore this page and instead follow the link below DEFAULTS that will take you to our own source code which is formatted in a marginally more sane fashion.

DEFAULTS

DEFAULTS: any = o({configversion: "0.0",// When creating new <modifier-letter> maps, make sure to make the modifier uppercase (e.g. <C-a> instead of <c-a>) otherwise some commands might not be able to find them (e.g. `bind <c-a>`)ignoremaps: o({"<S-Insert>": "mode normal","<CA-Esc>": "mode normal","<CA-`>": "mode normal",}),inputmaps: o({"<Esc>": "composite unfocus | mode normal","<C-[>": "composite unfocus | mode normal","<C-i>": "editor","<Tab>": "focusinput -n","<S-Tab>": "focusinput -N","<CA-Esc>": "mode normal","<CA-`>": "mode normal","<C-^>": "buffer #",}),imaps: o({"<Esc>": "composite unfocus | mode normal","<C-[>": "composite unfocus | mode normal","<C-i>": "editor","<CA-Esc>": "mode normal","<CA-`>": "mode normal","<C-6>": "buffer #","<C-^>": "buffer #",}),nmaps: o({"<F1>": "help",o: "fillcmdline open",O: "current_url open",w: "fillcmdline winopen",W: "current_url winopen",t: "fillcmdline tabopen","]]": "followpage next","[[": "followpage prev","[c": "urlincrement -1","]c": "urlincrement 1","<C-x>": "urlincrement -1","<C-a>": "urlincrement 1",T: "current_url tabopen",yy: "clipboard yank",ys: "clipboard yankshort",yc: "clipboard yankcanon",ym: "clipboard yankmd",yt: "clipboard yanktitle",gh: "home",gH: "home true",p: "clipboard open",P: "clipboard tabopen",j: "scrollline 10","<C-e>": "scrollline 10",k: "scrollline -10","<C-y>": "scrollline -10",h: "scrollpx -50",l: "scrollpx 50",G: "scrollto 100",gg: "scrollto 0","<C-u>": "scrollpage -0.5","<C-d>": "scrollpage 0.5","<C-f>": "scrollpage 1","<C-b>": "scrollpage -1",// Disabled while our find mode is bad/* "<C-f>": "scrollpage -1", */// "<C-b>": "scrollpage -1",$: "scrollto 100 x",// "0": "scrollto 0 x", // will get interpreted as a count"^": "scrollto 0 x","<C-6>": "buffer #","<C-^>": "buffer #",H: "back",L: "forward","<C-o>": "jumpprev","<C-i>": "jumpnext",d: "tabclose",D: "composite tabprev; sleep 100; tabclose #",gx0: "tabclosealltoleft",gx$: "tabclosealltoright","<<": "tabmove -1",">>": "tabmove +1",u: "undo",r: "reload",R: "reloadhard",gi: "focusinput -l","g;": "changelistjump -1",gt: "tabnext_gt",gT: "tabprev",// "<c-n>": "tabnext_gt", // c-n is reserved for new window// "<c-p>": "tabprev","g^": "tabfirst",g0: "tabfirst",g$: "tablast",gr: "reader",gu: "urlparent",gU: "urlroot",gf: "viewsource",":": "fillcmdline_notrail",s: "fillcmdline open search",S: "fillcmdline tabopen search",// find mode not suitable for general consumption yet.// "/": "find",// "?": "find -1",// "n": "findnext 1",// "N": "findnext -1",M: "gobble 1 quickmark",B: "fillcmdline bufferall",b: "fillcmdline buffer",ZZ: "qall",f: "hint",F: "hint -b",gF: "hint -br",";i": "hint -i",";I": "hint -I",";k": "hint -k",";y": "hint -y",";p": "hint -p",";P": "hint -P",";r": "hint -r",";s": "hint -s",";S": "hint -S",";a": "hint -a",";A": "hint -A",";;": "hint -;",";#": "hint -#",";v": "hint -W exclaim_quiet mpv",";w": "hint -w","<S-Insert>": "mode ignore","<CA-Esc>": "mode ignore","<CA-`>": "mode ignore","<Esc>": "composite mode normal ; hidecmdline","<C-[>": "composite mode normal ; hidecmdline",I:"fillcmdline Ignore mode is now toggled by pressing <S-Insert> or <C-A-`>",a: "current_url bmark",A: "bmark",zi: "zoom 0.1 true",zo: "zoom -0.1 true",zz: "zoom 1",".": "repeat","<SA-ArrowUp><SA-ArrowUp><SA-ArrowDown><SA-ArrowDown><SA-ArrowLeft><SA-ArrowRight><SA-ArrowLeft><SA-ArrowRight>ba":"open https://www.youtube.com/watch?v=M3iOROuTuMA","<A-p>": "pin","<A-m>": "mute toggle",}),autocmds: o({DocLoad: o({}),DocStart: o({// "addons.mozilla.org": "mode ignore",// "github.com": "reopenincontainer Work",}),DocEnd: o({// "emacs.org": "sanitise history",}),TriStart: o({".*": "source_quiet",}),TabEnter: o({// "gmail.com": "mode ignore",}),TabLeft: o({// Actually, this doesn't work because tabclose closes the current tab// Too bad :/// "emacs.org": "tabclose",}),}),autocontain: o({//"github.com": "microsoft",//"youtube.com": "google",}),exaliases: o({alias: "command",au: "autocmd",aucon: "autocontain",audel: "autocmddelete",audelete: "autocmddelete",b: "buffer",o: "open",w: "winopen",t: "tabopen",tn: "tabnext_gt",bn: "tabnext_gt",tnext: "tabnext_gt",bnext: "tabnext_gt",tp: "tabprev",tN: "tabprev",bp: "tabprev",bN: "tabprev",tprev: "tabprev",bprev: "tabprev",bfirst: "tabfirst",blast: "tablast",tfirst: "tabfirst",tlast: "tablast",bd: "tabclose",bdelete: "tabclose",quit: "tabclose",q: "tabclose",qa: "qall",sanitize: "sanitise",tutorial: "tutor",h: "help",unmute: "mute unmute",authors: "credits",openwith: "hint -W","!": "exclaim","!s": "exclaim_quiet",containerremove: "containerdelete",colourscheme: "set theme",colours: "colourscheme",colorscheme: "colourscheme",colors: "colourscheme",man: "help","!js":"fillcmdline Warning: !js is deprecated. Please use js instead: js ","!jsb":"fillcmdline Warning: !jsb is deprecated. Please use jsb instead: jsb ",current_url: "composite get_current_url | fillcmdline_notrail ",}),followpagepatterns: o({next: "^(next|newer)\\b|»|>>|more",prev: "^(prev(ious)?|older)\\b|«|<<",}),searchengine: "google",searchurls: o({google: "https://www.google.com/search?q=",scholar: "https://scholar.google.com/scholar?q=",googleuk: "https://www.google.co.uk/search?q=",bing: "https://www.bing.com/search?q=",duckduckgo: "https://duckduckgo.com/?q=",yahoo: "https://search.yahoo.com/search?p=",twitter: "https://twitter.com/search?q=",wikipedia: "https://en.wikipedia.org/wiki/Special:Search/",youtube: "https://www.youtube.com/results?search_query=",amazon:"https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=",amazonuk:"https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=",startpage:"https://startpage.com/do/search?language=english&cat=web&query=",github: "https://github.com/search?utf8=✓&q=",searx: "https://searx.me/?category_general=on&q=",cnrtl: "http://www.cnrtl.fr/lexicographie/",osm: "https://www.openstreetmap.org/search?query=",mdn: "https://developer.mozilla.org/en-US/search?q=",gentoo_wiki:"https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search=",qwant: "https://www.qwant.com/?q=",}),newtab: "",viewsource: "tridactyl", // "tridactyl" or "default"storageloc: "sync",homepages: [],hintchars: "hjklasdfgyuiopqwertnmzxcvb",hintfiltermode: "simple", // "simple", "vimperator", "vimperator-reflow"hintnames: "short",// Controls whether the page can focus elements for you via js// Remember to also change browser.autofocus (autofocusing elements via// HTML) in about:config// Maybe have a nice user-vicible message when the setting is changed?allowautofocus: "true",// These two options will fall back to user's preferences and then to a// default value set in scrolling.ts if left undefined.smoothscroll: "false", // "false" | "true"scrollduration: 100, // numbertabopenpos: "next",relatedopenpos: "related",ttsvoice: "default", // chosen from the listvoices list, or "default"ttsvolume: 1, // 0 to 1ttsrate: 1, // 0.1 to 10ttspitch: 1, // 0 to 2// either "nextinput" or "firefox"// If nextinput, <Tab> after gi brings selects the next input// If firefox, <Tab> selects the next selectable element, e.g. a linkgimode: "nextinput", // either "nextinput" or "firefox"// either "beginning" or "end"// Decides where to place the cursor when selecting non-empty input fieldscursorpos: "end",theme: "default", // currently available: "default", "dark"modeindicator: "true",jumpdelay: 3000, // Milliseconds before registering a scroll in the jumplist// Default logging levels - 2 === WARNINGlogging: o({messaging: 2,cmdline: 2,controller: 2,containers: 2,hinting: 2,state: 2,excmd: 1,styling: 2,}),noiframeon: [],// Native messenger settings// This has to be a command that stays in the foreground for the whole editing session// "auto" will attempt to find a sane editor in your path.// Please send your requests to have your favourite terminal moved further up the list to /dev/null.// (but we are probably happy to add your terminal to the list if it isn't already there).editorcmd: "auto",browser: "firefox",yankto: "clipboard", // "clipboard", "selection", "both"putfrom: "clipboard", // "clipboard", "selection"externalclipboardcmd: "auto",nativeinstallcmd:"curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash",win_nativeinstallcmd:"powershell -NoProfile -InputFormat None -Command \"Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/win_install.ps1'))\"",profiledir: "auto",// Container settings// If enabled, tabopen opens a new tab in the currently active tab's container.tabopencontaineraware: "false",// If moodeindicator is enabled, containerindicator will color the border of the mode indicator with the container color.containerindicator: "true",// AutoContain directives create a container if it doesn't exist already.auconcreatecontainer: "true",// Performance related settings// number of most recent results to ask Firefox for. We display the top 20 or so most frequently visited ones.historyresults: "50",// Security settingscsp: "untouched", // change this to "clobber" to ruin the CSP of all sites and make Tridactyl run a bit better on some of them, e.g. raw.github*})

INITIALISED

INITIALISED: boolean = false

USERCONFIG

USERCONFIG: any = o({})

WAITERS

WAITERS: any[] = []

Functions

get

  • get(...target: any[]): any
  • Get the value of the key target.

    If the user has not specified a key, use the corresponding key from defaults, if one exists, else undefined.

    Parameters

    • Rest ...target: any[]

    Returns any

getAsync

  • getAsync(...target: any[]): Promise<any>
  • Get the value of the key target, but wait for config to be loaded from the database first if it has not been at least once before.

    This is useful if you are a content script and you've just been loaded.

    Parameters

    • Rest ...target: any[]

    Returns Promise<any>

getDeepProperty

  • getDeepProperty(obj: any, target: any): any
  • Given an object and a target, extract the target if it exists, else return undefined

    Parameters

    • obj: any
    • target: any

      path of properties as an array

    Returns any

init

  • init(): Promise<void>
  • Read all user configuration from storage API then notify any waiting asynchronous calls

    asynchronous calls generated by getAsync.

    Returns Promise<void>

o

  • o(object: any): any

save

  • save(storage?: "local" | "sync"): Promise<void>
  • Save the config back to storage API.

    Config is not synchronised between different instances of this module until sometime after this happens.

    Parameters

    • Default value storage: "local" | "sync" = get("storageloc")

    Returns Promise<void>

schlepp

  • schlepp(settings: any): void

set

  • set(...args: any[]): void
  • Full target specification, then value

    e.g. set("nmaps", "o", "open") set("search", "default", "google") set("aucmd", "BufRead", "memrise.com", "open memrise.com")

    Parameters

    • Rest ...args: any[]

    Returns void

setDeepProperty

  • setDeepProperty(obj: any, value: any, target: any): any
  • Create the key path target if it doesn't exist and set the final property to value.

    If the path is an empty array, replace the obj.

    Parameters

    • obj: any
    • value: any
    • target: any

      path of properties as an array

    Returns any

unset

  • unset(...target: any[]): void
  • Delete the key at target if it exists

    Parameters

    • Rest ...target: any[]

    Returns void

update

  • update(): Promise<void>
  • Updates the config to the latest version. Proposed semantic for config versionning:

    • x.y -> x+1.0 : major architectural changes
    • x.y -> x.y+1 : renaming settings/changing their types There's no need for an updater if you're only adding a new setting/changing a default setting

    When adding updaters, don't forget to set("configversion", newversionnumber)!

    Returns Promise<void>