Create a new paragraph with <Enter>

Hello!

What I’m trying to do

I know this might be silly, but I am trying to create a new paragraph simply using the <Enter> key. The current behavior of Obsidian seems to me that it creates a new line (or a new “strict line” if that option is toggled) when the <Enter> key is hit, so if I want to create a new paragraph, I need to hit <Enter> two times.

Instead, I want to hit the <Enter> key once, and two new lines are created so that a new paragraph is formed.

Coming from Typora, this is the default behavior I am used to, and all of my Markdown files are already formatted accordingly.

Things I have tried

I have searched for community plugins that enable this but sadly that didn’t work. Also there is no keyboard shortcut defined for creating new line, so I guess I am out of luck.

Any help is appreciated.

What do you mean by “all of my Markdown files are already formatted accordingly”? It sounds like Typora formats them the same way as Obsidian but makes the typing more convenient — or have I misunderstood?

If I’ve understood you right, I think you’d need a plugin to exist, or for Obsidian to add the feature. You could post a feature request, or upvote with a heart if one already exists.

I meant that Typora inserts two lines when the <Enter> key is hit, so if you look at the Markdown file you would see two lines between each paragraph. In Obsidian, only one line is inserted, and opening Obisidian-generated files back in Typora causes them to look like this:

There is a difference apparently. (All Typora-generated files are like the paragraphs in “Actual first paragraph” and “Actual second paragraph”… they never look like the first, second and third lines written above).

I will post in the feature request category if no one has other ideas. Thanks for the tip!

I have the same problem and, while it’s easy to solve cosmetically, so that a single will space the paragraphs out on the screen as if there were two, it’s much harder to solve so that Obsidian will receive two carriage returns where you only type one. For a start, you’d have to write your extension so that this only happens while editing – but even that is not enough, because you will want single carriage returns within your YAML/properties box.

The other problem with the “cosmetic” CSS fix is that single carriage returns are ignored in reading view, so that all your paragraphs are smushed together into one. There is a fix for that, too: if a line ends with two spaces and a carriage return, Obsidian’s reading view recognises it properly.

The way round that is a script called from the shell commands plugin and attached to the right-click menu which cleans up the line endings.

I find this less of a faff than having to hit the return key twice. If you want to try I can post the relevant snippets here.

Thanks for your reply! Sadly I couldn’t grasp most of it, I installed Obsidian about one week ago and barely started using it for actual work, so I don’t know most of the concepts you mention.

I think am gonna have to post in the feature request category at the end.

OK, I see. I think the sentence I asked about is likely to confuse people so I would leave it out of the request. Obsidian and Typora use the same format for paragraphs but Typora makes it easier to type them.

(I’ll mention that almost every Markdown editor does it Obsidian’s way, so what Typora does is unusual — but I can see why they do it).

Sorry if my reply was bewildering. The short form is that you can work around the problem but there is no simple fix available.

1 Like

I would suggest resorting to a macro program like Keyboard Maestro. And I’d suggest the following solutions that are all equally easy to set up, even for a non-programmer :

  • (i.e. type “Enter” to get a single “Return”)
  • (i.e. type “Return” to get a “double Return”)
  • (“Option –Return” to get a “double Return”)

In Keyboard Maestro, you can group macros into sets. I have, for example, a set of such macros that are triggered only in Obsidian.

  Olivier :smiley:

1 Like

KM is great but it’s mac only. The Windows equivalent would be AutoHotKey, where I also have a set of macros that are only for Obsidian. But it’s still a little complicated. I like your idea of a special key to send a single carriage return.

Continue Here: