How do I create a multi line text snippet?

What I’m trying to do

I want to create a snippet that upon entering cl;, the text expands to with | as my cursor

class | {
    public:
    private:
};

Things I have tried

I’ve tried including this in my snippets text box

cl; : class $end$ {$nl$
    public:$nl$
    private:$nl$
};$nl$

But this doesn’t expand at all. What am I doing wrong?

Obsidian itself doesn’t have any text expansion feature built-in. Are you trying to do this with an OS option, another app, a community plugin, etc.?

This is with the community plugin, Text Snippets (Link).

I think maybe the ; is throwing things off. Try something without it. Both of these seem fine:

clp : class $end$ {$nl$ public:$nl$ private:$nl$ };$nl$

clpp : class $end$ {$nl$
    public:$nl$
    private:$nl$
};$nl$

Obsidian_uuefrTdJHp

Thanks! It works if I press the hotkey, but not when I press tab despite me having tab as a trigger.

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