Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snippets.default): filter_snippets function for disabling certain snippet files #996

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

stefanboca
Copy link
Collaborator

This can be used with eg.

filter_snippets = function(ft, file)
  return not (string.match(file, "friendly.snippets") and string.match(file, "framework"))
end,

to disable friendly-snippets frameworks.

Closes #291

Also removes the ignored_filetypes option, which is redundant now that users can filter snippets with more control.

…pet files

This can be used with eg.
```lua
filter_snippets = function(ft, file)
  return not (string.match(file, "friendly.snippets") and string.match(file, "framework"))
end,
```
to disable friendly-snippets frameworks.

Closes Saghen#291
This is redundant now that users can filter snippets with more control.
@stefanboca stefanboca added the snippets Built-in provider and library for snippets label Jan 12, 2025
@Saghen Saghen merged commit 996aba4 into Saghen:main Jan 12, 2025
3 checks passed
@Saghen
Copy link
Owner

Saghen commented Jan 12, 2025

Long term I think we should move the settings for the registry into the top level snippets (maybe under snippets.registry), and make the snippets source options generic to all snippet providers (luasnip, mini.snippets, default). Just something to think about

@stefanboca stefanboca deleted the sb/push-mkzzozoyonst branch January 12, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snippets Built-in provider and library for snippets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow selectively enabling friendly-snippets frameworks
2 participants