{"id":13895655,"url":"https://github.com/ziontee113/SnippetGenie","last_synced_at":"2025-07-17T11:31:47.158Z","repository":{"id":106850027,"uuid":"600093875","full_name":"ziontee113/SnippetGenie","owner":"ziontee113","description":"Snippet creation tool for Neovim","archived":true,"fork":false,"pushed_at":"2024-06-26T23:19:13.000Z","size":65,"stargazers_count":62,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T00:35:04.839Z","etag":null,"topics":["lua","luasnip","neovim","neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziontee113.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-10T15:13:52.000Z","updated_at":"2024-11-13T18:37:45.000Z","dependencies_parsed_at":"2024-11-18T01:47:09.985Z","dependency_job_id":null,"html_url":"https://github.com/ziontee113/SnippetGenie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziontee113/SnippetGenie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziontee113%2FSnippetGenie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziontee113%2FSnippetGenie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziontee113%2FSnippetGenie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziontee113%2FSnippetGenie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziontee113","download_url":"https://codeload.github.com/ziontee113/SnippetGenie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziontee113%2FSnippetGenie/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265600599,"owners_count":23795722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","luasnip","neovim","neovim-plugin"],"created_at":"2024-08-06T18:02:22.097Z","updated_at":"2025-07-17T11:31:46.887Z","avatar_url":"https://github.com/ziontee113.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"## SnippetGenie: Snippet creation tool for Neovim\n\nA Neovim plugin that aims to simplify the process of creating LuaSnip Snippets.\n\u003c!-- Say goodbye to manually creating snippets and hello to increased productivity. --\u003e\n\u003c!-- Get started with the easy-to-use plugin today. --\u003e\n\n\nhttps://user-images.githubusercontent.com/102876811/218838598-b12c73c9-3863-4db4-a08b-c8cccf43348d.mp4\n\n\n## Installation:\n\n`Lazy.nvim` example:\n\n```lua\nreturn {\n    \"ziontee113/SnippetGenie\",\n    config = function()\n        local genie = require(\"SnippetGenie\")\n\n        genie.setup({\n            -- SnippetGenie will use this regex to find the pattern in your snippet file,\n            -- and insert the newly generated snippet there.\n            regex = [[-\\+ Snippets goes here]],\n            -- A line that matches this regex looks like:\n            ------------------------------------------------ Snippets goes here\n\n            -- this must be configured\n            snippets_directory = \"/path/to/my/LuaSnip/snippet/folder/\",\n\n            -- let's say you're creating a snippet for Lua,\n            -- SnippetGenie will look for the file at `/path/to/my/LuaSnip/snippet/folder/lua/generated.lua`\n            -- and add the new snippet there.\n            file_name = \"generated\",\n\n            -- SnippetGenie was designed to generate LuaSnip's `fmt()` snippets.\n            -- here you can configure the generated snippet's \"skeleton\" / \"template\" according to your use case\n            snippet_skeleton = [[\ns(\n    \"{trigger}\",\n    fmt([=[\n{body}\n]=], {{\n        {nodes}\n    }})\n),\n]],\n        })\n\n        -- SnippetGenie doesn't map any keys by default.\n        -- Here're the suggested mappings:\n        vim.keymap.set(\"x\", \"\u003cCR\u003e\", function()\n            genie.create_new_snippet_or_add_placeholder()\n            vim.cmd(\"norm! \u001b\") -- exit Visual Mode, go back to Normal Mode\n        end, {})\n\n        vim.keymap.set(\"n\", \"\u003cCR\u003e\", function()\n            genie.finalize_snippet()\n        end, {})\n    end,\n}\n```\n\n## Example Usage:\n\nLet's say you want to create a snippet for Lua. We have this example Lua buffer:\n\n```lua\nlocal module = require(\"module\")\n\nlocal function my_func()\n    local x = 10\n    local y = 100\nend\n```\n\n1. Make sure that `/path/to/my/LuaSnip/snippet/folder/lua/generated.lua` file exists with required boilerplate already in place.\n\nFor example:\n\n```lua\nlocal ls = require(\"luasnip\")\nlocal s = ls.snippet\nlocal i = ls.insert_node\n\nlocal snippets = {\n  s(\n  \"my_snippet\",\n    fmt([=[\nHello {}\n]=], { i(1, \"World\") })\n  ),\n\n  ------------------------------------------------------ Snippets goes here\n}\n\nlocal autosnippets = {}\n\nreturn snippets, autosnippets\n```\n2. We select the content of the snippet we want to create. In this example, we `jj` to line 3, use `V` then `G` to\nselect the entire function. Then we press `\u003cCR\u003e` (as we mapped for SnippetGenie) to initiate the snippet creation process,\nand send us back to Normal Mode.\n\n3. We navigate to line 3 `my_func`, select it with Visual Mode, and press `\u003cCR\u003e` to add a `placeholder`.\nThen we go to line 4, select `10`, press `\u003cCR\u003e` to add the 2nd placeholder.\nThen we go to line 5, select `100`, press `\u003cCR\u003e` to add the 3rd placeholder.\n\n4. After we selected our initial snippet content and our placeholders, in Normal Mode, we press `\u003cCR\u003e` to finalize the\nsnippet creation process. You will be prompted to enter the trigger for the snippet, let's enter `testing`.\nAfter entering the trigger, press `\u003cCR\u003e`, the snippet will be added to the proper snippet file and will be instantly loaded.\n\n5. Enter the trigger for the snippet you just created to test it out.\n\nThe file `/path/to/my/LuaSnip/snippet/folder/lua/generated.lua` should now look something like:\n\n```lua\nlocal ls = require(\"luasnip\")\nlocal s = ls.snippet\nlocal i = ls.insert_node\n\nlocal snippets = {\n    s(\n        \"my_snippet\",\n        fmt([=[\n            Hello {}\n        ]=], { i(1, \"World\") })\n    ),\n\n    s(\n        \"testing\",\n        fmt([=[\nlocal function {}()\n    local x = {}\n    local y = {}\nend\n        ]=], {\n            i(1, \"my_func\"),\n            i(2, \"10\"),\n            i(3, \"100\"),\n        })\n    ),\n\n  ------------------------------------------------------ Snippets goes here\n}\n\nlocal autosnippets = {}\n\nreturn snippets, autosnippets\n```\n\n## Get involved in the development process \n\nFeedback is always appreciated. If you encounter any issues or have suggestions for improving the plugin,\nplease feel free to open an issue or pull request. One of the key goals is to make the plugin as user-friendly as possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziontee113%2FSnippetGenie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziontee113%2FSnippetGenie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziontee113%2FSnippetGenie/lists"}