garymjr / garymjr/nvim-snippets

Prioritise ignore_filetypes over global_snippets?

Open
#58 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
259
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I have been trying to configure `nvim_snippets` to be disabled when writing in plain text (e.g., I don't have the need for copyright or date snippets when I'm just writing simple text). Using lazy.nvim and configuring in `~/.config/nvim/lua/plugins/nvim-snippets.lua`:

```lua
return {
"garymjr/nvim-snippets",
opts = {
ignored_filetypes = { "*.jrnl", "*.txt" },
},
}
```

Unfortunately, this doesn't disable the snippets. However, if I reconfigure `global_snippets`, I can disable them, but then those snippets will not work on any filetype:

```lua
return {
"garymjr/nvim-snippets",
opts = {
ignored_filetypes = { "*.jrnl", "*.txt" },
global_snippets = {},
},
}
```

Am I configuring something wrong here? Or does `global_snippets` take priority over `ignored_filetypes` and why?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nvim-snippets configuration handling for `ignored_filetypes` and `global_snippets`, using the lazy.nvim setup in `~/.config/nvim/lua/plugins/nvim-snippets.lua` to reproduce the behavior. Done means snippets are disabled for `*.jrnl` and `*.txt` while global snippets remain available for other filetypes.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.