Crandel / tempel-collection

Collection tempel templates
GNU General Public License v3.0
76 stars 27 forks source link

Start templates which only make sense on newline with `&`? #18

Closed meliache closed 1 year ago

meliache commented 1 year ago

This is a discussion item.

Some templates only make sense on a newline and there I find it useful to prefix them with &, which adds a newline if point is not on an empty line. I have some personal python templates and there I did it for almost every template, because python is whitespace sensitiove and many statements need to be on their own line, there is no other way, e.g.

(ifm & "if __name__ == \"main\":" n> r)

I also found that this could be useful in some templates already in this repository, e.g. in most org-mode templates.

I'm thinking about contributing some templates, maybe also open PR's for improving existing ones, but would first like to discuss whether this is best practice or maybe there are good reasons not to spam &'s at the beginning of most templates.

Crandel commented 1 year ago

Fill free to open PR, I will review it for sure.

meliache commented 1 year ago

Not immediately cause I'm quite busy right now but soonish probably I will. Any PR from me will not be an extensive implementing everything that yasnippet had, but I expect that the snippets in this repo are more like examples on top of which users can add their own.

Crandel commented 1 year ago

I personally use only templates from this repo, so for me it's actually yassnipet-collection replacement.

jgarte commented 1 year ago

@Crandel Hi, should we worry about whether we duplicate templates from yasnippet-snippets in our PRs?

My goal is to also replace yasnippet-snippets with tempel-collection

Crandel commented 1 year ago

@jgarte You should ask yassnipet-snippets owners probably

jgarte commented 1 year ago

@Crandel I think it is probably OK given that it is free software. I should of phrased the question as the following:

What type of snippets do you want to curate in tempel-collection?

Are there any types of snippets for a particular language that you'd prefer not to have in the collection?

Crandel commented 1 year ago

@jgarte I'm fine with any language/mode in tempel-collection.