{"id":13479875,"url":"https://github.com/honza/vim-snippets","last_synced_at":"2025-04-13T06:15:15.331Z","repository":{"id":37251589,"uuid":"1924847","full_name":"honza/vim-snippets","owner":"honza","description":"vim-snipmate default snippets (Previously snipmate-snippets)","archived":false,"fork":false,"pushed_at":"2024-08-15T02:31:03.000Z","size":2079,"stargazers_count":4854,"open_issues_count":84,"forks_count":2026,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-04-13T06:15:11.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vim Snippet","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/honza.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-06-20T17:42:05.000Z","updated_at":"2025-04-10T05:45:18.000Z","dependencies_parsed_at":"2023-02-15T16:31:37.963Z","dependency_job_id":"716ebe58-5f4f-42fe-9d0a-8bbe9b1a1e40","html_url":"https://github.com/honza/vim-snippets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Fvim-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Fvim-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Fvim-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Fvim-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honza","download_url":"https://codeload.github.com/honza/vim-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670434,"owners_count":21142904,"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":[],"created_at":"2024-07-31T16:02:24.507Z","updated_at":"2025-04-13T06:15:15.309Z","avatar_url":"https://github.com/honza.png","language":"Vim Snippet","funding_links":[],"categories":["Vim Snippet","others","Tools"],"sub_categories":["Snippets"],"readme":"snipMate \u0026 UltiSnip Snippets\n============================\n\n[![Build Status](https://travis-ci.org/honza/vim-snippets.svg)](https://travis-ci.org/honza/vim-snippets)\n\nThis repository contains snippets files for various programming languages.\n\nIt is community-maintained and many people have contributed snippet files and\nother improvements already.\n\nContents\n--------\n\n- `snippets/*`: snippets using snipMate format\n- `UltiSnips/*`: snippets using UltiSnips format\n\nSnippet engines supporting vim-snippets\n----------------------------------------\n\nThere are different forks of snippet engines which allow the user to insert\nsnippets by typing the name of a snippet hitting the expansion mapping.\n\n- [github.com/SirVer/ultisnips][7]:\n  python, supports all snippets in this repo.\n- [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate):\n  VimL, snipmate-snippets, engine sometimes behaves strange. Supports\n  snippets/*\n- [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim):\n  VimL, supports snippets/* with some configuration.\n- [github.com/dcampos/nvim-snippy](https://github.com/dcampos/nvim-snippy):\n  Lua, supports snippets/* with some configuration.\n- [github.com/L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip):\n  Lua, supports snippets/* with some configuration.\n  Also supports redefining snippets without changing the priority, unlike\n  nvim-snippy.\n- [github.com/drmingdrmer/xptemplate](https://github.com/drmingdrmer/xptemplate):\n  Totally different syntax, does not read snippets contained in this file, but\n  it is also very powerful. It does not support vim-snippets (just listing it\n  here for completeness)\n\nThere tries to be a more comprehensive list (which still is incomplete) here:\nhttp://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html\n\nUltiSnips has additional features such as high speed, nesting snippets,\nexpanding snippets in snippets and offers powerful transformations on text in\nsnippets (like visual selections or placeholder texts).\n\nWhich one to use? If you have python give [SirVer/ultisnips][7] a try because\nits fast and has the most features.\n\nIf you have VimL only (vim without python support) your best option is using\n[garbas/vim-snipmate](https://github.com/garbas/vim-snipmate) and cope with the\nminor bugs found in the engine.\n\nIf you use Neovim and prefer Lua plugins,\n[L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) is the best option.\n\n**Q**: Should snipMate be deprecated in favour of UltiSnips?\n\n**A**: No, because snipMate is VimL, and UltiSnips requires Python.\nSome people want to use snippets without having to install Vim with Python\nsupport. Yes - this sucks.\n\nOne solution would be: Use snippets if they are good enough, but allow overriding them\nin UltiSnips. This would avoid most duplication while still serving most users.\nAFAIK there is a nested-placeholder branch for snipMate too. snipMate is still\nimproved by Adnan Zafar. So maybe time is not ready to make a final decision yet.\n\n[github issue/discussion](https://github.com/honza/vim-snippets/issues/363)\n\nVendor Snippets\n---------------\n\nAdditional library and framework snippets are available for UltiSnips users in\nthe `UltiSnips/` directory. These files are removed from the default language\nnamespaces to prevent them from all being loaded automatically. If there is a\nseparate library, framework, or package you would like to support open a pull\nrequest!\n\nAdditional snippets can be added to the current buffer with the\n`:UltiSnipsAddFiletypes` command followed by the snippet name without the\n\"snippets\" ending. For example, to add the JavaScript Jasmine snippets, run:\n`:UltiSnipsAddFiletypes javascript-jasmine`. To have this snippet loaded\neverytime a JavaScript file is opened or created you can add the command to your\n -`.vim/ftplugin/javascript.vim` file. Another way is to add\n `autocmd FileType js UltiSnipsAddFiletypes javascript-jasmine` in your `.vimrc`.\n\n\nFor more see the UltiSnips docs (`:help UltiSnips`).\n\nInstallation\n------------\n\nFirst be aware that there are many options, see \"Snippet engines\" above.  Second\nbe aware than there are [tons of plugin managers][8] which is why Marc Weber\nthinks that it doesn't make sense to repeat the same repetitive information\neverywhere.\n\nThe recommended way to install these snippets is by using\n[vim-addon-manager][9].  Marc Weber wrote it for exactly this reason, it\nsupports simple dependency management. E.g. all you need is this line in your\n`.vimrc`:\n\n```vim\n\" assuming you want to use snipmate snippet engine\nActivateAddons vim-snippets snipmate\n```\n\n[vim-pi](https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface)\nIs the place to discuss plugin managers and repository resources.\n\nFor snipMate installation instructions, please see [snipmate@garbas][1].\n\nPull requests adding installation instructions for Pathogen, Bundle, git clone,\netc. are welcome and much appreciated.\n\nGetting help\n------------\n\nIf you still have trouble getting this to work, please create a GitHub issue.\n\nThings to consider when contributing\n------------------------------------\n\nSome snippets are useful for almost all languages, so let's try to have the same\ntriggers for them:\n\n```\nif : if without else\nife: if $1 else $2\neif : else if ($1) { .. }\nel  : else ..\nwh  : while (cond) ...\n```\n\nDon't add useless placeholder default texts like:\n\n```\nif (${1:condition}){\n  ${0:some code here}\n}\n```\ninstead use:\n\n```\nif (${1}){\n  ${0:${VISUAL}}\n}\n```\n\nException: Functions which are used less often, such as Vim's `matchall()`, `matchstr()`\nfunctions which case hints may be helpful to remember order. In the VimL case\nget vim-dev plugin which has function completion\n\nThus for conditions (while, if ..) and block bodies just use ${N} - Thanks\n\nWhen the snippet can be used to wrap existing code leverage `${VISUAL}`\n\nOpen questions:\nWhat about one line if ee then .. else .. vs if \\n .. then \\n ... \\n else \\n .. ?\nWhich additional policies to add?\nDiscuss at: https://github.com/honza/vim-snippets/issues/230\n\n*folding markers*:\nUntil further work is done on `vim-snipmate`, please don't add folding markers\ninto snippets. `vim-snipmate` has some comments about how to patch all snippets\non the fly adding those.\n\nCurrently all snippets from UltiSnips have been put into `/UltiSnips` - some work\non merging should be done (dropping duplicates etc). Also see engines section above.\n\nSince UltiSnips supports both UltiSnip and vim-snipmate snippets, when\ncontributing fixes/new snippets, please prefer adding vim-snipmate snippets.\n\nRelated repositories\n--------------------\n\nWe also encourage people to maintain sets of snippets for particular use cases\nso that all users can benefit from them.  People can list their snippet repositories here:\n\n* https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files)\n* https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files)\n* https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML)\n* https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml)\n* https://github.com/sniphpets (advanced snippets for PHP, Symfony 2/3, Doctrine and etc.)\n\nInstallation using VAM: https://github.com/MarcWeber/vim-addon-manager\n\nFuture ideas and examples\n-------------------------\n\n[overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html)\nIf you have ideas you can add them to that list of \"snippet engine features by example\".\n\nHistorical notes\n----------------\n\n[vim-snipmate][1] was originally started by [Michael Sanders][2] who has now\nunfortunately abandoned the project. [Rok Garbas][3] is now maintaining a\n[fork][4] of the project in hopes of improving the existing code base.\n\nVersions / dialects / ..\n========================\n\nThere are some issues, such as newer language versions may require other\nsnippets than older. If this exists we currently recommend doing this:\n\n* add snippets/ruby.snippets (common snippets)\n* add snippets/ruby-1.8.snippets (1.8 only)\n* add snippets/ruby-1.9.snippets (1.9 only)\n\nthen configure https://github.com/garbas/vim-snipmate this way:\n\n```vim\nlet g:snipMate = {}\nlet g:snipMate.scope_aliases = {}\nlet g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'\n```\n\nIf it happens that you work on a project requiring ruby-1.8 snippets instead,\nconsider using `vim-addon-local-vimrc` and override the filetypes.\n\nWell - of course it may not make sense to create a new file for each\nruby-library-version triplet. Sometimes postfixing a name such as\n\n```\nmigrate_lib_20_down\nmigrate_lib_20_up\n```\n\nwill do it then if syntax has changed.\n\nLanguage maintainers\n--------------------\n\nNo one can really be proficient in all programming languages. If you would like\nto maintain snippets for a language, please get in touch.\n\nNotes: People are interested in snippets - and their interest may wane again.\nThis list is kept up-to-date on a best effort basis.\n\n* Elixir - [lpil](https://github.com/lpil), [iurifq](https://github.com/iurifq)\n* Falcon - [steveno](https://github.com/steveno)\n* HTML Django - [honza](http://github.com/honza)\n* Javascript - [honza](http://github.com/honza)\n* Markdown - [honza](http://github.com/honza)\n* PHP - [chrisyue](http://github.com/chrisyue)\n* Python - [honza](http://github.com/honza)\n* Ruby - [taq](http://github.com/taq)\n* Scala - [gorodinskiy](https://github.com/gorodinskiy)\n\nLicense\n-------\n\nJust as the original snipMate plugin, all the snippets are licensed under the\nterms of the MIT license.\n\n[1]: http://github.com/garbas/vim-snipmate\n[2]: http://github.com/msanders\n[3]: http://github.com/garbas\n[4]: http://github.com/garbas/vim-snipmate\n[7]: http://github.com/SirVer/ultisnips\n[8]: http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html\n[9]: https://github.com/MarcWeber/vim-addon-manager\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonza%2Fvim-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonza%2Fvim-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonza%2Fvim-snippets/lists"}