I have an NvChad configuration for NeoVim, and I was trying to configure a LuaSnip plugin, but for some reason my Lua snippets are working correctly, but the json ones do not, and I want to figure out the reason for this
My cpp.json file is located at:
~/.config/nvim/snippets/vscode/cpp.json
My cpp.lua file is located at:
~/.config/nvim/snippets/lua/cpp.lua
Here is my configuration for LuaSnip:
return {
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets",
"nvim-treesitter/nvim-treesitter",
},
config = function()
local ls = require("luasnip")
local base = vim.fn.expand("~/.config/nvim/snippets/")
require("luasnip.loaders.from_lua").load({
paths = { base .. "lua" }
})
-- require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({
paths = { base .. "vscode" }
})
ls.config.set_config({
keep_roots = true,
link_roots = true,
link_children = true,
update_events = "TextChanged, TextChangedI",
delete_check_events = "TextChanged",
})
end,
}
Here is the body of my cpp.json file:
{
"simpleTest": {
"prefix": "ttest",
"body": ["123"]
}
}
OS: Arch Linux, WM: Hyprland