vimium-c icon indicating copy to clipboard operation
vimium-c copied to clipboard

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

Open embeddedtofu opened this issue 2 years ago • 3 comments

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.

embeddedtofu avatar Jul 04 '23 13:07 embeddedtofu

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: @.***>

gdh1995 avatar Jul 04 '23 13:07 gdh1995

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.

embeddedtofu avatar Jul 04 '23 13:07 embeddedtofu

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.

gdh1995 avatar Jul 11 '23 17:07 gdh1995