This plugin allows you to use keyboard shortcuts for the most common wikitext markup.
This has been tested with tiddlywiki 5.0.8 and 5.0.9. Since I cant' guarantee retro-compatibility It should work with consecutive releases.
Just drag and drop the link below to your own tiddlywiki file.
While on a text field just try some key combinations. If you have text selected it will be enclosed in the text snipped.
I already defined the most common shortcuts to wiki syntax. Here is a table of what is already available
| Combination | snippet | renders as |
|---|---|---|
ctrl+b | '' '' | bold |
ctrl+i | // // | italics |
ctrl+u | __ __ | underline |
ctrl+s | ,, ,, | subscript |
ctrl+l | * | non ordered list |
ctrl+o | # | ordered list |
ctrl+k | code | |
alt+t | || | table cell |
alt+h | |!| | table head |
alt+s | ~~ ~~ |
You can add your own key bindings just editing the file :
$:/plugins/danielo/keyboardSnippets/KEYBINDINGS.
You have to respect the formatting of the file. The best way to add a new entry is to copy an existing one and edit it. Every entry has to end in },
The format is one or more key modifiers and a single normal letter in lower case.
The supported modifiers are: ctrl shift alt . To use more than one modifier you have to do it in that order. Example of valid key combinations are:
ctrl+oshift+octrl+shift+octrl+shift+alt+oAs invalid combinations you can see
shift+ctrl+octrl+alt+shift+oo+ctrlIf you mess up with your customizations and you want to restore to default just delete the tiddler:
$:/plugins/danielo/keyboardSnippets/KEYBINDINGS.
^ is not supported{
"ctrl+b" : { "pre":"''", "post":"''"},
"ctrl+i" : { "pre":"//", "post":"//"},
"ctrl+o" : { "pre":"\n#", "post":" "},
"ctrl+l" : { "pre":"\n*", "post":" "},
"ctrl+m" : { "pre":"<<", "post":">>"},
"ctrl+u" : { "pre":"__", "post":"__"},
"ctrl+k" : { "pre":"\n```\n", "post":"```"},
"ctrl+s" : { "pre":",,", "post":",,"},
"ctrl+alt+t" : { "pre":"{{", "post":"}}"},
"ctrl+alt+l" : { "pre":"[[", "post":"]]"},
"alt+w" : { "pre":"<$", "post":"/>"},
"alt+z" : { "pre":"{{!!", "post":"}}"},
"alt+t" : { "pre":"|", "post":"|"},
"alt+h" : { "pre":"|!", "post":"|"},
"alt+s" : { "pre":"~~", "post":"~~"}
}regards "alt+v" : { "pre":"$", "post":"$"},regards--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/5Wjr_nO7cMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
"alt+t" : [ { search: /^| +|$/gm, replace:"|" } ],
"ctrl+o" : [ { search: /^ */gm, replace:"# " } ],
"alt+t" : [ { search:/^/gm, replace:"|" }, { search:/ +/g, replace:"|" }, { search:/$/gm, replace:"|" } ]They are hard to read,
they are hard to write
and you can get unexpected behaviors.
I want to keep the syntax simple.
That way any user can write their own entries.
Anyway. Could you explain your idea a bit more? What are the advantages of your idea? I don't understand at all what this does:
"alt+t" : [ { search:/^/gm, replace:"|" }, { search:/ +/g, replace:"|" }, { search:/$/gm, replace:"|" } ]
Not in general. They can be hard to read..
Not in general. Just for thse who do not yet understand them ;)
You can get unexpected behaviour all the time you do something on a computer.
Great! Regexp syntax is simpl :D (just kidding - a bit)
That's why I propose regexp. That way any user - who understands regexps - can write even more powerful shortcuts.
So what this would do is to first search for all linestarts and out a | there. Then it would search for all sequences of 2 or more spaces and replace them with a pipe. Last it would put a pipe at the end of each line.
"Another thought I had was that it might be very usefull to have an optional little (yet another keyboard shortcut or a "simple" rightclick in editmode?) popup with keyboard shortcut info available. Eric's quickedittoolbar is very helpfull for someone who are learning wikitext markup because it is visual at all times. Maybe a popup for the keyboard shortcuts could help beginners learn/remember wikitext?"
I also though about that. It is definitively my next step. Even using it by myself I experienced those doubts. I thought to use a tiddlywiky message. Like the saved wiki. Have you thought something different? How do you think it's better? A key shortcut or right mouse button click? Maybe a help button?
I thought to use a tiddlywiky message. Like the saved wiki. Have you thought something different?
How do you think it's better? A key shortcut or right mouse button click? Maybe a help button?
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/5Wjr_nO7cMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/40baf995-b65d-478e-9132-7bcf5795ae2b%40googlegroups.com.