Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can call python in snippet? #1469

Open
hwypengsir opened this issue Nov 23, 2022 · 1 comment
Open

How can call python in snippet? #1469

hwypengsir opened this issue Nov 23, 2022 · 1 comment

Comments

@hwypengsir
Copy link

I want to expand ptest into welcome python in file ending with html,add lines in html.snippets(located in vim-snippets/UltiSnips):

snippet ptest
!p print("welcome python")
endsnippet

ptest expand into !p print("welcome python"),i rewrite the snippet as below then:

snippet ptest
`!p print("welcome python")`
endsnippet

ptest expand into nothing!

@smjonas
Copy link
Contributor

smjonas commented Nov 23, 2022

Python interpolation will use the result from the Python expression, so you can simply use "welcome python".

It's not about what you print since print does not return anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants