{"id":13410846,"url":"https://github.com/dcampos/nvim-snippy","last_synced_at":"2025-05-16T06:08:03.864Z","repository":{"id":39642518,"uuid":"386786647","full_name":"dcampos/nvim-snippy","owner":"dcampos","description":"Snippet plugin for Neovim written in Lua","archived":false,"fork":false,"pushed_at":"2025-04-02T16:09:41.000Z","size":298,"stargazers_count":326,"open_issues_count":9,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T16:06:14.226Z","etag":null,"topics":["lua","neovim","neovim-plugin","snippets"],"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/dcampos.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":"2021-07-16T23:18:10.000Z","updated_at":"2025-04-05T17:52:33.000Z","dependencies_parsed_at":"2023-11-11T01:27:58.683Z","dependency_job_id":"c59e3c25-fb3d-4c46-b88a-7de6a7c1be57","html_url":"https://github.com/dcampos/nvim-snippy","commit_stats":{"total_commits":305,"total_committers":17,"mean_commits":"17.941176470588236","dds":0.06557377049180324,"last_synced_commit":"87b9a4fc514a789fca833bf540484fbda6a946b3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fnvim-snippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fnvim-snippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fnvim-snippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fnvim-snippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcampos","download_url":"https://codeload.github.com/dcampos/nvim-snippy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478193,"owners_count":22077676,"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","neovim","neovim-plugin","snippets"],"created_at":"2024-07-30T20:01:09.729Z","updated_at":"2025-05-16T06:07:58.850Z","avatar_url":"https://github.com/dcampos.png","language":"Lua","readme":"# Snippy\n\nA snippets plugin for Neovim **0.7.0+** written in Lua.\n\n## Status\n\nThe plugin is mostly stable and feature complete as a minimal and simple snippets manager.\nAlso, see the [FAQ](#faq) section.\n\n## Features\n\n* Uses the built-in `extmarks` feature\n* Support for defining multiple snippets in a single file\n* Support for expanding LSP provided snippets\n* Full support for the syntax and file format used by SnipMate\n* No dependencies\n\n## Installation\n\nInstall using your favorite plugin manager.\n\nUsing vim-plug:\n\n```vim\nPlug 'dcampos/nvim-snippy'\n```\n\nThere are no snippets installed by default. You can create your own, or install\n`vim-snippets`:\n\n```vim\nPlug 'honza/vim-snippets'\n```\n\nIf you want to use Snippy with [nvim-cmp][2], please install and configure\n[cmp-snippy][6].\n\n## Usage\n\nSnippy comes with no mappings activated by default, so you need to define\nsome.\n\nFor example, to use `\u003cTab\u003e` to expand and jump forward, `\u003cS-Tab` to jump back:\n\n```vim\nimap \u003cexpr\u003e \u003cTab\u003e snippy#can_expand_or_advance() ? '\u003cPlug\u003e(snippy-expand-or-advance)' : '\u003cTab\u003e'\nimap \u003cexpr\u003e \u003cS-Tab\u003e snippy#can_jump(-1) ? '\u003cPlug\u003e(snippy-previous)' : '\u003cS-Tab\u003e'\nsmap \u003cexpr\u003e \u003cTab\u003e snippy#can_jump(1) ? '\u003cPlug\u003e(snippy-next)' : '\u003cTab\u003e'\nsmap \u003cexpr\u003e \u003cS-Tab\u003e snippy#can_jump(-1) ? '\u003cPlug\u003e(snippy-previous)' : '\u003cS-Tab\u003e'\nxmap \u003cTab\u003e \u003cPlug\u003e(snippy-cut-text)\n```\n\nWhen using Lua, you can wrap the above block in a `vim.cmd([[...]])` call, or\ncall the `snippy.setup()` function passing your mapping options:\n\n```lua\nrequire('snippy').setup({\n    mappings = {\n        is = {\n            ['\u003cTab\u003e'] = 'expand_or_advance',\n            ['\u003cS-Tab\u003e'] = 'previous',\n        },\n        nx = {\n            ['\u003cleader\u003ex'] = 'cut_text',\n        },\n    },\n})\n```\n\nYou can also define separate mappings to expand and jump forward. See `:help snippy-usage`\nand also the [mapping examples](../../wiki/Mappings) on the Wiki.\n\n## Adding snippets\n\nNormally, you should place your custom snippets in\n`$XDG_CONFIG_HOME/nvim/snippets`. However, any `snippets` directory in\n`runtimepath` will be searched for snippets. Files with the `.snippet`\nextension contain a single snippet, while files with the `.snippets`\nextension can be used to declare multiple snippets.\n\nA basic `lua.snippets` file for Lua, demonstrating some of the plugin's\nfeatures, would look like this:\n\n```vim-snippet\n# Comments are possible\nsnippet fun\n\tfunction ${1:name}(${2:params})\n\t\t${0:$VISUAL}\n\tend\nsnippet upcase\n\tlocal ${1:var} = '${1/.*/\\U\\0/g}'\nsnippet choices\n\tprint('My favorite language is: ${1|JavaScript,Lua,Rust|}')\nsnippet date\n\tCurrent date is `strftime('%c')`\n# Custom tabstop order\nsnippet repeat\n\trepeat\n\t\t${2:what}\n\twhile ${1:condition}\n```\n\nYou can find example snippets in the [honza/vim-snippets][3] repository, which,\nif installed, Snippy will also use automatically as a source of snippets.\n\nSee `:help snippy-usage-snippets` and `:help snippy-snippet-syntax` for more\ninformation.\n\n## Expanding LSP snippets\n\nThe LSP snippet syntax is almost fully supported. If you use a completion plugin\nlike nvim-cmp, please install the respective integration plugin listed\nabove in the [Installation](#installation) section.\n\nYou can also expand LSP snippets present in completion items provided by Neovim's\nbuilt-in `vim.lsp.omnifunc`. See `:help snippy.complete_done()` for details.\n\n## Running tests\n\nThere are some functional and unit tests available. To run them, use either:\n\n```\nmake functionaltest\n```\n\nOr:\n\n```\nmake unittest\n```\n\nYou need to have [`vusted`][4] installed for running the unit tests.\n\n## Advantages\n\nThese are some of the advantages of this plugin when compared with other snippet plugins for Vim/Neovim:\n\n* Core Neovim only, no external dependencies.\n* Uses built-in `extmarks` feature, avoiding insertion of markers in the text.\n* Simple snippet file format, no need to edit JSON files by hand.\n* No need to define snippets in Lua or Vimscript code.\n* Simple and standard snippet syntax.\n\n## FAQ\n\n#### Is feature X from Ultisnips available?\n\nThis question is very frequently asked and the answer is usually no. UltiSnips\nis a great snippet manager for those who want to use advanced snippet features,\nsuch as Python code evaluation, but that comes with the cost of being heavy and\ncomplex, whereas Snippy aims to be minimal and simple. That said, UltiSnips has\nsome useful features, like auto-trigger, that have been added to Snippy in\norder to improve usability.\n\n**See also:** issues with label [![label: question][~question]](https://github.com/dcampos/nvim-snippy/issues?q=label%3Aquestion).\n\n## Known bugs\n\n* There is a bug in Neovim where `extmarks` are extended to the beginning of\n  the completed item when the `complete()` function is called and a completion\n  menu is shown, even if the user does not select or confirm anything. See the\n  [bug report][1] for more information.\n\n## Acknowledgements\n\nThe snippet parsing code is based on [vsnip][5].\n\n## License\n\nMIT license.\n\n[1]: https://github.com/neovim/neovim/issues/13816\n[2]: https://github.com/hrsh7th/nvim-cmp\n[3]: https://github.com/honza/vim-snippets\n[4]: https://github.com/notomo/vusted\n[5]: https://github.com/hrsh7th/vim-vsnip\n[6]: https://github.com/dcampos/cmp-snippy\n[~question]: https://img.shields.io/github/labels/dcampos/nvim-snippy/question\n","funding_links":[],"categories":["Snippet","Lua","neovim-plugin"],"sub_categories":["Markdown and LaTeX","Assembly"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcampos%2Fnvim-snippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcampos%2Fnvim-snippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcampos%2Fnvim-snippy/lists"}