L3MON4D3 / LuaSnip

Snippet Engine for Neovim written in Lua.
Apache License 2.0
3.33k stars 237 forks source link

Need help with bootstrap 5 snippets #994

Open seralv opened 1 year ago

seralv commented 1 year ago

Does somebody know for some bootstrap5 snippets or, how can I create that snippet? I need that for NvChad, thanks.

L3MON4D3 commented 1 year ago

Have you looked into friendly-snippets, or vim-snippets? If you add them (via your package-manager), and load either vscode or snipmate snippets (via luasnip-config), they should be available

leiserfg commented 1 year ago

You can use a vscode snippet collection containing them, like https://github.com/pirulug/bootstrap5-snippets

seralv commented 1 year ago

Would you guide me how to do that please?

leiserfg commented 1 year ago

Just add it as a nvim plugin in your package manager (lazy, packer, ....) and luasnip vscode loader will find it.

seralv commented 1 year ago
image

Not loaded :(

leiserfg commented 1 year ago

Make luasnip depend on it, something like: { "L3MON4D3/LuaSnip", dependencies = { "rafamadriz/friendly-snippets", "pirulug/bootstrap5-snippets" }, }

seralv commented 1 year ago

Good, now is installed, but I want this for help me autocomplete code when I coding, but it doesn't work. What I have to do?

leiserfg commented 1 year ago

In your config, load the snippets as documented:

require("luasnip.loaders.from_vscode").lazy_load()
seralv commented 1 year ago

image

I have this in Lua/plugins/configs/others.lua, but not working the autocomplete in bootstrap code.

leiserfg commented 1 year ago

Why do you load and then lazy-load the snippets? Check https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#logging and set it up so you can see the logs. Maybe you can find clues of what's happening.