[Plugin] TW5-CodeMirror-Plus - with better formatting and autocompletion

745 views
Skip to first unread message

Adithya B

unread,
Mar 28, 2021, 4:59:11 PM3/28/21
to TiddlyWiki
Hi Everyone,

I first released TW5-CodeMirror-plus six months or so back but didnt get time to work on it since then. This is a major update with some nice additions.

Checkout it out here: https://adithya-badidey.github.io/TW5-codemirror-plus/

Cheers
Adithya

Joshua Fontany

unread,
Mar 28, 2021, 6:27:46 PM3/28/21
to TiddlyWiki
Excellent! Mahalo (thanks) for sharing!

-Joshua Fontany

dieg...@gmail.com

unread,
Mar 28, 2021, 8:27:12 PM3/28/21
to TiddlyWiki
Wow this autocomplete is lovely! And this seems more future-facing than the EditCompText plugin!

Do you know how we can define custom autocomplete triggers and menu-content? As in, when I type '@' I get a certain filter result, to choose from, etc. etc.

Thank you!

Adithya B

unread,
Mar 28, 2021, 10:15:35 PM3/28/21
to TiddlyWiki
Thanks!

Diego, it is possible to do custom autocomplete menu-content. Can you give a more specific example of what you hope to see?

Adithya B

unread,
Mar 29, 2021, 12:34:56 AM3/29/21
to TiddlyWiki
Also, posting your feature request at the github repo is a good way to keep track of it: https://github.com/adithya-badidey/TW5-codemirror-plus

Mohammad Rahmani

unread,
Mar 29, 2021, 2:32:30 AM3/29/21
to tiddl...@googlegroups.com
Nice addition Adithya,
One question: I note codemirror plus uses a theme! I think the font color and size come from this theme. am I right?

I think in text editor (as it is not a WYSIWYG) it is good to have the fonts in the same weight and size but use colors to distinguish between them
So, while I appreciate the current theme, I myself prefer the plain editor with syntax highlighting like the one by Joshua Fontany for Visual Studio code!

I really like to use Codemirror plus with TW syntax highlighting for wikitext scripting.


Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2045a2ac-4ad0-4193-b48e-dc6fbf6dce4dn%40googlegroups.com.

Eskha

unread,
Mar 29, 2021, 5:49:02 AM3/29/21
to TiddlyWiki
Hello  Adithya,

Very nice plugin, thank you for sharing.

Would it be possible to integrate the very convenient behaviour proposed by Saq in its "Editor AutoList - editor extension to automatically continue lists"?  (Pressing enter when in a list continues the list, pressing tab increases the indentation by one level, ...)

Best regards,

Eskha 

Adithya B

unread,
Mar 29, 2021, 6:37:05 PM3/29/21
to TiddlyWiki
Hi Eskha,  The Autolists seems to be working with the cmplus plugin. Try it out!

Mohammed,
I can make a separate theme with all standard font-weights. Would  that help?

Adithya

Soren Bjornstad

unread,
Mar 29, 2021, 7:17:40 PM3/29/21
to TiddlyWiki
Can't speak for how Diego imagined it, but this kind of custom autocomplete is a really interesting idea. I would imagine that beginning an autocomplete run with a custom prefix would run an arbitrary filter and provide (much like the command palette in VSCode et al.) the results of the filter as choices. A variable completionText accessible within the filter would provide access to the current partial match (with the prefix removed).

It would be even awesomer if the current tiddler was also accessible within the custom filter, and if the text completed when you accept the completion can be something different than what's shown in the list (not sure if CodeMirror offers this kind of "snippet"-ish capability; see second example).

So e.g., config tiddlers could look like:

title: TagAutocompleter
tags: $:/tags/CodeMirrorAutocomplete
description: Allow tags to be autocompleted
prefix: #
filter: [tagging[]prefix<completionText>]

title: EmailAutocompleter
tags: $:/tags/CodeMirrorAutocomplete
description: Given part of a contact name, autocomplete the contact's email address
prefix: @
filter: [tag[Contact]search:fullname<completionText>get[email]]

Then, say, to find specifically a tag called Test, even with 500 non-tag tiddlers beginning with T:

#T<C-space>
==> Test

And to complete an email address:

@Alice<C-space>

Mohammad Rahmani

unread,
Mar 30, 2021, 6:36:26 AM3/30/21
to tiddl...@googlegroups.com



Best wishes
Mohammad


On Tue, Mar 30, 2021 at 3:07 AM Adithya B <bmad...@gmail.com> wrote:
Hi Eskha,  The Autolists seems to be working with the cmplus plugin. Try it out!

Mohammed,
I can make a separate theme with all standard font-weights. Would  that help?

That would be great! I love syntax highlighting of TW in code mirror! and I am sure coding will be much more simpler then!

Adithya


On Monday, March 29, 2021 at 3:49:02 AM UTC-6 Eskha wrote:
Hello  Adithya,

Very nice plugin, thank you for sharing.

Would it be possible to integrate the very convenient behaviour proposed by Saq in its "Editor AutoList - editor extension to automatically continue lists"?  (Pressing enter when in a list continues the list, pressing tab increases the indentation by one level, ...)

Best regards,

Eskha 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Eskha

unread,
Mar 30, 2021, 6:54:45 AM3/30/21
to TiddlyWiki
Hello Adithya,

 It does not seem to work out of the box when using both plugins.

Here is a MTC:

* Star typing [[(someting)
* Pres Ctrl+Space
* Select a tiddler to link with the arrows keys
* Press enter
** What we get:
[[(someting) not completed and going to next line
** What is expected (behaviour with only cmplus):
[[(something)(completed)]]

Best regards,

Eskha

Soren Bjornstad

unread,
Mar 30, 2021, 7:50:18 AM3/30/21
to TiddlyWiki
Adithya,

Small bug in the new autocompletion: if I have a completed link, like [[MyLink]], and then with the cursor outside of any brackets later on that line I press Ctrl+Space, the text between the beginning of the link and the current cursor position changes to "[[Filter error: Syntax error in filter expression".

Adithya B

unread,
Mar 30, 2021, 11:32:30 PM3/30/21
to TiddlyWiki
Soren,  Thanks for testing this and the previous suggestions! I have added this as a bug on the github repo (https://github.com/adithya-badidey/TW5-codemirror-plus/issues/11). Will probably fix it over the weekend.

Eshka: I have added this to the repo too. I might not attempt to fix this soon though.


si

unread,
Apr 2, 2021, 10:17:11 AM4/2/21
to TiddlyWiki
@Adithya This is really nice - great contribution to TiddlyWiki.

I have a couple of suggestions regarding the autocomplete:

1. It would be cool to be able to set the suggestions to pop up automatically, without having to press ctrl+space.
2. On selecting a tiddler from the autocomplete, would it make sense for the closing brackets to be added automatically, and the cursor moved to the end of the line? I appreciate that there may be a reason for the current behaviour that I am not understanding.

If either of these make sense to you I'm happy to add them to github as feature requests.

Thanks again!

Adithya B

unread,
Apr 3, 2021, 1:15:51 PM4/3/21
to TiddlyWiki
Thanks for the feedback and suggestions. I will appreciate it if you add them to the github repo.

I have a sense of how to approach these problems but its likely to take a good amount of time. So please dont expect anything soon :D

Thanks, Adithya

dieg...@gmail.com

unread,
Apr 3, 2021, 3:55:45 PM4/3/21
to TiddlyWiki
Soren,

This is exactly how I imagined it!

si

unread,
Apr 4, 2021, 10:49:12 AM4/4/21
to TiddlyWiki
@Adithya I've added the feature requests to the repo (plus one extra :]).


>>> I have a sense of how to approach these problems but its likely to take a good amount of time. So please dont expect anything soon :D

Of course! This is already a great plugin, thanks a lot!

Dupui Uis

unread,
Apr 7, 2021, 12:06:08 AM4/7/21
to TiddlyWiki
Relatively new to tiddlywiki here, is it possible to not include the autocomplete as I already have a plugin that works for me? I tried not installing the autocomplete plugin but it still somehow overrides my settings. My intent is to just install the text formatting and not the additional plugins. Thanks!

Adithya B

unread,
Apr 19, 2021, 12:13:42 PM4/19/21
to TiddlyWiki
@Dupui...@gmail.com

It can be done - You can import all the files except the anyword.js file from the plugin to get just the text formatting.

Could you share the autocomplete you are using? I would love to switch over if that one's better.

Dupui Uis

unread,
Apr 19, 2021, 4:49:49 PM4/19/21
to TiddlyWiki
Thanks for your reply bmad, I am currently using this as my autocomplete. https://snowgoon88.github.io/TW5-extendedit/

Adithya B

unread,
Apr 19, 2021, 5:06:02 PM4/19/21
to TiddlyWiki
The  TW5-extendedit plugin works well with the default editor. It will not work with CodeMirror, which a different editor the TW5-codemirror-plus project is based on

si

unread,
Apr 21, 2021, 2:43:01 PM4/21/21
to TiddlyWiki
Hi Adithya. I noticed that this plugin makes the text boxes for the settings "Default tiddlers" and "Text for new journal tiddlers" unusually large (see Control Panel > Info > Basics). Also the text box for a blank new tiddler is quite a bit bigger than the default. Is there any way to adjust this?

On Sunday, 28 March 2021 at 21:59:11 UTC+1 bmad...@gmail.com wrote:

Adithya B

unread,
Apr 21, 2021, 3:26:14 PM4/21/21
to TiddlyWiki
Hi!

It would help if you filed this problem as a bug report with screenshots or an example wiki on the github repo (https://github.com/adithya-badidey/TW5-codemirror-plus

I will get to it either this weekend or the next. Thanks!

si

unread,
Apr 21, 2021, 4:58:34 PM4/21/21
to TiddlyWiki
Cool, I wasn't sure if it was a bug or not but I've added it to the repo. Thanks!
Reply all
Reply to author
Forward
0 new messages