Turn on spell checking

I search so much I cant handle it any more. I mean a tool for taking notes without spell checking?
Its so hard to start using TW, and then missing simple basic options like a spell checker?

How can I turn on the spell checker from my browser using CodeMirror? This should not be a rocket science thing to do.

I understand your need for spell checking in code mirror. There is a code mirror 6 plugin prototype that from memory does spell check.

  • I also have a custom preview that allows spell check to occur in the preview while code mirror is on the left. Just ask I will share it.

In defence of code mirror, the spell check is provided by the browser not code mirror and the browser spell check only works on text areas. To support code mirrors features it is a line editor wrapped in a user interface. If browser spell checkers were more sophisticated this may not be a problem.

Despite the above try CodeMirror 6 plugin Beta

Neeliy,

Most browsers have some kind of spellcheck built-in now. Right now this post I’m composing is being spellchecked by Chrome’s default in-browser spellcheck in a textbox, and tiddlywiki’s text entry areas are treated similarly. Are you not able to take advantage of such features?

Oh, I now understand maybe your problem is more specific to CodeMirror, about which I know nothing. So, feel free to disregard.

I know this offers no help, but one thing to consider is whether to use CodeMirror at all. I myself went back from CM to the default editor. CodeMirror seems helpful for, surprise surprise, coding, but not so much for note taking in my experience. I have the following issues with CM:

  • no spell check
  • unusable on touchscreen
  • does add bulk disproportionate to what it offers (in my case)
  • syntax highlighting and tag closing works only for pure HTML or pure CSS in tiddlers with appropriately defined content type, but not when intermixed with TW5 wikitext in an untyped tiddler (or have I set it up wrong?)
  • no support for TW5 syntax, which would be much more helpful than HTML or CSS

I have recently switched back to default editor, since I have realized the most needed features for me are:

  • spell check
  • inserting tab characters, to make occasional code more readable: possible in default editor with this or with Auto Complete plugin and emoji dictionary as explained below by @Mark_S.
  • auto closing brackets when inserting links: possible with Auto Complete
  • usability on mobile

It works well for note taking in my case. For the occasional tweaking, CM doesn’t help in many situations anyway. And it since I’m not familiar with Sublime or vim shortcuts anyway, I woildn’t benefit from this feature of CM.

So I’d say CM is right for you if you do a lot of coding in typed HTML/CSS/JS tiddlers. If you’re mostly taking notes or tweaking TW with its syntax, it’s not worth it.

1 Like

Your setup is not wrong. There is a discussion at Talk Codemirror - auto close tags in tiddlywiki code? - #9 by pmario where I did show a hack for 1 cm-module to make it work with TW wikitext.

We would need to create our own “patch and build” system to include a similar configuration to all cm-modules that should work in mixed mode. OR we would need to create new mixed mode for TW that activates the default modules for the text/vnd.tiddlywiki type, which is the default for tiddlers

1 Like

@Neeliy I found my work around edit-template-spell-check preview.json (621 Bytes) install this in your wiki.

When editing a tiddler in code mirror you can open the preview and select “Spell check Default Editor”, now click inside the preview and the default browser spell check works.

These are good points. I usually do like CM when doing wikitext because it completes brackets and stuff, but then sometimes I find myself in a battle with it over quote marks. “No, I just want ONE quote mark, not two”, and also it seems to have a hidden rule about when it will put brackets around selected text and when it will replace the text with brackets, so I’m always guessing which way it will work.

1 Like

Try the workaround I just shared it should work for you.

First of all thanks for all the answers. I was stuck in a different city because of heavy snow fall in south Germany and had no time for answering or responding, thank you for your patience.

@TW_Tones, I will try your plug-in immediately. Also thank you for explaining the problem why the browser spell check does not work, that is something I saw while searching for an answer but didn’t understood.

@Springer, yes, I would like to use CodeMirror and as TW_Tones wrote, its that the browser spell check does not work on HTML elements that are not some kind of text. (This is how I understood it now)

vilc, since I am just starting to use TW, so and wanted to take notes about code and put some examples in the tiddlers. But then as you say it may be not worth for me. I will try the plug-in first and then look if I will switch to the default one again.

pmario the reason I was posting is the last thing you posted here GitHub-TiddlyWiki-issue:6927 where you state that you found a way. I could not make it work for a long time, then after I got it work I read that turning on the spell check introduces some bugs and as a newbie to TW I dont want to change to much before I understand more.

Thank you all.

P.S. I am only allowed to mention 2 users as a new user.

3 Likes

You could also use the Emoji dictionary in the Auto Complete plugin, if you don’t mind post-editing. Just put an entry in the dictionary like:

X	X: Tab

Where the space between the X’s has a tab character.

Or, use a special trigger like the attached. Type “qt” and select “Tab” to have a tab inserted and your caret ready to go.

Why “qt” ? Because in English, the letter “q” is almost always followed by “u”. Making it a fairly safe choice in terms of keyboard sequences as an initial trigger letter.

TabChar.json (324 Bytes)

1 Like

This. On steroids. It seems to never give me what I want, pretty much always what I don’t want. Example: Cursor in the middle of some code/text, hit End, ", Home, " and move on. What CM has given me is ""stuff"" which I may not notice. Sometimes "Stuff"" which is worse.

In this regard, its focus is typing, not editing. ← weird considering it’s meant to be for coders, not writers.

Hopefully 6 is better (?)

1 Like

I just wanted to point out this advice is the result of a number different long conversations and is a good workaround given a number of quite complex issues.

  • A better solution would more than likely need a deeper dive into code mirror and the way it takes over the default editor.

Been there, done that, a couple of times, actually. Seriously, writing parsers (actually, modes) for CodeMirror is a lot of fun… but quite intense and time-consuming.

This works as expected, thanks alot. I would have another question how would I set a shortcut to switch between the preview and the “Spell check Default Editor”?

I’m not sure I have understood correctly.

The keyboard shortcuts I was referring to are the Sublime Text and vim shortcuts for CM, they are available as official sub-plugins to the CM plugin.

I know of no way of instant switching (be it through keyboard shortcut or any other way) between CM and default editor. The only way I know is to enable/disable CM plugin and reload wiki. But I’d be happy to be proven wrong.

The spell check default editor is in the preview. It is toggled on and off with the eye button, and selected in the drop down.

I did try to make a solution to toggle between the codemirror and the default editor, this was difficult so I took the preview approach.

  • You can see it is not the full editor as the toolbar buttons are not available to it.

I am sorry, I reply to the wrong person.

I understand that. Is there a way to switch between the output preview and the spell check default editor preview with shortcuts?
So that I don’t have to go to the eye button every time?

To open the preview window in edit view try alt-P

  • I Found this in Control Panel > Keyboard Shortcuts, and search in page for preview
  • This seems to be the only shortcut for previews

Consider Hidden Setting: Show Edit Preview per Tiddler

  • Otherwise the preview is the last used for all tiddlers.

It also makes sense for the default to be “output” as that is what a preview is. The thing is, the first time you select a preview, either the wiki or the tiddler (with Show Edit Preview per Tiddler) will remember that selection until changed.