Space Indenter
I find spaces to be a bit easier to manage on the mobile (compared to tabs, which I hold in respect), so I looked for a solution.
This plugin exposes CodeMirror's relevant settings to Joplin users, which enable switching between tab indentation and space indentation. In addition, it can automatically reformat your notes (if enabled in the settings) and convert any existing tabs to spaces (or vice versa, if you decide you're a tab-person after all). A dedicated toolbar button calls the same action manually.
AFAIK replacing tabs with 4 spaces is OK as far as CommonMark is concerned, and in practice most things work as expected even with 2 spaces. If there are caveats to this approach, please discuss below.
Thanks to Rich Markdown (@CalebJohn), that heavily influenced this implementation.
5 Likes
@shikuz, I prefer to set editors to use 4 spaces rather than tabs, so this is a welcome addition.
On testing, it doesn't seem consistent, sometimes it will insert a tab character, and sometimes four spaces. I can't figure out a particular pattern to it.
Setup in use here:
Joplin 2.8.8 (prod, linux)
Client ID: 615c7880d02145c5a89371d6264bdcb9
Sync Version: 3
Profile Version: 41
Keychain Supported: No
Revision: c2a6a13
CodeMirror's logic in this case is indeed a bit obscure, but I believe the following rules apply:
key / event |
result |
Indent less/more command (Edit menu) |
SPACE |
TAB while text is selected |
SPACE |
TAB on an empty bullet/checkbox line |
SPACE |
TAB on any other event (e.g., cursor in mid-line) |
TAB |
2 Likes
v0.2.5
I really needed this release since the new version of the app indents with tabs by default.
v0.2.4
- new: setting to disable auto-indent completely on new lines.
3 Likes