Replies: 6 comments 18 replies
-
Alright then, starting my megathread post here 👀 Progress/Advice/ResourcesI've converted a majority of my snippets from UltiSnips to LuaSnip and hope to finish the rest ASAP as school is starting and I simply would shudder at the thought of having to create a matrix from scratch for my linear algebra class. Will update as I take notes and see what I still need to turn into snippets. Takeaways/Advice
local function math():
return vim.api.nvim_eval('vimtex#syntax#in_mathzone()') == 1
end Unfortunately, I haven't figured out how to do this for the rest of the modes (see questions), but we'll get there hopefully. Resources
QuestionsStill a few things I hope to be able to understand more/be able to convert. Feel free to tag me and let me know if you have implemented the following!
Converting snippets from UltiSnips to LuaSnip is quite a task; however, LuaSnip is packed with features and I'm sure the journey will be worth it. If you need some references, you can find some of my snippets here - hopefully they will be helpful! |
Beta Was this translation helpful? Give feedback.
-
Late to the party here, but just finished a guide addressing exactly this UltiSnips-to-LuaSnip-in-a-LaTeX-context issue and thought I'd share it here: https://www.ejmastnak.com/tutorials/vim-latex/luasnip.html (@evesdropper , I know you recently wrote a guide of your own, so I guess this is a bit redundant.) @L3MON4D3, although the examples are LaTeX-flavored, do you think this might also be useful as a general reference for new users getting started with Lua snippets, LaTeX-oriented or otherwise? I did a similar sort of beginner's tutorial over at VimTeX---it seems like GIFs, highlighted code blocks and other such eye candy are well-received by new users even if all the info is already in the Wiki or docs haha |
Beta Was this translation helpful? Give feedback.
-
@evesdropper cool, I'll put together a write-up sometime and ping you when it's ready |
Beta Was this translation helpful? Give feedback.
-
A bit of a side tangent but would it also be a good idea to indicate in resources/readme or something that newer users can take advantage of this discussion for help on converting snippets just to centralize knowledge? |
Beta Was this translation helpful? Give feedback.
-
A quick question: In Ultisnips I have snippets with repeated placeholders, for example:
I can use the same snippet (with some small modifications) with LuaSnip's snipmate loader, but when I fill in the first I prefer the Ultisnips behavior because I sometimes cancel the session (by leaving insert mode) after filling in the first |
Beta Was this translation helpful? Give feedback.
-
So, I'm not wrong in thinking that LuaSnip doesn't include any snips. That was a unexpected. Rather than trying to convert all UltiSnips, I found this repo that seems like set of basic snips that you can add to LuaSnips: https://github.com/molleweide/LuaSnip-snippets.nvim |
Beta Was this translation helpful? Give feedback.
-
This discussion is for collecing general advice and answering questions on converting Ultisnip-snippets to luasnip.
If you have a question, advice, or anything else related really, post it to this thread :D
Beta Was this translation helpful? Give feedback.
All reactions