How to make a keyboard shortcut for line breaks?

208 views
Skip to first unread message

Peter Erne

unread,
Feb 21, 2021, 10:17:56 AM2/21/21
to TiddlyWiki
Hi all, I am a newbie to tiddlywiki and have no experience with javascript but with other programming languages. Tiddlywiki is a fascinating tool, which I would like to try out for my personal journal and to build a know how database. Entering text is very quick using markdown, however I am missing the linebreak short cut to enter a <BR>.

I found the Keyboard widget (and the Keyboard Shortcut Tiddlers), but have no clue how to set up. I made a first tiddler with the title $:/config/shortcuts/ShiftEnter showing up in the config page with "Shift-Enter" as shortcut (like other keyboard shortcuts). However: where do I have to enter the action "enter a <BR>" and how does it look like? I guess it is a piece of javascript, but how does it look like and where does it go? Another tiddler, text field of the tiddler mentioned,...?

I tried a second tiddler with the title $:/config/ShortcutInfo/ShiftEnter, tag name $:/tags/KeboardShortcut

Sorry for such dummy questions
Best regards
Peter

PMario

unread,
Feb 21, 2021, 10:31:05 AM2/21/21
to TiddlyWiki
Hi,
If you use markdown, you should use the markdown standard, which is defined as <space><space><enter>

So just put 2 spaces at the end of the line and it will create a hard-linebreak

If you want to do the same with TW syntax see:


Or you can use my space-space-newline plugin. It works the same way as MD syntax.


-mario

Peter Erne

unread,
Feb 21, 2021, 10:44:21 AM2/21/21
to TiddlyWiki
hi mario,

thanks for the very quick reply!  Of course, I would like to stay with the standard :-). However, the first option does not work in my wiki, I just downloaded an new empty.html TW wiki to test, and it does not work there either, unfortunately. Entering "<BR>" works fine but is simply tool long if used often and clutters the text. See screenshot. Any configurations I missed out? I am working on a Win 10 machine.

Peter
tw_linebreaks.PNG

clutterstack

unread,
Feb 21, 2021, 12:06:29 PM2/21/21
to TiddlyWiki
Hi Peter,

At first guess, it looks as though you may be using standard WikiText (the default in TiddlyWiki), rather than Markdown?

In this case, the triple-double-quote delimiters would be the syntax you want for hard linebreaks (or if you want Markdown-like syntax just for linebreaks, Mario's plugin). Mario's long link
brings up the relevant TiddlyWiki docs for that.

Quick excerpt from Hard Linebreaks in WikiText:

"""
This is a line
and this is a new line
while this is yet another line
and this is the final one
apart from this one
"""

Hope that helps,

Chris

Peter Erne

unread,
Feb 21, 2021, 4:15:34 PM2/21/21
to TiddlyWiki
Hi Chris,
thanks for the clarification! For me, bullet lists and numbered lists (including these line breaks are an important feature and I am using STROLL > i made an nteresting observation: I downloaded Marios plugin. It works in original TW with reasonable output: also for lists it works great, an space-space-enter at the end produces a new paragraph and for a next bullet/numbers I need to again hit * or #. However, in STROLL, hitting space-space-enter at the end of a bullet paragraph produces a correctly indented new line but with a (unneccessary) * or # at the beginning. No clue how to turn this off. Any idea?

kind regards
Peter

strikke...@gmail.com

unread,
Feb 21, 2021, 4:21:44 PM2/21/21
to TiddlyWiki
Test it, I think it is due to the plugin $:/plugins/sq/editor-autolist. If you do not need it, you could try to disable it.

Birthe
Reply all
Reply to author
Forward
0 new messages