How to leave gaps between some items in a list?

Thanks everyone for the great suggestions. I’ve figured out a solution that works most of the time - firstly, I added the following CSS snippet so that the “#” leaders aren’t so insanely huge in edit mode:

.cm-formatting-header {
    color: #e0e0e0 !important;
    font-size: 12pt !important
}

This isn’t strictly necessary, but if I was going to use them as separators between list items I wanted them to be subtle – and I also didn’t like the way those characters are so huge in headings as they distract from the headings themselves.

I then installed the templates plugin, and created a template I called “Blank line in list” with the following contents:


 # 
 - 

The first line is blank, and both the “#” and the “-” have a space in front of them.

Finally, I installed the Hotkeys for Templates plugin and setup a hotkey to insert this template whenever I press Command-Shift-Enter.

So now I can start typing a list, like this:

Things to do tomorrow:
 - Fix back door latch.
 - Carry duck food up from car.

and at the end of that second list item, simply press Command-Shift-Enter to insert a blank line into the list, like this:

Things to do tomorrow:
 - Fix back door latch.
 - Carry duck food up from car.
 # 
 - 

So with one keystroke, I’ve inserted a # line into the list (which Obsidian renders as a gap between the two list items) and am ready to start typing the next list item.

The only thing that doesn’t work well with this is that it’s limited to top-level list items. If I have an indented list, I have to go and manually edit the lines to get them to indent correctly. For example:

Item 1
 - Item 1.1
 - Item 1.2
    - Item 1.2.1
    - Item 1.2.2

If I type Command-Shift-Enter at the end of the “Item 1.2.2” line, I get the following:

Item 1
 - Item 1.1
 - Item 1.2
    - Item 1.2.1
    - Item 1.2.2
 # 
 - 

Ideally the “#” line and the “-” would be indented to match the item above – but a simple template can’t do that, of course.

I’d like to see if something like SilentVoid’s Templater community plugin can do this – it lets you run arbitrary JavaScript code in a template, and gives access to the Obsidian API, so in theory I could find the indent of the current line and use that to insert the right number of leading spaces to indent the new lines to match…

Anyway, thanks again, everyone – I’m happy with this limited solution for now.

4 Likes