LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

Add ability to load snipmate snippets that target all languages

Open kohloth opened this issue 1 year ago • 1 comments

Snipmate has a convention that lets you write snippets for specific languages. PHP snippets go inside php.snippets, Lua snippets go inside lua.snippets, and so on.

If you are in a Lua file, your PHP snippets are not elligable and are ignored.

Snipmate also has a convention that you can create a file named _.snippets. The snippets within this wildcard file are then elligable for use in any file type or language.

When using Luasnip with neovim, I just spent about 60 mins trying to understand why no snippets were working. After renaming my _.snippets file to php.snippets, and opening a php file, the snippets therein then worked, also demonstrating that this is why luasnip was seemingly doing nothing.

Could it be added to luasnip, an ability to define snipmate snippets somewhere that are elligable for use in any file?

kohloth avatar Mar 31 '24 12:03 kohloth

Use 'all' as the language

leiserfg avatar Mar 31 '24 12:03 leiserfg

(alternatively: ls.filetype_extend("all", "_"))

L3MON4D3 avatar Apr 01 '24 19:04 L3MON4D3