Skip to content

Instantly share code, notes, and snippets.

@felixr
Created April 3, 2026 12:30
Show Gist options
  • Select an option

  • Save felixr/2329ec7365160255f737a1c6e6ac5cd4 to your computer and use it in GitHub Desktop.

Select an option

Save felixr/2329ec7365160255f737a1c6e6ac5cd4 to your computer and use it in GitHub Desktop.
Vimium-C guide

My guide to Vimium-C

  • match CSS selector to match elements
    • e.g. map X LinkHints.activate match="li" to hint all
    • elements.
  • clickable CSS selector to match clickable elements
    • e.g. map X LinkHints.activate clickable="li" will add all <li> elements to the set of clickable elements and show hints on the clickable elements. The difference to match is that it extends the default logic for finding clickable elements and it does not replace it.
  • clickableOnHost per-host clickable settings
    • This allows you to set clickable to different values depending on the current host.
    • e.g map X LinkHints.activate clickableOnHost="wikipedia\.org##li;bikeshed\.com##h1,p
      • this will for hosts matching
        • wikipedia.org add all elements matching li
        • bikeshed.com add all elements matching h1,p
    • The syntax is {host regex}##{CSS selector};{host regex}##{CSS selector}
  • exclude & excludeOnHost
    • These work like clickable and clickableOnHost but instead of extending what gets a hint, this will exclude elements

    • This is good for reducing the noise when you have pages that will result in too many hints.

    • eg. map f LinkHints.activate excludeOnHost="news\.ycombinator\.com##.votelinks\u0020*,.reply\u0020*,.age\u0020*,.hnuser,.subline>:not(a:last-child),.sitebit>a;"

      • host regex: news.ycombinator.com
      • CSS selector: .votelinks *,.reply *,.age *,.hnuser,.subline>:not(a:last-child),.sitebit>a
      • This will exclude a bunch of links from producing hints and the remaining hints will be easier to use.

      Not working?

  • evenIf kHidden
  • scroll "force" is only option and code says same as ".evenIf |= kHidden.OverflowHidden"
  • https://github.com/gdh1995/vimium-c/blob/31885269460a3f0635c7dd69176ed387ad138e96/RELEASE-NOTES.md?plain=1#L421

    • "add .evenIf:enum typeFilter:enum textFilter:RegExp anyText:bool to allow/refuse elements"
  • anyText

  • textFilter Filter hinted elements using a regular expression

    • e.g map X LinkHints.activate textFilter="/(comments|more)/i"
      • only match elements that contain "comments" or "more" as text ("i" for case insensitive match)
      • Note: textFilter="foo" won't work. You need the surrounding /.
  • typeFilter Filter hinted elements using their "type"

    • The types are defined by enum ClickType as the following:
      • 1: edit (1): Text inputs, textareas, and editable content
      • 2: attrListener (4): Elements explicitly given attributes like onclick, onmousedown, role, or framework tags like ng-click or jsaction
      • 3: codeListener (8): Elements that have JavaScript event listeners attached to them
      • 4: classname (16): Elements that are clickable because they match known CSS classes
      • 5: tabindex (32): Elements made focusable via a positive tabindex attribute
      • 7: frame (128): Frames and iframes
      • 8: scrollX (256): Horizontally scrollable elements
      • 9: scrollY (512): Vertically scrollable elements
    • The typeFilter value is a bitmask. So 0 won't mask any types, 1 will mask edit types, 129 (= 1|(1<<7) = 1+128) will mask edit (1) and frame (7) types

https://github.com/gdh1995/vimium-c/blob/31885269460a3f0635c7dd69176ed387ad138e96/typings/messages.d.ts#L53

https://github.com/gdh1995/vimium-c/blob/31885269460a3f0635c7dd69176ed387ad138e96/typings/messages.d.ts#L279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment