abo-abo / auto-yasnippet

quickly create disposable yasnippets
246 stars 15 forks source link

Add ability to trim spaces from the beginning of the snippet #31

Closed r-darwish closed 5 years ago

r-darwish commented 5 years ago

Since the snippet starts with (line-beginning-position) the indentation is part of the snippet.

Since I use electric-indent-mode, I'm already indented to the right place whenever I make a new line, so calling aya-expand will just create the wrong indentation.

One solution would be to create a customized boolean which trims spaces from the snippets. Another approach would be to allow the users to customize the beginning of the line function so they can choose (mwim-beginning-of-line). I think I prefer the first solution and I could open a PR if this idea is accepted.

abo-abo commented 5 years ago

The first solution sounds good. Please PR.