如何在yasnippet中为python-mode删除一行的缩进?

evo*_*ute 5 emacs yasnippet

我想关闭我的if语句,注释指示在if语句中检查的条件.我正在使用带有emacs的yasnippet,我使用的代码是:

# -*- mode: snippet -*-
# name: if
# key: if
# group : control structure
# --
if ${1:cond}:
    $0
# endif $1
Run Code Online (Sandbox Code Playgroud)

我的问题是最终的#endif注释与$ 0对齐.有没有办法让它与if语句一致?

小智 8

yas-indent-line控制此行为的值.尝试添加

# expand-env: ((yas-indent-line 'fixed))
Run Code Online (Sandbox Code Playgroud)

到标题.