Skip to content

Instantly share code, notes, and snippets.

@pascalpoitras
Last active June 1, 2024 17:20
Show Gist options
  • Save pascalpoitras/b554d60bfdcc6eeffb6eb076b091cca5 to your computer and use it in GitHub Desktop.
Save pascalpoitras/b554d60bfdcc6eeffb6eb076b091cca5 to your computer and use it in GitHub Desktop.
difference-focus-bind.md

the hook_focus is triggered only if there's already a bind

for example the buflist already have a mouse bind so

/trigger add buflist_click focus buflist "" "" "/print -core clicked on buflist item"

then click on the buflist, the message is print

the time item in the status bar doesn't have any bind by default so

/trigger add time_click focus time "" "" "/print -core clicked on time item"

doesn't print anything

but create a bind

 /key bindctxt mouse @item(time):button1 /print -core hello

then click on the item and now "clicked on time item" is printed

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