gdh1995 / vimium-c

A keyboard shortcut browser extension for keyboard-based navigation and tab operations with an advanced omnibar
https://chrome.google.com/webstore/detail/vimium-c/hfjbmagddngcpeloejdejnfgbamkjaeg
Other
3.42k stars 253 forks source link

How to use `clickable` and `env`'s `element` #965

Open embeddedtofu opened 1 year ago

embeddedtofu commented 1 year ago

So, I'm using Firefox and I'd like to be able to toggle the

I expected something like the following to work

env lemmy element="label"

map f runKey expect="lemmy:<v-fml>" keys="<v-f>"

map <v-f> LinkHints.activate
map <v-fml> LinkHints.activate clickable=".btn-outline-secondary"

Yet, neither is env triggered nor does clickable match the tag.

Certainly, I can just use host="https://" and a workaround with match="..." or activateFocus but I'd prefer if I could avoid adding any extra shortcuts and limit the number of tags the command would match with.

gdh1995 commented 1 year ago

What do you want to do by combining env and element=xxx ?

The element=xxx is for insert mode,  But not related about link hints.

Why not env lemmy host="^https://lemmy\.\w+/"

---Original--- From: @.> Date: Tue, Jul 4, 2023 21:27 PM To: @.>; Cc: @.***>; Subject: [gdh1995/vimium-c] clickable and env element doesn't appear totrigger as expected (Issue #965)

So, I'm using Firefox and I'd like to be able to toggle the selectors like posts/comments or local/all on Lemmy instances like https://lemmy.ml or https://lemmy.world.

I expected something like the following to work env lemmy element="label" map f runKey expect="lemmy:<v-fml>" keys="<v-f>" map <v-f> LinkHints.activate map <v-fml> LinkHints.activate clickable=".btn-outline-secondary"
Yet, neither is env triggered nor does clickable match the tag.

Certainly, I can just use host="https://" and a workaround with match="..." or activateFocus but I'd prefer if I could avoid adding any extra shortcuts and limit the number of tags the command would match with.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

embeddedtofu commented 1 year ago

The way I read the wiki entry, I assumed element limited the matched tags like match=""

The reason I don't want to use host= is because Lemmy is a decentralized platform, so there are too many server domains out there.

But clickable is the more important part. Why does it not match when I use LinkHints.activate but match does as well as activateFocus.

gdh1995 commented 1 year ago

But, env's element is only tested on a currently focused element, but not others.

You may always enable clickable for all LinkHints commands, like

map f LinkHints.activate clickable=".btn-outline-secondary"
# and also
# map xxx LinkHints.activateQueue clickable=".btn-outline-secondary"

The clickable parameter is not affected by activateFocus.

If you can see a hint only in activateFocus mode, then it means the hint is generated by LinkHints' default rules, but not your clickable parameter. You should check the value of clickable parameter and fix any spelling mistake.