honza / vim-snippets
vim-snipmate default snippets (Previously snipmate-snippets)
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing honza/vim-snippets in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewsnipMate & UltiSnip Snippets ============================ This repository contains snippets files for various programming languages. It is community-maintained and many people have contributed snippet files and other improvements already. Contents -------- • : snippets using snipMate format • : snippets using UltiSnips format Snippet engines supporting vim-snippets ---------------------------------------- There are different forks of snippet engines which allow the user to insert snippets by typing the name of a snippet hitting the expansion mapping. • [github.com/SirVer/ultisnips][7]: python, supports all snippets in this repo. • github.com/garbas/vim-snipmate: VimL, snipmate-snippets, engine sometimes behaves strange. Supports snippets/* • github.com/Shougo/neosnippet: VimL, supports snippets/* with some configuration. • github.com/dcampos/nvim-snippy: Lua, supports snippets/* with some configuration. • github.com/L3MON4D3/LuaSnip: Lua, supports snippets/* with some configuration. Also supports redefining snippets without changing the priority, unlike nvim-snippy. • github.com/drmingdrmer/xptemplate: Totally different syntax, does not read snippets contained in this file, but it is also very powerful. It does not support vim-snippets (just listing it here for completeness) There tries to be a more comprehensive list (which still is incomplete) here: http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html UltiSnips has additional features such as high speed, nesting snippets, expanding snippets in snippets and offers powerful transformations on text in snippets (like visual selections or placeholder texts). Which one to use? If you have python give [SirVer/ultisnips][7] a try because its fast and has the most features. If you have VimL only (vim without python support) your best option is using garbas/vim-snipmate and cope with the minor bugs found in the engine. If you use Neovim and prefer Lua plugins, L3MON4D3/LuaSnip is the best option. **Q**: Should snipMate be deprecated in favour of UltiSnips? **A**: No, because snipMate is VimL, and UltiSnips requires Python. Some people want to use snippets without having to install Vim with Python support. Yes - this sucks. One solution would be: Use snippets if they are good enough, but allow overriding them in UltiSnips. This would avoid most duplication while still serving most users. AFAIK there is a nested-placeholder branch for snipMate too. snipMate is still improved by Adnan Zafar. So maybe time is not ready to make a final decision yet. github issue/discussion Vendor Snippets --------------- Additional library and framework snippets are available for UltiSnips users in the directory. These files are removed from the default language namespaces to prevent them from all being loaded automatically. If there is a separate library, framework, or package you would like to support open a pull request! Additional snippets can be added to the current buffer with the command followed by the snippet name without the "snippets" ending. For example, to add the JavaScript Jasmine snippets, run: . To have this snippet loaded everytime a JavaScript file is opened or created you can add the command to your • file. Another way is to add in your . For more see the UltiSnips docs ( ). Installation ------------ First be aware that there are many options, see "Snippet engines" above. Second be aware than there are [tons of plugin managers][8] which is why Marc Weber thinks that it doesn't make sense to repeat the same repetitive information everywhere. The recommended way to install these snippets is by using [vim-addon-manager][9]. Marc Weber wrote it for exactly this reason, it supports simple dependency management. E.g. all you need is this line in your : vim-pi Is the place to discuss plugin managers and repository resources. For snipMate installation instructions, please see [snipmate@garbas][1]. Pull requests adding installation instructions for Pathogen, Bundle, git clone, etc. are welcome and much appreciated. Getting help ------------ If you still have trouble getting this to work, please create a GitHub issue. Things to consider when contributing ------------------------------------ Some snippets are useful for almost all languages, so let's try to have the same triggers for them: Don't add useless placeholder default texts like: instead use: Exception: Functions which are used less often, such as Vim's , functions which case hints may be helpful to remember order. In the VimL case get vim-dev plugin which has function completion Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks When the snippet can be used to wrap existing code leverage Open questions: What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ? Which additional policies to add? Discuss at: https://github.com/honza/vim-snippets/issues/230 *folding markers*: Until further work is done on , please don't add folding markers into snippets. has some comments about how to patch all snippets on the fly adding those. Currently all snippets from UltiSnips have been put into - some work on merging should be done (dropping duplicates etc). Also see engines section above. Since UltiSnips supports both UltiSnip and vim-snipmate snippets, when contributing fixes/new snippets, please prefer adding vim-snipmate snippets. Related repositories -------------------- We also encourage people to maintain sets of snippets for particular use cases so that all users can benefit from them. People can list their snippet repositories here: • https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files) • https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files) • https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML) • https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml) •…