Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The ultimate snippet solution for python enabled Vim.

branch: master

Version 3.0

- Organisational changes: The project is now hosted on github. Snippets are
  now shipped separately - please track honza/vim-snippets.
- UltiSnips is now a drop in replacement for snipMate - it parses snipMate
  snippets and expands them emulating snipMates smaller feature set.
- Filetype tab completion for UltiSnipsEdit.
- UltiSnipsEdit now only edits private snippet files. Use UltiSnipsEdit! if
  you want to edit shipped files.
- New option 's' which strips trailing whitespace before jumping to next
  tabstop
- New option 'a' which converts non-ascii characters into ascii characters
  in transformations.
- New keyword in snippet files: priority defines which snippets should
  overwrite others. This deprecates the '!' option.
  *UltiSnips-adding-snippets*
- Remove common whitespace of visual line selections before inserting in an
  indented tabstop.
- Support for overwriting the snippet directory name on a per buffer basis
  to support per project snippets. *UltiSnips-snippet-search-path*
- The keymaps for jumping in snippets are now only mapped when a snippet is
  active, allowing them to be used for something else otherwise.
- Expanding and jumping no longer overwrites the unnamed register.
- Integration with Valloric/YouCompleteMe and Shougo/neocomplete.vim.
- Other plugins can add sources for snippets to create snippets on the fly.
  *UltiSnips-extending*
- Vim functions now indicates if it did any work.
  *UltiSnips-trigger-functions*
- For python extensions: UltiSnips adds itself to the sys.path and can be
  easily imported if it is available. *UltiSnips-python-module-path*
- A new function giving programmatic access to the snippets currently
  available for expansion for other plugins integrating with UltiSnips.
  *UltiSnips_SnippetsInCurrentScope*
- New or improved snippets (now in a different repo): all, bib, c, cpp, cs,
  d, django, eruby, go, haskell, html, html, htmljinja, java, javascript,
  js, ledger, ocaml, perl, php, puppet, python, ruby, scss, sh, tex, vim,
  xml, zsh.
latest commit 90dc0a267f
Holger Rapp authored vim-scripts committed
Octocat-spinner-32 after Version 3.0 March 22, 2014
Octocat-spinner-32 autoload Version 3.0 March 22, 2014
Octocat-spinner-32 doc Version 3.0 March 22, 2014
Octocat-spinner-32 ftdetect Version 3.0 March 22, 2014
Octocat-spinner-32 ftplugin Version 3.0 March 22, 2014
Octocat-spinner-32 plugin Version 3.0 March 22, 2014
Octocat-spinner-32 pythonx Version 3.0 March 22, 2014
Octocat-spinner-32 syntax Version 3.0 March 22, 2014
Octocat-spinner-32 utils Version 3.0 March 22, 2014
Octocat-spinner-32 .bzrignore Version 3.0 March 22, 2014
Octocat-spinner-32 .gitignore Version 1.6 January 04, 2012
Octocat-spinner-32 ChangeLog Version 3.0 March 22, 2014
Octocat-spinner-32 README Version 3.0 March 22, 2014
Octocat-spinner-32 README.md Version 3.0 March 22, 2014
Octocat-spinner-32 pylintrc Version 3.0 March 22, 2014
Octocat-spinner-32 test.py Version 3.0 March 22, 2014
README.md

UltiSnips

UltiSnips is the ultimate solution for snippets in Vim. It has tons of features and is very fast.

GIF Demo

In this demo I am editing a python file. I first expand the #! snippet, then the class snippet. The completion menu comes from YouCompleteMe, UltiSnips also integrates with neocomplete. I can jump through placeholders and add text while the snippet inserts text in other places automatically: when I add Animal as a base class, __init__ gets updated to call the base class constructor. When I add arguments to the constructor, they automatically get assigned to instance variables. I then insert my personal snippet for print debugging. Note that I left insert mode, inserted another snippet and went back to add an additional argument to __init__ and the class snippet was still active and added another instance variable.

The official home of UltiSnips is at https://github.com/sirver/ultisnips. Please add pull requests and issues there.

Quick Start

This assumes you are using Vundle. Adapt for your plugin manager of choice. Put this into your .vimrc.

" Track the engine.
Bundle 'SirVer/ultisnips'

" Snippets are separated from the engine. Add this if you want them:
Bundle 'honza/vim-snippets'

" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"

" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

UltiSnips comes with comprehensive documentation. As there are more options and tons of features I suggest you at least skim it.

Screencasts

From a gentle introduction to really advanced in a few minutes. The blog posts of the screencasts contain more advanced examples of the things discussed in the videos.

Something went wrong with that request. Please try again.