Strict line breaks and automatically insert two space

What I’m trying to do

Adjust Obsidian to use standard markdown syntax and a little automation.

Say standard markdown use two space to break a line. By default, Obsidian break the line without need to type in the end of a line.

Things I have tried

In Obsidian setting, there is “Strict line breaks” switch, when turned on, Obsidian will use standard markdown line break.

But I didn’t find an effective way to automatically insert two space when I hit enter. I have tried “Template” and “Template Hotkey” plugin, so I can hit Ctrl+Enter to insert two space by using template.

I even find a method to bind the template directly to Enter button so I don’t need to hold Ctrl by edit .obsidian/hotkeys.json to remove the value in modifiers group. But this hack sacrificed automatically indent: no longer works, after hit enter, cursor go to next line position 1 without any indent.

Any idea that could insert two space to the end of a line, move cursor to next line, but also indent as usual when I hit Enter?

I’ve also managed to highlight the two space by using community plugins if anyone interested.

Install “Dynamic Highlights” obsidian-dynamic-highlights

Go to settings, give any setting name,
background color picker #4D0000,
search criteria " $" (two space + $ without quotes),
switch enable regex to on,
switch matchs to on,
custom css: dummy-css: none;

Without custom css, this highlights won’t save for unknown reason.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.