Yasnippet-snippets contains a snippet for Python mode to create a function with a docstring. The indention is not correct when I use it, I think it maybe has to do with some Spacemacs settings, but I can not find the source.

Are you using spacemacs and does this snippet indent correctly for you?

See here for Github issue.

  • 1
    Welcome! Can you edit your post to demonstrate what the snippet is giving you, and what you expect it to give? Also, you mentioned that you think Spacemacs may part of the problem. Can you start Emacs without Spacemacs (emacs -Q), run the snippet, and check?
    – Dan
    Jul 28, 2021 at 12:16

1 Answer 1


You need the following to preserve the spaces or tabs.

# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.