Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Just to make clear it's needed a 'package.json' file with proper content in order to require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./my-cool-snippets" } }) to work.

I think the way this section is written right now may lead the reader to think package.json may be just a config file that can be added later on. Personally, it took me too much time to figure out this (imho) detail. This necessity wasn't entirely clear for me even after reading the documentation. Only after testing it by making the file and put the required content on it.

Hope this 2¢ may help other anxious people like me to set their cool snippets up. Thank you.
  • Loading branch information
heit0r authored and L3MON4D3 committed Nov 30, 2024
1 parent 4e58435 commit 2592b91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ loaders and their benefits. The following list serves only as a short overview.
```lua
-- load snippets from path/of/your/nvim/config/my-cool-snippets
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./my-cool-snippets" } })

(Note: It's mandatory to have a 'package.json' file in the snippet directory. For examples, see documentation.)
```
For more info on the VS Code loader, check the [examples](https://github.com/L3MON4D3/LuaSnip/blob/b5a72f1fbde545be101fcd10b70bcd51ea4367de/Examples/snippets.lua#L501) or [documentation](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#loaders).

Expand Down

0 comments on commit 2592b91

Please sign in to comment.