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

Excluding specific snippets from specific filetype #439

Open
fmorroni opened this issue Apr 18, 2024 · 1 comment
Open

Excluding specific snippets from specific filetype #439

fmorroni opened this issue Apr 18, 2024 · 1 comment

Comments

@fmorroni
Copy link

Hi, I see there's a way to exclude all snippets of a specific language, but I'd like to exclude specific snippets. For example I have a custom for snippet for javascript and I would like to disable the friendly-snippets' one, while still leaving the rest active.
Is this currently possible?

@OkelleyDevelopment
Copy link
Collaborator

Hi @fmorroni, I don't currently have a lua snippet to share. However, I can recommend this alternative (assuming you're using LuaSnip as the snippet engine):

{
  "custom-for-loop": {
    "prefix": "for",
    "body": "for { $0 }",
    "luasnip": {
      "priority": 2000
    }
  }
}

where the important part is this:

"luasnip": {
  "priority": 2000
}

This will place the custom for loop snippet above the one loaded from friendly-snippets. Pretty sure the number just needs to be >= 100, but test around and see for yourself. I tested with 2000 and it worked ... so let me know if this helps (at least in the short term)! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants