Skip to content

Custom Markdown Snippets Not Loading in LuaSnip #1289

Closed
@adimail

Description

@adimail

After adding custom Markdown snippets in the ~/.config/nvim/lua/snippets/markdown.lua file and configuring LuaSnip, the snippets are not recognized in .md files. I have ensured filetype detection works and keybindings for snippet expansion are set up. However, the snippets remain inaccessible when editing Markdown files.

snippets/markdown.md

lua/snippets/markdown.md
local ls = require('luasnip')
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node

return {
    -- Headings
    s('h1', { t('# '), i(1, 'Header 1') }),
    s('h2', { t('## '), i(1, 'Header 2') }),
    ...
    ...
    ...
}

Other extensions are working fine, but the markdown snippets are not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions