Open baronyoung opened 2 months ago
+1
@baronyoung , @zmunk
{
"Say hello to the world": {
"prefix": ["hw", "hello"],
"body": "Hello, ${1:world}!$0"
}
}
Where does this go? A file in ~/.config/nvim/lua/config/snippets? What's the filename? Is that all that goes in the file? I'm using a mostly vanilla lazyVim setup and this plugin is included.
Since it has support for Friendly Snippets, you could follow that structure or use also a package.json
from #31 .
{
“name”: “snippets”,
“contributes”: {
“snippets”: [
{
“language”: [
“javascript”, “typescript"
],
“path”: “./javascript.json"
}
}
\n
Here, two filetypes are associated to the same .json file
Basically the following structure should work (I’m using my own fork of friendly-snippets, so I didn’t tested it):
DIR: ~/.config/nvim/snippets/
~/.config/nvim/snippets/
├── global.json
├── markdown.json
└── <filetype>.json
global.json
or all.json
are the ones loaded for every filetype, while markdown.json
are snippets loaded on buffers that match the filetype.
You could have folders to split multiple snippets for the same filetype, like
~/.config/nvim/snippets/
├── global.json
├── markdown.json
├── <filetype>.json
└── lua
├── lua.json
├── luadoc.json
└── nvim_lua.json
where lua
in this case is a folder with the specific snippets for it
I’m not able to make it work either. No matter what. I’m using Lazy package manager.
I’d like to remove luasnip and use this one. I’m only using LSP snippets features in luasnip.
@kevinm6 I saw your fork, I’ll try it later today. Thanks!
The readme has this: { "Say hello to the world": { "prefix": ["hw", "hello"], "body": "Hello, ${1:world}!$0" } }
Where does this go? A file in ~/.config/nvim/lua/config/snippets? What's the filename? Is that all that goes in the file? I'm using a mostly vanilla lazyVim setup and this plugin is included.