How to change the "[[something]]" add icon ahead as default?

I make the macro which can show the link with icon ahead.


\define ML(name:"Macro")
<$transclude tiddler={{$name$!!icon}}/><$link />
\end

It is worked but now I want to change the default “[[xxx]]” syntax with the same effect of my macro, since I get used to the shift alt l shortcut.

It is easy to make this? If not I will use ahk something else to make it, which is a little ugly.

The shift+alt+L shortcut is handled by the tiddler $:/core/ui/EditorToolbar/linkify. Its text looks like this:

<$action-sendmessage
	$message="tm-edit-text-operation"
	$param="wrap-selection"
	prefix="[["
	suffix="]]"
/>

It wraps your selection (or your caret) with a prefix [[ and a suffix ]]. So to insert your macro, you would replace the prefix and suffix attributes and other fields.

<$action-sendmessage
	$message="tm-edit-text-operation"
	$param="wrap-selection"
	prefix='<<ML "'
	suffix='">>'
/>

I suggest to make a new shortcut though. You could clone the linkify tiddler instead. Then you need to bind it to a shortcut. There’s a guide at tiddlywiki.com. Check the “How to create editor toolbar buttons” and “How to create keyboard shortcuts”, and also: “WidgetMessage: tm-edit-text-operation” for more on how the editor toolbar buttons work.

Have a great day!

1 Like

Thank you man. And with your help I know how to solve this.

  1. Go to the ControlPanel keyboard shortcut,
  2. find the shift alt l. Name of the shortcut is linkify.
  3. Then you can located the related tiddler in the advanced search.

Thank you again! sull

1 Like

There is a HowTo at tiddlywiki .com, that tells you ho to create toolbar buttons and related keyboard shortcuts see: https://tiddlywiki.com/#How%20to%20create%20dynamic%20editor%20toolbar%20buttons … It contains some buttons, so you can “play” with the functionality.

1 Like