Important: It’s important that the $:/config/ tiddler titles are renamed to have the /tab at the end. This title has to match the shortcut-field ((tab)) from the very first tiddler. So if you change that text, your config-tiddlers need to be adjusted too.
Change the icon-field to: tab.svg which is part of the attached .JSON file here in the post
Change the Position of the Button in the Editor Toolbar
Open the $:/ControlPanel → Appearence → Toolbars → Editor Toolbar
Drag & Drop the tab-button to the position you prefer
Finally you may rename :/insert/tab to $:/insert/tab to make it a system-tiddler and hide it.
have fun!
Mario
PS: You can change the :/insert/tab tiddler content with this code snippet and you’ll get a similar behaviour as the “toggle bullet list” button.
I’m not sure, which character is used in your text=" " string, because tabs are invisible. … And that’s the difference to text={{{ [charcode[9]] }}} where it is obvious what happens.
I made a plugin for this, based on @pmario 's instructions and stuff. That may seem like overkill for a mere character (and you can’t even see it!) it should significantly simplify things for a user. @pmario , if you think it looks good, could you include in your first post in this thread?
…however, shouldn’t this be a button in the standard distro? Surely, being able to type TAB must be a general enough use case?
True, but they will discover this right away. And, of course, status quo is that they cannot produce a tab character at all.
Actually, the functionality of the button should ideally be extended to handle a selected text to insert a tab character before each new “line broken” row. This would be superior for defining css.
Is there a means of having this behavior while also being able to indent more than a single line? something along the lines of a “insert-prefix-lines” param?
This code allows you to indent several lines. You need to select some text in the lines that you want to indent. The content of the lines will not be modified. They will all be indented.
Apologies, I didn’t word that clearly, what I mean is, when using this the text will indent over 1 indention, and upon clicking it again, will remove the indention.
My question was, is there a way of creating a param for adding multiple indentions for the selected text, so for instance..
For my custom-markup plugin I did create 2 more buttons and the js-code that is needed for those functions.
1 button for adding any character multiple times
1 button for removing that character
The problem is, that it would be overkill to install that plugin, just to get those buttons.
On the other hand there are some more useful functions that are similar to the core stamp button but 10 times more powerful and fully configurable. Those functions are part of the custom-markup plugin atm.
I did think about it to release them as a separated plugin. But I would add extra overhead to the cm-plugin and there is no docs for the buttons atm.
Edit: Having a look at my code, I also think the functions could be more generic. So a redesign would probably be needed too