Download Latest Version v2.4.0 source code.tar.gz (336.5 kB)
Email in envelope

Get an email when there's a new version of LuaSnip

Home / v2.2.0
Name Modified Size InfoDownloads / Week
Parent folder
2.2.0 source code.tar.gz 2023-12-31 316.4 kB
2.2.0 source code.zip 2023-12-31 389.4 kB
README.md 2023-12-31 2.5 kB
Totals: 3 Items   708.3 kB 0

Highlights

Overhaul of vscode/snipmate/lua-loaders

The implementation of the loaders was greatly refactored, and there are a few new features: * We can now reload files when they are updated in another neovim-instance/in some other editor (via libuv). This can be enabled by passing fs_event_providers = {libuv=true} to the load-call, like so

:::lua
require("luasnip.loaders.from_lua").lazy_load({paths = "./luasnippets", fs_event_providers = {libuv=true}})
  • Files that are created after the load-call will be loaded (which was not the case previously)
  • Similarly to the above, it is also possible to "register" a snippet-collection for loading as soon as it is created. To enable this for some collection, pass it to the lazy_paths-key in load:

    :::lua require("luasnip.loaders.from_lua").load({lazy_paths = ".luasnippets"}) (this example is especially useful since it will load a snippet-collection in the current directory, which could be a project-specific one) * The lua-loader may define dependencies on files, such that the snippet-files that depend on some file will be reloaded when the file is edited. Load a file via ls_tracked_dofile or a package via ls_tracked_dopackageto make use of this.

All of these features are also documented in DOC.md, take a look for more details.

What's Changed

New Contributors

A hearty Thank You! to all contributors :)

Full Changelog: https://github.com/L3MON4D3/LuaSnip/compare/v2.1.1...v2.2.0

Source: README.md, updated 2023-12-31