Replies: 1 comment 10 replies
-
Ah, that article omits one detail: you'll have to also return the defined snippets in that file -- python.lua
return { require("luasnip").snippet(...) } It also works with |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm reading the suggested A LuaSnip guide for LaTeX workflows.
I have created the file
~/.config/nvim/snippets/my-snippets/python.lua
and I have put this inside of it:In my
init.lua
I have:When I type "hi", nothing happens.
If I wrap the content of
python.lua
insideadd_snippets
:Then it works correctly.
I don't understand why the guide didn't tell me to do so.
I also don't understand if "The file’s base name determines which Vim filetype the snippets apply to. For example, snippets inside the file tex.lua would apply to files with filetype=tex".
If that is the case, do I need to specify
python
as the first argument ofadd_snippets
? isn't the filename sufficient to identify which filetype the snippet applies to?Beta Was this translation helpful? Give feedback.
All reactions