Showing preview only (598K chars total). Download the full file or copy to clipboard to get everything.
Repository: SirVer/ultisnips
Branch: master
Commit: 34d3ef028f19
Files: 119
Total size: 564.4 KB
Directory structure:
gitextract_ito3bm8h/
├── .github/
│ ├── FUNDING.yml
│ ├── issue_template.md
│ └── workflows/
│ └── main.yml
├── .gitignore
├── CONTRIBUTING.md
├── COPYING.txt
├── ChangeLog
├── Dockerfile
├── Dockerfile.repro
├── Makefile
├── Pipfile
├── README.md
├── after/
│ └── plugin/
│ └── UltiSnips_after.vim
├── autoload/
│ ├── UltiSnips/
│ │ └── map_keys.vim
│ ├── UltiSnips.vim
│ ├── neocomplete/
│ │ └── sources/
│ │ └── ultisnips.vim
│ └── unite/
│ └── sources/
│ └── ultisnips.vim
├── ctags/
│ └── UltiSnips.cnf
├── doc/
│ ├── UltiSnips-advanced.txt
│ ├── UltiSnips.txt
│ └── examples/
│ ├── autojump-if-empty/
│ │ └── README.md
│ ├── snippets-aliasing/
│ │ └── README.md
│ └── tabstop-generation/
│ └── README.md
├── docker/
│ ├── build_vim.sh
│ ├── docker_vimrc.vim
│ ├── download_vim.sh
│ ├── install_packages.sh
│ ├── run_tests.sh
│ └── snippets/
│ └── all.snippets
├── ftdetect/
│ └── snippets.vim
├── ftplugin/
│ └── snippets.vim
├── mypy.ini
├── plugin/
│ └── UltiSnips.vim
├── pylintrc
├── pythonx/
│ └── UltiSnips/
│ ├── __init__.py
│ ├── buffer_proxy.py
│ ├── compatibility.py
│ ├── debug.py
│ ├── diff.py
│ ├── err_to_scratch_buffer.py
│ ├── error.py
│ ├── indent_util.py
│ ├── position.py
│ ├── remote_pdb.py
│ ├── snippet/
│ │ ├── __init__.py
│ │ ├── definition/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── snipmate.py
│ │ │ └── ulti_snips.py
│ │ ├── parsing/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── lexer.py
│ │ │ ├── snipmate.py
│ │ │ └── ulti_snips.py
│ │ └── source/
│ │ ├── __init__.py
│ │ ├── added.py
│ │ ├── base.py
│ │ ├── file/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── common.py
│ │ │ ├── snipmate.py
│ │ │ └── ulti_snips.py
│ │ └── snippet_dictionary.py
│ ├── snippet_manager.py
│ ├── test_diff.py
│ ├── test_position.py
│ ├── text.py
│ ├── text_objects/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── choices.py
│ │ ├── escaped_char.py
│ │ ├── mirror.py
│ │ ├── python_code.py
│ │ ├── shell_code.py
│ │ ├── snippet_instance.py
│ │ ├── tabstop.py
│ │ ├── transformation.py
│ │ ├── viml_code.py
│ │ └── visual.py
│ ├── vim_helper.py
│ └── vim_state.py
├── rplugin/
│ └── python3/
│ └── deoplete/
│ └── sources/
│ └── ultisnips.py
├── syntax/
│ ├── snippets.vim
│ └── snippets_snipmate.vim
├── test/
│ ├── __init__.py
│ ├── constant.py
│ ├── test_AnonymousExpansion.py
│ ├── test_Autocommands.py
│ ├── test_Autotrigger.py
│ ├── test_Chars.py
│ ├── test_Choices.py
│ ├── test_Completion.py
│ ├── test_ContextSnippets.py
│ ├── test_Editing.py
│ ├── test_Expand.py
│ ├── test_Fixes.py
│ ├── test_Folding.py
│ ├── test_Format.py
│ ├── test_Interpolation.py
│ ├── test_ListSnippets.py
│ ├── test_Mirror.py
│ ├── test_Movement.py
│ ├── test_MultipleMatches.py
│ ├── test_ParseSnippets.py
│ ├── test_Plugin.py
│ ├── test_Recursive.py
│ ├── test_Selection.py
│ ├── test_SnipMate.py
│ ├── test_SnippetActions.py
│ ├── test_SnippetOptions.py
│ ├── test_SnippetPriorities.py
│ ├── test_TabStop.py
│ ├── test_Transformation.py
│ ├── test_UltiSnipFunc.py
│ ├── test_Visual.py
│ ├── util.py
│ ├── vim_interface.py
│ └── vim_test_case.py
└── test_all.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
github: SirVer
================================================
FILE: .github/issue_template.md
================================================
<!--
Thanks for reporting your issue. Please follow this template closely. Without
all essential info the issue may be closed as unreproducible.
Fill out the table below ----- symbols and keep it at the end of your issue
text. Please provide an answer for every line.
Please provide an explanation of the issue below this line. -->
**Expected behavior:**
**Actual behavior:**
**Steps to reproduce**
<!--
Provide a minimal viable repro case, ideally following
https://github.com/SirVer/ultisnips/blob/master/CONTRIBUTING.md#reproducing-bugs
If this is not possible, post a minimal, complete `.vimrc`, snippet definition,
and set of keystrokes that reproduces your problem.
-->
1.
2.
3.
-----
<!-- NOTE: contents inside arrows will be ignored. -->
- **Operating System**: <!-- e.g. Windows XP / Ubuntu 16.04 / Mac OS 10.5 -->
- **Vim Version**: <!-- first two lines of `:version` output -->
- **UltiSnips Version**: <!-- e.g. 3.1. If you're using version from git
run: `git rev-parse origin/master` -->
- **Python inside Vim**: <!-- e.g. 3.9.1 / 3.6.5. If unsure run inside vim:
`:py import sys; print(sys.version)` and
`:py3 import sys; print(sys.version)' -->
- **Docker repo/vimrc**: <!-- link to the branch containing the repro case,
or the uploaded minimal vimrc -->
================================================
FILE: .github/workflows/main.yml
================================================
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { vim_version: "9.0.0000", python_image: "3.10-bookworm", tag: "vim_90_py310" }
- { vim_version: "9.1.0000", python_image: "3.10-bookworm", tag: "vim_91_py310" }
- { vim_version: "git", python_image: "3.10-bookworm", tag: "vim_git_py310" }
- { vim_version: "9.0.0000", python_image: "3.11-bookworm", tag: "vim_90_py311" }
- { vim_version: "9.1.0000", python_image: "3.11-bookworm", tag: "vim_91_py311" }
- { vim_version: "git", python_image: "3.11-bookworm", tag: "vim_git_py311" }
- { vim_version: "9.0.0000", python_image: "3.12-bookworm", tag: "vim_90_py312" }
- { vim_version: "9.1.0000", python_image: "3.12-bookworm", tag: "vim_91_py312" }
- { vim_version: "git", python_image: "3.12-bookworm", tag: "vim_git_py312" }
# Vim 9.0 and 9.1 prior to 417 hang forever with python 3.13 due to a bug fixed here
# https://github.com/vim/vim/issues/14776.
- { vim_version: "9.1.0417", python_image: "3.13-bookworm", tag: "vim_91_py313" }
- { vim_version: "git", python_image: "3.13-bookworm", tag: "vim_git_py313" }
# Builds Vim and Tests it within docker.
name: CI
steps:
- uses: actions/checkout@v2
- name: Build the image
run: docker build -t ultisnips:${{ matrix.tag }} --build-arg PYTHON_IMAGE=${{ matrix.python_image }} --build-arg VIM_VERSION=${{ matrix.vim_version }} .
- name: Run the tests
run: docker run --rm -t ultisnips:${{ matrix.tag }} docker/run_tests.sh
================================================
FILE: .gitignore
================================================
*.pyc
*.swp
doc/tags
/.ropeproject/
/.mypy_cache/
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to UltiSnips
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
This document will take you through the process of making your change, testing it, documenting it and sending it for review.
No new feature will be accepted without good test coverage, passing CI and proper documentation.
## Before you add a feature
UltiSnips is so rich on features that it borders on feature creep.
It is also an understaffed and undermaintained project.
Since every feature needs to be maintained forever, we are very careful about new ones.
Please create alignment before putting too much work into a novel idea.
There are several ways of doing this:
1. Open an issue to discuss your idea.
2. Open a PR with a hackish or minimal implementation, i.e. no tests and no docs.
3. Write a short (<= 1 page) design doc in a Gist or on Google Docs.
Should there be agreement that your feature idea adds enough value to offset the maintenance burden, you can go ahead and implement it, including tests and documentation.
## Debugging
UltiSnips embeds some remote debugging facilities in the `UltiSnips.remote_pdb` module.
When enabled (by setting `let g:UltiSnipsDebugServerEnable=1`), whenever an exception is raised, vim will pause
and you will be able to connect to the debug server with netcat or telnet.
By default, the server listens on 'localhost:8080' (it can be changed).
See `:help UltiSnips-Advanced-Debugging` for more informations
## Testing
UltiSnips has a rigorous test suite and every new feature or bug fix is expected to come with a new test.
The overwhelming number of the > 500 test cases are integration tests.
Each test case sets up a full on-disk Vim configuration, including `.vimrc`, plugins and snippet definitions.
We then simulate a user typing out a test case by programmatically sending keys into a [tmux](https://github.com/tmux/tmux/wiki) terminal that runs Vim.
A test is a Python class in the `test` directory.
Some simple examples are in [test_Expand.py](https://github.com/SirVer/ultisnips/blob/master/test/test_Expand.py).
Each class contains at least
- a `keys` property that defines the key strokes taken,
- a `wanted` golden string that defines the expected output of the snippet, and
- a `snippets` list that defines the snippet that are in scope for the test case.
Each test types out a given set of key strokes and compares the resulting text in the Vim buffer to `wanted`.
### Running the test suite.
The basic process of running the suite is simple:
1. open a terminal and start a new tmux session in the current directory named
vim: `tmux new -s vim`. Do not type anything into the tmux session.
2. In a second terminal, run `./test_all.py`.
To filter the tests that are executed, specify a pattern to be used to match the beginning of the test name.
For instance, the following will execute all tests that start with `SimpleExpand`:
$ ./test_all.py SimpleExpand
Currently, the test suite only runs under Linux and Mac, not under Windows.
Contributions to make it work under Windows again would be very much appreciated.
#### Running using docker.
The problem with running tests on the system directly is that the user's environment can bleed into the test execution.
To avoid this problem, we strongly suggest running the tests inside of [Docker](https://www.docker.com/).
It is useful to think of Docker as a lightweight virtual machine, i.e. a way of running exactly the same OS and userland configuration on any machine.
UltiSnips comes with a [Makefile](https://github.com/SirVer/ultisnips/blob/master/Makefile) that makes the use of Docker easy.
First, build the image of the test environment (Vim 8.0, using Python 3):
$ make image_repro
Now we can launch the image in a container and run the tmux session for testing.
$ make repro
... now inside container
# tmux new -s vim
The container will have the current directory mounted under `/src/UltiSnips`.
This means all changes you make to UltiSnips' sources will directly be represented inside the container and therefore available for testing.
In a second terminal we'll use `docker run` to get another shell in the already running container.
In this shell we can then trigger the test execution:
$ make shell_in_repro
... now inside container
# ./test_all.py
### Enable the remote debug server
The test suite provides `--remote-pdb*` options equivalent to the config variables to enable the debug server during the test suite.
Note that some tests may fail because the post-mortem will catch an expected exceptions and that these options are mainly useful for single test case debugging.
Check `./test_all.py --help` for more informations.
## Documenting
User documentation goes into [`doc/UltiSnips.txt`](https://github.com/SirVer/ultisnips/blob/00_contributing/doc/UltiSnips.txt).
Developer documentation should go into this file.
# Reproducing Bugs
Reproducing bugs is the hardest part of getting them fixed.
UltiSnips is usually used in complex interaction with other software and plugins.
This makes reproducing issues even harder.
Here is a process of creating a minimal viable reproduction case for your particular problem.
Having this available in a bug report will increase the chances of your issue being fixed tremendously.
1. Install [Docker](https://docs.docker.com/install/). It is useful to think of Docker as a lightweight virtual machine, i.e. a way of running exactly the same OS and userland configuration on any machine.
2. Build the image using `make image_repro`.
3. Launch the image using `make repro`. This drops you into a shell where you can run `vim` to get to a vim instance configured for UltiSnips.
Now try to reproduce your issue.
Keep in mind that all your changes to the container are lost once you exit the shell.
You must edit the configuration outside the container and rebuild the image.
You can add snippets to `docker/snippets/`.
You can also copy more and more of your own `.vimrc` into `docker/docker_vimrc.vim` until your issue reproduces.
Whenever you have edited `snippets` or `docker_vimrc.vim` you need to rerun `make image_repo && make repro`.
Once you have a minimal complete repro case ready,
1. fork UltiSnips,
2. commit your changes to the Vim configuration into a branch,
3. push the branch,
4. link it in the issue.
================================================
FILE: COPYING.txt
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: ChangeLog
================================================
version 3.2 (05-Nov-2019):
- This is the first release done again by @SirVer. And this is also posted
on vim.org again. `¯\_(ツ)_/¯`
- This is the last version to support Python 2.
- Syntax highlighting improvements: a new one for unite & tweaks to others.
- Support for transformations on multiple lines.
- Python interpolation got more powerful, for example tabstops can now be
modified in python interpolation, you can access the last changed
placeholder text and more.
- Support for deoplete.
- Snippet files are no longer watched for changes. This increases
performance, but also means that if you change your snippet files outside
of Vim, UltiSnips will not know about it. You need to run `:call
UltiSnips#RefreshSnippets()` or restart Vim.
- Text objects for selecting snippets in visual mode: iS, aS
version 3.1 (07-Dec-2015):
- This is the last release done by @SirVer. The new maintainer of UltiSnips
is @seletskiy. The repository remains https://github.com/SirVer/ultisnips,
so this should not affect any users. This is also the last release to be
published on vim.org. Please follow the master branch on GitHub for the
latest stable version.
- New option `e`: Context aware snippets. This gives very precise and
powerful control over which snippet should be expanded depending on
surrounding code. *UltiSnips-context-snippets*
- New option `m`: Trim whitespace in all snippet lines.
- Very powerful, freely configurable pre/post-expand and post-jump actions
allow for transforming the buffer outside the snippet. *UltiSnips-snippet-actions*
- Automatic triggering of snippets without the need to press the expand
trigger. *UltiSnips-autotrigger*
- Better error reporting for snippet errors including python stacktraces
and listing of executed code.
- Undo is more granular. Each jump and expand is now a separate undo step.
- UltiSnips now emits autocommands on certain events. *UltiSnips-custom-autocommands*
- clearsnippets now clears all snippets below the current priority. This
fits better with the priority system introduced in 3.0.
- snipMate snippets support can be disabled. *UltiSnipsEnableSnipMate*
- UltiSnipsEditSplit got a new value 'context'. *UltiSnipsEditSplit*
- Improved syntax highlighting for snippets filetype.
- Mappings and autocommands are now only established when needed, i.e. when
a snippet is active. This boosts performance outside of snippets.
- New integration with Unite, TagBar, and deoplete.
- New Ctags configuration file for snippet definitions.
- Bug fixes, performance improvements, code cleanups and refactorings.
- No longer supports Vim < 7.4.
version 3.0 (02-Mar-2014):
- 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.
version 2.2 (01-Sep-2012):
- Support to silence Python-not-found warnings. *UltiSnips-python-warning*
- Matchit support for snippet files.
- Improvements to syntax file.
- Various smaller bug fixes.
- New command to manually add a filetype to the list for the current
buffer. *:UltiSnipsAddFiletypes*
- New or improved snippets: all, snippets, haskell, bindzone, python, golang,
json, html, coffee, coffee_jasmine, javascript_jasmine, ruby, php,
markdown.
version 2.1 (14-Feb-2012):
- Python interpolation access to text from visual selection via snip.v.
- Support for transformations of ${VISUAL} texts.
- New or improved snippets: python, tex, texmath, ruby, rails, html, django
version 2.0 (05-Feb-2012):
- Backwards incompatible change: Support for normal mode editing. Snippets
are no longer exited when leaving insert mode but only by leaving the
text span of the snippets. This allows usage of normal mode commands and
autoformatting. It also increases compatibility with other plugins.
- Backwards incompatible change: Changed glob patterns for snippets to
behave more like Vim *UltiSnips-adding-snippets*
- Backwards incompatible change: Zero Tabstop is no longer removed in
nested snippets
- Support for ${VISUAL:default text} placeholder. *UltiSnips-visual-placeholder*
- Improved handling of utf-8 characters in files and snippet definitions.
- Full support for :py3. UltiSnips now works with python >= 2.6 or >= 3.2.
- New or improved snippets: python, all
version 1.6 (30-Dec-2011):
- Significant speed improvements and a few bugs fixed.
- Better handling of non ASCII chars in snippets by assuming UTF-8 encoding
when no other information is available.
- Contributions for UltiSnips are now also accepted on GitHub: https://github.com/SirVer/ultisnips/
- New or improved snippets: ruby, rails, xhtml
version 1.5 (24-Sep-2011):
- Some critical bug fixes for new vim versions.
- New or improved snippets: tex, texmath, python, jinja2, go, puppet, xhtml
- Configuration of search path for snippets *UltiSnips-snippet-search-path*
- New parser implementation: A little faster, more flexible and less bugged.
version 1.4 (17-Jul-2011):
- New or improved snippets: php, html, djangohtml, mako, lua
- Snippets are now listed alphabetically by their trigger, no longer in
order of appearance
- Snippet files are now automatically reloaded when they change.
- Support for other directory names for snippets beside
"UltiSnips" *UltiSnips-snippet-search-path*
- Errors are now shown in a scratch window.
- Now fully supports Windows with python >= 2.6. UltiSnips should now work
on all systems that Vim runs on.
- a syntax file was added for snippets files with nice highlighting.
- snippets definition files now have the filetype 'snippets'. It used to be
'snippet'.
version 1.3 (14-Feb-2011):
- Erlang snippets (g0rdin)
- Other VimScripts can now define and immediately expand anonymous snippets
( *UltiSnips_Anon* ) (Ryan Wooden)
- Other VimScripts can now define new snippets via a function
( *UltiSnips_AddSnippet* ) (Ryan Wooden)
- New Snippets for eruby and rails (Ches Martin).
- A new Option 't' has been added to snippets that avoid expanding tabstops.
Be also more consistent with how indenting is handled. (Ryan Wooden)
- Added a ftplugin script for .snippets files. Syntax highlighting still
missing. (Rupa Deadwyler)
- Added UltiSnipsReset and UltiSnipsEdit (Idea by JCEB)
version 1.2 (24-Aug-2010):
- many bugs were fixed
- smode mappings for printable characters are now removed before expanding a
snippet. This is configurable. *UltiSnips-warning-smappings*
- all shipped snippets are now fully compatible with UltiSnips
- added support for global snippets which enhance python interpolation even
more *UltiSnips-globals*
- added support for multi word and regular expression triggers. Very
powerful in combination with python interpolation.
- Python interpolation became much more powerful *UltiSnips-python*
- added support for clearsnippets command *UltiSnips-clearing-snippets*
- added support for option w which is a little more strict than i.
- added support for listing of valid triggers. Defaults to <c-tab>.
- added support for option i (inword expansion)
- extends keyword is now supported on the first line of snippet files. This makes it easy to
define special cases, for example cpp extends c: a cpp trigger is useless
in c, but a c trigger is valuable for cpp.
- UltiSnips now adheres to expandtab and tabstop options of vim
version 1.1 (21-Jul-2009):
- Made triggers configurable. You can also use the same trigger for
expanding and tabbing. The TextMate configuration <tab> and <s-tab> is now
possible.
- Conditional Inserts can now be nested
- Added support for b option. This only considers a snippet at the beginning
of a line ( *UltiSnips-adding-snippets* )
- Added support for ! option. This overwrites previously defined snippets
with the same tab trigger ( *UltiSnips-adding-snippets* )
- Support for dotted filetype syntax. Now snippets for more than one filetype
can be active ( *UltiSnips-adding-snippets* )
================================================
FILE: Dockerfile
================================================
ARG PYTHON_IMAGE
FROM python:${PYTHON_IMAGE}
ARG VIM_VERSION
COPY docker/install_packages.sh src/scripts/
RUN src/scripts/install_packages.sh
COPY docker/download_vim.sh src/scripts/
RUN src/scripts/download_vim.sh
COPY docker/build_vim.sh src/scripts/
RUN src/scripts/build_vim.sh
RUN pip install unidecode
COPY . /src/UltiSnips
WORKDIR /src/UltiSnips
RUN ./test_all.py --clone-plugins
================================================
FILE: Dockerfile.repro
================================================
ARG BASE_IMAGE
FROM ultisnips:${BASE_IMAGE}
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
ADD docker/docker_vimrc.vim /root/.vim/vimrc
RUN vim -c 'PlugInstall | qa'
ADD docker/snippets /root/.vim/UltiSnips
================================================
FILE: Makefile
================================================
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir ${MAKEFILE_PATH})
# Test images as run on CI.
image_vim_80_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=8.0 .
image_vim_81_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=8.1 .
image_vim_82_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=8.2 .
image_vim_git_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=git .
image_vim_80_py36:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=8.0 .
image_vim_81_py36:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=8.1 .
image_vim_82_py36:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=8.2 .
image_vim_git_py36:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=git .
image_vim_81_py37:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.7-stretch --build-arg VIM_VERSION=8.1 .
image_vim_82_py37:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.7-stretch --build-arg VIM_VERSION=8.2 .
image_vim_git_py37:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.7-stretch --build-arg VIM_VERSION=git .
image_vim_81_py38:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.8-buster --build-arg VIM_VERSION=8.1 .
image_vim_82_py38:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.8-buster --build-arg VIM_VERSION=8.2 .
image_vim_git_py38:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.8-buster --build-arg VIM_VERSION=git .
image_vim_81_py39:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.9-buster --build-arg VIM_VERSION=8.1 .
image_vim_82_py39:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.9-buster --build-arg VIM_VERSION=8.2 .
image_vim_git_py39:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.9-buster --build-arg VIM_VERSION=git .
image_vim_git_py310:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.10-buster --build-arg VIM_VERSION=git .
image_repro: image_vim_82_py39
docker build -t ultisnips:repro --build-arg BASE_IMAGE=$< -f Dockerfile.repro .
# A reproduction image that drops you into a naked environment,
# with a Vim having UltiSnips and vim-snippets configured. See
# docker/docker_vimrc.vim for the full vimrc. Need to run `make
# image_repro` before this will work.
repro:
docker run -it -v ${MAKEFILE_DIR}:/src/UltiSnips ultisnips:repro /bin/bash
# This assumes, the repro image is already running and it opens an extra shell
# inside the running container
shell_in_repro:
docker exec -it $(shell docker ps -q) /bin/bash
format:
find . -name '*.py' -print0 | xargs -0 black
================================================
FILE: Pipfile
================================================
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
black = "*"
mypy = "*"
pylint = "*"
[packages]
mypy = "*"
black = "*"
[requires]
python_version = "3.10"
[pipenv]
allow_prereleases = true
================================================
FILE: README.md
================================================

[](https://gitter.im/SirVer/ultisnips?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
UltiSnips
=========
UltiSnips is the ultimate solution for snippets in Vim. It has many features,
speed being one of them.

In this demo I am editing a python file. I first expand the `#!` snippet, then
the `class` snippet. The completion menu comes from
[YouCompleteMe](https://github.com/Valloric/YouCompleteMe), UltiSnips also
integrates with [deoplete](https://github.com/Shougo/deoplete.nvim),
[vim-easycomplete](https://github.com/jayli/vim-easycomplete) and more. 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.
UltiSnips was started in Jun 2009 by @SirVer. In Dec 2015, maintenance was
handed over to [@seletskiy](https://github.com/seletskiy) who ran out of time
in early 2017. Since Jun 2019, @SirVer is maintaining UltiSnips again on a
very constrained time budget. If you can help triaging issues it would be
greatly appreciated.
Quick Start
-----------
This assumes you are using [Vundle](https://github.com/gmarik/Vundle.vim). Adapt
for your plugin manager of choice. Put this into your `.vimrc`.
" Track the engine.
Plugin 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
" Trigger configuration. You need to change this to something other than <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
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](https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt).
As there are more options and tons of features I suggest you at least skim it.
There are example uses for some power user features here:
* [Snippets Aliases](doc/examples/snippets-aliasing/README.md)
* [Dynamic Tabstops/Tabstop Generation](doc/examples/tabstop-generation/README.md)
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.
- [Episode 1: What are snippets and do I need them?](http://www.sirver.net/blog/2011/12/30/first-episode-of-ultisnips-screencast/)
- [Episode 2: Creating Basic Snippets](http://www.sirver.net/blog/2012/01/08/second-episode-of-ultisnips-screencast/)
- [Episode 3: What's new in version 2.0](http://www.sirver.net/blog/2012/02/05/third-episode-of-ultisnips-screencast/)
- [Episode 4: Python Interpolation](http://www.sirver.net/blog/2012/03/31/fourth-episode-of-ultisnips-screencast/)
Also the excellent [Vimcasts](http://vimcasts.org) dedicated three episodes to
UltiSnips:
- [Meet UltiSnips](http://vimcasts.org/episodes/meet-ultisnips/)
- [Using Python interpolation in UltiSnips snippets](http://vimcasts.org/episodes/ultisnips-python-interpolation/)
- [Using selected text in UltiSnips snippets](http://vimcasts.org/episodes/ultisnips-visual-placeholder/)
================================================
FILE: after/plugin/UltiSnips_after.vim
================================================
" Called after everything else to reclaim keys (Needed for Supertab)
if exists("b:did_after_plugin_ultisnips_after")
finish
endif
let b:did_after_plugin_ultisnips_after = 1
call UltiSnips#map_keys#MapKeys()
================================================
FILE: autoload/UltiSnips/map_keys.vim
================================================
if exists("b:did_autoload_ultisnips_map_keys")
finish
endif
let b:did_autoload_ultisnips_map_keys = 1
" The trigger used to expand a snippet.
" NOTE: expansion and forward jumping can, but needn't be the same trigger
if !exists("g:UltiSnipsExpandTrigger")
let g:UltiSnipsExpandTrigger = "<tab>"
endif
" The trigger used to display all triggers that could possible
" match in the current position. Use empty to disable.
if !exists("g:UltiSnipsListSnippets")
let g:UltiSnipsListSnippets = "<c-tab>"
endif
" The trigger used to jump forward to the next placeholder.
" NOTE: expansion and forward jumping can be the same trigger.
if !exists("g:UltiSnipsJumpForwardTrigger")
let g:UltiSnipsJumpForwardTrigger = "<c-j>"
endif
" The trigger to jump backward inside a snippet
if !exists("g:UltiSnipsJumpBackwardTrigger")
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
endif
" Should UltiSnips unmap select mode mappings automagically?
if !exists("g:UltiSnipsRemoveSelectModeMappings")
let g:UltiSnipsRemoveSelectModeMappings = 1
end
" If UltiSnips should remove Mappings, which should be ignored
if !exists("g:UltiSnipsMappingsToIgnore")
let g:UltiSnipsMappingsToIgnore = []
endif
" UltiSnipsEdit will use this variable to decide if a new window
" is opened when editing. default is "normal", allowed are also
" "tabdo", "vertical", "horizontal", and "context".
if !exists("g:UltiSnipsEditSplit")
let g:UltiSnipsEditSplit = 'normal'
endif
" A list of directory names that are searched for snippets.
if !exists("g:UltiSnipsSnippetDirectories")
let g:UltiSnipsSnippetDirectories = [ "UltiSnips" ]
endif
" Enable or Disable snipmate snippet expansion.
if !exists("g:UltiSnipsEnableSnipMate")
let g:UltiSnipsEnableSnipMate = 1
endif
function! UltiSnips#map_keys#MapKeys() abort
if exists("g:UltiSnipsExpandOrJumpTrigger")
exec "inoremap <silent> " . g:UltiSnipsExpandOrJumpTrigger . " <C-R>=UltiSnips#ExpandSnippetOrJump()<cr>"
exec "snoremap <silent> " . g:UltiSnipsExpandOrJumpTrigger . " <Esc>:call UltiSnips#ExpandSnippetOrJump()<cr>"
elseif exists("g:UltiSnipsJumpOrExpandTrigger")
exec "inoremap <silent> " . g:UltiSnipsJumpOrExpandTrigger . " <C-R>=UltiSnips#JumpOrExpandSnippet()<cr>"
exec "snoremap <silent> " . g:UltiSnipsJumpOrExpandTrigger . " <Esc>:call UltiSnips#JumpOrExpandSnippet()<cr>"
elseif g:UltiSnipsExpandTrigger == g:UltiSnipsJumpForwardTrigger
exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=UltiSnips#ExpandSnippetOrJump()<cr>"
exec "snoremap <silent> " . g:UltiSnipsExpandTrigger . " <Esc>:call UltiSnips#ExpandSnippetOrJump()<cr>"
else
exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=UltiSnips#ExpandSnippet()<cr>"
exec "snoremap <silent> " . g:UltiSnipsExpandTrigger . " <Esc>:call UltiSnips#ExpandSnippet()<cr>"
endif
exec "xnoremap <silent> " . g:UltiSnipsExpandTrigger. " :call UltiSnips#SaveLastVisualSelection()<cr>gvs"
if len(g:UltiSnipsListSnippets) > 0
exec "inoremap <silent> " . g:UltiSnipsListSnippets . " <C-R>=UltiSnips#ListSnippets()<cr>"
exec "snoremap <silent> " . g:UltiSnipsListSnippets . " <Esc>:call UltiSnips#ListSnippets()<cr>"
endif
snoremap <silent> <BS> <c-g>"_c
snoremap <silent> <DEL> <c-g>"_c
snoremap <silent> <c-h> <c-g>"_c
snoremap <c-r> <c-g>"_c<c-r>
endf
================================================
FILE: autoload/UltiSnips.vim
================================================
if exists("b:did_autoload_ultisnips")
finish
endif
let b:did_autoload_ultisnips = 1
" Ensure snippets are loaded for current buffer
au UltiSnips_AutoTrigger FileType,BufEnter * call UltiSnips#CheckFiletype()
" Also import vim as we expect it to be imported in many places.
py3 import vim
py3 from UltiSnips import UltiSnips_Manager
function! s:compensate_for_pum() abort
""" The CursorMovedI event is not triggered while the popup-menu is visible,
""" and it's by this event that UltiSnips updates its vim-state. The fix is
""" to explicitly check for the presence of the popup menu, and update
""" the vim-state accordingly.
if pumvisible()
py3 UltiSnips_Manager._cursor_moved()
endif
endfunction
function! s:is_floating(winId) abort
if has('nvim')
return get(nvim_win_get_config(a:winId), 'relative', '') !=# ''
endif
return 0
endfunction
function! UltiSnips#Edit(bang, ...) abort
if a:0 == 1 && a:1 != ''
let type = a:1
else
let type = ""
endif
py3 vim.command("let file = '%s'" % UltiSnips_Manager._file_to_edit(vim.eval("type"), vim.eval('a:bang')))
if !len(file)
return
endif
let mode = 'e'
if exists('g:UltiSnipsEditSplit')
if g:UltiSnipsEditSplit == 'vertical'
let mode = 'vs'
elseif g:UltiSnipsEditSplit == 'horizontal'
let mode = 'sp'
elseif g:UltiSnipsEditSplit == 'tabdo'
let mode = 'tabedit'
elseif g:UltiSnipsEditSplit == 'context'
let mode = 'vs'
if winwidth(0) <= 2 * (&tw ? &tw : 80)
let mode = 'sp'
endif
endif
endif
exe ':'.mode.' '.escape(file, ' ')
endfunction
function! UltiSnips#AddFiletypes(filetypes) abort
py3 UltiSnips_Manager.add_buffer_filetypes(vim.eval("a:filetypes"))
return ""
endfunction
function! UltiSnips#FileTypeComplete(arglead, cmdline, cursorpos) abort
let ret = {}
let items = map(
\ split(globpath(&runtimepath, 'syntax/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")'
\ )
call insert(items, 'all')
for item in items
if !has_key(ret, item) && item =~ '^'.a:arglead
let ret[item] = 1
endif
endfor
return sort(keys(ret))
endfunction
function! UltiSnips#ExpandSnippet() abort
py3 UltiSnips_Manager.expand()
return ""
endfunction
function! UltiSnips#ExpandSnippetOrJump() abort
call s:compensate_for_pum()
py3 UltiSnips_Manager.expand_or_jump()
return ""
endfunction
function! UltiSnips#JumpOrExpandSnippet() abort
call s:compensate_for_pum()
py3 UltiSnips_Manager.jump_or_expand()
return ""
endfunction
function! UltiSnips#ListSnippets() abort
py3 UltiSnips_Manager.list_snippets()
return ""
endfunction
function! UltiSnips#SnippetsInCurrentScope(...) abort
let g:current_ulti_dict = {}
let all = get(a:, 1, 0)
if all
let g:current_ulti_dict_info = {}
endif
py3 UltiSnips_Manager.snippets_in_current_scope(int(vim.eval("all")))
return g:current_ulti_dict
endfunction
function! UltiSnips#CanExpandSnippet() abort
py3 vim.command("let can_expand = %d" % UltiSnips_Manager.can_expand())
return can_expand
endfunction
function! UltiSnips#CanJumpForwards() abort
py3 vim.command("let can_jump_forwards = %d" % UltiSnips_Manager.can_jump_forwards())
return can_jump_forwards
endfunction
function! UltiSnips#CanJumpBackwards() abort
py3 vim.command("let can_jump_backwards = %d" % UltiSnips_Manager.can_jump_backwards())
return can_jump_backwards
endfunction
function! UltiSnips#ToggleAutoTrigger() abort
py3 vim.command("let autotrigger = %d" % UltiSnips_Manager._toggle_autotrigger())
return autotrigger
endfunction
function! UltiSnips#SaveLastVisualSelection() range abort
py3 UltiSnips_Manager._save_last_visual_selection()
return ""
endfunction
function! UltiSnips#JumpBackwards() abort
call s:compensate_for_pum()
py3 UltiSnips_Manager.jump_backwards()
return ""
endfunction
function! UltiSnips#JumpForwards() abort
call s:compensate_for_pum()
py3 UltiSnips_Manager.jump_forwards()
return ""
endfunction
function! UltiSnips#AddSnippetWithPriority(trigger, value, description, options, filetype, priority) abort
py3 trigger = vim.eval("a:trigger")
py3 value = vim.eval("a:value")
py3 description = vim.eval("a:description")
py3 options = vim.eval("a:options")
py3 filetype = vim.eval("a:filetype")
py3 priority = vim.eval("a:priority")
py3 UltiSnips_Manager.add_snippet(trigger, value, description, options, filetype, priority)
return ""
endfunction
function! UltiSnips#Anon(value, ...) abort
" Takes the same arguments as SnippetManager.expand_anon:
" (value, trigger="", description="", options="")
py3 args = vim.eval("a:000")
py3 value = vim.eval("a:value")
py3 UltiSnips_Manager.expand_anon(value, *args)
return ""
endfunction
function! UltiSnips#CursorMoved() abort
py3 UltiSnips_Manager._cursor_moved()
endf
function! UltiSnips#LeavingBuffer() abort
let from_preview = getwinvar(winnr('#'), '&previewwindow')
let to_preview = getwinvar(winnr(), '&previewwindow')
let from_floating = s:is_floating(win_getid('#'))
let to_floating = s:is_floating(win_getid())
if !(from_preview || to_preview || from_floating || to_floating)
py3 UltiSnips_Manager._leaving_buffer()
endif
endf
function! UltiSnips#LeavingInsertMode() abort
py3 UltiSnips_Manager._leaving_insert_mode()
endfunction
function! UltiSnips#TrackChange() abort
py3 UltiSnips_Manager._track_change()
endfunction
function! UltiSnips#CheckFiletype() abort
py3 UltiSnips_Manager._check_filetype(vim.eval('&ft'))
endfunction
function! UltiSnips#RefreshSnippets() abort
py3 UltiSnips_Manager._refresh_snippets()
endfunction
" }}}
================================================
FILE: autoload/neocomplete/sources/ultisnips.vim
================================================
let s:save_cpo = &cpo
set cpo&vim
let s:source = {
\ 'name' : 'ultisnips',
\ 'kind' : 'keyword',
\ 'mark' : '[US]',
\ 'rank' : 8,
\ 'matchers' :
\ (g:neocomplete#enable_fuzzy_completion ?
\ ['matcher_fuzzy'] : ['matcher_head']),
\ }
function! s:source.gather_candidates(context) abort
let suggestions = []
let snippets = UltiSnips#SnippetsInCurrentScope()
for trigger in keys(snippets)
let description = get(snippets, trigger)
call add(suggestions, {
\ 'word' : trigger,
\ 'menu' : self.mark . ' '. description,
\ 'kind' : 'snippet'
\ })
endfor
return suggestions
endfunction
function! neocomplete#sources#ultisnips#define() abort
return s:source
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
================================================
FILE: autoload/unite/sources/ultisnips.vim
================================================
let s:save_cpo = &cpo
set cpo&vim
let s:unite_source = {
\ 'name': 'ultisnips',
\ 'hooks': {},
\ 'action_table': {},
\ 'syntax' : 'uniteSource__Ultisnips',
\ 'default_action': 'expand',
\ }
let s:unite_source.action_table.preview = {
\ 'description' : 'ultisnips snippets',
\ 'is_quit' : 0,
\ }
function! s:unite_source.hooks.on_syntax(args, context) abort
syntax case ignore
syntax match uniteSource__UltisnipsHeader /^.*$/
\ containedin=uniteSource__Ultisnips
syntax match uniteSource__UltisnipsTrigger /\v^\s.{-}\ze\s/ contained
\ containedin=uniteSource__UltisnipsHeader
\ nextgroup=uniteSource__UltisnipsDescription
syntax match uniteSource__UltisnipsDescription /\v.{3}\s\zs\w.*$/ contained
\ containedin=uniteSource__UltisnipsHeader
highlight default link uniteSource__UltisnipsTrigger Identifier
highlight default link uniteSource__UltisnipsDescription Statement
endfunction
function! s:unite_source.action_table.preview.func(candidate) abort
" no nice preview at this point, cannot get snippet text
let snippet_preview = a:candidate['word']
echo snippet_preview
endfunction
let s:unite_source.action_table.expand = {
\ 'description': 'expand the current snippet',
\ 'is_quit': 1
\}
function! s:unite_source.action_table.expand.func(candidate) abort
let delCurrWord = (getline(".")[col(".")-1] == " ") ? "" : "diw"
exe "normal " . delCurrWord . "a" . a:candidate['trigger'] . " "
call UltiSnips#ExpandSnippet()
return ''
endfunction
function! s:unite_source.get_longest_snippet_len(snippet_list) abort
let longest = 0
for snip in items(a:snippet_list)
if strlen(snip['word']) > longest
let longest = strlen(snip['word'])
endif
endfor
return longest
endfunction
function! s:unite_source.gather_candidates(args, context) abort
let default_val = {'word': '', 'unite__abbr': '', 'is_dummy': 0, 'source':
\ 'ultisnips', 'unite__is_marked': 0, 'kind': 'command', 'is_matched': 1,
\ 'is_multiline': 0}
let snippet_list = UltiSnips#SnippetsInCurrentScope()
let max_len = s:unite_source.get_longest_snippet_len(snippet_list)
let canditates = []
for snip in items(snippet_list)
let curr_val = copy(default_val)
let curr_val['word'] = printf('%-*s', max_len, snip[0]) . " " . snip[1]
let curr_val['trigger'] = snip[0]
let curr_val['kind'] = 'common'
call add(canditates, curr_val)
endfor
return canditates
endfunction
function! unite#sources#ultisnips#define() abort
return s:unite_source
endfunction
"unlet s:unite_source
let &cpo = s:save_cpo
unlet s:save_cpo
================================================
FILE: ctags/UltiSnips.cnf
================================================
--langdef=UltiSnips
--langmap=UltiSnips:.snippets
--regex-UltiSnips=/^snippet (.*)/\1/s,snippet/
================================================
FILE: doc/UltiSnips-advanced.txt
================================================
*UltiSnips-advanced.txt* Advanced topics for UltiSnips
1. Debugging |UltiSnips-Advanced-Debugging|
1.1 Setting breakpoints |UltiSnips-Advanced-breakpoints|
1.2 Accessing Pdb |UltiSnips-Advanced-Pdb|
=============================================================================
1. Debugging *UltiSnips-Advanced-Debugging*
*g:UltiSnipsDebugServerEnable*
UltiSnips comes with a remote debugger disabled *g:UltiSnipsDebugHost*
by default. When authoring a complex snippet *g:UltiSnipsDebugPort*
with python code, you may want to be able to *g:UltiSnipsPMDebugBlocking*
set breakpoints to inspect variables.
It is also useful when debugging UltiSnips itself.
Note: Due to some technical limitations, it is not possible for pdb to print
the code of the snippet with the `l`/`ll` commands.
You can enable it and configure it with the folowing variables: >
let g:UltiSnipsDebugServerEnable=0
(bool) Set to 1 to Enable the debug server. If an exception occurs or
a breakpoint (see below) is set, a Pdb server is launched, and you can
connect to it through telnet.
let g:UltiSnipsDebugHost='localhost'
(string) The host the server listens on
let g:UltiSnipsDebugPort=8080
(int) The port the server listens to
let g:UltiSnipsPMDebugBlocking=0
(bool) Set whether the post mortem debugger should freeze vim.
If set to 0, vim will continue to run if an exception
arises while expanding a snippet and the error message describing the
error will be printed with the directives to connect to the remote
debug server. Internally, Pdb will run in another thread and the session
will use the python trace back object stored at the moment the error
was caught. The variable values and the application state may not reflect
the exact state at the moment of the error.
If set to 1, vim will simply freeze on the error and will resume
only after quiting the debugging session (you must connect via telnet
to type the Pdb's `quit` command to resume vim). However, the
execution is paused right after caughting the exception, reflecting
the exact state when the error occured.
NOTE: Do not run vim as root with `g:UltiSnipsDebugServerEnable=1` since anything
can connect to it and do anything with root privileges.
Try to use these features only for... debugging... and turn it off when you
are done.
These variables can be set at any moment. The debug server will be active
only when an exception arises (or a breakpoint set as below is reached),
and only if `g:UltiSnipsDebugServerEnable` is set at the moment of the
error. It will be innactive as soon as the `quit` command is issued
from telnet.
1.1 Setting breakpoints *UltiSnips-Advanced-breakpoints*
-----------------------
The easiest way of setting a breakpoint inside a snippet or UltiSnips
internal code is the following: >
from UltiSnips.remote_pdb import RemotePDB
RemotePDB.breakpoint()
...You can also raise an exception since it will be caught, and then will
launch the post-mortem session. However, using the breakpoint method allows
to continue the execution once the debugger quit.
1.2 Accessing Pdb *UltiSnips-Advanced-Pdb*
-----------------
Even though it's possible to use the builtin Pdb, (or any other compatible
debugger), the best experience is achived with Pdb++.
You can install it this way: >
pip install pdbpp
It is a no-configuration replacement of the built-in pdb.
To connect to the pdb server, simply use a telnet-like client.
To have readline support (arrow keys working and history), you can use socat: >
socat READLINE,history=$HOME/.ultisnips-dbg-history TCP:localhost:8080
(Change `localhost` and `8080` to match your configuration)
To leave the server and continue the execution, run Pdb's `quit` command
Known issue: Tab completion is not supported yet.
================================================
FILE: doc/UltiSnips.txt
================================================
*UltiSnips.txt* For Vim version 8.0 or later.
The Ultimate Plugin for Snippets in Vim~
UltiSnips *snippet* *snippets* *UltiSnips*
1. Description |UltiSnips-description|
1.1 Requirements |UltiSnips-requirements|
1.2 Acknowledgments |UltiSnips-acknowledgments|
2. Installation and Updating |UltiSnips-install-and-update|
3. Settings & Commands |UltiSnips-settings|
3.1 Commands |UltiSnips-commands|
3.1.1 UltiSnipsEdit |UltiSnipsEdit|
3.1.2 UltiSnipsAddFiletypes |UltiSnipsAddFiletypes|
3.2 Triggers |UltiSnips-triggers|
3.2.1 Trigger key mappings |UltiSnips-trigger-key-mappings|
3.2.2 Using your own trigger functions |UltiSnips-trigger-functions|
3.2.3 Custom autocommands |UltiSnips-custom-autocommands|
3.2.4 Direct use of Python API |UltiSnips-use-python-api|
3.3 Warning About Select Mode Mappings |UltiSnips-warning-smappings|
3.4 Functions |UltiSnips-functions|
3.4.1 UltiSnips#AddSnippetWithPriority |UltiSnips#AddSnippetWithPriority|
3.4.2 UltiSnips#Anon |UltiSnips#Anon|
3.4.3 UltiSnips#SnippetsInCurrentScope |UltiSnips#SnippetsInCurrentScope|
3.4.4 UltiSnips#CanExpandSnippet |UltiSnips#CanExpandSnippet|
3.4.5 UltiSnips#CanJumpForwards |UltiSnips#CanJumpForwards|
3.4.6 UltiSnips#CanJumpBackwards |UltiSnips#CanJumpBackwards|
3.5 Missing python support |UltiSnips-python-warning|
4. Authoring snippets |UltiSnips-authoring-snippets|
4.1 Basics |UltiSnips-basics|
4.1.1 How snippets are loaded |UltiSnips-how-snippets-are-loaded|
4.1.2 Basic syntax |UltiSnips-basic-syntax|
4.1.3 Snippet Options |UltiSnips-snippet-options|
4.1.4 Character Escaping |UltiSnips-character-escaping|
4.1.5 Snippets text-objects |UltiSnips-snippet-text-objects|
4.2 Plaintext Snippets |UltiSnips-plaintext-snippets|
4.3 Visual Placeholder |UltiSnips-visual-placeholder|
4.4 Interpolation |UltiSnips-interpolation|
4.4.1 Shellcode |UltiSnips-shellcode|
4.4.2 VimScript |UltiSnips-vimscript|
4.4.3 Python |UltiSnips-python|
4.4.4 Global Snippets |UltiSnips-globals|
4.5 Tabstops and Placeholders |UltiSnips-tabstops|
4.6 Mirrors |UltiSnips-mirrors|
4.7 Transformations |UltiSnips-transformations|
4.7.1 Replacement String |UltiSnips-replacement-string|
4.7.2 Demos |UltiSnips-demos|
4.8 Clearing snippets |UltiSnips-clearing-snippets|
4.9 Custom context snippets |UltiSnips-custom-context-snippets|
4.10 Snippet actions |UltiSnips-snippet-actions|
4.10.1 Pre-expand actions |UltiSnips-pre-expand-actions|
4.10.2 Post-expand actions |UltiSnips-post-expand-actions|
4.10.3 Post-jump actions |UltiSnips-post-jump-actions|
4.11 Autotrigger |UltiSnips-autotrigger|
5. UltiSnips and Other Plugins |UltiSnips-other-plugins|
5.1 Existing Integrations |UltiSnips-integrations|
5.2 Extending UltiSnips |UltiSnips-extending|
6. Debugging |UltiSnips-Debugging|
7. FAQ |UltiSnips-FAQ|
8. Helping Out |UltiSnips-helping|
9. Contributors |UltiSnips-contributors|
This plugin only works if 'compatible' is not set.
{Vi does not have any of these features}
{only available when |+python3| has been enabled at compile time}
==============================================================================
1. Description *UltiSnips-description*
UltiSnips provides snippet management for the Vim editor. A snippet is a short
piece of text that is either re-used often or contains a lot of redundant
text. UltiSnips allows you to insert a snippet with only a few key strokes.
Snippets are common in structured text like source code but can also be used
for general editing like inserting a signature in an email or inserting the
current date in a text file.
@SirVer posted several short screencasts which make a great introduction to
UltiSnips, illustrating its features and usage.
http://www.sirver.net/blog/2011/12/30/first-episode-of-ultisnips-screencast/
http://www.sirver.net/blog/2012/01/08/second-episode-of-ultisnips-screencast/
http://www.sirver.net/blog/2012/02/05/third-episode-of-ultisnips-screencast/
http://www.sirver.net/blog/2012/03/31/fourth-episode-of-ultisnips-screencast/
Also the excellent [Vimcasts](http://vimcasts.org) dedicated three episodes to
UltiSnips:
http://vimcasts.org/episodes/meet-ultisnips/
http://vimcasts.org/episodes/ultisnips-python-interpolation/
http://vimcasts.org/episodes/ultisnips-visual-placeholder/
1.1 Requirements *UltiSnips-requirements*
----------------
This plugin works with Vim version 8.0 or later with Python 3 support enabled.
It only works if the 'compatible' setting is not set.
The Python 3.x interface must be available. In other words, Vim
must be compiled with the |+python3| feature.
The following commands show how to test if you have python compiled in Vim.
They print '1' if the python version is compiled in, '0' if not.
Test if Vim is compiled with python version 3.x: >
:echo has("python3")
The python version Vim is linked against can be found with: >
:py3 import sys; print(sys.version)
Note that Vim is maybe not using your system-wide installed python version, so
make sure to check the Python version inside of Vim.
1.2 Acknowledgments *UltiSnips-acknowledgments*
-------------------
UltiSnips was inspired by the snippets feature of TextMate
(http://macromates.com/), the GUI text editor for Mac OS X. Managing snippets
in Vim is not new. I want to thank Michael Sanders, the author of snipMate,
for some implementation details I borrowed from his plugin and for the
permission to use his snippets.
=============================================================================
2. Installation and Updating *UltiSnips-install-and-update*
The recommended way of getting UltiSnips is to track SirVer/ultisnips on
github. The master branch is always stable.
Using Pathogen: *UltiSnips-using-pathogen*
If you are a pathogen user, you can track the official mirror of UltiSnips on
github: >
$ cd ~/.vim/bundle && git clone git://github.com/SirVer/ultisnips.git
If you also want the default snippets, also track >
$ cd ~/.vim/bundle && git clone git://github.com/honza/vim-snippets.git
See the pathogen documentation for more details on how to update a bundle.
Using a downloaded packet: *UltiSnips-using-a-downloaded-packet*
Download the packet and unpack into a directory of your choice. Then add this
directory to your Vim runtime path by adding this line to your vimrc file. >
set runtimepath+=~/.vim/ultisnips_rep
UltiSnips also needs Vim files from the ftdetect/ directory. Unfortunately,
Vim only allows this directory in the .vim directory. You therefore have to
symlink/copy the files: >
mkdir -p ~/.vim/ftdetect/
ln -s ~/.vim/ultisnips_rep/ftdetect/* ~/.vim/ftdetect/
Restart Vim and UltiSnips should work. To access the help, use >
:helptags ~/.vim/ultisnips_rep/doc
:help UltiSnips
UltiSnips comes without snippets. An excellent selection of snippets can be
found here: https://github.com/honza/vim-snippets
=============================================================================
3. Settings & Commands *UltiSnips-settings*
3.1 Commands *UltiSnips-commands*
------------
3.1.1 UltiSnipsEdit *:UltiSnipsEdit*
The UltiSnipsEdit command opens a private snippet definition file for the
current filetype. If no snippet file exists, a new file is created. If used as
UltiSnipsEdit! all public snippet files that exist are taken into account too. If
multiple files match the search, the user gets to choose the file.
There are several variables associated with the UltiSnipsEdit command.
*g:UltiSnipsEditSplit*
g:UltiSnipsEditSplit Defines how the edit window is opened. Possible
values:
|normal| Default. Opens in the current window.
|tabdo| Opens the window in a new tab.
|horizontal| Splits the window horizontally.
|vertical| Splits the window vertically.
|context| Splits the window vertically or
horizontally depending on context.
*g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit*
g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit
A single absolute path to a directory which will
be used as the storage for location for
`UltiSnipsEdit`. This means that UltiSnipsEdit no
longer searches all paths in
`g:UltiSnipsSnippetDirectories` for snippets to
edit, but only this one. Note that this does not
imply that the snippet expansion engine also
searches this directory. Please read
|UltiSnips-how-snippets-are-loaded| for details.
*g:UltiSnipsSnippetDirectories*
g:UltiSnipsSnippetDirectories
An array of relative directory names OR an array
with a single absolute path. Defaults to [
"UltiSnips" ]. No entry in this list must be
"snippets". Please read
|UltiSnips-how-snippets-are-loaded| for details.
*g:UltiSnipsEnableSnipMate*
g:UltiSnipsEnableSnipMate
Enable looking for SnipMate snippets in
&runtimepath. UltiSnips will search only for
directories named 'snippets' while looking for
SnipMate snippets. Defaults to "1", so UltiSnips
will look for SnipMate snippets.
3.1.2 UltiSnipsAddFiletypes *:UltiSnipsAddFiletypes*
The UltiSnipsAddFiletypes command allows for explicit merging of other snippet
filetypes for the current buffer. For example, if you edit a .rst file but
also want the Lua snippets to be available you can issue the command >
:UltiSnipsAddFiletypes rst.lua
using the dotted filetype syntax. Order is important, the first filetype in
this list will be the one used for UltiSnipsEdit and the list is
ordered by evaluation priority. For example you might add this to your
ftplugin/rails.vim >
:UltiSnipsAddFiletypes rails.ruby
I mention rails first because I want to edit rails snippets when using
UltiSnipsEdit and because rails snippets should overwrite equivalent ruby
snippets. The priority will now be rails -> ruby -> all. If you have some
special programming snippets that should have lower priority than your ruby
snippets you can call >
:UltiSnipsAddFiletypes ruby.programming
The priority will then be rails -> ruby -> programming -> all.
3.2 Triggers *UltiSnips-triggers*
------------
3.2.1 Trigger key mappings *UltiSnips-trigger-key-mappings*
*g:UltiSnipsExpandTrigger* *g:UltiSnipsListSnippets*
*g:UltiSnipsJumpForwardTrigger* *g:UltiSnipsJumpBackwardTrigger*
*g:UltiSnipsExpandOrJumpTrigger* *g:UltiSnipsJumpOrExpandTrigger*
You can define the keys used to trigger UltiSnips actions by setting global
variables. Variables define the keys used to expand a snippet, jump forward
and jump backwards within a snippet, and list all available snippets in the
current expand context. Be advised, that some terminal emulators don't send
<c-tab> (and others, like <c-h>) to the running program. The variables with
their default values are: >
g:UltiSnipsExpandTrigger <tab>
g:UltiSnipsListSnippets <c-tab>
g:UltiSnipsJumpForwardTrigger <c-j>
g:UltiSnipsJumpBackwardTrigger <c-k>
UltiSnips will only map the jump triggers while a snippet is active to
interfere as little as possible with other mappings.
The default value for g:UltiSnipsJumpBackwardTrigger interferes with the
built-in complete function: |i_CTRL-X_CTRL-K|. A workaround is to add the
following to your vimrc file or switching to a plugin like Supertab or
YouCompleteMe. >
inoremap <c-x><c-k> <c-x><c-k>
If you prefer to use the same trigger for expanding snippets and jumping
forward, g:UltiSnipsExpandOrJumpTrigger and g:UltiSnipsJumpOrExpandTrigger
variables are what you want. Try to set g:UltiSnipsExpandOrJumpTrigger if
you give priority to expanding snippets. It'll expand snippets first when
you are in a position where you can both expand snippets and jump forward. >
let g:UltiSnipsExpandOrJumpTrigger = "<tab>"
Or else, if you have a preference for jumping forward first, set
g:UltiSnipsJumpOrExpandTrigger instead. >
let g:UltiSnipsJumpOrExpandTrigger = "<tab>"
If both g:UltiSnipsExpandOrJumpTrigger and g:UltiSnipsJumpOrExpandTrigger
is set, g:UltiSnipsExpandOrJumpTrigger variable will take effects.
3.2.2 Using your own trigger functions *UltiSnips-trigger-functions*
For advanced users there are functions that you can map directly to a
key and that correspond to some of the triggers previously defined:
g:UltiSnipsExpandTrigger <--> UltiSnips#ExpandSnippet
g:UltiSnipsJumpForwardTrigger <--> UltiSnips#JumpForwards
g:UltiSnipsJumpBackwardTrigger <--> UltiSnips#JumpBackwards
g:UltiSnipsExpandOrJumpTrigger <--> UltiSnips#ExpandSnippetOrJump
g:UltiSnipsJumpOrExpandTrigger <--> UltiSnips#JumpOrExpandSnippet
If you have g:UltiSnipsExpandTrigger and g:UltiSnipsJumpForwardTrigger set
to the same value then the function you are actually going to use is
UltiSnips#ExpandSnippetOrJump.
Each time any of the functions UltiSnips#ExpandSnippet,
UltiSnips#ExpandSnippetOrJump, UltiSnips#JumpOrExpandSnippet,
UltiSnips#JumpForwards or UltiSnips#JumpBackwards is called a global variable
is set that contains the return value of the corresponding function.
The corresponding variables and functions are:
UltiSnips#ExpandSnippet --> g:ulti_expand_res (0: fail, 1: success)
UltiSnips#ExpandSnippetOrJump --> g:ulti_expand_or_jump_res (0: fail,
1: expand, 2: jump)
UltiSnips#JumpOrExpandSnippet --> g:ulti_expand_or_jump_res (0: fail,
1: expand, 2: jump)
UltiSnips#JumpForwards --> g:ulti_jump_forwards_res (0: fail, 1: success)
UltiSnips#JumpBackwards --> g:ulti_jump_backwards_res (0: fail, 1: success)
To see how these return values may come in handy, suppose that you want to map
a key to expand or jump, but if none of these actions is successful you want
to call another function. UltiSnips already does this automatically for
supertab, but this allows you individual fine tuning of your Tab key usage.
Usage is as follows: You define a function >
let g:ulti_expand_or_jump_res = 0 "default value, just set once
function! Ulti_ExpandOrJump_and_getRes()
call UltiSnips#ExpandSnippetOrJump()
return g:ulti_expand_or_jump_res
endfunction
then you define your mapping as >
inoremap <NL> <C-R>=(Ulti_ExpandOrJump_and_getRes() > 0)?"":IMAP_Jumpfunc('', 0)<CR>
and if the you can't expand or jump from the current location then the
alternative function IMAP_Jumpfunc('', 0) is called.
3.2.3 Custom autocommands *UltiSnips-custom-autocommands*
Note Autocommands must not change the buffer in any way. If lines are added,
deleted, or modified it will confuse UltiSnips which might scramble your
snippet contents.
*UltiSnipsEnterFirstSnippet* *UltiSnipsExitLastSnippet*
For maximum compatibility with other plug-ins, UltiSnips sets up some special
state, include mappings and autocommands, when a snippet starts being
expanded, and tears them down once the last snippet has been exited. In order
to make it possible to override these "inner" settings, it fires the following
"User" autocommands:
UltiSnipsEnterFirstSnippet
UltiSnipsExitLastSnippet
For example, to call a pair of custom functions in response to these events,
you might do: >
autocmd! User UltiSnipsEnterFirstSnippet
autocmd User UltiSnipsEnterFirstSnippet call CustomInnerKeyMapper()
autocmd! User UltiSnipsExitLastSnippet
autocmd User UltiSnipsExitLastSnippet call CustomInnerKeyUnmapper()
Note that snippet expansion may be nested, in which case
|UltiSnipsEnterFirstSnippet| will fire only as the first (outermost) snippet
is entered, and |UltiSnipsExitLastSnippet| will only fire once the last
(outermost) snippet have been exited.
3.2.4 Direct use of Python API *UltiSnips-use-python-api*
For even more advanced usage, you can directly write python functions using
UltiSnip's python modules. This is an internal and therefore unstable API and
not recommended though.
Here is a small example function that expands a snippet: >
function! s:Ulti_ExpandSnip()
Python << EOF
import sys, vim
from UltiSnips import UltiSnips_Manager
UltiSnips_Manager.expand()
EOF
return ""
endfunction
3.3 Warning About Select Mode Mappings *UltiSnips-warning-smappings*
--------------------------------------
Vim's help document for |mapmode-s| states: >
NOTE: Mapping a printable character in Select mode may confuse the user.
It's better to explicitly use :xmap and :smap for printable characters. Or
use :sunmap after defining the mapping.
However, most Vim plugins, including some default Vim plugins, do not adhere
to this. UltiSnips uses Select mode to mark tabstops in snippets for
overwriting. Existing Visual+Select mode mappings will interfere. Therefore,
UltiSnips issues a |:sunmap| command to remove each Select mode mapping for
printable characters. No other mappings are touched. In particular, UltiSnips
does not change existing normal, insert or visual mode mappings.
If this behavior is not desired, you can disable it by adding this line to
your vimrc file. >
let g:UltiSnipsRemoveSelectModeMappings = 0
If you want to disable this feature for specific mappings only, add them to
the list of mappings to be ignored. For example, the following lines in your
vimrc file will unmap all Select mode mappings except those mappings
containing either the string "somePlugin" or the string "otherPlugin" in its
complete definition as listed by the |:smap| command. >
let g:UltiSnipsRemoveSelectModeMappings = 1
let g:UltiSnipsMappingsToIgnore = [ "somePlugin", "otherPlugin" ]
3.4 Functions *UltiSnips-functions*
-------------
UltiSnips provides some functions for extending core functionality.
3.4.1 UltiSnips#AddSnippetWithPriority *UltiSnips#AddSnippetWithPriority*
The first function is UltiSnips#AddSnippetWithPriority(trigger, value, description,
options, filetyp, priority). It adds a new snippet to the current list of
snippets. See |UltiSnips-authoring-snippets| for details most of the function
arguments. The priority is a number that defines which snippet should be
preferred over others. See the priority keyword in |UltiSnips-basic-syntax|.
3.4.2 UltiSnips#Anon *UltiSnips#Anon*
The second function is UltiSnips#Anon(value, ...). It expands an anonymous
snippet. Anonymous snippets are defined on the spot, expanded and immediately
discarded again. Anonymous snippets are not added to the global list of
snippets, so they cannot be expanded a second time unless the function is
called again. The function takes three optional arguments, in order: trigger,
description, options. Arguments coincide with the arguments of the
|UltiSnips#AddSnippetWithPriority| function of the same name. The trigger and
options arguments can change the way the snippet expands. Same options
can be specified as in the snippet definition. See full list of options at
|UltiSnips-snippet-options|. The description is unused at this point.
An example use case might be this line from a reStructuredText plugin file:
inoremap <silent> $$ $$<C-R>=UltiSnips#Anon(':latex:\`$1\`', '$$')<cr>
This expands the snippet whenever two $ signs are typed.
Note: The right-hand side of the mapping starts with an immediate retype of
the '$$' trigger and passes '$$' to the function as the trigger argument.
This is required in order for UltiSnips to have access to the characters
typed so it can determine if the trigger matches or not. A more elegant way of
creating such a snippet could be to use |UltiSnips-autotrigger|.
3.4.3 UltiSnips#SnippetsInCurrentScope *UltiSnips#SnippetsInCurrentScope*
UltiSnips#SnippetsInCurrentScope returns a vim dictionary with the snippets
whose trigger matches the current word. If you need all snippets information
for the current buffer, you can simply pass 1 (which means all) as first
argument of this function, and use a global variable g:current_ulti_dict_info
to get the result (see example below).
This function does not add any new functionality to ultisnips directly but
allows to use third party plugins to integrate the current available snippets.
For example, all completion plugins that integrate with UltiSnips use this
function.
Another example on how to use this function consider the following function
and mapping definition:
function! ExpandPossibleShorterSnippet()
if len(UltiSnips#SnippetsInCurrentScope()) == 1 "only one candidate...
let curr_key = keys(UltiSnips#SnippetsInCurrentScope())[0]
normal diw
exe "normal a" . curr_key
exe "normal a "
return 1
endif
return 0
endfunction
inoremap <silent> <C-L> <C-R>=(ExpandPossibleShorterSnippet() == 0? '': UltiSnips#ExpandSnippet())<CR>
If the trigger for your snippet is lorem, you type lor, and you have no other
snippets whose trigger matches lor then hitting <C-L> will expand to whatever
lorem expands to.
One more example on how to use this function to extract all snippets available
in the current buffer: >
function! GetAllSnippets()
call UltiSnips#SnippetsInCurrentScope(1)
let list = []
for [key, info] in items(g:current_ulti_dict_info)
let parts = split(info.location, ':')
call add(list, {
\"key": key,
\"path": parts[0],
\"linenr": parts[1],
\"description": info.description,
\})
endfor
return list
endfunction
3.4.4 UltiSnips#CanExpandSnippet *UltiSnips#CanExpandSnippet*
This function returns 1 if UltiSnips can actually do a meaningful expansion in
the current situation. This is useful in conditional mappings.
3.4.5 UltiSnips#CanJumpForwards *UltiSnips#CanJumpForwards*
This function returns 1 if UltiSnips can jump forward in the current
situation. This is useful in conditional mappings.
3.4.6 UltiSnips#CanJumpBackwards *UltiSnips#CanJumpBackwards*
This function returns 1 if UltiSnips can jump backwards in the current
situation. This is useful in conditional mappings.
3.4.7 UltiSnips#ToggleAutoTrigger *UltiSnips#ToggleAutoTrigger*
This function toggles the `autotrigger` functionality. Its return value
corresponds to the new state of the `autotrigger` (0: disabled, 1: enabled).
For example, the following mapping can be used to toggle the `autotrigger`
in the Insert mode: >
inoremap <silent> <C-t> <CMD>call UltiSnips#ToggleAutoTrigger()<CR>
<
*g:UltiSnipsAutoTrigger*
By default, `autotrigger` is enabled (relevant for snippets with the option 'A').
If you want to disable it by default, add the following line to your vimrc: >
let g:UltiSnipsAutoTrigger = 0
3.5 Warning about missing python support *UltiSnips-python-warning*
----------------------------------------
When UltiSnips is loaded, it will check that the running Vim was compiled with
python support. If no support is detected, a warning will be displayed and
loading of UltiSnips will be skipped.
If you would like to suppress this warning message, you may add the following
line to your vimrc file.
let g:UltiSnipsNoPythonWarning = 1
This may be useful if your Vim configuration files are shared across several
systems where some of them may not have Vim compiled with python support.
=============================================================================
4. Authoring snippets *UltiSnips-authoring-snippets*
4.1 Basics *UltiSnips-basics*
----------
4.1.1 How snippets are loaded *UltiSnips-how-snippets-are-loaded*
Snippet definition files are stored in snippet directories. The main
controlling variable for where these directories are searched for is the
list variable, set by default to >
let g:UltiSnipsSnippetDirectories=["UltiSnips"]
Note that "snippets" is reserved for snipMate snippets and cannot be used in
this list. Whether snipMate snippets are active or not is controlled by the
variable `g:UltiSnipsEnableSnipMate`.
UltiSnips will search each 'runtimepath' directory for the subdirectory names
defined in g:UltiSnipsSnippetDirectories in the order they are defined. For
example, if you keep your snippets in `~/.vim/mycoolsnippets` and you want to
make use of the UltiSnips snippets that come with other plugins, add the
following to your vimrc file. >
let g:UltiSnipsSnippetDirectories=["UltiSnips", "mycoolsnippets"]
If you do not want to use the third party snippets that come with plugins,
define the variable accordingly: >
let g:UltiSnipsSnippetDirectories=["mycoolsnippets"]
If the list has only one entry that is an absolute path, UltiSnips will not
iterate through &runtimepath but only look in this one directory for snippets.
This can lead to significant speedup. This means you will miss out on snippets
that are shipped with third party plugins. You'll need to copy them into this
directory manually.
An example configuration could be: >
let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips']
You can also redefine the search path on a buffer by buffer basis by setting
the variable b:UltiSnipsSnippetDirectories. This variable takes precedence
over the global variable.
There is an additional variable which does not control the search path for
snippets at expansion time, but controls where `:UltiSnipsEdit` is looking for
snippets. If this variable is set to a single absolute path it will only
affect where the edit command is looking for and writing snippets too. This is
useful if you want to use third party snippets, but have all your self created
snippets in a single place without being asked where to put the file on edit.
Using a strategy similar to how Vim detects |ftplugins|, UltiSnips iterates
over the snippet definition directories looking for files with names of the
following patterns: ft.snippets, ft_*.snippets, or ft/*, where "ft" is the
'filetype' of the current document and "*" is a shell-like wildcard matching
any string including the empty string. The following table shows some typical
snippet filenames and their associated filetype.
snippet filename filetype ~
ruby.snippets ruby
perl.snippets perl
c.snippets c
c_my.snippets c
c/a c
c/b.snippets c
all.snippets all
all/a.snippets all
The 'all' filetype is unique. It represents snippets available for use when
editing any document regardless of the filetype. A date insertion snippet, for
example, would fit well in the all.snippets file.
UltiSnips understands Vim's dotted filetype syntax. For example, if you define
a dotted filetype for the CUDA C++ framework, e.g. ":set ft=cuda.cpp", then
UltiSnips will search for and activate snippets for both the cuda and cpp
filetypes.
4.1.2 Basic syntax *UltiSnips-basic-syntax*
The snippets file syntax is simple. All lines starting with a # character are
considered comments. Comments are ignored by UltiSnips. Use them to document
snippets.
A line beginning with the keyword 'extends' provides a way of combining
snippet files. When the 'extends' directive is included in a snippet file, it
instructs UltiSnips to include all snippets from the indicated filetypes.
The syntax looks like this: >
extends ft1, ft2, ft3
For example, the first line in cpp.snippets looks like this: >
extends c
When UltiSnips activates snippets for a cpp file, it first looks for all c
snippets and activates them as well. This is a convenient way to create
specialized snippet files from more general ones. Multiple 'extends' lines are
permitted in a snippet file, and they can be included anywhere in the file.
A line beginning with the keyword 'priority' sets the priority for all
snippets defined in the current file after this line. The default priority for
a file is always 0. When a snippet should be expanded, UltiSnips will collect
all snippet definitions from all sources that match the trigger and keep only
the ones with the highest priority. For example, all shipped snippets have a
priority < 0, so that user defined snippets always overwrite shipped snippets.
A line beginning with the keyword 'snippet' marks the beginning of a snippet
definition and a line starting with the keyword 'endsnippet' marks the end.
The snippet definition is placed between the lines. Here is a snippet of an
'if' statement for the Unix shell (sh) filetype. >
snippet if "if ... then (if)"
if ${2:[[ ${1:condition} ]]}; then
${0:#statements}
fi
endsnippet
The start line takes the following form: >
snippet trigger_word [ "description" [ options ] ]
The trigger_word is required, but the description and options are optional.
The 'trigger_word' is the word or string sequence used to trigger the snippet.
Generally a single word is used but the trigger_word can include spaces. If you
wish to include spaces, you must wrap the tab trigger in quotes. >
snippet "tab trigger" [ "description" [ options ] ]
The quotes are not part of the trigger. To activate the snippet type: tab trigger
followed by the snippet expand character.
It is not technically necessary to use quotes to wrap a trigger with spaces.
Any matching characters will do. For example, this is a valid snippet starting
line. >
snippet !tab trigger! [ "description" [ options ] ]
Quotes can be included as part of the trigger by wrapping the trigger in
another character. >
snippet !"tab trigger"! [ "description" [ options ] ]
To activate this snippet one would type: "tab trigger"
The 'description' is a string describing the trigger. It is helpful for
documenting the snippet and for distinguishing it from other snippets with the
same tab trigger. When a snippet is activated and more than one tab trigger
match, UltiSnips displays a list of the matching snippets with their
descriptions. The user then selects the snippet they want.
4.1.3 Snippet Options: *UltiSnips-snippet-options*
The 'options' control the behavior of the snippet. Options are indicated by
single characters. The 'options' characters for a snippet are combined into
a word without spaces.
The options currently supported are: >
b Beginning of line - A snippet with this option is expanded only if the
tab trigger is the first word on the line. In other words, if only
whitespace precedes the tab trigger, expand. The default is to expand
snippets at any position regardless of the preceding non-whitespace
characters.
i In-word expansion - By default a snippet is expanded only if the tab
trigger is the first word on the line or is preceded by one or more
whitespace characters. A snippet with this option is expanded
regardless of the preceding character. In other words, the snippet can
be triggered in the middle of a word.
w Word boundary - With this option, the snippet is expanded if
the tab trigger start matches a word boundary and the tab trigger end
matches a word boundary. In other words the tab trigger must be
preceded and followed by non-word characters. Word characters are
defined by the 'iskeyword' setting. Use this option, for example, to
permit expansion where the tab trigger follows punctuation without
expanding suffixes of larger words. This option overrides 'i'.
r Regular expression - With this option, the tab trigger is expected to
be a python regular expression. The snippet is expanded if the recently
typed characters match the regular expression. Note: The regular
expression MUST be quoted (or surrounded with another character) like a
multi-word tab trigger (see above) whether it has spaces or not. A
resulting match is passed to any python code blocks in the snippet
definition as the local variable "match". Regular expression snippets
can be triggered in-word by default. To avoid this you can start your
regex pattern with '\b', although this will not respect your
'iskeyword' setting.
t Do not expand tabs - If a snippet definition includes leading tab
characters, by default UltiSnips expands the tab characters honoring
the Vim 'shiftwidth', 'softtabstop', 'expandtab' and 'tabstop'
indentation settings. (For example, if 'expandtab' is set, the tab is
replaced with spaces.) If this option is set, UltiSnips will ignore the
Vim settings and insert the tab characters as is. This option is useful
for snippets involved with tab delimited formats.
s Remove whitespace immediately before the cursor at the end of a line
before jumping to the next tabstop. This is useful if there is a
tabstop with optional text at the end of a line.
m Trim all whitespaces from right side of snippet lines. Useful when
snippet contains empty lines which should remain empty after expanding.
Without this option empty lines in snippets definition will have
indentation too.
e Custom context snippet - With this option expansion of snippet can be
controlled not only by previous characters in line, but by any given
python expression. This option can be specified along with other
options, like 'b'. See |UltiSnips-custom-context-snippets| for more info.
A Snippet will be triggered automatically, when condition matches.
See |UltiSnips-autotrigger| for more info.
The end line is the 'endsnippet' keyword on a line by itself. >
endsnippet
When parsing snippet files, UltiSnips chops the trailing newline character
from the 'endsnippet' end line.
4.1.4 Character Escaping: *UltiSnips-character-escaping*
In snippet definitions, the characters '`', '{', '$' and '\' have special
meaning. If you want to insert one of these characters literally, escape them
with a backslash, '\'.
4.1.5 Snippets text-objects *UltiSnips-snippet-text-objects*
Inside a snippets buffer, the following text objects are available:
>
iS inside snippet
aS around snippet (including empty lines that follow)
4.2 Plaintext Snippets *UltiSnips-plaintext-snippets*
----------------------
To illustrate plaintext snippets, let's begin with a simple example. You can
try the examples yourself. Simply edit a new file with Vim. Example snippets
will be added to the 'all.snippets' file, so you'll want to open it in Vim for
editing as well in the same Vim instance. You can use |UltiSnipsEdit| for this,
but you can also just run >
:tabedit ~/.vim/UltiSnips/all.snippets
Add this snippet to 'all.snippets' and save the file.
------------------- SNIP -------------------
>
snippet bye "My mail signature"
Good bye, Sir. Hope to talk to you soon.
- Arthur, King of Britain
endsnippet
<
------------------- SNAP -------------------
UltiSnips detects when you write changes to a snippets file and automatically
makes the changes active. So in the empty buffer, type the tab trigger 'bye'
and then press the <Tab> key.
bye<Tab> -->
Good bye, Sir. Hope to talk to you soon.
- Arthur, King of Britain
The word 'bye' will be replaced with the text of the snippet definition.
4.3 Visual Placeholder *UltiSnips-visual-placeholder*
----------------------
Snippets can contain a special placeholder called ${VISUAL}. The ${VISUAL}
variable is expanded with the text selected just prior to expanding the
snippet.
To see how a snippet with a ${VISUAL} placeholder works, define a snippet with
the placeholder, use Vim's Visual mode to select some text, and then press the
key you use to trigger expanding a snippet (see g:UltiSnipsExpandTrigger). The
selected text is deleted, and you are dropped into Insert mode. Now type the
snippet tab trigger and press the key to trigger expansion. As the snippet
expands, the previously selected text is printed in place of the ${VISUAL}
placeholder.
The ${VISUAL} placeholder can contain default text to use when the snippet has
been triggered when not in Visual mode. The syntax is: >
${VISUAL:default text}
The ${VISUAL} placeholder can also define a transformation (see
|UltiSnips-transformations|). The syntax is: >
${VISUAL:default/search/replace/option}.
Here is a simple example illustrating a visual transformation. The snippet
will take selected text, replace every instance of "should" within it with
"is", and wrap the result in tags.
------------------- SNIP -------------------
>
snippet t
<tag>${VISUAL:inside text/should/is/g}</tag>
endsnippet
<
------------------- SNAP -------------------
Start with this line of text: >
this should be cool
Position the cursor on the word "should", then press the key sequence: viw
(visual mode -> select inner word). Then press <Tab>, type "t" and press <Tab>
again. The result is: >
-> this <tag>is</tag> be cool
If you expand this snippet while not in Visual mode (e.g., in Insert mode type
t<Tab>), you will get: >
<tag>inside text</tag>
4.4 Interpolation *UltiSnips-interpolation*
-----------------
4.4.1 Shellcode: *UltiSnips-shellcode*
Snippets can include shellcode. Put a shell command in a snippet and when the
snippet is expanded, the shell command is replaced by the output produced when
the command is executed. The syntax for shellcode is simple: wrap the code in
backticks, '`'. When a snippet is expanded, UltiSnips runs shellcode by first
writing it to a temporary script and then executing the script. The shellcode
is replaced by the standard output. Anything you can run as a script can be
used in shellcode. Include a shebang line, for example, #!/usr/bin/perl, and
your snippet has the ability to run scripts using other programs, perl, for
example.
Here are some examples. This snippet uses a shell command to insert the
current date.
------------------- SNIP -------------------
>
snippet today
Today is the `date +%d.%m.%y`.
endsnippet
<
------------------- SNAP -------------------
today<tab> ->
Today is the 15.07.09.
This example inserts the current date using perl.
------------------- SNIP -------------------
>
snippet today
Today is `#!/usr/bin/perl
@a = localtime(); print $a[3] . '.' . $a[4] . '.' . ($a[5]+1900);`.
endsnippet
<
------------------- SNAP -------------------
today<tab> ->
Today is 15.6.2009.
4.4.2 VimScript: *UltiSnips-vimscript*
You can also use Vim scripts (sometimes called VimL) in interpolation. The
syntax is similar to shellcode. Wrap the code in backticks and to distinguish
it as a Vim script, start the code with '!v'. Here is an example that counts
the indent of the current line:
------------------- SNIP -------------------
>
snippet indent
Indent is: `!v indent(".")`.
endsnippet
<
------------------- SNAP -------------------
(note the 4 spaces in front): indent<tab> ->
(note the 4 spaces in front): Indent is: 4.
4.4.3 Python: *UltiSnips-python*
Python interpolation is by far the most powerful. The syntax is similar to Vim
scripts except code is started with '!p'. Python scripts can be run using the
python shebang '#!/usr/bin/python', but using the '!p' format comes with some
predefined objects and variables, which can simplify and shorten code. For
example, a 'snip' object instance is implied in python code. Python code using
the '!p' indicator differs also in another way. Generally when a snippet is
expanded the standard output of code replaces the code. With python code the
value of the 'snip.rv' property replaces the code. Standard output is ignored.
The variables automatically defined in python code are: >
fn - The current filename
path - The complete path to the current file
t - The values of the placeholders, t[1] is the text of ${1}, etc.
snip - UltiSnips.TextObjects.SnippetUtil object instance. Has methods
that simplify indentation handling and owns the string that
should be inserted for the snippet.
context - Result of context condition. See |UltiSnips-custom-context-snippets|.
match - Only in regular expression triggered snippets. This is the return
value of the match of the regular expression. See
http://docs.python.org/library/re.html#match-objects
The 'snip' object provides the following methods: >
snip.mkline(line="", indent=None):
Returns a line ready to be appended to the result. If indent
is None, then mkline prepends spaces and/or tabs appropriate to the
current 'tabstop' and 'expandtab' variables.
snip.shift(amount=1):
Shifts the default indentation level used by mkline right by the
number of spaces defined by 'shiftwidth', 'amount' times.
snip.unshift(amount=1):
Shifts the default indentation level used by mkline left by the
number of spaces defined by 'shiftwidth', 'amount' times.
snip.reset_indent():
Resets the indentation level to its initial value.
snip.opt(var, default):
Checks if the Vim variable 'var' has been set. If so, it returns the
variable's value; otherwise, it returns the value of 'default'.
The 'snip' object provides some properties as well: >
snip.rv:
'rv' is the return value, the text that will replace the python block
in the snippet definition. It is initialized to the empty string. This
deprecates the 'res' variable.
snip.c:
The text currently in the python block's position within the snippet.
It is set to empty string as soon as interpolation is completed. Thus
you can check if snip.c is != "" to make sure that the interpolation
is only done once. This deprecates the "cur" variable.
snip.v:
Data related to the ${VISUAL} placeholder. This has two attributes:
snip.v.mode ('v', 'V', '^V', see |visual-mode| )
snip.v.text The text that was selected.
snip.fn:
The current filename.
snip.basename:
The current filename with the extension removed.
snip.ft:
The current filetype.
snip.p:
Last selected placeholder. Will contain placeholder object with
following properties:
'current_text' - text in the placeholder on the moment of selection;
'start' - placeholder start on the moment of selection;
'end' - placeholder end on the moment of selection;
For your convenience, the 'snip' object also provides the following
operators: >
snip >> amount:
Equivalent to snip.shift(amount)
snip << amount:
Equivalent to snip.unshift(amount)
snip += line:
Equivalent to "snip.rv += '\n' + snip.mkline(line)"
Any variables defined in a python block can be used in other python blocks
that follow within the same snippet. Also, the python modules 'vim', 're',
'os', 'string' and 'random' are pre-imported within the scope of snippet code.
Other modules can be imported using the python 'import' command.
Python code allows for very flexible snippets. For example, the following
snippet mirrors the first tabstop value on the same line but right aligned and
in uppercase.
------------------- SNIP -------------------
>
snippet wow
${1:Text}`!p snip.rv = (75-2*len(t[1]))*' '+t[1].upper()`
endsnippet
<
------------------- SNAP -------------------
wow<tab>Hello World ->
Hello World HELLO WORLD
The following snippet uses the regular expression option and illustrates
regular expression grouping using python's match object. It shows that the
expansion of a snippet can depend on the tab trigger used to define the
snippet, and that tab trigger itself can vary.
------------------- SNIP -------------------
>
snippet "be(gin)?( (\S+))?" "begin{} / end{}" br
\begin{${1:`!p
snip.rv = match.group(3) if match.group(2) is not None else "something"`}}
${2:${VISUAL}}
\end{$1}$0
endsnippet
<
------------------- SNAP -------------------
be<tab>center<c-j> ->
\begin{center}
\end{center}
------------------- SNAP -------------------
be center<tab> ->
\begin{center}
\end{center}
The second form is a variation of the first; both produce the same result,
but it illustrates how regular expression grouping works. Using regular
expressions in this manner has some drawbacks:
1. If you use the <Tab> key for both expanding snippets and completion then
if you typed "be form<Tab>" expecting the completion "be formatted", you
would end up with the above SNAP instead, not what you want.
2. The snippet is harder to read.
The biggest advantage, however, is that you can create snippets that take into
account the text preceding a "trigger". This way, you can use it to create
postfix snippets, which are popular in some IDEs.
------------------- SNIP -------------------
>
snippet "(\w+).par" "Parenthesis (postfix)" r
(`!p snip.rv = match.group(1)`$1)$0
endsnippet
<
------------------- SNAP -------------------
something.par<tab> ->
(something)
------------------- SNIP -------------------
>
snippet "([^\s].*)\.return" "Return (postfix)" r
return `!p snip.rv = match.group(1)`$0
endsnippet
<
------------------- SNAP -------------------
value.return<tab> ->
return value
4.4.4 Global Snippets: *UltiSnips-globals*
Global snippets provide a way to reuse common code in multiple snippets.
Currently, only python code is supported. The result of executing the contents
of a global snippet is put into the globals of each python block in the
snippet file. To create a global snippet, use the keyword 'global' in place of
'snippet', and for python code, you use '!p' for the trigger. For example, the
following snippet produces the same output as the last example . However, with
this syntax the 'upper_right' snippet can be reused by other snippets.
------------------- SNIP -------------------
>
global !p
def upper_right(inp):
return (75 - 2 * len(inp))*' ' + inp.upper()
endglobal
snippet wow
${1:Text}`!p snip.rv = upper_right(t[1])`
endsnippet
<
------------------- SNAP -------------------
wow<tab>Hello World ->
Hello World HELLO WORLD
Python global functions can be stored in a python module and then imported.
This makes global functions easily accessible to all snippet files. You can
just drop python files into ~/.vim/pythonx and import them directly inside
your snippets. For example to use
~/.vim/pythonx/my_snippets_helpers.py >
global !p
from my_snippet_helpers import *
endglobal
4.5 Tabstops and Placeholders *UltiSnips-tabstops* *UltiSnips-placeholders*
-----------------------------
Snippets are used to quickly insert reused text into a document. Often the
text has a fixed structure with variable components. Tabstops are used to
simplify modifying the variable content. With tabstops you can easily place
the cursor at the point of the variable content, enter the content you want,
then jump to the next variable component, enter that content, and continue
until all the variable components are complete.
The syntax for a tabstop is the dollar sign followed by a number, for example,
'$1'. Tabstops start at number 1 and are followed in sequential order. The
'$0' tabstop is a special tabstop. It is always the last tabstop in the
snippet no matter how many tabstops are defined. If there is no '$0' defined,
'$0' tabstop will be defined at the end of the snippet.
Here is a simple example.
------------------- SNIP -------------------
>
snippet letter
Dear $1,
$0
Yours sincerely,
$2
endsnippet
<
------------------- SNAP -------------------
letter<tab>Ben<c-j>Paul<c-j>Thanks for suggesting UltiSnips!->
Dear Ben,
Thanks for suggesting UltiSnips!
Yours sincerely,
Paul
You can use <c-j> to jump to the next tabstop, and <c-k> to jump to the
previous. The <Tab> key was not used for jumping forward because it is
commonly used for completion. See |UltiSnips-triggers| for help on defining
different keys for motions.
It is often useful to have some default text for a tabstop. The default text
may be a value commonly used for the variable component, or it may be a word
or phrase that reminds you what is expected for the variable component. To
include default text, the syntax is '${1:value}'.
The following example illustrates a snippet for the shell 'case' statement.
The tabstops use default values to remind the user of what value is expected.
------------------- SNIP -------------------
>
snippet case
case ${1:word} in
${2:pattern} ) $0;;
esac
endsnippet
<
------------------- SNAP -------------------
case<tab>$option<c-j>-v<c-j>verbose=true
case $option in
-v ) verbose=true;;
esac
Sometimes it is useful to have a tabstop within a tabstop. To do this, simply
include the nested tabstop as part of the default text. Consider the following
example illustrating an HTML anchor snippet.
------------------- SNIP -------------------
>
snippet a
<a href="${1:http://www.${2:example.com}}"
$0
</a>
endsnippet
<
------------------- SNAP -------------------
When this snippet is expanded, the first tabstop has a default value of
'http://www.example.com'. If you want the 'http://' schema, jump to the next
tabstop. It has a default value of 'example.com'. This can be replaced by
typing whatever domain you want.
a<tab><c-j>google.com<c-j>Google ->
<a href="http://www.google.com">
Google
</a>
If at the first tabstop you want a different url schema or want to replace the
default url with a named anchor, '#name', for example, just type the value you
want.
a<tab>#top<c-j>Top ->
<a href="#top">
Top
</a>
In the last example, typing any text at the first tabstop replaces the default
value, including the second tabstop, with the typed text. So the second
tabstop is essentially deleted. When a tabstop jump is triggered, UltiSnips
moves to the next remaining tabstop '$0'. This feature can be used
intentionally as a handy way for providing optional tabstop values to the
user. Here is an example to illustrate.
------------------- SNIP -------------------
>
snippet a
<a href="$1"${2: class="${3:link}"}>
$0
</a>
endsnippet
<
------------------- SNAP -------------------
Here, '$1' marks the first tabstop. It is assumed you always want to add a
value for the 'href' attribute. After entering the url and pressing <c-j>, the
snippet will jump to the second tabstop, '$2'. This tabstop is optional. The
default text is ' class="link"'. You can press <c-j> to accept the tabstop,
and the snippet will jump to the third tabstop, '$3', and you can enter the
class attribute value, or, at the second tabstop you can press the backspace
key thereby replacing the second tabstop default with an empty string,
essentially removing it. In either case, continue by pressing <c-j> and the
snippet will jump to the final tabstop inside the anchor.
a<tab>http://www.google.com<c-j><c-j>visited<c-j>Google ->
<a href="http://www.google.com" class="visited">
Google
</a>
a<tab>http://www.google.com<c-j><BS><c-j>Google ->
<a href="http://www.google.com">
Google
</a>
Another special type of tabstop is choice tabstop. It let's you to choose
from a predefined list of items. The syntax of a choice tabstop is >
${1|item1,item2,item3,...|}
Here is an example to illustrate this feature.
------------------- SNIP -------------------
>
snippet q
Your age: ${1|<18,18~60,>60|}
Your height: ${2|<120cm,120cm~180cm,>180cm|}
endsnippet
<
------------------- SNAP -------------------
q<tab>2<c-j>2
Your age: 18~60
Your height: 120cm~180cm
The default text of tabstops can also contain mirrors, transformations or
interpolation.
4.6 Mirrors *UltiSnips-mirrors*
-----------
Mirrors repeat the content of a tabstop. During snippet expansion when you
enter the value for a tabstop, all mirrors of that tabstop are replaced with
the same value. To mirror a tabstop simply insert the tabstop again using the
"dollar sign followed by a number" syntax, e.g., '$1'.
A tabstop can be mirrored multiple times in one snippet, and more than one
tabstop can be mirrored in the same snippet. A mirrored tabstop can have a
default value defined. Only the first instance of the tabstop need have a
default value. Mirrored tabstop will take on the default value automatically.
Mirrors are handy for start-end tags, for example, TeX 'begin' and 'end' tag
labels, XML and HTML tags, and C code #ifndef blocks. Here are some snippet
examples.
------------------- SNIP -------------------
>
snippet env
\begin{${1:enumerate}}
$0
\end{$1}
endsnippet
<
------------------- SNAP -------------------
env<tab>itemize ->
\begin{itemize}
\end{itemize}
------------------- SNIP -------------------
>
snippet ifndef
#ifndef ${1:SOME_DEFINE}
#define $1
$0
#endif /* $1 */
endsnippet
<
------------------- SNAP -------------------
ifndef<tab>WIN32 ->
#ifndef WIN32
#define WIN32
#endif /* WIN32 */
4.7 Transformations *UltiSnips-transformations*
-------------------
Note: Transformations are a bit difficult to grasp so this chapter is divided
into two sections. The first describes transformations and their syntax, and
the second illustrates transformations with demos.
Transformations are like mirrors but instead of just copying text from the
original tabstop verbatim, a regular expression is matched to the content of
the referenced tabstop and a transformation is then applied to the matched
pattern. The syntax and functionality of transformations in UltiSnips follow
very closely to TextMate transformations.
A transformation has the following syntax: >
${<tab_stop_no/regular_expression/replacement/options}
The components are defined as follows: >
tab_stop_no - The number of the tabstop to reference
regular_expression - The regular expression the value of the referenced
tabstop is matched on
replacement - The replacement string, explained in detail below
options - Options for the regular expression
The options can be any combination of >
g - global replace
By default, only the first match of the regular expression is
replaced. With this option all matches are replaced.
i - case insensitive
By default, regular expression matching is case sensitive. With this
option, matching is done without regard to case.
m - multiline
By default, the '^' and '$' special characters only apply to the
start and end of the entire string; so if you select multiple lines,
transformations are made on them entirely as a whole single line
string. With this option, '^' and '$' special characters match the
start or end of any line within a string ( separated by newline
character - '\n' ).
a - ascii conversion
By default, transformation are made on the raw utf-8 string. With
this option, matching is done on the corresponding ASCII string
instead, for example 'à' will become 'a'.
This option required the python package 'unidecode'.
The syntax of regular expressions is beyond the scope of this document. Python
regular expressions are used internally, so the python 're' module can be used
as a guide. See http://docs.python.org/library/re.html.
The syntax for the replacement string is unique. The next paragraph describes
it in detail.
4.7.1 Replacement String: *UltiSnips-replacement-string*
The replacement string can contain $no variables, e.g., $1, which reference
matched groups in the regular expression. The $0 variable is special and
yields the whole match. The replacement string can also contain special escape
sequences: >
\u - Uppercase next letter
\l - Lowercase next letter
\U - Uppercase everything till the next \E
\L - Lowercase everything till the next \E
\E - End upper or lowercase started with \L or \U
\n - A newline
\t - A literal tab
Finally, the replacement string can contain conditional replacements using the
syntax (?no:text:other text). This reads as follows: if the group $no has
matched, insert "text", otherwise insert "other text". "other text" is
optional and if not provided defaults to the empty string, "". This feature
is very powerful. It allows you to add optional text into snippets.
4.7.2 Demos: *UltiSnips-demos*
Transformations are very powerful but often the syntax is convoluted.
Hopefully the demos below help illustrate transformation features.
Demo: Uppercase one character
------------------- SNIP -------------------
>
snippet title "Title transformation"
${1:a text}
${1/\w+\s*/\u$0/}
endsnippet
<
------------------- SNAP -------------------
title<tab>big small ->
big small
Big small
Demo: Uppercase one character and global replace
------------------- SNIP -------------------
>
snippet title "Titlelize in the Transformation"
${1:a text}
${1/\w+\s*/\u$0/g}
endsnippet
<
------------------- SNAP -------------------
title<tab>this is a title ->
this is a title
This Is A Title
Demo: ASCII transformation
------------------- SNIP -------------------
>
snippet ascii "Replace non ascii chars"
${1: an accentued text}
${1/.*/$0/a}
endsnippet
<
------------------- SNAP -------------------
ascii<tab>à la pêche aux moules
à la pêche aux moules
a la peche aux moules
Demo: Regular expression grouping
This is a clever c-like printf snippet, the second tabstop is only shown
when there is a format (%) character in the first tabstop.
------------------- SNIP -------------------
>
snippet printf
printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet
<
------------------- SNAP -------------------
printf<tab>Hello<c-j> // End of line ->
printf("Hello\n"); // End of line
But
printf<tab>A is: %s<c-j>A<c-j> // End of line ->
printf("A is: %s\n", A); // End of line
There are many more examples of what can be done with transformations in the
vim-snippets repo.
4.8 Clearing snippets *UltiSnips-clearing-snippets*
To remove snippets for the current file type, use the 'clearsnippets'
directive.
------------------- SNIP -------------------
>
clearsnippets
<
------------------- SNAP -------------------
'clearsnippets' removes all snippets with a priority lower than the current
one. For example, the following cleares all snippets that have priority <= 1,
even though the example snippet is defined after the 'clearsnippets'.
------------------- SNIP -------------------
>
priority 1
clearsnippets
priority -1
snippet example "Cleared example"
This will never be expanded.
endsnippet
<
------------------- SNAP -------------------
To clear one or more specific snippet, provide the triggers of the snippets as
arguments to the 'clearsnippets' command. The following example will clear the
snippets 'trigger1' and 'trigger2'.
------------------- SNIP -------------------
>
clearsnippets trigger1 trigger2
<
------------------- SNAP -------------------
4.9 Custom context snippets *UltiSnips-custom-context-snippets*
Custom context snippets can be enabled by using the 'e' option in the snippet
definition.
In that case snippet should be defined using this syntax: >
snippet trigger_word "description" "expression" options
The context can also be defined using a special header: >
context "python_expression"
snippet trigger_word "description" options
The 'expression' can be any python expression. If 'expression' evaluates to
'True', then this snippet will be eligible for expansion. The 'expression'
must be wrapped with double-quotes.
The following python modules are automatically imported into the scope before
'expression' is evaluated: 're', 'os', 'vim', 'string', 'random'.
Global variable `snip` will be available with following properties:
'snip.window' - alias for 'vim.current.window'
'snip.buffer' - alias for 'vim.current.window.buffer'
'snip.cursor' - cursor object, which behaves like
'vim.current.window.cursor', but zero-indexed and with following
additional methods:
- 'preserve()' - special method for executing pre/post/jump actions;
- 'set(line, column)' - sets cursor to specified line and column;
- 'to_vim_cursor()' - returns 1-indexed cursor, suitable for assigning
to 'vim.current.window.cursor';
'snip.line' and 'snip.column' - aliases for cursor position (zero-indexed);
'snip.visual_mode' - ('v', 'V', '^V', see |visual-mode|);
'snip.visual_text' - last visually-selected text;
'snip.last_placeholder' - last active placeholder from previous snippet
with following properties:
- 'current_text' - text in the placeholder on the moment of selection;
- 'start' - placeholder start on the moment of selection;
- 'end' - placeholder end on the moment of selection;
'snip.before' - contains the text in the current line up to and including
the matched snippet. Since 'snip.column' counts bytes, not characters,
this is **not** equivalent to 'snip.buffer[snip.line][:snip.column+1]'.
This property is only available in the scope of contexts but not in
that of actions.
For regular expression triggered snippets the variable `match` will contain
the return value of the match of the regular expression. See http://docs.python.org/library/re.html#match-objects.
------------------- SNIP -------------------
>
snippet r "return" "re.match('^\s+if err ', snip.buffer[snip.line-1])" be
return err
endsnippet
<
------------------- SNAP -------------------
That snippet will expand to 'return err' only if the previous line is starting
from 'if err' prefix.
Note: custom context snippets are prioritized over other snippets. It makes possible
to use other snippets as a fallback if no context can be matched:
------------------- SNIP -------------------
>
snippet i "if ..." b
if $1 {
$2
}
endsnippet
snippet i "if err != nil" "re.match('^\s+[^=]*err\s*:?=', snip.buffer[snip.line-1])" be
if err != nil {
$1
}
endsnippet
<
------------------- SNAP -------------------
That snippet will expand into 'if err != nil' if the previous line will match
'err :=' prefix, otherwise the default 'if' snippet will be expanded.
It's a good idea to move context conditions to a separate module, so it can be
used by other UltiSnips users. In that case, module should be imported
using 'global' keyword, like this:
------------------- SNIP -------------------
>
global !p
import my_utils
endglobal
snippet , "return ..., nil/err" "my_utils.is_return_argument(snip)" ie
, `!p if my_utils.is_in_err_condition():
snip.rv = "err"
else:
snip.rv = "nil"`
endsnippet
<
------------------- SNAP -------------------
That snippet will expand only if the cursor is located in the return statement,
and then it will expand either to 'err' or to 'nil' depending on which 'if'
statement it's located. 'is_return_argument' and 'is_in_err_condition' are
part of custom python module which is called 'my_utils' in this example.
Context condition can return any value which python can use as condition in
it's 'if' statement, and if it's considered 'True', then snippet will be
expanded. The evaluated value of 'condition' is available in the 'snip.context'
variable inside the snippet:
------------------- SNIP -------------------
>
snippet + "var +=" "re.match('\s*(.*?)\s*:?=', snip.buffer[snip.line-1])" ie
`!p snip.rv = snip.context.group(1)` += $1
endsnippet
<
------------------- SNAP -------------------
That snippet will expand to 'var1 +=' after line, which begins from 'var1 :='.
*UltiSnips-capture-placeholder*
You can capture placeholder text from the previous snippet by using the
following trick:
------------------- SNIP -------------------
>
snippet = "desc" "snip.last_placeholder" Ae
`!p snip.rv = snip.context.current_text` == nil
endsnippet
<
------------------- SNAP -------------------
That snippet will be expanded only if you will replace selected tabstop in
other snippet (like, as in 'if ${1:var}') and will replace that tabstop by
tabstop value following by ' == nil'.
4.10 Snippets actions *UltiSnips-snippet-actions*
---------------------
A snippet action is an arbitrary python code which can be executed at specific
points in the lifetime of a snippet expansion.
There are three types of actions:
* Pre-expand - invoked just after trigger condition was matched, but before
snippet actually expanded;
* Post-expand - invoked after snippet was expanded and interpolations
were applied for the first time, but before jump on the first placeholder.
* Jump - invoked just after a jump to the next/prev placeholder.
Specified code will be evaluated at stages defined above and same global
variables and modules will be available that are stated in
the |UltiSnips-custom-context-snippets| section (except 'snip.before').
*UltiSnips-buffer-proxy*
Note: special variable called 'snip.buffer' should be used for all buffer
modifications. Not 'vim.current.buffer' and not 'vim.command("...")', because
in that case UltiSnips will not be able to track changes to the buffer
correctly.
'snip.buffer' has the same interface as 'vim.current.window.buffer'.
4.10.1 Pre-expand actions *UltiSnips-pre-expand-actions*
Pre-expand actions can be used to match snippet in one location and then
expand it in the different location. Some useful cases are: correcting
indentation for snippet; expanding snippet for function declaration in another
function body with moving expansion point beyond initial function; performing
extract method refactoring via expanding snippet in different place.
Pre-expand action declared as follows: >
pre_expand "python code here"
snippet ...
endsnippet
Buffer can be modified in pre-expand action code through variable called
'snip.buffer', snippet expansion position will be automatically adjusted.
If cursor line (where trigger was matched) need to be modified, then special
variable method 'snip.cursor.set(line, column)' must be called with the
desired cursor position. In that case UltiSnips will not remove any matched
trigger text and it should be done manually in action code.
To addition to the scope variables defined above 'snip.visual_content' will be
also declared and will contain text that was selected before snippet expansion
(similar to $VISUAL placeholder).
Following snippet will be expanded at 4 spaces indentation level no matter
where it was triggered.
------------------- SNIP -------------------
>
pre_expand "snip.buffer[snip.line] = ' '*4; snip.cursor.set(snip.line, 4)"
snippet d
def $1():
$0
endsnippet
<
------------------- SNAP -------------------
Following snippet will move the selected code to the end of file and create
new method definition for it:
------------------- SNIP -------------------
>
pre_expand "del snip.buffer[snip.line]; snip.buffer.append(''); snip.cursor.set(len(snip.buffer)-1, 0)"
snippet x
def $1():
${2:${VISUAL}}
endsnippet
<
------------------- SNAP -------------------
4.10.2 Post-expand actions *UltiSnips-post-expand-actions*
Post-expand actions can be used to perform some actions based on the expanded
snippet text. Some cases are: code style formatting (e.g. inserting newlines
before and after method declaration), and apply actions depending on python
interpolation result.
Post-expand action declared as follows: >
post_expand "python code here"
snippet ...
endsnippet
Buffer can be modified in post-expand action code through variable called
'snip.buffer', snippet expansion position will be automatically adjusted.
Variables 'snip.snippet_start' and 'snip.snippet_end' will be defined at the
action code scope and will point to positions of the start and end of expanded
snippet accordingly in the form '(line, column)'.
Note: 'snip.snippet_start' and 'snip.snippet_end' will automatically adjust to
the correct positions if post-action will insert or delete lines before
expansion.
Following snippet will expand to method definition and automatically insert
additional newline after end of the snippet. It's very useful to create a
function that will insert as many newlines as required in specific context.
------------------- SNIP -------------------
>
post_expand "snip.buffer[snip.snippet_end[0]+1:snip.snippet_end[0]+1] = ['']"
snippet d "Description" b
def $1():
$2
endsnippet
<
------------------- SNAP -------------------
4.10.3 Post-jump actions *UltiSnips-post-jump-actions*
Post-jump actions can be used to trigger some code based on user input into
the placeholders. Notable use cases: expand another snippet after jump or
anonymous snippet after last jump (e.g. perform move method refactoring and
then insert new method invokation); insert heading into TOC after last jump.
Jump-expand action declared as follows: >
post_jump "python code here"
snippet ...
endsnippet
Buffer can be modified in post-jump action code through variable called
'snip.buffer', snippet expansion position will be automatically adjusted.
Next variables and methods will be also defined in the action code scope:
* 'snip.tabstop' - number of tabstop jumped onto;
* 'snip.jump_direction' - '1' if jumped forward and '-1' otherwise;
* 'snip.tabstops' - list with tabstop objects, see above;
* 'snip.snippet_start' - (line, column) of start of the expanded snippet;
* 'snip.snippet_end' - (line, column) of end of the expanded snippet;
* 'snip.expand_anon()' - alias for 'UltiSnips_Manager.expand_anon()';
Tabstop object has several useful properties:
* 'start' - (line, column) of the starting position of the tabstop (also
accessible as 'tabstop.line' and 'tabstop.col').
* 'end' - (line, column) of the ending position;
* 'current_text' - text inside the tabstop.
Following snippet will insert section in the Table of Contents in the vim-help
file:
------------------- SNIP -------------------
>
post_jump "if snip.tabstop == 0: insert_toc_item(snip.tabstops[1], snip.buffer)"
snippet s "section" b
`!p insert_delimiter_0(snip, t)`$1`!p insert_section_title(snip, t)`
`!p insert_delimiter_1(snip, t)`
$0
endsnippet
<
------------------- SNAP -------------------
'insert_toc_item' will be called after first jump and will add newly entered
section into the TOC for current file.
Note: It is also possible to trigger snippet expansion from the jump action.
In that case method 'snip.cursor.preserve()' should be called, so UltiSnips
will know that cursor is already at the required position.
Following example will insert method call at the end of file after user jump
out of method declaration snippet.
------------------- SNIP -------------------
>
global !p
def insert_method_call(name):
vim.command('normal G')
snip.expand_anon(name + '($1)\n')
endglobal
post_jump "if snip.tabstop == 0: insert_method_call(snip.tabstops[1].current_text)"
snippet d "method declaration" b
def $1():
$2
endsnippet
<
------------------- SNAP -------------------
4.11 Autotrigger *UltiSnips-autotrigger*
----------------
Many language constructs can occur only at specific places, so it's
possible to use snippets without manually triggering them.
Snippet can be marked as autotriggered by specifying 'A' option in the snippet
definition.
After snippet is defined as being autotriggered, snippet condition will be
checked on every typed character and if condition matches, then the snippet
will be triggered.
*Warning:* using of this feature might lead to significant vim slowdown. If
you discovered that, please report an issue.
If you want to temporarily disable autotriggering, the `autotrigger` behavior
can be toggled via |UltiSnips#ToggleAutoTrigger|. By default it is enabled,
but it is possible to customize it with |g:UltiSnipsAutoTrigger|.
Consider following useful Go snippets:
------------------- SNIP -------------------
>
snippet "^p" "package" rbA
package ${1:main}
endsnippet
snippet "^m" "func main" rbA
func main() {
$1
}
endsnippet
<
------------------- SNAP -------------------
When "p" character will occur in the beginning of the line, it will be
automatically expanded into "package main". Same with "m" character. There is
no need to press the trigger key after "m"
==============================================================================
5. UltiSnips and Other Plugins *UltiSnips-other-plugins*
5.1 Existing Integrations *UltiSnips-integrations*
-------------------------
UltiSnips has built-in support for some common plugins and there are others
that are aware of UltiSnips and use it to improve the user experience. This is
an incomplete list - if you want to have your plugin listed here, just send a
pull request.
*UltiSnips-snipMate*
snipMate - UltiSnips is a drop-in replacement for snipMate. It has many more
features, so porting snippets is still a good idea, but switching has low
friction. UltiSnips is trying hard to truly emulate snipMate, for example
recursive tabstops are not supported in snipMate snippets (but of course in
UltiSnips snippets).
YouCompleteMe - comes with out of the box completion support for UltiSnips. It
offers a really nice completion dialogue for snippets.
neocomplete - UltiSnips ships with a source for neocomplete and therefore
offers out of the box completion dialogue support for it too.
deoplete - The successor of neocomplete is also supported. The completion
source is called 'ultisnips'.
vim-easycomplete - Vim-EasyComplete needs ultisnips and vim-snippets for
snippets support. This two plugin is compatible with EasyComplete out of
the box. More information: <https://github.com/jayli/vim-easycomplete>
unite - UltiSnips has a source for unite. As an example of how you can use
it add the following function and mappings to your vimrc: >
function! UltiSnipsCallUnite()
Unite -start-insert -winheight=100 -immediately -no-empty ultisnips
return ''
endfunction
inoremap <silent> <F12> <C-R>=(pumvisible()? "\<LT>C-E>":"")<CR><C-R>=UltiSnipsCallUnite()<CR>
nnoremap <silent> <F12> a<C-R>=(pumvisible()? "\<LT>C-E>":"")<CR><C-R>=UltiSnipsCallUnite()<CR>
When typing <F12> in either insert or normal mode you will get the unite
interface with matching snippets. Pressing enter will expand the corresponding
snippet. If only one snippet matches the text in front of the cursor will be
expanded when you press the <F12> key.
Supertab - UltiSnips has built-in support for Supertab. Just use a recent
enough version of both plugins and <tab> will either expand a snippet or defer
to Supertab for expansion.
5.2 Extending UltiSnips *UltiSnips-extending*
-------------------------
UltiSnips allows other plugins to add new snippets on the fly. Since UltiSnips
is written in python, the integration is also on a python basis. A small
example can be found in `test/test_UltiSnipsFunc.py`, search for
AddNewSnippetSource. Please contact us on github if you integrate UltiSnips
with your plugin so it can be listed in the docs.
=============================================================================
6. Debugging *UltiSnips-Debugging*
UltiSnips comes with a remote debugger disabled
by default. When authoring a complex snippet
with python code, you may want to be able to
set breakpoints to inspect variables.
It is also useful when debugging UltiSnips itself.
See |UltiSnips-Advanced-Debugging| for more informations
=============================================================================
7. FAQ *UltiSnips-FAQ*
Q: Do I have to call UltiSnips#ExpandSnippet() to check if a snippet is
expandable? Is there instead an analog of neosnippet#expandable?
A: Yes there is, try
function UltiSnips#IsExpandable()
return !empty(UltiSnips#SnippetsInCurrentScope())
endfunction
Consider that UltiSnips#SnippetsInCurrentScope() will return all the
snippets you have if you call it after a space character. If you want
UltiSnips#IsExpandable() to return false when you call it after a space
character use this a bit more complicated implementation:
function UltiSnips#IsExpandable()
return !(
\ col('.') <= 1
\ || !empty(matchstr(getline('.'), '\%' . (col('.') - 1) . 'c\s'))
\ || empty(UltiSnips#SnippetsInCurrentScope())
\ )
endfunction
=============================================================================
8. Helping Out *UltiSnips-helping*
UltiSnips needs the help of the Vim community to keep improving. Please
consider joining this effort by providing new features or bug reports.
* Clone the repository on GitHub (git clone git@github.com:SirVer/ultisnips.git),
make your changes and send a pull request on GitHub.
* Make a patch, report a bug/feature request (see below) and attach the patch
to it.
You can contribute by fixing or reporting bugs in our issue tracker:
https://github.com/sirver/ultisnips/issues
=============================================================================
9. Contributors *UltiSnips-contributors*
UltiSnips has been started and maintained from Jun 2009 - Dec 2015 by Holger
Rapp (@SirVer, SirVer@gmx.de). Up to April 2018 it was maintained by Stanislav
Seletskiy (@seletskiy). Now, it is maintained by a growing set of
contributors.
This is the list of contributors pre-git in chronological order. For a full
list of contributors take the union of this set and the authors according to
git log.
JCEB - Jan Christoph Ebersbach
Michael Henry
Chris Chambers
Ryan Wooden
rupa - Rupa Deadwyler
Timo Schmiade
blueyed - Daniel Hahler
expelledboy - Anthony Jackson
allait - Alexey Bezhan
peacech - Charles Gunawan
guns - Sung Pae
shlomif - Shlomi Fish
pberndt - Phillip Berndt
thanatermesis-elive - Thanatermesis
rico-ambiescent - Rico Sta. Cruz
Cody Frazer
suy - Alejandro Exojo
grota - Giuseppe Rota
iiijjjii - Jim Karsten
fgalassi - Federico Galassi
lucapette
Psycojoker - Laurent Peuch
aschrab - Aaron Schrab
stardiviner - NagatoPain
skeept - Jorge Rodrigues
buztard
stephenmckinney - Steve McKinney
Pedro Algarvio - s0undt3ch
Eric Van Dewoestine - ervandew
Matt Patterson - fidothe
Mike Morearty - mmorearty
Stanislav Golovanov - JazzCore
David Briscoe - DavidBriscoe
Keith Welch - paralogiki
Zhao Cai - zhaocai
John Szakmeister - jszakmeister
Jonas Diemer - diemer
Romain Giot - rgiot
Sergey Alexandrov - taketwo
Brian Mock - saikobee
Gernot Höflechner - LFDM
Marcelo D Montu - mMontu
Karl Yngve Lervåg - lervag
Pedro Ferrari - petobens
Ches Martin - ches
Christian - Oberon00
Andrew Ruder - aeruder
Mathias Fußenegger - mfussenegger
Kevin Ballard - kballard
Ahbong Chang - cwahbong
Glenn Griffin - ggriffiniii
Michael - Pyrohh
Stanislav Seletskiy - seletskiy
Pawel Palucki - ppalucki
Dettorer - dettorer
Zhao Jiarong - kawing-chiu
Ye Ding - dyng
Greg Hurrell - wincent
vim:tw=78:ts=8:ft=help:norl:
================================================
FILE: doc/examples/autojump-if-empty/README.md
================================================
# Autojump from tabstop when it's empty
UltiSnips offers enough API to support automatic jump from one tabstop to
another, when some condition is met.
One example of applying this behaviour is to jump to the next placeholder when the
current one becomes empty, when the user types <kbd>BackSpace</kbd> or another erase sequence while the
tabstop is active.
Let's imagine, that we have the following snippet:

The first placeholder, surrounded by parentheses, can be erased by the user, but then the
surrounding parentheses will be left untouched and the user has to remove the parentheses and
one space and only then jump to the next placeholder. That equates to **5** total
keypresses: <kbd>BackSpace</kbd> (erase placeholder), <kbd>BackSpace</kbd> and
<kbd>Delete</kbd> (erase parentheses), <kbd>Delete</kbd> (erase space),
<kbd>Tab</kbd> (jump to next placeholder).
However, with UltiSnips, it can be done via only one keypress:
<kbd>BackSpace</kbd>:

## Implementation
This example uses the [vim-pythonx library](https://github.com/reconquest/vim-pythonx/blob/master/pythonx/px/snippets.py), which provides a set of functions to make coding a little bit easier.
```
global !p
import px.snippets
endglobal
global !p
# This function will jump to next placeholder when first is empty.
def jump_to_second_when_first_is_empty(snip):
if px.snippets.get_jumper_position(snip) == 1:
if not px.snippets.get_jumper_text(snip):
px.snippets.advance_jumper(snip)
# This function will clean up first placeholder when this is empty.
def clean_first_placeholder(snip):
# Jumper is a helper for performing jumps in UltiSnips.
px.snippets.make_jumper(snip)
if snip.tabstop == 2 and not px.snippets.get_jumper_text(snip):
line = snip.buffer[snip.cursor[0]]
snip.buffer[snip.cursor[0]] = \
line[:snip.tabstops[1].start[1]-2] + \
line[snip.tabstops[1].end[1]+1:]
snip.cursor.set(
snip.cursor[0],
snip.cursor[1] - 3,
)
endglobal
context "px.snippets.make_context(snip)"
post_jump "clean_first_placeholder(snip)"
snippet x "Description" b
`!p jump_to_second_when_first_is_empty(snip)
`func (${1:blah}) $2() {
$3
}
endsnippet
```
================================================
FILE: doc/examples/snippets-aliasing/README.md
================================================
# Aliases for snippets

These examples use thes [vim-pythonx library](https://github.com/reconquest/vim-pythonx/blob/master/pythonx/px/snippets.py) which provides set of functions to make coding little bit easier.
Let's imagine we're editing a shell file and we need to debug some state.
We will probably end up with a snippet that will automatically insert the location of the debug statement, the variable name and its content:
```
global !p
import px.snippets
endglobal
snippet pr "print debug" bw
`!p
prefix = t[1] + ": %q\\n' "
prefix = "{}:{}: {}".format(
os.path.basename(px.buffer.get().name),
str(px.cursor.get()[0]),
prefix
)
`printf 'XXXXXX `!p snip.rv=prefix`$1 >&2
endsnippet
```
Now, we want to use same debug snippet, but dump output to a file.
How can we do it?
Simple, declare new snippet in that way:
```
post_jump "px.snippets.expand(snip)"
snippet pd "Description" b
pr$1 >${2:/tmp/debug}
endsnippet
```
This snippet will expand the `pr` snippet automatically (note `pr$1` part) after
jumping to the first placeholder (jump will be done automatically by UltiSnips
engine).
`px.snippets.expand(snip)` is declared in that way:
```python
def expand(snip, jump_pos=1):
if snip.tabstop != jump_pos:
return
vim.eval('feedkeys("\<C-R>=UltiSnips#ExpandSnippet()\<CR>")')
```
`px.buffer.get()` and `px.cursor.get()` are simple helpers for the `vim.current.window.buffer` and `vim.current.window.cursor`.
================================================
FILE: doc/examples/tabstop-generation/README.md
================================================
# Dynamic tabstop generation

UltiSnips at the present day is more than snippet engine. It's more like
constructor, where you can implement some complex features without prior
feature implementation in the snippet by itself.
One of that features is dynamic tabstop generation.
Consider case, where you want set of snippets for inserting latex rows of
various lengths. No-brainer solution is just implement snippet for every
row length you're possible will want, like this:
```
snippet tr9 "LaTeX table row of length nine"
$1 & $2 & $3 & $4 & $5 & $6 & $7 & $8 & $9
endsnippet
```
But soon it becomes a burden to maintain that kind of snippets.
Gladly, tabstops can be generated by using anonymous snippet expansion:
```
global !p
def create_row_placeholders(snip):
# retrieving single line from current string and treat it like tabstops
# count
placeholders_amount = int(snip.buffer[snip.line].strip())
# erase current line
snip.buffer[snip.line] = ''
# create anonymous snippet with expected content and number of tabstops
anon_snippet_body = ' & '.join(['$' + str(i+1)
for i in range(placeholders_amount)])
# expand anonymous snippet
snip.expand_anon(anon_snippet_body)
endglobal
post_jump "create_row_placeholders(snip)"
snippet "tr(\d+)" "latex table row variable" br
`!p snip.rv = match.group(1)`
endsnippet
```
Snippet is declared via regular expression and will expand to any required
number of fields in row.
Now, for a more robust tabstop generation, to create placeholders within
multiple lines:
```
global !p
def create_matrix_placeholders(snip):
# Create anonymous snippet body
anon_snippet_body = ""
# Get start and end line number of expanded snippet
start = snip.snippet_start[0]
end = snip.snippet_end[0]
# Append current line into anonymous snippet
for i in range(start, end + 1):
anon_snippet_body += snip.buffer[i]
anon_snippet_body += "" if i == end else "\n"
# Delete expanded snippet line till second to last line
for i in range(start, end):
del snip.buffer[start]
# Empty last expanded snippet line while preserving the line
snip.buffer[start] = ''
# Expand anonymous snippet
snip.expand_anon(anon_snippet_body)
def create_matrix(cols, rows, sep, start, end):
res = ""
placeholder = 1
for _ in range(0, int(rows)):
res += start + f"${placeholder} "
placeholder += 1
for _ in range(0, int(cols) - 1):
res += sep + f" ${placeholder} "
placeholder += 1
res += end
return res[:-1]
endglobal
post_jump "create_matrix_placeholders(snip)"
snippet 'arr(\d+),(\d+)' "LaTeX array" br
\begin{array}{`!p
orient = ""
for _ in range(0, int(match.group(1))): orient += "l"
snip.rv = orient`}
`!p
snip.rv = create_matrix(match.group(1), match.group(2), "&", "\t", "\\\\\\\\\n")
`$0
\end{array}
endsnippet
```

================================================
FILE: docker/build_vim.sh
================================================
#!/bin/bash
set -o errexit
set -o verbose
cd /src/vim
PYTHON_BUILD_CONFIG="--enable-python3interp"
export CFLAGS="$(python-config --cflags)"
echo $CFLAGS
./configure \
--disable-gpm \
--disable-nls \
--disable-sysmouse \
--enable-gui=no \
--enable-multibyte \
--enable-python3interp \
--with-features=huge \
--with-tlib=ncurses \
--without-x \
|| cat $(find . -name 'config.log')
make install
================================================
FILE: docker/docker_vimrc.vim
================================================
call plug#begin('~/.vim_plugged')
Plug '/src/UltiSnips'
Plug 'honza/vim-snippets'
let g:UltiSnipsExpandTrigger="<tab>"
" Weird choices for triggers, but I wanted something that is rarely typed and
" never eaten by the shell.
let g:UltiSnipsListSnippets="9"
let g:UltiSnipsJumpForwardTrigger="2"
let g:UltiSnipsJumpBackwardTrigger="1"
let g:UltiSnipsEditSplit="vertical"
call plug#end()
================================================
FILE: docker/download_vim.sh
================================================
#!/bin/bash
set -o errexit
set -o verbose
mkdir -p /src && cd /src
if [[ $VIM_VERSION == "git" ]]; then
git clone https://github.com/vim/vim
else
curl -L https://github.com/vim/vim/archive/refs/tags/v${VIM_VERSION}.tar.gz -o vim.tar.gz
tar xf vim.tar.gz && rm vim.tar.gz
mv -v vim* vim
fi
================================================
FILE: docker/install_packages.sh
================================================
#!/bin/sh
set -o errexit
set -o verbose
apt-get update
apt-get install -y \
g++ \
moreutils \
tmux \
git
apt-get clean
================================================
FILE: docker/run_tests.sh
================================================
#!/usr/bin/env bash
set -e -o pipefail
PYTHON_CMD="$(which python)"
VIM="/usr/local/bin/vim"
PYTHON_VERSION=$($PYTHON_CMD -c 'import sys;print(sys.version.split()[0])')
echo "Using python from: $PYTHON_CMD Version: $PYTHON_VERSION"
echo "Using vim from: $VIM"
$VIM --version | head -n 3
set -x
tmux new -d -s vim
# Tests on CI sometimes hang, but we do not know which test it is for sure,
# since all we see are lines of the prior passed tests. In an attempt to have
# every character appear unbuffered we hope to uncover where the test actually
# hangs.
# We also use the `ts` tool to inform us when each line was printed to increase
# the likelyhood to find the failing test faster. Adding these debug helps seem
# to have reduced the likelyhood of the tests failing though.
# See https://stackoverflow.com/questions/3465619/how-to-make-output-of-any-shell-command-unbuffered/25548995
stdbuf -i0 -o0 -e0 \
$PYTHON_CMD ./test_all.py \
-v \
--failfast \
--plugins \
--session vim \
--vim $VIM \
--interface tmux \
--expected-python-version $PYTHON_VERSION \
2>&1 | ts '[%Y-%m-%d %H:%M:%S]'
================================================
FILE: docker/snippets/all.snippets
================================================
snippet example "Repro case example"
This is a simple snippet example
endsnippet
================================================
FILE: ftdetect/snippets.vim
================================================
" recognize .snippet files
if has("autocmd")
autocmd BufNewFile,BufRead *.snippets setf snippets
endif
================================================
FILE: ftplugin/snippets.vim
================================================
" Set some sane defaults for snippet files
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo&vim
" Fold by syntax, but open all folds by default
setlocal foldmethod=syntax
setlocal foldlevel=99
setlocal commentstring=#%s
setlocal noexpandtab
setlocal autoindent nosmartindent nocindent
" Whenever a snippets file is written, we ask UltiSnips to reload all snippet
" files. This feels like auto-updating, but is of course just an
" approximation: If files change outside of the current Vim instance, we will
" not notice.
augroup ultisnips_snippets.vim
autocmd!
autocmd BufWritePost <buffer> call UltiSnips#RefreshSnippets()
augroup END
" Define match words for use with matchit plugin
" http://www.vim.org/scripts/script.php?script_id=39
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
function! s:set_match_words() abort
let pairs = [
\ ['^snippet\>', '^endsnippet\>'],
\ ['^global\>', '^endglobal\>'],
\ ]
" Note: Keep the related patterns into a pattern
" Because tabstop-patterns such as ${1}, ${1:foo}, ${VISUAL}, ..., end with
" the same pattern, '}', matchit could fail to get corresponding '}' in
" nested patterns like ${1:${VISUAL:bar}} when the end-pattern is simply
" set to '}'.
call add(pairs, ['\${\%(\d\|VISUAL\)|\ze.*\\\@<!|}', '\\\@<!|}']) " ${1|baz,qux|}
call add(pairs, ['\${\%(\d\|VISUAL\)\/\ze.*\\\@<!\/[gima]*}', '\\\@<!\/[gima]*}']) " ${1/garply/waldo/g}
call add(pairs, ['\${\%(\%(\d\|VISUAL\)\:\ze\|\ze\%(\d\|VISUAL\)\).*\\\@<!}', '\\\@<!}']) " ${1:foo}, ${VISUAL:bar}, ... or ${1}, ${VISUAL}, ...
call add(pairs, ['\\\@<!`\%(![pv]\|#!\/\f\+\)\%( \|$\)', '\\\@<!`']) " `!p quux`, `!v corge`, `#!/usr/bin/bash grault`, ... (indicators includes a whitespace or end-of-line)
let pats = map(deepcopy(pairs), 'join(v:val, ":")')
let match_words = join(pats, ',')
return match_words
endfunction
let b:match_words = s:set_match_words()
delfunction s:set_match_words
let s:set_match_words = 1
endif
" Add TagBar support
let g:tagbar_type_snippets = {
\ 'ctagstype': 'UltiSnips',
\ 'kinds': [
\ 's:snippets',
\ ],
\ 'deffile': expand('<sfile>:p:h:h') . '/ctags/UltiSnips.cnf',
\ }
" don't unset g:tagbar_type_snippets, it serves no purpose
let b:undo_ftplugin = "
\ setlocal foldmethod< foldlevel< commentstring<
\|setlocal expandtab< autoindent< smartindent< cindent<
\|if get(s:, 'set_match_words')
\|unlet! b:match_ignorecase b:match_words s:set_match_words
\|endif
\"
" snippet text object:
" iS: inside snippet
" aS: around snippet (including empty lines that follow)
fun! s:UltiSnippetTextObj(inner) abort
normal! 0
let start = search('^snippet', 'nbcW')
let end = search('^endsnippet', 'ncW')
let prev = search('^endsnippet', 'nbW')
if !start || !end || prev > start
return feedkeys("\<Esc>", 'n')
endif
exe end
if a:inner
let start += 1
let end -= 1
else
if search('^\S') <= (end + 1)
exe end
else
let end = line('.') - 1
endif
endif
exe start
k<
exe end
normal! $m>gv
endfun
onoremap <silent><buffer> iS :<C-U>call <SID>UltiSnippetTextObj(1)<CR>
xnoremap <silent><buffer> iS :<C-U>call <SID>UltiSnippetTextObj(1)<CR>
onoremap <silent><buffer> aS :<C-U>call <SID>UltiSnippetTextObj(0)<CR>
xnoremap <silent><buffer> aS :<C-U>call <SID>UltiSnippetTextObj(0)<CR>
let &cpo = s:save_cpo
unlet s:save_cpo
================================================
FILE: mypy.ini
================================================
# Global options:
[mypy]
python_version = 3.7
warn_return_any = True
warn_unused_configs = True
mypy_path=pythonx/UltiSnips
[mypy-vim]
ignore_missing_imports = True
[mypy-unidecode]
ignore_missing_imports = True
================================================
FILE: plugin/UltiSnips.vim
================================================
if exists('did_plugin_ultisnips') || &cp
finish
endif
let did_plugin_ultisnips=1
if version < 800
echohl WarningMsg
echom "UltiSnips requires Vim >= 8.0"
echohl None
finish
endif
" Enable Post debug server config
if !exists("g:UltiSnipsDebugServerEnable")
let g:UltiSnipsDebugServerEnable = 0
endif
if !exists("g:UltiSnipsDebugHost")
let g:UltiSnipsDebugHost = 'localhost'
endif
if !exists("g:UltiSnipsDebugPort")
let g:UltiSnipsDebugPort = 8080
endif
if !exists("g:UltiSnipsPMDebugBlocking")
let g:UltiSnipsPMDebugBlocking = 0
endif
" The Commands we define.
command! -bang -nargs=? -complete=customlist,UltiSnips#FileTypeComplete UltiSnipsEdit
\ :call UltiSnips#Edit(<q-bang>, <q-args>)
command! -nargs=1 UltiSnipsAddFiletypes :call UltiSnips#AddFiletypes(<q-args>)
augroup UltiSnips_AutoTrigger
au!
au InsertCharPre * call UltiSnips#TrackChange()
au TextChangedI * call UltiSnips#TrackChange()
if exists('##TextChangedP')
au TextChangedP * call UltiSnips#TrackChange()
endif
augroup END
call UltiSnips#map_keys#MapKeys()
" vim: ts=8 sts=4 sw=4
================================================
FILE: pylintrc
================================================
[MASTER]
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
init-hook='import sys; sys.path.append("pythonx/")'
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS,compatibility_py3
# Pickle collected data for later comparisons.
persistent=no
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=
attribute-defined-outside-init,
bad-continuation,
fixme,
import-error,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
redefined-builtin,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-locals,
too-many-public-methods,
too-many-return-statements,
too-many-statements
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text
# Tells whether to display a full report or only the messages
reports=no
msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# List of builtins function names that should not be used, separated by a comma
bad-functions=apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=_?[a-z_][a-z0-9_]{2,50}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,50}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,50}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{1,50}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{1,50}$
# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,a,b,x,y,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=(__.*__|wrapper)
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=110
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
ignored-modules=vim
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_$|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
================================================
FILE: pythonx/UltiSnips/__init__.py
================================================
#!/usr/bin/env python3
# encoding: utf-8
"""Entry point for all things UltiSnips."""
from UltiSnips.snippet_manager import UltiSnips_Manager
================================================
FILE: pythonx/UltiSnips/buffer_proxy.py
================================================
# coding=utf8
import vim
from UltiSnips import vim_helper
from UltiSnips.diff import diff
from UltiSnips.error import PebkacError
from UltiSnips.position import Position
from contextlib import contextmanager
@contextmanager
def use_proxy_buffer(snippets_stack, vstate):
"""
Forward all changes made in the buffer to the current snippet stack while
function call.
"""
buffer_proxy = VimBufferProxy(snippets_stack, vstate)
old_buffer = vim_helper.buf
try:
vim_helper.buf = buffer_proxy
yield
finally:
vim_helper.buf = old_buffer
buffer_proxy.validate_buffer()
@contextmanager
def suspend_proxy_edits():
"""
Prevents changes being applied to the snippet stack while function call.
"""
if not isinstance(vim_helper.buf, VimBufferProxy):
yield
else:
try:
vim_helper.buf._disable_edits()
yield
finally:
vim_helper.buf._enable_edits()
class VimBufferProxy(vim_helper.VimBuffer):
"""
Proxy object used for tracking changes that made from snippet actions.
Unfortunately, vim by itself lacks of the API for changing text in
trackable maner.
Vim marks offers limited functionality for tracking line additions and
deletions, but nothing offered for tracking changes withing single line.
Instance of this class is passed to all snippet actions and behaves as
internal vim.current.window.buffer.
All changes that are made by user passed to diff algorithm, and resulting
diff applied to internal snippet structures to ensure they are in sync with
actual buffer contents.
"""
def __init__(self, snippets_stack, vstate):
"""
Instantiate new object.
snippets_stack is a slice of currently active snippets.
"""
self._snippets_stack = snippets_stack
self._buffer = vim.current.buffer
self._change_tick = int(vim.eval("b:changedtick"))
self._forward_edits = True
self._vstate = vstate
def is_buffer_changed_outside(self):
"""
Returns true, if buffer was changed without using proxy object, like
with vim.command() or through internal vim.current.window.buffer.
"""
return self._change_tick < int(vim.eval("b:changedtick"))
def validate_buffer(self):
"""
Raises exception if buffer is changes beyound proxy object.
"""
if self.is_buffer_changed_outside():
raise PebkacError(
"buffer was modified using vim.command or "
+ "vim.current.buffer; that changes are untrackable and leads to "
+ "errors in snippet expansion; use special variable `snip.buffer` "
"for buffer modifications.\n\n"
+ "See :help UltiSnips-buffer-proxy for more info."
)
def __setitem__(self, key, value):
"""
Behaves as vim.current.window.buffer.__setitem__ except it tracks
changes and applies them to the current snippet stack.
"""
if isinstance(key, slice):
value = [line for line in value]
changes = list(self._get_diff(key.start, key.stop, value))
self._buffer[key.start : key.stop] = [line.strip("\n") for line in value]
else:
value = value
changes = list(self._get_line_diff(key, self._buffer[key], value))
self._buffer[key] = value
self._change_tick += 1
if self._forward_edits:
for change in changes:
self._apply_change(change)
if self._snippets_stack:
self._vstate.remember_buffer(self._snippets_stack[0])
def __setslice__(self, i, j, text):
"""
Same as __setitem__.
"""
self.__setitem__(slice(i, j), text)
def __getitem__(self, key):
"""
Just passing call to the vim.current.window.buffer.__getitem__.
"""
return self._buffer[key]
def __getslice__(self, i, j):
"""
Same as __getitem__.
"""
return self.__getitem__(slice(i, j))
def __len__(self):
"""
Same as len(vim.current.window.buffer).
"""
return len(self._buffer)
def append(self, line, line_number=-1):
"""
Same as vim.current.window.buffer.append(), but with tracking changes.
"""
if line_number < 0:
line_number = len(self)
if not isinstance(line, list):
line = [line]
self[line_number:line_number] = [l for l in line]
def __delitem__(self, key):
if isinstance(key, slice):
self.__setitem__(key, [])
else:
self.__setitem__(slice(key, key + 1), [])
def _get_diff(self, start, end, new_value):
"""
Very fast diffing algorithm when changes are across many lines.
"""
for line_number in range(start, end):
if line_number < 0:
line_number = len(self._buffer) + line_number
yield ("D", line_number, 0, self._buffer[line_number], True)
if start < 0:
start = len(self._buffer) + start
for line_number in range(0, len(new_value)):
yield ("I", start + line_number, 0, new_value[line_number], True)
def _get_line_diff(self, line_number, before, after):
"""
Use precise diffing for tracking changes in single line.
"""
if before == "":
for change in self._get_diff(line_number, line_number + 1, [after]):
yield change
else:
for change in diff(before, after):
yield (change[0], line_number, change[2], change[3])
def _apply_change(self, change):
"""
Apply changeset to current snippets stack, correctly moving around
snippet itself or its child.
"""
if not self._snippets_stack:
return
change_type, line_number, column_number, change_text = change[0:4]
line_before = line_number <= self._snippets_stack[0]._start.line
column_before = column_number <= self._snippets_stack[0]._start.col
if line_before and column_before:
direction = 1
if change_type == "D":
direction = -1
diff = Position(direction, 0)
if len(change) != 5:
diff = Position(0, direction * len(change_text))
self._snippets_stack[0]._move(Position(line_number, column_number), diff)
else:
if line_number > self._snippets_stack[0]._end.line:
return
if column_number >= self._snippets_stack[0]._end.col:
return
self._snippets_stack[0]._do_edit(change[0:4])
def _disable_edits(self):
"""
Temporary disable applying changes to snippets stack. Should be done
while expanding anonymous snippet in the middle of jump to prevent
double tracking.
"""
self._forward_edits = False
def _enable_edits(self):
"""
Enables changes forwarding back.
"""
self._forward_edits = True
================================================
FILE: pythonx/UltiSnips/compatibility.py
================================================
#!/usr/bin/env python3
# encoding: utf-8
"""This file contains compatibility code to stay compatible with as many python
versions as possible."""
import vim
def _vim_dec(string):
"""Decode 'string' using &encoding."""
# We don't have the luxury here of failing, everything
# falls apart if we don't return a bytearray from the
# passed in string
return string.decode(vim.eval("&encoding"), "replace")
def _vim_enc(bytearray):
"""Encode 'string' using &encoding."""
# We don't have the luxury here of failing, everything
# falls apart if we don't return a string from the passed
# in bytearray
return bytearray.encode(vim.eval("&encoding"), "replace")
def col2byte(line, col):
"""Convert a valid column index into a byte index inside of vims
buffer."""
# We pad the line so that selecting the +1 st column still works.
pre_chars = (vim.current.buffer[line - 1] + " ")[:col]
return len(_vim_enc(pre_chars))
def byte2col(line, nbyte):
"""Convert a column into a byteidx suitable for a mark or cursor
position inside of vim."""
line = vim.current.buffer[line - 1]
raw_bytes = _vim_enc(line)[:nbyte]
return len(_vim_dec(raw_bytes))
================================================
FILE: pythonx/UltiSnips/debug.py
================================================
#!/usr/bin/env python3
# encoding: utf-8
"""Convenience methods that help with debugging.
They should never be used in production code.
"""
import sys
DUMP_FILENAME = (
"/tmp/file.txt"
if not sys.platform.lower().startswith("win")
else "C:/windows/temp/ultisnips.txt"
)
with open(DUMP_FILENAME, "w"):
pass # clears the file
def echo_to_hierarchy(text_object):
"""Outputs the given 'text_object' and its children hierarchically."""
# pylint:disable=protected-access
orig = text_object
parent = text_object
while parent._parent:
parent = parent._parent
def _do_print(text_object, indent=""):
"""prints recursively."""
debug(indent + ("MAIN: " if text_object == orig else "") + str(text_object))
try:
for child in text_object._children:
gitextract_ito3bm8h/ ├── .github/ │ ├── FUNDING.yml │ ├── issue_template.md │ └── workflows/ │ └── main.yml ├── .gitignore ├── CONTRIBUTING.md ├── COPYING.txt ├── ChangeLog ├── Dockerfile ├── Dockerfile.repro ├── Makefile ├── Pipfile ├── README.md ├── after/ │ └── plugin/ │ └── UltiSnips_after.vim ├── autoload/ │ ├── UltiSnips/ │ │ └── map_keys.vim │ ├── UltiSnips.vim │ ├── neocomplete/ │ │ └── sources/ │ │ └── ultisnips.vim │ └── unite/ │ └── sources/ │ └── ultisnips.vim ├── ctags/ │ └── UltiSnips.cnf ├── doc/ │ ├── UltiSnips-advanced.txt │ ├── UltiSnips.txt │ └── examples/ │ ├── autojump-if-empty/ │ │ └── README.md │ ├── snippets-aliasing/ │ │ └── README.md │ └── tabstop-generation/ │ └── README.md ├── docker/ │ ├── build_vim.sh │ ├── docker_vimrc.vim │ ├── download_vim.sh │ ├── install_packages.sh │ ├── run_tests.sh │ └── snippets/ │ └── all.snippets ├── ftdetect/ │ └── snippets.vim ├── ftplugin/ │ └── snippets.vim ├── mypy.ini ├── plugin/ │ └── UltiSnips.vim ├── pylintrc ├── pythonx/ │ └── UltiSnips/ │ ├── __init__.py │ ├── buffer_proxy.py │ ├── compatibility.py │ ├── debug.py │ ├── diff.py │ ├── err_to_scratch_buffer.py │ ├── error.py │ ├── indent_util.py │ ├── position.py │ ├── remote_pdb.py │ ├── snippet/ │ │ ├── __init__.py │ │ ├── definition/ │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── snipmate.py │ │ │ └── ulti_snips.py │ │ ├── parsing/ │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── lexer.py │ │ │ ├── snipmate.py │ │ │ └── ulti_snips.py │ │ └── source/ │ │ ├── __init__.py │ │ ├── added.py │ │ ├── base.py │ │ ├── file/ │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── common.py │ │ │ ├── snipmate.py │ │ │ └── ulti_snips.py │ │ └── snippet_dictionary.py │ ├── snippet_manager.py │ ├── test_diff.py │ ├── test_position.py │ ├── text.py │ ├── text_objects/ │ │ ├── __init__.py │ │ ├── base.py │ │ ├── choices.py │ │ ├── escaped_char.py │ │ ├── mirror.py │ │ ├── python_code.py │ │ ├── shell_code.py │ │ ├── snippet_instance.py │ │ ├── tabstop.py │ │ ├── transformation.py │ │ ├── viml_code.py │ │ └── visual.py │ ├── vim_helper.py │ └── vim_state.py ├── rplugin/ │ └── python3/ │ └── deoplete/ │ └── sources/ │ └── ultisnips.py ├── syntax/ │ ├── snippets.vim │ └── snippets_snipmate.vim ├── test/ │ ├── __init__.py │ ├── constant.py │ ├── test_AnonymousExpansion.py │ ├── test_Autocommands.py │ ├── test_Autotrigger.py │ ├── test_Chars.py │ ├── test_Choices.py │ ├── test_Completion.py │ ├── test_ContextSnippets.py │ ├── test_Editing.py │ ├── test_Expand.py │ ├── test_Fixes.py │ ├── test_Folding.py │ ├── test_Format.py │ ├── test_Interpolation.py │ ├── test_ListSnippets.py │ ├── test_Mirror.py │ ├── test_Movement.py │ ├── test_MultipleMatches.py │ ├── test_ParseSnippets.py │ ├── test_Plugin.py │ ├── test_Recursive.py │ ├── test_Selection.py │ ├── test_SnipMate.py │ ├── test_SnippetActions.py │ ├── test_SnippetOptions.py │ ├── test_SnippetPriorities.py │ ├── test_TabStop.py │ ├── test_Transformation.py │ ├── test_UltiSnipFunc.py │ ├── test_Visual.py │ ├── util.py │ ├── vim_interface.py │ └── vim_test_case.py └── test_all.py
SYMBOL INDEX (1163 symbols across 74 files)
FILE: pythonx/UltiSnips/buffer_proxy.py
function use_proxy_buffer (line 13) | def use_proxy_buffer(snippets_stack, vstate):
function suspend_proxy_edits (line 29) | def suspend_proxy_edits():
class VimBufferProxy (line 43) | class VimBufferProxy(vim_helper.VimBuffer):
method __init__ (line 61) | def __init__(self, snippets_stack, vstate):
method is_buffer_changed_outside (line 73) | def is_buffer_changed_outside(self):
method validate_buffer (line 80) | def validate_buffer(self):
method __setitem__ (line 93) | def __setitem__(self, key, value):
method __setslice__ (line 115) | def __setslice__(self, i, j, text):
method __getitem__ (line 121) | def __getitem__(self, key):
method __getslice__ (line 127) | def __getslice__(self, i, j):
method __len__ (line 133) | def __len__(self):
method append (line 139) | def append(self, line, line_number=-1):
method __delitem__ (line 149) | def __delitem__(self, key):
method _get_diff (line 155) | def _get_diff(self, start, end, new_value):
method _get_line_diff (line 169) | def _get_line_diff(self, line_number, before, after):
method _apply_change (line 180) | def _apply_change(self, change):
method _disable_edits (line 209) | def _disable_edits(self):
method _enable_edits (line 217) | def _enable_edits(self):
FILE: pythonx/UltiSnips/compatibility.py
function _vim_dec (line 10) | def _vim_dec(string):
function _vim_enc (line 18) | def _vim_enc(bytearray):
function col2byte (line 26) | def col2byte(line, col):
function byte2col (line 34) | def byte2col(line, nbyte):
FILE: pythonx/UltiSnips/debug.py
function echo_to_hierarchy (line 21) | def echo_to_hierarchy(text_object):
function debug (line 41) | def debug(msg):
function print_stack (line 47) | def print_stack():
FILE: pythonx/UltiSnips/diff.py
function is_complete_edit (line 14) | def is_complete_edit(initial_line, original, wanted, cmds):
function guess_edit (line 40) | def guess_edit(initial_line, last_text, current_text, vim_state):
function diff (line 158) | def diff(a, b, sline=0):
FILE: pythonx/UltiSnips/err_to_scratch_buffer.py
function _report_exception (line 15) | def _report_exception(self, msg, e):
function wrap (line 40) | def wrap(func):
FILE: pythonx/UltiSnips/error.py
class PebkacError (line 5) | class PebkacError(RuntimeError):
FILE: pythonx/UltiSnips/indent_util.py
class IndentUtil (line 9) | class IndentUtil:
method __init__ (line 13) | def __init__(self):
method reset (line 16) | def reset(self):
method ntabs_to_proper_indent (line 24) | def ntabs_to_proper_indent(self, ntabs):
method indent_to_spaces (line 31) | def indent_to_spaces(self, indent):
method spaces_to_indent (line 39) | def spaces_to_indent(self, indent):
FILE: pythonx/UltiSnips/position.py
class JumpDirection (line 7) | class JumpDirection(Enum):
class Position (line 12) | class Position:
method __init__ (line 16) | def __init__(self, line, col):
method move (line 20) | def move(self, pivot, delta):
method delta (line 37) | def delta(self, pos):
method __add__ (line 47) | def __add__(self, pos):
method __sub__ (line 51) | def __sub__(self, pos):
method __eq__ (line 55) | def __eq__(self, other):
method __ne__ (line 58) | def __ne__(self, other):
method __lt__ (line 61) | def __lt__(self, other):
method __le__ (line 64) | def __le__(self, other):
method __repr__ (line 67) | def __repr__(self):
method __getitem__ (line 70) | def __getitem__(self, index):
FILE: pythonx/UltiSnips/remote_pdb.py
class RemotePDB (line 8) | class RemotePDB(object):
method __init__ (line 16) | def __init__(self, host, port):
method start_server (line 21) | def start_server(self):
method _pm (line 47) | def _pm(self, tb):
method set_trace (line 56) | def set_trace(self, frame):
method _shutdown (line 59) | def _shutdown(self):
method get_host_port (line 69) | def get_host_port(host=None, port=None):
method is_enable (line 77) | def is_enable():
method is_blocking (line 81) | def is_blocking():
method _create (line 85) | def _create(cls):
method breakpoint (line 90) | def breakpoint(cls, host=None, port=None):
method pm (line 98) | def pm(cls):
FILE: pythonx/UltiSnips/snippet/definition/base.py
class _SnippetUtilCursor (line 23) | class _SnippetUtilCursor:
method __init__ (line 24) | def __init__(self, cursor):
method preserve (line 28) | def preserve(self):
method is_set (line 32) | def is_set(self):
method set (line 35) | def set(self, line, column):
method to_vim_cursor (line 39) | def to_vim_cursor(self):
method __getitem__ (line 42) | def __getitem__(self, index):
method __setitem__ (line 45) | def __setitem__(self, index, value):
method __len__ (line 49) | def __len__(self):
method __str__ (line 52) | def __str__(self):
function split_at_whitespace (line 56) | def split_at_whitespace(string):
function _words_for_line (line 61) | def _words_for_line(trigger, before, num_words=None):
class SnippetDefinition (line 81) | class SnippetDefinition:
method __init__ (line 88) | def __init__(
method __repr__ (line 129) | def __repr__(self):
method _re_match (line 137) | def _re_match(self, trigger):
method _context_match (line 153) | def _context_match(self, visual_content, before):
method _eval_code (line 175) | def _eval_code(self, code, additional_locals={}, compiled_code=None):
method _execute_action (line 209) | def _execute_action(
method _make_debug_exception (line 250) | def _make_debug_exception(self, e, code=""):
method _precompile_globals (line 274) | def _precompile_globals(self):
method has_option (line 286) | def has_option(self, opt):
method description (line 291) | def description(self):
method priority (line 296) | def priority(self):
method trigger (line 302) | def trigger(self):
method matched (line 307) | def matched(self):
method location (line 313) | def location(self):
method context (line 318) | def context(self):
method matches (line 322) | def matches(self, before, visual_content=None):
method could_match (line 372) | def could_match(self, before):
method instantiate (line 420) | def instantiate(self, snippet_instance, initial_text, indent):
method do_pre_expand (line 425) | def do_pre_expand(self, visual_content, snippets_stack):
method do_post_expand (line 440) | def do_post_expand(self, start, end, snippets_stack):
method do_post_jump (line 461) | def do_post_jump(
method launch (line 490) | def launch(self, text_before, visual_content, parent, start, end):
FILE: pythonx/UltiSnips/snippet/definition/snipmate.py
class SnipMateSnippetDefinition (line 10) | class SnipMateSnippetDefinition(SnippetDefinition):
method __init__ (line 16) | def __init__(self, trigger, value, description, location):
method instantiate (line 30) | def instantiate(self, snippet_instance, initial_text, indent):
FILE: pythonx/UltiSnips/snippet/definition/ulti_snips.py
class UltiSnipsSnippetDefinition (line 10) | class UltiSnipsSnippetDefinition(SnippetDefinition):
method instantiate (line 14) | def instantiate(self, snippet_instance, initial_text, indent):
FILE: pythonx/UltiSnips/snippet/parsing/base.py
function resolve_ambiguity (line 14) | def resolve_ambiguity(all_tokens, seen_ts):
function tokenize_snippet_text (line 28) | def tokenize_snippet_text(
function finalize (line 70) | def finalize(all_tokens, seen_ts, snippet_instance):
FILE: pythonx/UltiSnips/snippet/parsing/lexer.py
class _TextIterator (line 15) | class _TextIterator:
method __init__ (line 19) | def __init__(self, text, offset):
method __iter__ (line 26) | def __iter__(self):
method __next__ (line 30) | def __next__(self):
method peek (line 44) | def peek(self, count=1):
method pos (line 54) | def pos(self):
function _parse_number (line 59) | def _parse_number(stream):
function _parse_till_closing_brace (line 69) | def _parse_till_closing_brace(stream):
function _parse_till_unescaped_char (line 93) | def _parse_till_unescaped_char(stream, chars):
class Token (line 115) | class Token:
method __init__ (line 119) | def __init__(self, gen, indent):
method _parse (line 125) | def _parse(self, stream, indent):
class TabStopToken (line 130) | class TabStopToken(Token):
method starts_here (line 137) | def starts_here(cls, stream):
method _parse (line 142) | def _parse(self, stream, indent):
method __repr__ (line 152) | def __repr__(self):
class VisualToken (line 161) | class VisualToken(Token):
method starts_here (line 168) | def starts_here(cls, stream):
method _parse (line 173) | def _parse(self, stream, indent):
method __repr__ (line 196) | def __repr__(self):
class TransformationToken (line 200) | class TransformationToken(Token):
method starts_here (line 207) | def starts_here(cls, stream):
method _parse (line 212) | def _parse(self, stream, indent):
method __repr__ (line 224) | def __repr__(self):
class MirrorToken (line 234) | class MirrorToken(Token):
method starts_here (line 241) | def starts_here(cls, stream):
method _parse (line 246) | def _parse(self, stream, indent):
method __repr__ (line 250) | def __repr__(self):
class ChoicesToken (line 254) | class ChoicesToken(Token):
method starts_here (line 264) | def starts_here(cls, stream):
method _parse (line 269) | def _parse(self, stream, indent):
method _get_unescaped_choice_item (line 305) | def _get_unescaped_choice_item(self, escaped_choice_item):
method __repr__ (line 309) | def __repr__(self):
class EscapeCharToken (line 318) | class EscapeCharToken(Token):
method starts_here (line 323) | def starts_here(cls, stream, chars=r"{}\$`"):
method _parse (line 330) | def _parse(self, stream, indent):
method __repr__ (line 334) | def __repr__(self):
class ShellCodeToken (line 338) | class ShellCodeToken(Token):
method starts_here (line 343) | def starts_here(cls, stream):
method _parse (line 348) | def _parse(self, stream, indent):
method __repr__ (line 352) | def __repr__(self):
class PythonCodeToken (line 356) | class PythonCodeToken(Token):
method starts_here (line 363) | def starts_here(cls, stream):
method _parse (line 368) | def _parse(self, stream, indent):
method __repr__ (line 385) | def __repr__(self):
class VimLCodeToken (line 389) | class VimLCodeToken(Token):
method starts_here (line 396) | def starts_here(cls, stream):
method _parse (line 401) | def _parse(self, stream, indent):
method __repr__ (line 406) | def __repr__(self):
class EndOfTextToken (line 410) | class EndOfTextToken(Token):
method __repr__ (line 414) | def __repr__(self):
function tokenize (line 418) | def tokenize(text, indent, offset, allowed_tokens):
FILE: pythonx/UltiSnips/snippet/parsing/snipmate.py
function parse_and_instantiate (line 42) | def parse_and_instantiate(parent_to, text, indent):
FILE: pythonx/UltiSnips/snippet/parsing/ulti_snips.py
function _create_transformations (line 57) | def _create_transformations(all_tokens, seen_ts):
function parse_and_instantiate (line 69) | def parse_and_instantiate(parent_to, text, indent):
FILE: pythonx/UltiSnips/snippet/source/added.py
class AddedSnippetsSource (line 9) | class AddedSnippetsSource(SnippetSource):
method add_snippet (line 13) | def add_snippet(self, ft, snippet):
FILE: pythonx/UltiSnips/snippet/source/base.py
class SnippetSource (line 11) | class SnippetSource:
method __init__ (line 15) | def __init__(self):
method ensure (line 20) | def ensure(self, filetypes):
method refresh (line 23) | def refresh(self):
method _get_existing_deep_extends (line 28) | def _get_existing_deep_extends(self, base_filetypes):
method get_snippets (line 33) | def get_snippets(
method get_clear_priority (line 54) | def get_clear_priority(self, filetypes):
method get_cleared (line 68) | def get_cleared(self, filetypes):
method update_extends (line 79) | def update_extends(self, child_ft, parent_fts):
method get_deep_extends (line 84) | def get_deep_extends(self, base_filetypes):
FILE: pythonx/UltiSnips/snippet/source/file/base.py
class SnippetSyntaxError (line 15) | class SnippetSyntaxError(PebkacError):
method __init__ (line 19) | def __init__(self, filename, line_index, msg):
class SnippetFileSource (line 23) | class SnippetFileSource(SnippetSource):
method __init__ (line 26) | def __init__(self):
method ensure (line 29) | def ensure(self, filetypes):
method refresh (line 36) | def refresh(self):
method _get_all_snippet_files_for (line 39) | def _get_all_snippet_files_for(self, ft):
method _parse_snippet_file (line 43) | def _parse_snippet_file(self, filedata, filename):
method _needs_update (line 47) | def _needs_update(self, ft):
method _load_snippets_for (line 52) | def _load_snippets_for(self, ft):
method _parse_snippets (line 62) | def _parse_snippets(self, ft, filename):
FILE: pythonx/UltiSnips/snippet/source/file/common.py
function normalize_file_path (line 9) | def normalize_file_path(path: str) -> str:
function handle_extends (line 15) | def handle_extends(tail, line_index):
function handle_action (line 23) | def handle_action(head, tail, line_index):
function handle_context (line 31) | def handle_context(tail, line_index):
FILE: pythonx/UltiSnips/snippet/source/file/snipmate.py
function _splitall (line 16) | def _splitall(path):
function _snipmate_files_for (line 35) | def _snipmate_files_for(ft):
function _parse_snippet_file (line 54) | def _parse_snippet_file(content, full_filename):
function _parse_snippet (line 72) | def _parse_snippet(line, lines, filename):
function _parse_snippets_file (line 98) | def _parse_snippets_file(data, filename):
class SnipMateFileSource (line 120) | class SnipMateFileSource(SnippetFileSource):
method _get_all_snippet_files_for (line 124) | def _get_all_snippet_files_for(self, ft):
method _parse_snippet_file (line 127) | def _parse_snippet_file(self, filedata, filename):
FILE: pythonx/UltiSnips/snippet/source/file/ulti_snips.py
function find_snippet_files (line 24) | def find_snippet_files(ft, directory: str) -> Set[str]:
function find_all_snippet_directories (line 35) | def find_all_snippet_directories() -> List[str]:
function find_all_snippet_files (line 69) | def find_all_snippet_files(ft) -> Set[str]:
function _handle_snippet_or_global (line 83) | def _handle_snippet_or_global(
function _parse_snippets_file (line 155) | def _parse_snippets_file(data, filename):
class UltiSnipsFileSource (line 213) | class UltiSnipsFileSource(SnippetFileSource):
method _get_all_snippet_files_for (line 217) | def _get_all_snippet_files_for(self, ft):
method _parse_snippet_file (line 220) | def _parse_snippet_file(self, filedata, filename):
FILE: pythonx/UltiSnips/snippet/source/snippet_dictionary.py
class SnippetDictionary (line 7) | class SnippetDictionary:
method __init__ (line 11) | def __init__(self):
method add_snippet (line 16) | def add_snippet(self, snippet):
method get_matching_snippets (line 20) | def get_matching_snippets(
method clear_snippets (line 44) | def clear_snippets(self, priority, triggers):
method __len__ (line 59) | def __len__(self):
method __iter__ (line 62) | def __iter__(self):
FILE: pythonx/UltiSnips/snippet_manager.py
function _ask_user (line 34) | def _ask_user(a, formatted):
function _show_user_warning (line 53) | def _show_user_warning(msg):
function _ask_snippets (line 60) | def _ask_snippets(snippets):
function _select_and_create_file_to_edit (line 70) | def _select_and_create_file_to_edit(potentials: Set[str]) -> str:
function _get_potential_snippet_filenames_to_edit (line 94) | def _get_potential_snippet_filenames_to_edit(
class SnippetManager (line 111) | class SnippetManager:
method __init__ (line 119) | def __init__(self, expand_trigger, forward_trigger, backward_trigger):
method jump_forwards (line 160) | def jump_forwards(self):
method jump_backwards (line 170) | def jump_backwards(self):
method expand (line 180) | def expand(self):
method expand_or_jump (line 188) | def expand_or_jump(self):
method jump_or_expand (line 206) | def jump_or_expand(self):
method snippets_in_current_scope (line 224) | def snippets_in_current_scope(self, search_all):
method list_snippets (line 267) | def list_snippets(self):
method add_snippet (line 292) | def add_snippet(
method expand_anon (line 320) | def expand_anon(
method register_snippet_source (line 334) | def register_snippet_source(self, name, snippet_source):
method unregister_snippet_source (line 343) | def unregister_snippet_source(self, name):
method get_buffer_filetypes (line 356) | def get_buffer_filetypes(self):
method add_buffer_filetypes (line 363) | def add_buffer_filetypes(self, filetypes: str):
method _cursor_moved (line 378) | def _cursor_moved(self):
method _setup_inner_state (line 449) | def _setup_inner_state(self):
method _teardown_inner_state (line 498) | def _teardown_inner_state(self):
method _save_last_visual_selection (line 523) | def _save_last_visual_selection(self):
method _leaving_buffer (line 532) | def _leaving_buffer(self):
method _reinit (line 543) | def _reinit(self):
method _check_if_still_inside_snippet (line 548) | def _check_if_still_inside_snippet(self):
method _current_snippet_is_done (line 559) | def _current_snippet_is_done(self):
method _jump (line 565) | def _jump(self, jump_direction: JumpDirection):
method _leaving_insert_mode (line 650) | def _leaving_insert_mode(self):
method _handle_failure (line 654) | def _handle_failure(self, trigger, pass_through=False):
method _snips (line 691) | def _snips(self, before, partial, autotrigger_only=False):
method _do_snippet (line 747) | def _do_snippet(self, snippet, before):
method _can_expand (line 819) | def _can_expand(self, autotrigger_only=False):
method _try_expand (line 823) | def _try_expand(self, autotrigger_only=False):
method can_expand (line 845) | def can_expand(self, autotrigger_only=False):
method can_jump (line 849) | def can_jump(self, direction):
method can_jump_forwards (line 854) | def can_jump_forwards(self):
method can_jump_backwards (line 857) | def can_jump_backwards(self):
method _toggle_autotrigger (line 860) | def _toggle_autotrigger(self):
method _current_snippet (line 865) | def _current_snippet(self):
method _file_to_edit (line 871) | def _file_to_edit(self, requested_ft, bang):
method _action_context (line 943) | def _action_context(self):
method _track_change (line 952) | def _track_change(self):
method _refresh_snippets (line 983) | def _refresh_snippets(self):
method _check_filetype (line 989) | def _check_filetype(self, ft):
FILE: pythonx/UltiSnips/test_diff.py
function transform (line 13) | def transform(a, cmds):
class _BaseGuessing (line 30) | class _BaseGuessing:
method runTest (line 31) | def runTest(self):
class TestGuessing_Noop0 (line 39) | class TestGuessing_Noop0(_BaseGuessing, unittest.TestCase):
class TestGuessing_InsertOneChar (line 47) | class TestGuessing_InsertOneChar(_BaseGuessing, unittest.TestCase):
class TestGuessing_InsertOneChar1 (line 54) | class TestGuessing_InsertOneChar1(_BaseGuessing, unittest.TestCase):
class TestGuessing_BackspaceOneChar (line 61) | class TestGuessing_BackspaceOneChar(_BaseGuessing, unittest.TestCase):
class TestGuessing_DeleteOneChar (line 68) | class TestGuessing_DeleteOneChar(_BaseGuessing, unittest.TestCase):
class _Base (line 75) | class _Base:
method runTest (line 76) | def runTest(self):
class TestEmptyString (line 83) | class TestEmptyString(_Base, unittest.TestCase):
class TestAllMatch (line 88) | class TestAllMatch(_Base, unittest.TestCase):
class TestLotsaNewlines (line 93) | class TestLotsaNewlines(_Base, unittest.TestCase):
class TestCrash (line 105) | class TestCrash(_Base, unittest.TestCase):
class TestRealLife (line 111) | class TestRealLife(_Base, unittest.TestCase):
class TestRealLife1 (line 117) | class TestRealLife1(_Base, unittest.TestCase):
class TestWithNewline (line 123) | class TestWithNewline(_Base, unittest.TestCase):
class TestCheapDelete (line 134) | class TestCheapDelete(_Base, unittest.TestCase):
class TestNoSubstring (line 140) | class TestNoSubstring(_Base, unittest.TestCase):
class TestCommonCharacters (line 145) | class TestCommonCharacters(_Base, unittest.TestCase):
class TestUltiSnipsProblem (line 150) | class TestUltiSnipsProblem(_Base, unittest.TestCase):
class MatchIsTooCheap (line 156) | class MatchIsTooCheap(_Base, unittest.TestCase):
class MultiLine (line 162) | class MultiLine(_Base, unittest.TestCase):
FILE: pythonx/UltiSnips/test_position.py
class _MPBase (line 11) | class _MPBase:
method runTest (line 12) | def runTest(self):
class MovePosition_DelSameLine (line 19) | class MovePosition_DelSameLine(_MPBase, unittest.TestCase):
class MovePosition_DelSameLine1 (line 25) | class MovePosition_DelSameLine1(_MPBase, unittest.TestCase):
class MovePosition_InsSameLine1 (line 31) | class MovePosition_InsSameLine1(_MPBase, unittest.TestCase):
class MovePosition_InsSameLine2 (line 41) | class MovePosition_InsSameLine2(_MPBase, unittest.TestCase):
class MovePosition_DelSecondLine (line 47) | class MovePosition_DelSecondLine(_MPBase, unittest.TestCase):
class MovePosition_DelSecondLine1 (line 55) | class MovePosition_DelSecondLine1(_MPBase, unittest.TestCase):
FILE: pythonx/UltiSnips/text.py
function unescape (line 7) | def unescape(text):
function escape (line 21) | def escape(text, chars):
function fill_in_whitespace (line 31) | def fill_in_whitespace(text):
function head_tail (line 41) | def head_tail(line):
class LineIterator (line 54) | class LineIterator:
method __init__ (line 58) | def __init__(self, text):
method __iter__ (line 62) | def __iter__(self):
method __next__ (line 65) | def __next__(self):
method line_index (line 73) | def line_index(self):
method peek (line 77) | def peek(self):
FILE: pythonx/UltiSnips/text_objects/base.py
function _calc_end (line 10) | def _calc_end(text, start):
function _replace_text (line 19) | def _replace_text(buf, start, end, text):
class TextObject (line 44) | class TextObject:
method __init__ (line 48) | def __init__(
method _move (line 65) | def _move(self, pivot, diff):
method __lt__ (line 70) | def __lt__(self, other):
method __le__ (line 85) | def __le__(self, other):
method __repr__ (line 100) | def __repr__(self):
method current_text (line 110) | def current_text(self):
method start (line 121) | def start(self):
method end (line 126) | def end(self):
method overwrite_with_initial_text (line 130) | def overwrite_with_initial_text(self, buf):
method overwrite (line 133) | def overwrite(self, buf, gtext):
method _update (line 154) | def _update(self, done, buf):
class EditableTextObject (line 164) | class EditableTextObject(TextObject):
method __init__ (line 169) | def __init__(self, *args, **kwargs):
method children (line 178) | def children(self):
method _editable_children (line 183) | def _editable_children(self):
method find_parent_for_new_to (line 192) | def find_parent_for_new_to(self, pos):
method _do_edit (line 204) | def _do_edit(self, cmd, ctab=None):
method _move (line 292) | def _move(self, pivot, diff):
method _child_has_moved (line 298) | def _child_has_moved(self, idx, pivot, diff):
method _get_next_tab (line 311) | def _get_next_tab(self, number):
method _get_prev_tab (line 335) | def _get_prev_tab(self, number):
method _get_tabstop (line 359) | def _get_tabstop(self, requester, number):
method _update (line 376) | def _update(self, done, buf):
method _add_child (line 382) | def _add_child(self, child):
method _del_child (line 387) | def _del_child(self, child):
class NoneditableTextObject (line 400) | class NoneditableTextObject(TextObject):
method _update (line 404) | def _update(self, done, buf):
FILE: pythonx/UltiSnips/text_objects/choices.py
class Choices (line 14) | class Choices(TabStop):
method __init__ (line 17) | def __init__(self, parent, token: ChoicesToken):
method _get_choices_placeholder (line 29) | def _get_choices_placeholder(self) -> str:
method _update (line 40) | def _update(self, done, buf):
method _do_edit (line 56) | def _do_edit(self, cmd, ctab=None):
method __repr__ (line 148) | def __repr__(self):
FILE: pythonx/UltiSnips/text_objects/escaped_char.py
class EscapedChar (line 9) | class EscapedChar(NoneditableTextObject):
FILE: pythonx/UltiSnips/text_objects/mirror.py
class Mirror (line 9) | class Mirror(NoneditableTextObject):
method __init__ (line 13) | def __init__(self, parent, tabstop, token):
method _update (line 17) | def _update(self, done, buf):
method _get_text (line 29) | def _get_text(self):
FILE: pythonx/UltiSnips/text_objects/python_code.py
function cached_compile (line 21) | def cached_compile(*args):
class _Tabs (line 25) | class _Tabs:
method __init__ (line 29) | def __init__(self, to):
method __getitem__ (line 32) | def __getitem__(self, no):
method __setitem__ (line 38) | def __setitem__(self, no, value):
class SnippetUtilForAction (line 49) | class SnippetUtilForAction(dict):
method __init__ (line 50) | def __init__(self, *args, **kwargs):
method expand_anon (line 54) | def expand_anon(self, *args, **kwargs):
class SnippetUtil (line 59) | class SnippetUtil:
method __init__ (line 67) | def __init__(self, initial_indent, vmode, vtext, context, parent):
method _reset (line 77) | def _reset(self, cur):
method shift (line 89) | def shift(self, amount=1):
method unshift (line 98) | def unshift(self, amount=1):
method mkline (line 111) | def mkline(self, line="", indent=None):
method reset_indent (line 132) | def reset_indent(self):
method fn (line 138) | def fn(self): # pylint:disable=no-self-use,invalid-name
method basename (line 143) | def basename(self): # pylint:disable=no-self-use
method ft (line 148) | def ft(self): # pylint:disable=invalid-name
method rv (line 153) | def rv(self): # pylint:disable=invalid-name
method rv (line 162) | def rv(self, value): # pylint:disable=invalid-name
method _rv_changed (line 168) | def _rv_changed(self):
method c (line 173) | def c(self): # pylint:disable=invalid-name
method v (line 178) | def v(self): # pylint:disable=invalid-name
method p (line 183) | def p(self):
method context (line 189) | def context(self):
method opt (line 192) | def opt(self, option, default=None): # pylint:disable=no-self-use
method __add__ (line 201) | def __add__(self, value):
method __lshift__ (line 207) | def __lshift__(self, other):
method __rshift__ (line 211) | def __rshift__(self, other):
method snippet_start (line 216) | def snippet_start(self):
method snippet_end (line 223) | def snippet_end(self):
method buffer (line 230) | def buffer(self):
class PythonCode (line 234) | class PythonCode(NoneditableTextObject):
method __init__ (line 238) | def __init__(self, parent, token):
method _update (line 268) | def _update(self, done, buf):
FILE: pythonx/UltiSnips/text_objects/shell_code.py
function _chomp (line 15) | def _chomp(string):
function _run_shell_command (line 25) | def _run_shell_command(cmd, tmpdir):
function _get_tmp (line 46) | def _get_tmp():
class ShellCode (line 64) | class ShellCode(NoneditableTextObject):
method __init__ (line 68) | def __init__(self, parent, token):
method _update (line 73) | def _update(self, done, buf):
FILE: pythonx/UltiSnips/text_objects/snippet_instance.py
class SnippetInstance (line 19) | class SnippetInstance(EditableTextObject):
method __init__ (line 25) | def __init__(
method replace_initial_text (line 54) | def replace_initial_text(self, buf):
method replay_user_edits (line 66) | def replay_user_edits(self, cmds, ctab=None):
method update_textobjects (line 72) | def update_textobjects(self, buf):
method select_next_tab (line 116) | def select_next_tab(self, jump_direction: JumpDirection):
method has_next_tab (line 150) | def has_next_tab(self, jump_direction: JumpDirection):
method _get_tabstop (line 157) | def _get_tabstop(self, requester, no):
method get_tabstops (line 166) | def get_tabstops(self):
class _VimCursor (line 170) | class _VimCursor(NoneditableTextObject):
method __init__ (line 175) | def __init__(self, parent):
method to_vim (line 184) | def to_vim(self):
FILE: pythonx/UltiSnips/text_objects/tabstop.py
class TabStop (line 14) | class TabStop(EditableTextObject):
method __init__ (line 18) | def __init__(self, parent, token, start=None, end=None):
method number (line 28) | def number(self):
method is_killed (line 33) | def is_killed(self):
method __repr__ (line 38) | def __repr__(self):
FILE: pythonx/UltiSnips/text_objects/transformation.py
function _find_closing_brace (line 13) | def _find_closing_brace(string, start_pos):
function _split_conditional (line 32) | def _split_conditional(string):
function _replace_conditional (line 59) | def _replace_conditional(match, string):
class _CleverReplace (line 82) | class _CleverReplace:
method __init__ (line 86) | def __init__(self, expression):
method replace (line 89) | def replace(self, match):
class TextObjectTransformation (line 123) | class TextObjectTransformation:
method __init__ (line 127) | def __init__(self, token):
method _transform (line 149) | def _transform(self, text):
class Transformation (line 169) | class Transformation(Mirror, TextObjectTransformation):
method __init__ (line 173) | def __init__(self, parent, ts, token):
method _get_text (line 177) | def _get_text(self):
FILE: pythonx/UltiSnips/text_objects/viml_code.py
class VimLCode (line 10) | class VimLCode(NoneditableTextObject):
method __init__ (line 14) | def __init__(self, parent, token):
method _update (line 19) | def _update(self, done, buf):
FILE: pythonx/UltiSnips/text_objects/visual.py
class Visual (line 21) | class Visual(NoneditableTextObject, TextObjectTransformation):
method __init__ (line 25) | def __init__(self, parent, token):
method _update (line 42) | def _update(self, done, buf):
FILE: pythonx/UltiSnips/vim_helper.py
class VimBuffer (line 18) | class VimBuffer:
method __getitem__ (line 22) | def __getitem__(self, idx):
method __setitem__ (line 25) | def __setitem__(self, idx, text):
method __len__ (line 28) | def __len__(self):
method __iter__ (line 33) | def __iter__(self):
method line_till_cursor (line 37) | def line_till_cursor(self): # pylint:disable=no-self-use
method number (line 43) | def number(self): # pylint:disable=no-self-use
method filetypes (line 48) | def filetypes(self):
method cursor (line 52) | def cursor(self): # pylint:disable=no-self-use
method cursor (line 64) | def cursor(self, pos): # pylint:disable=no-self-use
function option_set_to (line 74) | def option_set_to(name, new_value):
function save_mark (line 84) | def save_mark(name):
function escape (line 95) | def escape(inp):
function command (line 121) | def command(cmd):
function eval (line 126) | def eval(text):
function bindeval (line 134) | def bindeval(text):
function feedkeys (line 142) | def feedkeys(keys, mode="n"):
function new_scratch_buffer (line 162) | def new_scratch_buffer(text):
function virtual_position (line 181) | def virtual_position(line, col):
function select (line 187) | def select(start, end):
function get_dot_vim (line 224) | def get_dot_vim():
function set_mark_from_pos (line 254) | def set_mark_from_pos(name, pos):
function get_mark_pos (line 258) | def get_mark_pos(name):
function set_cursor_from_pos (line 262) | def set_cursor_from_pos(pos):
function get_cursor_pos (line 266) | def get_cursor_pos():
function delete_mark (line 270) | def delete_mark(name):
function _set_pos (line 277) | def _set_pos(name, pos):
function _get_pos (line 281) | def _get_pos(name):
function _is_pos_zero (line 285) | def _is_pos_zero(pos):
function _unmap_select_mode_mapping (line 289) | def _unmap_select_mode_mapping():
FILE: pythonx/UltiSnips/vim_state.py
class VimPosition (line 15) | class VimPosition(Position):
method __init__ (line 20) | def __init__(self):
method mode (line 26) | def mode(self):
class VimState (line 31) | class VimState:
method __init__ (line 36) | def __init__(self):
method remember_unnamed_register (line 51) | def remember_unnamed_register(self, text_to_expect):
method restore_unnamed_register (line 67) | def restore_unnamed_register(self):
method remember_position (line 74) | def remember_position(self):
method remember_buffer (line 78) | def remember_buffer(self, to):
method diff_in_buffer_length (line 85) | def diff_in_buffer_length(self):
method pos (line 91) | def pos(self):
method ppos (line 96) | def ppos(self):
method remembered_buffer (line 101) | def remembered_buffer(self):
class VisualContentPreserver (line 106) | class VisualContentPreserver:
method __init__ (line 111) | def __init__(self):
method reset (line 114) | def reset(self):
method conserve (line 120) | def conserve(self):
method conserve_placeholder (line 149) | def conserve_placeholder(self, placeholder):
method text (line 158) | def text(self):
method mode (line 163) | def mode(self):
method placeholder (line 168) | def placeholder(self):
FILE: rplugin/python3/deoplete/sources/ultisnips.py
class Source (line 4) | class Source(Base):
method __init__ (line 5) | def __init__(self, vim):
method gather_candidates (line 13) | def gather_candidates(self, context):
FILE: test/test_AnonymousExpansion.py
class _AnonBase (line 5) | class _AnonBase(_VimTest):
method _extra_vim_config (line 8) | def _extra_vim_config(self, vim_config):
class Anon_NoTrigger_Simple (line 14) | class Anon_NoTrigger_Simple(_AnonBase):
class Anon_NoTrigger_AfterSpace (line 20) | class Anon_NoTrigger_AfterSpace(_AnonBase):
class Anon_NoTrigger_BeginningOfLine (line 26) | class Anon_NoTrigger_BeginningOfLine(_AnonBase):
class Anon_NoTrigger_FirstCharOfLine (line 32) | class Anon_NoTrigger_FirstCharOfLine(_AnonBase):
class Anon_NoTrigger_Multi (line 38) | class Anon_NoTrigger_Multi(_AnonBase):
class Anon_Trigger_Multi (line 44) | class Anon_Trigger_Multi(_AnonBase):
class Anon_Trigger_Simple (line 50) | class Anon_Trigger_Simple(_AnonBase):
class Anon_Trigger_Twice (line 56) | class Anon_Trigger_Twice(_AnonBase):
class Anon_Trigger_Opts (line 62) | class Anon_Trigger_Opts(_AnonBase):
FILE: test/test_Autocommands.py
class Autocommands (line 6) | class Autocommands(_VimTest):
method _extra_vim_config (line 26) | def _extra_vim_config(self, vim_config):
FILE: test/test_Autotrigger.py
class Autotrigger_CanMatchSimpleTrigger (line 5) | class Autotrigger_CanMatchSimpleTrigger(_VimTest):
class Autotrigger_CanMatchContext (line 17) | class Autotrigger_CanMatchContext(_VimTest):
class Autotrigger_CanExpandOnTriggerWithLengthMoreThanOne (line 29) | class Autotrigger_CanExpandOnTriggerWithLengthMoreThanOne(_VimTest):
class Autotrigger_CanMatchPreviouslySelectedPlaceholder (line 41) | class Autotrigger_CanMatchPreviouslySelectedPlaceholder(_VimTest):
class Autotrigger_GlobalDisable (line 56) | class Autotrigger_GlobalDisable(_VimTest):
method _extra_vim_config (line 57) | def _extra_vim_config(self, vim_config):
class Autotrigger_CanToggle (line 69) | class Autotrigger_CanToggle(_VimTest):
class Autotrigger_GlobalDisableThenToggle (line 86) | class Autotrigger_GlobalDisableThenToggle(_VimTest):
method _extra_vim_config (line 87) | def _extra_vim_config(self, vim_config):
FILE: test/test_Chars.py
function _snip_quote (line 7) | def _snip_quote(qt):
class Snippet_With_SingleQuote (line 14) | class Snippet_With_SingleQuote(_VimTest):
class Snippet_With_SingleQuote_List (line 20) | class Snippet_With_SingleQuote_List(_VimTest):
class Snippet_With_DoubleQuote (line 26) | class Snippet_With_DoubleQuote(_VimTest):
class Snippet_With_DoubleQuote_List (line 32) | class Snippet_With_DoubleQuote_List(_VimTest):
class RemoveTrailingWhitespace (line 38) | class RemoveTrailingWhitespace(_VimTest):
class TrimSpacesAtEndOfLines (line 44) | class TrimSpacesAtEndOfLines(_VimTest):
class DoNotTrimSpacesAtEndOfLinesByDefault (line 50) | class DoNotTrimSpacesAtEndOfLinesByDefault(_VimTest):
class LeaveTrailingWhitespace (line 56) | class LeaveTrailingWhitespace(_VimTest):
class TrailingNewline_TabStop_NLInsideStuffBehind (line 65) | class TrailingNewline_TabStop_NLInsideStuffBehind(_VimTest):
class TrailingNewline_TabStop_JustNL (line 79) | class TrailingNewline_TabStop_JustNL(_VimTest):
class TrailingNewline_TabStop_EndNL (line 93) | class TrailingNewline_TabStop_EndNL(_VimTest):
class TrailingNewline_TabStop_StartNL (line 107) | class TrailingNewline_TabStop_StartNL(_VimTest):
class TrailingNewline_TabStop_EndStartNL (line 121) | class TrailingNewline_TabStop_EndStartNL(_VimTest):
class TrailingNewline_TabStop_NotEndStartNL (line 136) | class TrailingNewline_TabStop_NotEndStartNL(_VimTest):
class TrailingNewline_TabStop_ExtraNL_ECR (line 150) | class TrailingNewline_TabStop_ExtraNL_ECR(_VimTest):
class _MultiLineDefault (line 166) | class _MultiLineDefault(_VimTest):
class MultiLineDefault_Jump (line 180) | class MultiLineDefault_Jump(_MultiLineDefault):
class MultiLineDefault_Type (line 192) | class MultiLineDefault_Type(_MultiLineDefault):
class MultiLineDefault_BS (line 199) | class MultiLineDefault_BS(_MultiLineDefault):
class _UmlautsBase (line 206) | class _UmlautsBase(_VimTest):
class Snippet_With_Umlauts_List (line 211) | class Snippet_With_Umlauts_List(_UmlautsBase):
class Snippet_With_Umlauts (line 217) | class Snippet_With_Umlauts(_UmlautsBase):
class Snippet_With_Umlauts_TypeOn (line 223) | class Snippet_With_Umlauts_TypeOn(_UmlautsBase):
class Snippet_With_Umlauts_OverwriteFirst (line 229) | class Snippet_With_Umlauts_OverwriteFirst(_UmlautsBase):
class Snippet_With_Umlauts_OverwriteSecond (line 235) | class Snippet_With_Umlauts_OverwriteSecond(_UmlautsBase):
class Snippet_With_Umlauts_OverwriteNone (line 241) | class Snippet_With_Umlauts_OverwriteNone(_UmlautsBase):
class Snippet_With_Umlauts_Mirrors (line 247) | class Snippet_With_Umlauts_Mirrors(_UmlautsBase):
class Snippet_With_Umlauts_Python (line 253) | class Snippet_With_Umlauts_Python(_UmlautsBase):
class UmlautsBeforeTriggerAndCharsAfter (line 259) | class UmlautsBeforeTriggerAndCharsAfter(_UmlautsBase):
class NoUmlautsBeforeTriggerAndCharsAfter (line 265) | class NoUmlautsBeforeTriggerAndCharsAfter(_UmlautsBase):
FILE: test/test_Choices.py
class Choices_WillBeExpandedToInlineSelection (line 5) | class Choices_WillBeExpandedToInlineSelection(_VimTest):
class Choices_ExpectCorrectResult (line 11) | class Choices_ExpectCorrectResult(_VimTest):
class Choices_WillAbandonSelection_If_CharTyped (line 17) | class Choices_WillAbandonSelection_If_CharTyped(_VimTest):
class Choices_WillAbandonSelection_If_InputIsGreaterThanMaxSelectionIndex (line 23) | class Choices_WillAbandonSelection_If_InputIsGreaterThanMaxSelectionInde...
class Choices_WilNotMessWithTabstopsAfterIt (line 29) | class Choices_WilNotMessWithTabstopsAfterIt(_VimTest):
class Choices_MoreThan9Candidates_ShouldWaitForInputs (line 35) | class Choices_MoreThan9Candidates_ShouldWaitForInputs(_VimTest):
class Choices_MoreThan9Candidates_ShouldTerminateWithSpace (line 41) | class Choices_MoreThan9Candidates_ShouldTerminateWithSpace(_VimTest):
class Choices_EmptyChoiceWillBeDiscarded (line 47) | class Choices_EmptyChoiceWillBeDiscarded(_VimTest):
class Choices_WillNotExpand_If_ChoiceListIsEmpty (line 53) | class Choices_WillNotExpand_If_ChoiceListIsEmpty(_VimTest):
class Choices_CanTakeNonAsciiCharacters (line 59) | class Choices_CanTakeNonAsciiCharacters(_VimTest):
class Choices_AsNestedElement_ShouldOverwriteDefaultText (line 65) | class Choices_AsNestedElement_ShouldOverwriteDefaultText(_VimTest):
class Choices_AsNestedElement_ShallNotTakeActionIfParentInput (line 71) | class Choices_AsNestedElement_ShallNotTakeActionIfParentInput(_VimTest):
class Choices_AsNestedElement_CanBeTabbedInto (line 77) | class Choices_AsNestedElement_CanBeTabbedInto(_VimTest):
class Choices_AsNestedElement_CanBeTabbedThrough (line 83) | class Choices_AsNestedElement_CanBeTabbedThrough(_VimTest):
class Choices_With_Mirror (line 89) | class Choices_With_Mirror(_VimTest):
class Choices_With_Mirror_ContinueMirroring_EvenAfterSelectionDone (line 95) | class Choices_With_Mirror_ContinueMirroring_EvenAfterSelectionDone(_VimT...
class Choices_ShouldThrowErrorWithZeroTabstop (line 101) | class Choices_ShouldThrowErrorWithZeroTabstop(_VimTest):
class Choices_CanEscapeCommaInsideChoiceItem (line 107) | class Choices_CanEscapeCommaInsideChoiceItem(_VimTest):
FILE: test/test_Completion.py
class Completion_SimpleExample_ECR (line 5) | class Completion_SimpleExample_ECR(_VimTest):
class Completion_ForwardsJumpWithoutCOMPL_ACCEPT (line 26) | class Completion_ForwardsJumpWithoutCOMPL_ACCEPT(_VimTest):
class Completion_BackwardsJumpWithoutCOMPL_ACCEPT (line 34) | class Completion_BackwardsJumpWithoutCOMPL_ACCEPT(_VimTest):
FILE: test/test_ContextSnippets.py
class ContextSnippets_SimpleSnippet (line 5) | class ContextSnippets_SimpleSnippet(_VimTest):
class ContextSnippets_ExpandOnTrue (line 17) | class ContextSnippets_ExpandOnTrue(_VimTest):
class ContextSnippets_DoNotExpandOnFalse (line 34) | class ContextSnippets_DoNotExpandOnFalse(_VimTest):
class ContextSnippets_Before (line 51) | class ContextSnippets_Before(_VimTest):
class ContextSnippets_UseContext (line 65) | class ContextSnippets_UseContext(_VimTest):
class ContextSnippets_SnippetPriority (line 82) | class ContextSnippets_SnippetPriority(_VimTest):
class ContextSnippets_PriorityKeyword (line 119) | class ContextSnippets_PriorityKeyword(_VimTest):
class ContextSnippets_ReportError (line 137) | class ContextSnippets_ReportError(_VimTest):
class ContextSnippets_ReportErrorOnIndexOutOfRange (line 151) | class ContextSnippets_ReportErrorOnIndexOutOfRange(_VimTest):
class ContextSnippets_CursorIsZeroBased (line 167) | class ContextSnippets_CursorIsZeroBased(_VimTest):
class ContextSnippets_ContextIsClearedBeforeExpand (line 180) | class ContextSnippets_ContextIsClearedBeforeExpand(_VimTest):
class ContextSnippets_ContextHasAccessToVisual (line 194) | class ContextSnippets_ContextHasAccessToVisual(_VimTest):
class ContextSnippets_Header_ExpandOnTrue (line 213) | class ContextSnippets_Header_ExpandOnTrue(_VimTest):
class ContextSnippets_Header_DoNotExpandOnFalse (line 231) | class ContextSnippets_Header_DoNotExpandOnFalse(_VimTest):
class ContextSnippets_ContextHasAccessToReMatch (line 249) | class ContextSnippets_ContextHasAccessToReMatch(_VimTest):
FILE: test/test_Editing.py
class Undo_RemoveMultilineSnippet (line 5) | class Undo_RemoveMultilineSnippet(_VimTest):
class Undo_RemoveEditInTabstop (line 11) | class Undo_RemoveEditInTabstop(_VimTest):
class Undo_RemoveWholeSnippet (line 17) | class Undo_RemoveWholeSnippet(_VimTest):
class Undo_RemoveOneSnippetByTime (line 23) | class Undo_RemoveOneSnippetByTime(_VimTest):
class Undo_RemoveOneSnippetByTime2 (line 29) | class Undo_RemoveOneSnippetByTime2(_VimTest):
class Undo_ChangesInPlaceholder (line 35) | class Undo_ChangesInPlaceholder(_VimTest):
class Undo_CompletelyUndoSnippet (line 41) | class Undo_CompletelyUndoSnippet(_VimTest):
class JumpForward_DefSnippet (line 51) | class JumpForward_DefSnippet(_VimTest):
class DeleteSnippetInsertion0 (line 57) | class DeleteSnippetInsertion0(_VimTest):
class DeleteSnippetInsertion1 (line 63) | class DeleteSnippetInsertion1(_VimTest):
class DoNotCrashOnUndoAndJumpInNestedSnippet (line 69) | class DoNotCrashOnUndoAndJumpInNestedSnippet(_VimTest):
class DeleteLastTwoLinesInSnippet (line 76) | class DeleteLastTwoLinesInSnippet(_VimTest):
class DeleteCurrentTabStop1_JumpBack (line 82) | class DeleteCurrentTabStop1_JumpBack(_VimTest):
class DeleteCurrentTabStop2_JumpBack (line 88) | class DeleteCurrentTabStop2_JumpBack(_VimTest):
class DeleteCurrentTabStop3_JumpAround (line 94) | class DeleteCurrentTabStop3_JumpAround(_VimTest):
class Backspace_TabStop_Zero (line 103) | class Backspace_TabStop_Zero(_VimTest):
class Backspace_TabStop_NotZero (line 109) | class Backspace_TabStop_NotZero(_VimTest):
class UpdateModifiedSnippetWithoutCursorMove1 (line 115) | class UpdateModifiedSnippetWithoutCursorMove1(_VimTest):
class UpdateModifiedSnippetWithoutCursorMove2 (line 121) | class UpdateModifiedSnippetWithoutCursorMove2(_VimTest):
FILE: test/test_Expand.py
class _SimpleExpands (line 5) | class _SimpleExpands(_VimTest):
class SimpleExpand_ExpectCorrectResult (line 9) | class SimpleExpand_ExpectCorrectResult(_SimpleExpands):
class SimpleExpandTwice_ExpectCorrectResult (line 14) | class SimpleExpandTwice_ExpectCorrectResult(_SimpleExpands):
class SimpleExpandNewLineAndBackspae_ExpectCorrectResult (line 19) | class SimpleExpandNewLineAndBackspae_ExpectCorrectResult(_SimpleExpands):
method _extra_vim_config (line 23) | def _extra_vim_config(self, vim_config):
class SimpleExpandTypeAfterExpand_ExpectCorrectResult (line 27) | class SimpleExpandTypeAfterExpand_ExpectCorrectResult(_SimpleExpands):
class SimpleExpandTypeAndDelete_ExpectCorrectResult (line 32) | class SimpleExpandTypeAndDelete_ExpectCorrectResult(_SimpleExpands):
class DoNotExpandAfterSpace_ExpectCorrectResult (line 37) | class DoNotExpandAfterSpace_ExpectCorrectResult(_SimpleExpands):
class ExitSnippetModeAfterTabstopZero (line 42) | class ExitSnippetModeAfterTabstopZero(_VimTest):
class ExpandInTheMiddleOfLine_ExpectCorrectResult (line 48) | class ExpandInTheMiddleOfLine_ExpectCorrectResult(_SimpleExpands):
class MultilineExpand_ExpectCorrectResult (line 53) | class MultilineExpand_ExpectCorrectResult(_VimTest):
class MultilineExpandTestTyping_ExpectCorrectResult (line 59) | class MultilineExpandTestTyping_ExpectCorrectResult(_VimTest):
class SimpleExpandEndingWithNewline_ExpectCorrectResult (line 65) | class SimpleExpandEndingWithNewline_ExpectCorrectResult(_VimTest):
class SimpleExpand_DoNotClobberDefaultRegister (line 71) | class SimpleExpand_DoNotClobberDefaultRegister(_VimTest):
method _extra_vim_config (line 76) | def _extra_vim_config(self, vim_config):
class SimpleExpand_Issue1343 (line 80) | class SimpleExpand_Issue1343(_VimTest):
class SimpleExpandJumpOrExpand_Expand (line 85) | class SimpleExpandJumpOrExpand_Expand(_VimTest):
method _extra_vim_config (line 90) | def _extra_vim_config(self, vim_config):
class SimpleExpandJumpOrExpand_Ambiguity (line 93) | class SimpleExpandJumpOrExpand_Ambiguity(_VimTest):
method _extra_vim_config (line 98) | def _extra_vim_config(self, vim_config):
class SimpleExpandExpandOrJump_Expand (line 101) | class SimpleExpandExpandOrJump_Expand(_VimTest):
method _extra_vim_config (line 106) | def _extra_vim_config(self, vim_config):
class SimpleExpandExpandOrJump_Ambiguity (line 109) | class SimpleExpandExpandOrJump_Ambiguity(_VimTest):
method _extra_vim_config (line 114) | def _extra_vim_config(self, vim_config):
FILE: test/test_Fixes.py
class Bug1251994 (line 7) | class Bug1251994(_VimTest):
class VirtualEdit (line 16) | class VirtualEdit(_VimTest):
method _extra_vim_config (line 21) | def _extra_vim_config(self, vim_config):
class RetainsTheUnnamedRegister (line 31) | class RetainsTheUnnamedRegister(_VimTest):
class RetainsTheUnnamedRegister_ButOnlyOnce (line 37) | class RetainsTheUnnamedRegister_ButOnlyOnce(_VimTest):
class ShiftWidthZero (line 62) | class ShiftWidthZero(_VimTest):
method _extra_vim_config (line 63) | def _extra_vim_config(self, vim_config):
class NonUnicodeDataInUnnamedRegister (line 76) | class NonUnicodeDataInUnnamedRegister(_VimTest):
method _before_test (line 99) | def _before_test(self):
class PassThroughNonexecutedTrigger (line 117) | class PassThroughNonexecutedTrigger(_VimTest):
class NullByte_ListSnippets (line 138) | class NullByte_ListSnippets(_VimTest):
class NullByte_ExpandAfter (line 144) | class NullByte_ExpandAfter(_VimTest):
FILE: test/test_Folding.py
class FoldingEnabled_SnippetWithFold_ExpectNoFolding (line 5) | class FoldingEnabled_SnippetWithFold_ExpectNoFolding(_VimTest):
method _extra_vim_config (line 6) | def _extra_vim_config(self, vim_config):
class FoldOverwrite_Simple_ECR (line 20) | class FoldOverwrite_Simple_ECR(_VimTest):
class Fold_DeleteMiddleLine_ECR (line 31) | class Fold_DeleteMiddleLine_ECR(_VimTest):
class PerlSyntaxFold (line 43) | class PerlSyntaxFold(_VimTest):
method _extra_vim_config (line 44) | def _extra_vim_config(self, vim_config):
FILE: test/test_Format.py
class _ExpandTabs (line 6) | class _ExpandTabs(_VimTest):
method _extra_vim_config (line 7) | def _extra_vim_config(self, vim_config):
class RecTabStopsWithExpandtab_SimpleExample_ECR (line 12) | class RecTabStopsWithExpandtab_SimpleExample_ECR(_ExpandTabs):
class RecTabStopsWithExpandtab_SpecialIndentProblem_ECR (line 18) | class RecTabStopsWithExpandtab_SpecialIndentProblem_ECR(_ExpandTabs):
method _extra_vim_config (line 30) | def _extra_vim_config(self, vim_config):
class ProperIndenting_SimpleCase_ECR (line 36) | class ProperIndenting_SimpleCase_ECR(_VimTest):
class ProperIndenting_SingleLineNoReindenting_ECR (line 42) | class ProperIndenting_SingleLineNoReindenting_ECR(_VimTest):
class ProperIndenting_AutoIndentAndNewline_ECR (line 48) | class ProperIndenting_AutoIndentAndNewline_ECR(_VimTest):
method _extra_vim_config (line 53) | def _extra_vim_config(self, vim_config):
class ProperIndenting_FirstLineInFile_ECR (line 60) | class ProperIndenting_FirstLineInFile_ECR(_VimTest):
class ProperIndenting_FirstLineInFileComplete_ECR (line 86) | class ProperIndenting_FirstLineInFileComplete_ECR(ProperIndenting_FirstL...
class _FormatoptionsBase (line 91) | class _FormatoptionsBase(_VimTest):
method _extra_vim_config (line 92) | def _extra_vim_config(self, vim_config):
class FOSimple_Break_ExpectCorrectResult (line 97) | class FOSimple_Break_ExpectCorrectResult(_FormatoptionsBase):
class FOTextBeforeAndAfter_ExpectCorrectResult (line 113) | class FOTextBeforeAndAfter_ExpectCorrectResult(_FormatoptionsBase):
class FOTextAfter_ExpectCorrectResult (line 125) | class FOTextAfter_ExpectCorrectResult(_FormatoptionsBase):
class FOWrapOnLongWord_ExpectCorrectResult (line 143) | class FOWrapOnLongWord_ExpectCorrectResult(_FormatoptionsBase):
FILE: test/test_Interpolation.py
class TabStop_Shell_SimpleExample (line 9) | class TabStop_Shell_SimpleExample(_VimTest):
class TabStop_Shell_WithUmlauts (line 16) | class TabStop_Shell_WithUmlauts(_VimTest):
class TabStop_Shell_TextInNextLine (line 23) | class TabStop_Shell_TextInNextLine(_VimTest):
class TabStop_Shell_InDefValue_Leave (line 30) | class TabStop_Shell_InDefValue_Leave(_VimTest):
class TabStop_Shell_InDefValue_Overwrite (line 37) | class TabStop_Shell_InDefValue_Overwrite(_VimTest):
class TabStop_Shell_TestEscapedChars_Overwrite (line 44) | class TabStop_Shell_TestEscapedChars_Overwrite(_VimTest):
class TabStop_Shell_TestEscapedCharsAndShellVars_Overwrite (line 51) | class TabStop_Shell_TestEscapedCharsAndShellVars_Overwrite(_VimTest):
class TabStop_Shell_ShebangPython (line 58) | class TabStop_Shell_ShebangPython(_VimTest):
class TabStop_VimScriptInterpolation_SimpleExample (line 71) | class TabStop_VimScriptInterpolation_SimpleExample(_VimTest):
class PythonCodeOld_SimpleExample (line 77) | class PythonCodeOld_SimpleExample(_VimTest):
class PythonCodeOld_ReferencePlaceholderAfter (line 83) | class PythonCodeOld_ReferencePlaceholderAfter(_VimTest):
class PythonCodeOld_ReferencePlaceholderBefore (line 89) | class PythonCodeOld_ReferencePlaceholderBefore(_VimTest):
class PythonCodeOld_TransformedBeforeMultiLine (line 95) | class PythonCodeOld_TransformedBeforeMultiLine(_VimTest):
class PythonCodeOld_IndentedMultiline (line 105) | class PythonCodeOld_IndentedMultiline(_VimTest):
class PythonCode_UseNewOverOld (line 119) | class PythonCode_UseNewOverOld(_VimTest):
class PythonCode_SimpleExample (line 129) | class PythonCode_SimpleExample(_VimTest):
class PythonCode_SimpleExample_ReturnValueIsEmptyString (line 135) | class PythonCode_SimpleExample_ReturnValueIsEmptyString(_VimTest):
class PythonCode_ReferencePlaceholder (line 141) | class PythonCode_ReferencePlaceholder(_VimTest):
class PythonCode_ReferencePlaceholderBefore (line 147) | class PythonCode_ReferencePlaceholderBefore(_VimTest):
class PythonCode_TransformedBeforeMultiLine (line 153) | class PythonCode_TransformedBeforeMultiLine(_VimTest):
class PythonCode_MultilineIndented (line 163) | class PythonCode_MultilineIndented(_VimTest):
class PythonCode_SimpleAppend (line 177) | class PythonCode_SimpleAppend(_VimTest):
class PythonCode_MultiAppend (line 187) | class PythonCode_MultiAppend(_VimTest):
class PythonCode_MultiAppendSimpleIndent (line 198) | class PythonCode_MultiAppendSimpleIndent(_VimTest):
class PythonCode_SimpleMkline (line 220) | class PythonCode_SimpleMkline(_VimTest):
class PythonCode_MultiAppendShift (line 242) | class PythonCode_MultiAppendShift(_VimTest):
class PythonCode_MultiAppendShiftMethods (line 271) | class PythonCode_MultiAppendShiftMethods(_VimTest):
class PythonCode_ResetIndent (line 300) | class PythonCode_ResetIndent(_VimTest):
class PythonCode_IndentEtSw (line 330) | class PythonCode_IndentEtSw(_VimTest):
method _extra_vim_config (line 331) | def _extra_vim_config(self, vim_config):
class PythonCode_IndentEtSwOffset (line 357) | class PythonCode_IndentEtSwOffset(_VimTest):
method _extra_vim_config (line 358) | def _extra_vim_config(self, vim_config):
class PythonCode_IndentNoetSwTs (line 384) | class PythonCode_IndentNoetSwTs(_VimTest):
method _extra_vim_config (line 385) | def _extra_vim_config(self, vim_config):
class PythonCode_OptExists (line 414) | class PythonCode_OptExists(_VimTest):
method _extra_vim_config (line 415) | def _extra_vim_config(self, vim_config):
class PythonCode_OptNoExists (line 423) | class PythonCode_OptNoExists(_VimTest):
class PythonCode_IndentProblem (line 429) | class PythonCode_IndentProblem(_VimTest):
class PythonCode_TrickyReferences (line 441) | class PythonCode_TrickyReferences(_VimTest):
class PythonCode_Locals (line 450) | class PythonCode_Locals(_VimTest):
class PythonCode_LongerTextThanSource_Chars (line 461) | class PythonCode_LongerTextThanSource_Chars(_VimTest):
class PythonCode_LongerTextThanSource_MultiLine (line 467) | class PythonCode_LongerTextThanSource_MultiLine(_VimTest):
class PythonCode_AccessKilledTabstop_OverwriteSecond (line 473) | class PythonCode_AccessKilledTabstop_OverwriteSecond(_VimTest):
class PythonCode_AccessKilledTabstop_OverwriteFirst (line 482) | class PythonCode_AccessKilledTabstop_OverwriteFirst(_VimTest):
class PythonCode_CanOverwriteTabstop (line 491) | class PythonCode_CanOverwriteTabstop(_VimTest):
class PythonVisual_NoVisualSelection_Ignore (line 504) | class PythonVisual_NoVisualSelection_Ignore(_VimTest):
class PythonVisual_SelectOneWord (line 510) | class PythonVisual_SelectOneWord(_VimTest):
class PythonVisual_LineSelect_Simple (line 516) | class PythonVisual_LineSelect_Simple(_VimTest):
class PythonVisual_HasAccessToSelectedPlaceholders (line 522) | class PythonVisual_HasAccessToSelectedPlaceholders(_VimTest):
class PythonVisual_HasAccessToZeroPlaceholders (line 533) | class PythonVisual_HasAccessToZeroPlaceholders(_VimTest):
class Python_SnipRvCanBeNonText (line 544) | class Python_SnipRvCanBeNonText(_VimTest):
FILE: test/test_ListSnippets.py
class _ListAllSnippets (line 5) | class _ListAllSnippets(_VimTest):
class ListAllAvailable_NothingTyped_ExpectCorrectResult (line 13) | class ListAllAvailable_NothingTyped_ExpectCorrectResult(_ListAllSnippets):
class ListAllAvailable_SpaceInFront_ExpectCorrectResult (line 18) | class ListAllAvailable_SpaceInFront_ExpectCorrectResult(_ListAllSnippets):
class ListAllAvailable_BraceInFront_ExpectCorrectResult (line 23) | class ListAllAvailable_BraceInFront_ExpectCorrectResult(_ListAllSnippets):
class ListAllAvailable_testtyped_ExpectCorrectResult (line 28) | class ListAllAvailable_testtyped_ExpectCorrectResult(_ListAllSnippets):
class ListAllAvailable_testtypedSecondOpt_ExpectCorrectResult (line 33) | class ListAllAvailable_testtypedSecondOpt_ExpectCorrectResult(_ListAllSn...
class ListAllAvailable_NonDefined_NoExpectionShouldBeRaised (line 38) | class ListAllAvailable_NonDefined_NoExpectionShouldBeRaised(_ListAllSnip...
class ListAllAvailable_Disabled_ExpectCorrectResult (line 43) | class ListAllAvailable_Disabled_ExpectCorrectResult(_ListAllSnippets):
method _extra_vim_config (line 47) | def _extra_vim_config(self, vim_config):
FILE: test/test_Mirror.py
class TextTabStopTextAfterTab_ExpectCorrectResult (line 5) | class TextTabStopTextAfterTab_ExpectCorrectResult(_VimTest):
class TextTabStopTextBeforeTab_ExpectCorrectResult (line 11) | class TextTabStopTextBeforeTab_ExpectCorrectResult(_VimTest):
class TextTabStopTextSurroundedTab_ExpectCorrectResult (line 17) | class TextTabStopTextSurroundedTab_ExpectCorrectResult(_VimTest):
class TextTabStopTextBeforeMirror_ExpectCorrectResult (line 23) | class TextTabStopTextBeforeMirror_ExpectCorrectResult(_VimTest):
class TextTabStopAfterMirror_ExpectCorrectResult (line 29) | class TextTabStopAfterMirror_ExpectCorrectResult(_VimTest):
class TextTabStopSurroundMirror_ExpectCorrectResult (line 35) | class TextTabStopSurroundMirror_ExpectCorrectResult(_VimTest):
class TextTabStopAllSurrounded_ExpectCorrectResult (line 41) | class TextTabStopAllSurrounded_ExpectCorrectResult(_VimTest):
class MirrorBeforeTabstopLeave_ExpectCorrectResult (line 47) | class MirrorBeforeTabstopLeave_ExpectCorrectResult(_VimTest):
class MirrorBeforeTabstopOverwrite_ExpectCorrectResult (line 53) | class MirrorBeforeTabstopOverwrite_ExpectCorrectResult(_VimTest):
class TextTabStopSimpleMirrorMultiline_ExpectCorrectResult (line 59) | class TextTabStopSimpleMirrorMultiline_ExpectCorrectResult(_VimTest):
class SimpleMirrorMultilineMany_ExpectCorrectResult (line 65) | class SimpleMirrorMultilineMany_ExpectCorrectResult(_VimTest):
class MultilineTabStopSimpleMirrorMultiline_ExpectCorrectResult (line 71) | class MultilineTabStopSimpleMirrorMultiline_ExpectCorrectResult(_VimTest):
class MultilineTabStopSimpleMirrorMultiline1_ExpectCorrectResult (line 77) | class MultilineTabStopSimpleMirrorMultiline1_ExpectCorrectResult(_VimTest):
class MultilineTabStopSimpleMirrorDeleteInLine_ExpectCorrectResult (line 83) | class MultilineTabStopSimpleMirrorDeleteInLine_ExpectCorrectResult(_VimT...
class TextTabStopSimpleMirrorMultilineMirrorInFront_ECR (line 89) | class TextTabStopSimpleMirrorMultilineMirrorInFront_ECR(_VimTest):
class SimpleMirrorDelete_ExpectCorrectResult (line 95) | class SimpleMirrorDelete_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLine_ExpectCorrectResult (line 101) | class SimpleMirrorSameLine_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineNoSpace_ExpectCorrectResult (line 107) | class SimpleMirrorSameLineNoSpace_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineNoSpaceInsideOther_ExpectCorrectResult (line 113) | class SimpleMirrorSameLineNoSpaceInsideOther_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineNoSpaceSpaceAfter_ExpectCorrectResult (line 119) | class SimpleMirrorSameLineNoSpaceSpaceAfter_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineNoSpaceInsideOtherSpaceAfter_ExpectCorrectResult (line 125) | class SimpleMirrorSameLineNoSpaceInsideOtherSpaceAfter_ExpectCorrectResu...
class SimpleMirrorSameLine_InText_ExpectCorrectResult (line 131) | class SimpleMirrorSameLine_InText_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineBeforeTabDefVal_ECR (line 137) | class SimpleMirrorSameLineBeforeTabDefVal_ECR(_VimTest):
class SimpleMirrorSameLineBeforeTabDefVal_DelB4Typing_ECR (line 143) | class SimpleMirrorSameLineBeforeTabDefVal_DelB4Typing_ECR(_VimTest):
class SimpleMirrorSameLineMany_ExpectCorrectResult (line 149) | class SimpleMirrorSameLineMany_ExpectCorrectResult(_VimTest):
class SimpleMirrorSameLineManyMultiline_ExpectCorrectResult (line 155) | class SimpleMirrorSameLineManyMultiline_ExpectCorrectResult(_VimTest):
class SimpleMirrorDeleteSomeEnterSome_ExpectCorrectResult (line 164) | class SimpleMirrorDeleteSomeEnterSome_ExpectCorrectResult(_VimTest):
class SimpleTabstopWithDefaultSimpelType_ExpectCorrectResult (line 170) | class SimpleTabstopWithDefaultSimpelType_ExpectCorrectResult(_VimTest):
class SimpleTabstopWithDefaultComplexType_ExpectCorrectResult (line 176) | class SimpleTabstopWithDefaultComplexType_ExpectCorrectResult(_VimTest):
class SimpleTabstopWithDefaultSimpelKeep_ExpectCorrectResult (line 182) | class SimpleTabstopWithDefaultSimpelKeep_ExpectCorrectResult(_VimTest):
class SimpleTabstopWithDefaultComplexKeep_ExpectCorrectResult (line 188) | class SimpleTabstopWithDefaultComplexKeep_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorManyFromAll_ExpectCorrectResult (line 194) | class TabstopWithMirrorManyFromAll_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorInDefaultNoType_ExpectCorrectResult (line 214) | class TabstopWithMirrorInDefaultNoType_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorInDefaultNoType1_ExpectCorrectResult (line 220) | class TabstopWithMirrorInDefaultNoType1_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorInDefaultTwiceAndExtra_ExpectCorrectResult (line 226) | class TabstopWithMirrorInDefaultTwiceAndExtra_ExpectCorrectResult(_VimTe...
class TabstopWithMirrorInDefaultMultipleLeave_ExpectCorrectResult (line 232) | class TabstopWithMirrorInDefaultMultipleLeave_ExpectCorrectResult(_VimTe...
class TabstopWithMirrorInDefaultMultipleOverwrite_ExpectCorrectResult (line 238) | class TabstopWithMirrorInDefaultMultipleOverwrite_ExpectCorrectResult(_V...
class TabstopWithMirrorInDefaultOverwrite_ExpectCorrectResult (line 244) | class TabstopWithMirrorInDefaultOverwrite_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorInDefaultOverwrite1_ExpectCorrectResult (line 250) | class TabstopWithMirrorInDefaultOverwrite1_ExpectCorrectResult(_VimTest):
class TabstopWithMirrorInDefaultNoOverwrite1_ExpectCorrectResult (line 256) | class TabstopWithMirrorInDefaultNoOverwrite1_ExpectCorrectResult(_VimTest):
class MirrorRealLifeExample_ExpectCorrectResult (line 262) | class MirrorRealLifeExample_ExpectCorrectResult(_VimTest):
class Mirror_TestKill_InsertBefore_NoKill (line 287) | class Mirror_TestKill_InsertBefore_NoKill(_VimTest):
class Mirror_TestKill_InsertAfter_NoKill (line 293) | class Mirror_TestKill_InsertAfter_NoKill(_VimTest):
class Mirror_TestKill_InsertBeginning_Kill (line 299) | class Mirror_TestKill_InsertBeginning_Kill(_VimTest):
class Mirror_TestKill_InsertEnd_Kill (line 305) | class Mirror_TestKill_InsertEnd_Kill(_VimTest):
class Mirror_TestKillTabstop_Kill (line 311) | class Mirror_TestKillTabstop_Kill(_VimTest):
FILE: test/test_Movement.py
class CursorMovement_Multiline_ECR (line 5) | class CursorMovement_Multiline_ECR(_VimTest):
class CursorMovement_BS_InEditMode (line 14) | class CursorMovement_BS_InEditMode(_VimTest):
method _extra_vim_config (line 15) | def _extra_vim_config(self, vim_config):
class IMMoving_CursorsKeys_ECR (line 23) | class IMMoving_CursorsKeys_ECR(_VimTest):
class IMMoving_AcceptInputWhenMoved_ECR (line 29) | class IMMoving_AcceptInputWhenMoved_ECR(_VimTest):
class IMMoving_NoExiting_ECR (line 35) | class IMMoving_NoExiting_ECR(_VimTest):
class IMMoving_NoExitingEventAtEnd_ECR (line 41) | class IMMoving_NoExitingEventAtEnd_ECR(_VimTest):
class IMMoving_ExitWhenOutsideRight_ECR (line 47) | class IMMoving_ExitWhenOutsideRight_ECR(_VimTest):
class IMMoving_NotExitingWhenBarelyOutsideLeft_ECR (line 53) | class IMMoving_NotExitingWhenBarelyOutsideLeft_ECR(_VimTest):
class IMMoving_ExitWhenOutsideLeft_ECR (line 59) | class IMMoving_ExitWhenOutsideLeft_ECR(_VimTest):
class IMMoving_ExitWhenOutsideAbove_ECR (line 65) | class IMMoving_ExitWhenOutsideAbove_ECR(_VimTest):
class IMMoving_ExitWhenOutsideBelow_ECR (line 73) | class IMMoving_ExitWhenOutsideBelow_ECR(_VimTest):
FILE: test/test_MultipleMatches.py
class _MultipleMatches (line 5) | class _MultipleMatches(_VimTest):
class Multiple_SimpleCaseSelectFirst_ECR (line 12) | class Multiple_SimpleCaseSelectFirst_ECR(_MultipleMatches):
class Multiple_SimpleCaseSelectSecond_ECR (line 17) | class Multiple_SimpleCaseSelectSecond_ECR(_MultipleMatches):
class Multiple_SimpleCaseSelectTooHigh_ESelectLast (line 22) | class Multiple_SimpleCaseSelectTooHigh_ESelectLast(_MultipleMatches):
class Multiple_SimpleCaseSelectZero_EEscape (line 27) | class Multiple_SimpleCaseSelectZero_EEscape(_MultipleMatches):
class Multiple_SimpleCaseEscapeOut_ECR (line 32) | class Multiple_SimpleCaseEscapeOut_ECR(_MultipleMatches):
class Multiple_ManySnippetsOneTrigger_ECR (line 37) | class Multiple_ManySnippetsOneTrigger_ECR(_VimTest):
FILE: test/test_ParseSnippets.py
class ParseSnippets_SimpleSnippet (line 5) | class ParseSnippets_SimpleSnippet(_VimTest):
class ParseSnippets_MissingEndSnippet (line 17) | class ParseSnippets_MissingEndSnippet(_VimTest):
class ParseSnippets_UnknownDirective (line 29) | class ParseSnippets_UnknownDirective(_VimTest):
class ParseSnippets_InvalidPartialSnippet (line 40) | class ParseSnippets_InvalidPartialSnippet(_VimTest):
class ParseSnippets_InvalidPriorityLine (line 51) | class ParseSnippets_InvalidPriorityLine(_VimTest):
class ParseSnippets_InvalidPriorityLine1 (line 62) | class ParseSnippets_InvalidPriorityLine1(_VimTest):
class ParseSnippets_ExtendsWithoutFiletype (line 73) | class ParseSnippets_ExtendsWithoutFiletype(_VimTest):
class ParseSnippets_ClearAll (line 84) | class ParseSnippets_ClearAll(_VimTest):
class ParseSnippets_ClearOne (line 98) | class ParseSnippets_ClearOne(_VimTest):
class ParseSnippets_ClearTwo (line 116) | class ParseSnippets_ClearTwo(_VimTest):
class _ParseSnippets_MultiWord (line 134) | class _ParseSnippets_MultiWord(_VimTest):
class ParseSnippets_MultiWord_Simple (line 152) | class ParseSnippets_MultiWord_Simple(_ParseSnippets_MultiWord):
class ParseSnippets_MultiWord_Description (line 157) | class ParseSnippets_MultiWord_Description(_ParseSnippets_MultiWord):
class ParseSnippets_MultiWord_Description_Option (line 162) | class ParseSnippets_MultiWord_Description_Option(_ParseSnippets_MultiWord):
class _ParseSnippets_MultiWord_RE (line 167) | class _ParseSnippets_MultiWord_RE(_VimTest):
class ParseSnippets_MultiWord_RE1 (line 185) | class ParseSnippets_MultiWord_RE1(_ParseSnippets_MultiWord_RE):
class ParseSnippets_MultiWord_RE2 (line 190) | class ParseSnippets_MultiWord_RE2(_ParseSnippets_MultiWord_RE):
class ParseSnippets_MultiWord_RE3 (line 195) | class ParseSnippets_MultiWord_RE3(_ParseSnippets_MultiWord_RE):
class ParseSnippets_MultiWord_Quotes (line 200) | class ParseSnippets_MultiWord_Quotes(_VimTest):
class ParseSnippets_MultiWord_WithQuotes (line 212) | class ParseSnippets_MultiWord_WithQuotes(_VimTest):
class ParseSnippets_MultiWord_NoContainer (line 224) | class ParseSnippets_MultiWord_NoContainer(_VimTest):
class ParseSnippets_MultiWord_UnmatchedContainer (line 237) | class ParseSnippets_MultiWord_UnmatchedContainer(_VimTest):
class ParseSnippets_Global_Python_After (line 250) | class ParseSnippets_Global_Python_After(_VimTest):
class ParseSnippets_Global_Python (line 275) | class ParseSnippets_Global_Python(_VimTest):
class ParseSnippets_Global_Local_Python (line 296) | class ParseSnippets_Global_Local_Python(_VimTest):
class ParseSnippets_PrintPythonStacktrace (line 314) | class ParseSnippets_PrintPythonStacktrace(_VimTest):
class ParseSnippets_PrintPythonStacktraceMultiline (line 327) | class ParseSnippets_PrintPythonStacktraceMultiline(_VimTest):
class ParseSnippets_PrintErroneousSnippet (line 341) | class ParseSnippets_PrintErroneousSnippet(_VimTest):
class ParseSnippets_PrintErroneousSnippetContext (line 353) | class ParseSnippets_PrintErroneousSnippetContext(_VimTest):
class ParseSnippets_PrintErroneousSnippetPreAction (line 365) | class ParseSnippets_PrintErroneousSnippetPreAction(_VimTest):
class ParseSnippets_PrintErroneousSnippetPostAction (line 378) | class ParseSnippets_PrintErroneousSnippetPostAction(_VimTest):
class ParseSnippets_PrintErroneousSnippetLocation (line 391) | class ParseSnippets_PrintErroneousSnippetLocation(_VimTest):
FILE: test/test_Plugin.py
class Plugin_SuperTab_SimpleTest (line 7) | class Plugin_SuperTab_SimpleTest(_VimTest):
method _before_test (line 15) | def _before_test(self):
method _extra_vim_config (line 19) | def _extra_vim_config(self, vim_config):
FILE: test/test_Recursive.py
class RecTabStops_SimpleCase_ExpectCorrectResult (line 5) | class RecTabStops_SimpleCase_ExpectCorrectResult(_VimTest):
class RecTabStops_SimpleCaseLeaveSecondSecond_ExpectCorrectResult (line 11) | class RecTabStops_SimpleCaseLeaveSecondSecond_ExpectCorrectResult(_VimTe...
class RecTabStops_SimpleCaseLeaveFirstSecond_ExpectCorrectResult (line 17) | class RecTabStops_SimpleCaseLeaveFirstSecond_ExpectCorrectResult(_VimTest):
class RecTabStops_InnerWOTabStop_ECR (line 23) | class RecTabStops_InnerWOTabStop_ECR(_VimTest):
class RecTabStops_InnerWOTabStopTwiceDirectly_ECR (line 29) | class RecTabStops_InnerWOTabStopTwiceDirectly_ECR(_VimTest):
class RecTabStops_InnerWOTabStopTwice_ECR (line 35) | class RecTabStops_InnerWOTabStopTwice_ECR(_VimTest):
class RecTabStops_OuterOnlyWithZeroTS_ECR (line 41) | class RecTabStops_OuterOnlyWithZeroTS_ECR(_VimTest):
class RecTabStops_OuterOnlyWithZero_ECR (line 47) | class RecTabStops_OuterOnlyWithZero_ECR(_VimTest):
class RecTabStops_ExpandedInZeroTS_ECR (line 53) | class RecTabStops_ExpandedInZeroTS_ECR(_VimTest):
class RecTabStops_ExpandedInZeroTSTwice_ECR (line 59) | class RecTabStops_ExpandedInZeroTSTwice_ECR(_VimTest):
class RecTabStops_ExpandedInZeroTSSecondTime_ECR (line 65) | class RecTabStops_ExpandedInZeroTSSecondTime_ECR(_VimTest):
class RecTabsStops_TypeInZero_ECR (line 71) | class RecTabsStops_TypeInZero_ECR(_VimTest):
class RecTabsStops_TypeInZero2_ECR (line 101) | class RecTabsStops_TypeInZero2_ECR(_VimTest):
class RecTabsStops_BackspaceZero_ECR (line 107) | class RecTabsStops_BackspaceZero_ECR(_VimTest):
class RecTabStops_MirrorInnerSnippet_ECR (line 113) | class RecTabStops_MirrorInnerSnippet_ECR(_VimTest):
class RecTabStops_NotAtBeginningOfTS_ExpectCorrectResult (line 133) | class RecTabStops_NotAtBeginningOfTS_ExpectCorrectResult(_VimTest):
class RecTabStops_InNewlineInTabstop_ExpectCorrectResult (line 153) | class RecTabStops_InNewlineInTabstop_ExpectCorrectResult(_VimTest):
class RecTabStops_InNewlineInTabstopNotAtBeginOfLine_ECR (line 173) | class RecTabStops_InNewlineInTabstopNotAtBeginOfLine_ECR(_VimTest):
class RecTabStops_InNewlineMultiline_ECR (line 193) | class RecTabStops_InNewlineMultiline_ECR(_VimTest):
class RecTabStops_InNewlineManualIndent_ECR (line 199) | class RecTabStops_InNewlineManualIndent_ECR(_VimTest):
class RecTabStops_InNewlineManualIndentTextInFront_ECR (line 205) | class RecTabStops_InNewlineManualIndentTextInFront_ECR(_VimTest):
class RecTabStops_InNewlineMultilineWithIndent_ECR (line 211) | class RecTabStops_InNewlineMultilineWithIndent_ECR(_VimTest):
class RecTabStops_InNewlineMultilineWithNonZeroTS_ECR (line 217) | class RecTabStops_InNewlineMultilineWithNonZeroTS_ECR(_VimTest):
class RecTabStops_BarelyNotLeavingInner_ECR (line 223) | class RecTabStops_BarelyNotLeavingInner_ECR(_VimTest):
class RecTabStops_LeavingInner_ECR (line 244) | class RecTabStops_LeavingInner_ECR(_VimTest):
class RecTabStops_LeavingInnerInner_ECR (line 250) | class RecTabStops_LeavingInnerInner_ECR(_VimTest):
class RecTabStops_LeavingInnerInnerTwo_ECR (line 273) | class RecTabStops_LeavingInnerInnerTwo_ECR(_VimTest):
class RecTabStops_ZeroTSisNothingSpecial_ECR (line 279) | class RecTabStops_ZeroTSisNothingSpecial_ECR(_VimTest):
class RecTabStops_MirroredZeroTS_ECR (line 299) | class RecTabStops_MirroredZeroTS_ECR(_VimTest):
class RecTabStops_ChildTriggerContainsParentTextObjects (line 322) | class RecTabStops_ChildTriggerContainsParentTextObjects(_VimTest):
FILE: test/test_Selection.py
class _SelectModeMappings (line 7) | class _SelectModeMappings(_VimTest):
method _extra_vim_config (line 16) | def _extra_vim_config(self, vim_config):
class SelectModeMappings_RemoveBeforeSelecting_ECR (line 37) | class SelectModeMappings_RemoveBeforeSelecting_ECR(_SelectModeMappings):
class SelectModeMappings_DisableRemoveBeforeSelecting_ECR (line 42) | class SelectModeMappings_DisableRemoveBeforeSelecting_ECR(_SelectModeMap...
class SelectModeMappings_IgnoreMappings_ECR (line 48) | class SelectModeMappings_IgnoreMappings_ECR(_SelectModeMappings):
class SelectModeMappings_IgnoreMappings1_ECR (line 54) | class SelectModeMappings_IgnoreMappings1_ECR(_SelectModeMappings):
class SelectModeMappings_IgnoreMappings2_ECR (line 60) | class SelectModeMappings_IgnoreMappings2_ECR(_SelectModeMappings):
class SelectModeMappings_BufferLocalMappings_ECR (line 66) | class SelectModeMappings_BufferLocalMappings_ECR(_SelectModeMappings):
class _ES_Base (line 71) | class _ES_Base(_VimTest):
method _extra_vim_config (line 72) | def _extra_vim_config(self, vim_config):
class ExclusiveSelection_SimpleTabstop_Test (line 76) | class ExclusiveSelection_SimpleTabstop_Test(_ES_Base):
class ExclusiveSelection_RealWorldCase_Test (line 82) | class ExclusiveSelection_RealWorldCase_Test(_ES_Base):
class _OS_Base (line 95) | class _OS_Base(_VimTest):
method _extra_vim_config (line 96) | def _extra_vim_config(self, vim_config):
class OldSelection_SimpleTabstop_Test (line 100) | class OldSelection_SimpleTabstop_Test(_OS_Base):
class OldSelection_RealWorldCase_Test (line 106) | class OldSelection_RealWorldCase_Test(_OS_Base):
FILE: test/test_SnipMate.py
class snipMate_SimpleSnippet (line 6) | class snipMate_SimpleSnippet(_VimTest):
class snipMate_Disabled (line 17) | class snipMate_Disabled(_VimTest):
method _extra_vim_config (line 27) | def _extra_vim_config(self, vim_config):
class snipMate_OtherFiletype (line 31) | class snipMate_OtherFiletype(_VimTest):
class snipMate_MultiMatches (line 41) | class snipMate_MultiMatches(_VimTest):
class snipMate_SimpleSnippetSubDirectory (line 53) | class snipMate_SimpleSnippetSubDirectory(_VimTest):
class snipMate_SimpleSnippetInSnippetFile (line 63) | class snipMate_SimpleSnippetInSnippetFile(_VimTest):
class snipMate_Interpolation (line 73) | class snipMate_Interpolation(_VimTest):
class snipMate_InterpolationWithSystem (line 83) | class snipMate_InterpolationWithSystem(_VimTest):
class snipMate_TestMirrors (line 93) | class snipMate_TestMirrors(_VimTest):
class snipMate_TestNoBraceTabstops (line 105) | class snipMate_TestNoBraceTabstops(_VimTest):
class snipMate_TestNoBraceTabstopsAndMirrors (line 115) | class snipMate_TestNoBraceTabstopsAndMirrors(_VimTest):
class snipMate_TestMirrorsInPlaceholders (line 125) | class snipMate_TestMirrorsInPlaceholders(_VimTest):
class snipMate_TestMirrorsInPlaceholders_Overwrite (line 135) | class snipMate_TestMirrorsInPlaceholders_Overwrite(_VimTest):
class snipMate_Visual_Simple (line 145) | class snipMate_Visual_Simple(_VimTest):
class snipMate_NoNestedTabstops (line 155) | class snipMate_NoNestedTabstops(_VimTest):
class snipMate_Extends (line 165) | class snipMate_Extends(_VimTest):
class snipMate_EmptyLinesContinueSnippets (line 179) | class snipMate_EmptyLinesContinueSnippets(_VimTest):
class snipMate_OverwrittenByRegExpTrigger (line 194) | class snipMate_OverwrittenByRegExpTrigger(_VimTest):
class snipMate_Issue658 (line 210) | class snipMate_Issue658(_VimTest):
class snipMate_Issue1325 (line 227) | class snipMate_Issue1325(_VimTest):
class snipMate_Issue1344 (line 239) | class snipMate_Issue1344(_VimTest):
FILE: test/test_SnippetActions.py
class SnippetActions_PreActionModifiesBuffer (line 5) | class SnippetActions_PreActionModifiesBuffer(_VimTest):
class SnippetActions_PostActionModifiesBuffer (line 18) | class SnippetActions_PostActionModifiesBuffer(_VimTest):
class SnippetActions_ErrorOnBufferModificationThroughCommand (line 31) | class SnippetActions_ErrorOnBufferModificationThroughCommand(_VimTest):
class SnippetActions_ErrorOnModificationSnippetLine (line 44) | class SnippetActions_ErrorOnModificationSnippetLine(_VimTest):
class SnippetActions_EnsureIndent (line 58) | class SnippetActions_EnsureIndent(_VimTest):
class SnippetActions_PostActionCanUseSnippetRange (line 75) | class SnippetActions_PostActionCanUseSnippetRange(_VimTest):
class SnippetActions_CanModifyParentBody (line 106) | class SnippetActions_CanModifyParentBody(_VimTest):
class SnippetActions_MoveParentSnippetFromChildInPreAction (line 141) | class SnippetActions_MoveParentSnippetFromChildInPreAction(_VimTest):
class SnippetActions_CanExpandSnippetInDifferentPlace (line 173) | class SnippetActions_CanExpandSnippetInDifferentPlace(_VimTest):
class SnippetActions_MoveVisual (line 197) | class SnippetActions_MoveVisual(_VimTest):
class SnippetActions_CanMirrorTabStopsOutsideOfSnippet (line 239) | class SnippetActions_CanMirrorTabStopsOutsideOfSnippet(_VimTest):
class SnippetActions_CanExpandAnonSnippetInJumpAction (line 264) | class SnippetActions_CanExpandAnonSnippetInJumpAction(_VimTest):
class SnippetActions_CanExpandAnonSnippetInJumpActionWhileSelected (line 285) | class SnippetActions_CanExpandAnonSnippetInJumpActionWhileSelected(_VimT...
class SnippetActions_CanUseContextFromContextMatch (line 306) | class SnippetActions_CanUseContextFromContextMatch(_VimTest):
class SnippetActions_CanExpandAnonSnippetOnFirstJump (line 320) | class SnippetActions_CanExpandAnonSnippetOnFirstJump(_VimTest):
class SnippetActions_CanExpandAnonOnPreExpand (line 339) | class SnippetActions_CanExpandAnonOnPreExpand(_VimTest):
class SnippetActions_CanEvenWrapSnippetInPreAction (line 351) | class SnippetActions_CanEvenWrapSnippetInPreAction(_VimTest):
class SnippetActions_CanVisuallySelectFirstPlaceholderInAnonSnippetInPre (line 364) | class SnippetActions_CanVisuallySelectFirstPlaceholderInAnonSnippetInPre...
class SnippetActions_UseCorrectJumpActions (line 376) | class SnippetActions_UseCorrectJumpActions(_VimTest):
class SnippetActions_PostActionModifiesCharAfterSnippet (line 411) | class SnippetActions_PostActionModifiesCharAfterSnippet(_VimTest):
class SnippetActions_PostActionModifiesLineAfterSnippet (line 424) | class SnippetActions_PostActionModifiesLineAfterSnippet(_VimTest):
class SnippetActions_DoNotBreakCursorOnSingleLikeChange (line 438) | class SnippetActions_DoNotBreakCursorOnSingleLikeChange(_VimTest):
FILE: test/test_SnippetOptions.py
class SnippetOptions_OnlyExpandWhenWSInFront_Expand (line 7) | class SnippetOptions_OnlyExpandWhenWSInFront_Expand(_VimTest):
class SnippetOptions_OnlyExpandWhenWSInFront_Expand2 (line 13) | class SnippetOptions_OnlyExpandWhenWSInFront_Expand2(_VimTest):
class SnippetOptions_OnlyExpandWhenWSInFront_DontExpand (line 19) | class SnippetOptions_OnlyExpandWhenWSInFront_DontExpand(_VimTest):
class SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWO (line 25) | class SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWO(_VimTest):
class SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWOChoose (line 31) | class SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWOChoose(_VimTest):
class SnippetOptions_ExpandInwordSnippets_SimpleExpand (line 37) | class SnippetOptions_ExpandInwordSnippets_SimpleExpand(_VimTest):
class SnippetOptions_ExpandInwordSnippets_ExpandSingle (line 43) | class SnippetOptions_ExpandInwordSnippets_ExpandSingle(_VimTest):
class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand (line 49) | class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand(_VimTest):
class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand2 (line 55) | class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand2(_VimTest):
class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand3 (line 61) | class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand3(_VimTest):
class _SnippetOptions_ExpandWordSnippets (line 68) | class _SnippetOptions_ExpandWordSnippets(_VimTest):
class SnippetOptions_ExpandWordSnippets_NormalExpand (line 72) | class SnippetOptions_ExpandWordSnippets_NormalExpand(
class SnippetOptions_ExpandWordSnippets_NoExpand (line 79) | class SnippetOptions_ExpandWordSnippets_NoExpand(_SnippetOptions_ExpandW...
class SnippetOptions_ExpandWordSnippets_ExpandSuffix (line 84) | class SnippetOptions_ExpandWordSnippets_ExpandSuffix(
class SnippetOptions_ExpandWordSnippets_ExpandSuffix2 (line 91) | class SnippetOptions_ExpandWordSnippets_ExpandSuffix2(
class SnippetOptions_ExpandWordSnippets_ExpandSuffix3 (line 98) | class SnippetOptions_ExpandWordSnippets_ExpandSuffix3(
class _No_Tab_Expand (line 105) | class _No_Tab_Expand(_VimTest):
class No_Tab_Expand_Simple (line 109) | class No_Tab_Expand_Simple(_No_Tab_Expand):
class No_Tab_Expand_Leading_Spaces (line 114) | class No_Tab_Expand_Leading_Spaces(_No_Tab_Expand):
class No_Tab_Expand_Leading_Tabs (line 119) | class No_Tab_Expand_Leading_Tabs(_No_Tab_Expand):
class No_Tab_Expand_No_TS (line 124) | class No_Tab_Expand_No_TS(_No_Tab_Expand):
method _extra_vim_config (line 125) | def _extra_vim_config(self, vim_config):
class No_Tab_Expand_ET (line 133) | class No_Tab_Expand_ET(_No_Tab_Expand):
method _extra_vim_config (line 134) | def _extra_vim_config(self, vim_config):
class No_Tab_Expand_ET_Leading_Spaces (line 142) | class No_Tab_Expand_ET_Leading_Spaces(_No_Tab_Expand):
method _extra_vim_config (line 143) | def _extra_vim_config(self, vim_config):
class No_Tab_Expand_ET_SW (line 151) | class No_Tab_Expand_ET_SW(_No_Tab_Expand):
method _extra_vim_config (line 152) | def _extra_vim_config(self, vim_config):
class No_Tab_Expand_ET_SW_TS (line 160) | class No_Tab_Expand_ET_SW_TS(_No_Tab_Expand):
method _extra_vim_config (line 161) | def _extra_vim_config(self, vim_config):
class _TabExpand_RealWorld (line 171) | class _TabExpand_RealWorld:
class No_Tab_Expand_RealWorld (line 188) | class No_Tab_Expand_RealWorld(_TabExpand_RealWorld, _VimTest):
method _extra_vim_config (line 189) | def _extra_vim_config(self, vim_config):
class SnippetOptions_Regex_Expand (line 203) | class SnippetOptions_Regex_Expand(_VimTest):
class SnippetOptions_Regex_WithSpace (line 209) | class SnippetOptions_Regex_WithSpace(_VimTest):
class SnippetOptions_Regex_Multiple (line 215) | class SnippetOptions_Regex_Multiple(_VimTest):
class _Regex_Self (line 221) | class _Regex_Self(_VimTest):
class SnippetOptions_Regex_Self_Start (line 225) | class SnippetOptions_Regex_Self_Start(_Regex_Self):
class SnippetOptions_Regex_Self_Space (line 230) | class SnippetOptions_Regex_Self_Space(_Regex_Self):
class SnippetOptions_Regex_Self_TextAfter (line 235) | class SnippetOptions_Regex_Self_TextAfter(_Regex_Self):
class SnippetOptions_Regex_Self_TextBefore (line 240) | class SnippetOptions_Regex_Self_TextBefore(_Regex_Self):
class SnippetOptions_Regex_PythonBlockMatch (line 245) | class SnippetOptions_Regex_PythonBlockMatch(_VimTest):
class SnippetOptions_Regex_PythonBlockNoMatch (line 259) | class SnippetOptions_Regex_PythonBlockNoMatch(_VimTest):
class SnippetOptions_Regex_SameLine_Long_End (line 268) | class SnippetOptions_Regex_SameLine_Long_End(_VimTest):
class SnippetOptions_Regex_SameLine_Long_Start (line 274) | class SnippetOptions_Regex_SameLine_Long_Start(_VimTest):
class SnippetOptions_Regex_SameLine_Simple (line 280) | class SnippetOptions_Regex_SameLine_Simple(_VimTest):
class MultiWordSnippet_Simple (line 286) | class MultiWordSnippet_Simple(_VimTest):
class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_Expand (line 292) | class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_Expand(_VimTest):
class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_Expand2 (line 298) | class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_Expand2(_VimTest):
class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_DontExpand (line 304) | class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_DontExpand(_VimTe...
class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWO (line 310) | class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWO(_Vim...
class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWOChoose (line 319) | class MultiWord_SnippetOptions_OnlyExpandWhenWSInFront_OneWithOneWOChoos...
class MultiWord_SnippetOptions_ExpandInwordSnippets_SimpleExpand (line 328) | class MultiWord_SnippetOptions_ExpandInwordSnippets_SimpleExpand(_VimTest):
class MultiWord_SnippetOptions_ExpandInwordSnippets_ExpandSingle (line 334) | class MultiWord_SnippetOptions_ExpandInwordSnippets_ExpandSingle(_VimTest):
class _MultiWord_SnippetOptions_ExpandWordSnippets (line 340) | class _MultiWord_SnippetOptions_ExpandWordSnippets(_VimTest):
class MultiWord_SnippetOptions_ExpandWordSnippets_NormalExpand (line 344) | class MultiWord_SnippetOptions_ExpandWordSnippets_NormalExpand(
class MultiWord_SnippetOptions_ExpandWordSnippets_NoExpand (line 351) | class MultiWord_SnippetOptions_ExpandWordSnippets_NoExpand(
class MultiWord_SnippetOptions_ExpandWordSnippets_ExpandSuffix (line 358) | class MultiWord_SnippetOptions_ExpandWordSnippets_ExpandSuffix(
FILE: test/test_SnippetPriorities.py
class SnippetPriorities_MultiWordTriggerOverwriteExisting (line 5) | class SnippetPriorities_MultiWordTriggerOverwriteExisting(_VimTest):
class SnippetPriorities_DoNotCareAboutNonMatchings (line 15) | class SnippetPriorities_DoNotCareAboutNonMatchings(_VimTest):
class SnippetPriorities_OverwriteExisting (line 24) | class SnippetPriorities_OverwriteExisting(_VimTest):
class SnippetPriorities_OverwriteTwice_ECR (line 34) | class SnippetPriorities_OverwriteTwice_ECR(_VimTest):
class SnippetPriorities_OverwriteThenChoose_ECR (line 45) | class SnippetPriorities_OverwriteThenChoose_ECR(_VimTest):
class SnippetPriorities_AddedHasHigherThanFile (line 56) | class SnippetPriorities_AddedHasHigherThanFile(_VimTest):
class SnippetPriorities_FileHasHigherThanAdded (line 69) | class SnippetPriorities_FileHasHigherThanAdded(_VimTest):
class SnippetPriorities_FileHasHigherThanAdded_neg_prio (line 82) | class SnippetPriorities_FileHasHigherThanAdded_neg_prio(_VimTest):
class SnippetPriorities_SimpleClear (line 96) | class SnippetPriorities_SimpleClear(_VimTest):
class SnippetPriorities_SimpleClear2 (line 111) | class SnippetPriorities_SimpleClear2(_VimTest):
class SnippetPriorities_ClearedByParent (line 124) | class SnippetPriorities_ClearedByParent(_VimTest):
class SnippetPriorities_ClearedByChild (line 140) | class SnippetPriorities_ClearedByChild(_VimTest):
FILE: test/test_TabStop.py
class TabStopSimpleReplace_ExpectCorrectResult (line 5) | class TabStopSimpleReplace_ExpectCorrectResult(_VimTest):
class TabStopSimpleReplaceZeroLengthTabstops_ExpectCorrectResult (line 11) | class TabStopSimpleReplaceZeroLengthTabstops_ExpectCorrectResult(_VimTest):
class TabStopSimpleReplaceReversed_ExpectCorrectResult (line 17) | class TabStopSimpleReplaceReversed_ExpectCorrectResult(_VimTest):
class TabStopSimpleReplaceSurrounded_ExpectCorrectResult (line 23) | class TabStopSimpleReplaceSurrounded_ExpectCorrectResult(_VimTest):
class TabStopSimpleReplaceSurrounded1_ExpectCorrectResult (line 29) | class TabStopSimpleReplaceSurrounded1_ExpectCorrectResult(_VimTest):
class TabStop_Exit_ExpectCorrectResult (line 35) | class TabStop_Exit_ExpectCorrectResult(_VimTest):
class TabStopNoReplace_ExpectCorrectResult (line 41) | class TabStopNoReplace_ExpectCorrectResult(_VimTest):
class TabStop_EscapingCharsBackticks (line 47) | class TabStop_EscapingCharsBackticks(_VimTest):
class TabStop_EscapingCharsDollars (line 53) | class TabStop_EscapingCharsDollars(_VimTest):
class TabStop_EscapingCharsDollars1 (line 59) | class TabStop_EscapingCharsDollars1(_VimTest):
class TabStop_EscapingCharsDollars_BeginningOfLine (line 65) | class TabStop_EscapingCharsDollars_BeginningOfLine(_VimTest):
class TabStop_EscapingCharsDollars_BeginningOfDefinitionText (line 71) | class TabStop_EscapingCharsDollars_BeginningOfDefinitionText(_VimTest):
class TabStop_EscapingChars_Backslash (line 77) | class TabStop_EscapingChars_Backslash(_VimTest):
class TabStop_EscapingChars_Backslash2 (line 83) | class TabStop_EscapingChars_Backslash2(_VimTest):
class TabStop_EscapingChars_Backslash3 (line 89) | class TabStop_EscapingChars_Backslash3(_VimTest):
class TabStop_EscapingChars_Backslash4 (line 95) | class TabStop_EscapingChars_Backslash4(_VimTest):
class TabStop_EscapingChars_RealLife (line 102) | class TabStop_EscapingChars_RealLife(_VimTest):
class TabStopEscapingWhenSelected_ECR (line 108) | class TabStopEscapingWhenSelected_ECR(_VimTest):
class TabStopEscapingWhenSelectedSingleCharTS_ECR (line 114) | class TabStopEscapingWhenSelectedSingleCharTS_ECR(_VimTest):
class TabStopEscapingWhenSelectedNoCharTS_ECR (line 120) | class TabStopEscapingWhenSelectedNoCharTS_ECR(_VimTest):
class TabStopWithOneChar_ExpectCorrectResult (line 126) | class TabStopWithOneChar_ExpectCorrectResult(_VimTest):
class TabStopTestJumping_ExpectCorrectResult (line 132) | class TabStopTestJumping_ExpectCorrectResult(_VimTest):
class TabStopTestJumping2_ExpectCorrectResult (line 138) | class TabStopTestJumping2_ExpectCorrectResult(_VimTest):
class TabStopTestJumpingRLExampleWithZeroTab_ExpectCorrectResult (line 144) | class TabStopTestJumpingRLExampleWithZeroTab_ExpectCorrectResult(_VimTest):
class TabStopTestJumpingDontJumpToEndIfThereIsTabZero_ExpectCorrectResult (line 150) | class TabStopTestJumpingDontJumpToEndIfThereIsTabZero_ExpectCorrectResul...
class TabStopTestBackwardJumping_ExpectCorrectResult (line 156) | class TabStopTestBackwardJumping_ExpectCorrectResult(_VimTest):
class TabStopTestBackwardJumping2_ExpectCorrectResult (line 175) | class TabStopTestBackwardJumping2_ExpectCorrectResult(_VimTest):
class TabStopTestMultilineExpand_ExpectCorrectResult (line 194) | class TabStopTestMultilineExpand_ExpectCorrectResult(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteNone_ECR (line 216) | class TabStop_TSInDefaultTextRLExample_OverwriteNone_ECR(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteFirst_NoJumpBack (line 222) | class TabStop_TSInDefaultTextRLExample_OverwriteFirst_NoJumpBack(_VimTest):
class TabStop_TSInDefaultTextRLExample_DeleteFirst (line 228) | class TabStop_TSInDefaultTextRLExample_DeleteFirst(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteFirstJumpBack (line 234) | class TabStop_TSInDefaultTextRLExample_OverwriteFirstJumpBack(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteSecond (line 252) | class TabStop_TSInDefaultTextRLExample_OverwriteSecond(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBack (line 258) | class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBack(_VimTest):
class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBackTwice (line 264) | class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBackTwice(_VimT...
class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecond (line 285) | class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecond(_VimTest):
class TabStop_TSInDefaultText_ZeroLengthZerothTabstop (line 291) | class TabStop_TSInDefaultText_ZeroLengthZerothTabstop(_VimTest):
class TabStop_TSInDefaultText_ZeroLengthZerothTabstop_Override (line 300) | class TabStop_TSInDefaultText_ZeroLengthZerothTabstop_Override(_VimTest):
class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteFirst (line 309) | class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteFirst(_VimTest):
class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackOverwrite (line 315) | class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackOv...
class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackAndForward0 (line 323) | class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackAn...
class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackAndForward1 (line 331) | class TabStop_TSInDefaultText_ZeroLengthNested_OverwriteSecondJumpBackAn...
class TabStop_TSInDefaultNested_OverwriteOneJumpBackToOther (line 339) | class TabStop_TSInDefaultNested_OverwriteOneJumpBackToOther(_VimTest):
class TabStop_TSInDefaultNested_OverwriteOneJumpToThird (line 345) | class TabStop_TSInDefaultNested_OverwriteOneJumpToThird(_VimTest):
class TabStop_TSInDefaultNested_OverwriteOneJumpAround (line 351) | class TabStop_TSInDefaultNested_OverwriteOneJumpAround(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_DoNothing (line 357) | class TabStop_TSInDefault_MirrorsOutside_DoNothing(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond (line 363) | class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_Overwrite0 (line 369) | class TabStop_TSInDefault_MirrorsOutside_Overwrite0(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_Overwrite1 (line 375) | class TabStop_TSInDefault_MirrorsOutside_Overwrite1(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond1 (line 381) | class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond1(_VimTest):
class TabStop_TSInDefault_MirrorsOutside_OverwriteFirstSwitchNumbers (line 387) | class TabStop_TSInDefault_MirrorsOutside_OverwriteFirstSwitchNumbers(_Vi...
class TabStop_TSInDefault_MirrorsOutside_OverwriteFirst_RLExample (line 393) | class TabStop_TSInDefault_MirrorsOutside_OverwriteFirst_RLExample(_VimTe...
class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond_RLExample (line 402) | class TabStop_TSInDefault_MirrorsOutside_OverwriteSecond_RLExample(_VimT...
class TabStop_Multiline_Leave (line 411) | class TabStop_Multiline_Leave(_VimTest):
class TabStop_Multiline_Overwrite (line 417) | class TabStop_Multiline_Overwrite(_VimTest):
class TabStop_Multiline_MirrorInFront_Leave (line 423) | class TabStop_Multiline_MirrorInFront_Leave(_VimTest):
class TabStop_Multiline_MirrorInFront_Overwrite (line 429) | class TabStop_Multiline_MirrorInFront_Overwrite(_VimTest):
class TabStop_Multiline_DelFirstOverwriteSecond_Overwrite (line 435) | class TabStop_Multiline_DelFirstOverwriteSecond_Overwrite(_VimTest):
class TabStopNavigatingInInsertModeSimple_ExpectCorrectResult (line 441) | class TabStopNavigatingInInsertModeSimple_ExpectCorrectResult(_VimTest):
class TabStop_CROnlyOnSelectedNear (line 447) | class TabStop_CROnlyOnSelectedNear(_VimTest):
class TabStop_AdjacentTabStopAddText_ExpectCorrectResult (line 453) | class TabStop_AdjacentTabStopAddText_ExpectCorrectResult(_VimTest):
class TabStop_KeepCorrectJumpListOnOverwriteOfPartOfSnippet (line 459) | class TabStop_KeepCorrectJumpListOnOverwriteOfPartOfSnippet(_VimTest):
class TabStop_KeepCorrectJumpListOnOverwriteOfPartOfSnippetRE (line 474) | class TabStop_KeepCorrectJumpListOnOverwriteOfPartOfSnippetRE(_VimTest):
FILE: test/test_Transformation.py
class Transformation_SimpleCase_ExpectCorrectResult (line 7) | class Transformation_SimpleCase_ExpectCorrectResult(_VimTest):
class Transformation_SimpleCaseNoTransform_ExpectCorrectResult (line 13) | class Transformation_SimpleCaseNoTransform_ExpectCorrectResult(_VimTest):
class Transformation_SimpleCaseTransformInFront_ExpectCorrectResult (line 19) | class Transformation_SimpleCaseTransformInFront_ExpectCorrectResult(_Vim...
class Transformation_SimpleCaseTransformInFrontDefVal_ECR (line 25) | class Transformation_SimpleCaseTransformInFrontDefVal_ECR(_VimTest):
class Transformation_MultipleTransformations_ECR (line 31) | class Transformation_MultipleTransformations_ECR(_VimTest):
class Transformation_TabIsAtEndAndDeleted_ECR (line 37) | class Transformation_TabIsAtEndAndDeleted_ECR(_VimTest):
class Transformation_TabIsAtEndAndDeleted1_ECR (line 43) | class Transformation_TabIsAtEndAndDeleted1_ECR(_VimTest):
class Transformation_TabIsAtEndNoTextLeave_ECR (line 49) | class Transformation_TabIsAtEndNoTextLeave_ECR(_VimTest):
class Transformation_TabIsAtEndNoTextType_ECR (line 55) | class Transformation_TabIsAtEndNoTextType_ECR(_VimTest):
class Transformation_InsideTabLeaveAtDefault_ECR (line 61) | class Transformation_InsideTabLeaveAtDefault_ECR(_VimTest):
class Transformation_InsideTabOvertype_ECR (line 67) | class Transformation_InsideTabOvertype_ECR(_VimTest):
class Transformation_Backreference_ExpectCorrectResult (line 73) | class Transformation_Backreference_ExpectCorrectResult(_VimTest):
class Transformation_BackreferenceTwice_ExpectCorrectResult (line 79) | class Transformation_BackreferenceTwice_ExpectCorrectResult(_VimTest):
class Transformation_CleverTransformUpercaseChar_ExpectCorrectResult (line 85) | class Transformation_CleverTransformUpercaseChar_ExpectCorrectResult(_Vi...
class Transformation_CleverTransformLowercaseChar_ExpectCorrectResult (line 91) | class Transformation_CleverTransformLowercaseChar_ExpectCorrectResult(_V...
class Transformation_CleverTransformLongUpper_ExpectCorrectResult (line 97) | class Transformation_CleverTransformLongUpper_ExpectCorrectResult(_VimTe...
class Transformation_CleverTransformLongLower_ExpectCorrectResult (line 103) | class Transformation_CleverTransformLongLower_ExpectCorrectResult(_VimTe...
class Transformation_SimpleCaseAsciiResult (line 109) | class Transformation_SimpleCaseAsciiResult(_VimTest):
class Transformation_LowerCaseAsciiResult (line 116) | class Transformation_LowerCaseAsciiResult(_VimTest):
class Transformation_ConditionalInsertionSimple_ExpectCorrectResult (line 123) | class Transformation_ConditionalInsertionSimple_ExpectCorrectResult(_Vim...
class Transformation_CIBothDefinedNegative_ExpectCorrectResult (line 129) | class Transformation_CIBothDefinedNegative_ExpectCorrectResult(_VimTest):
class Transformation_CIBothDefinedPositive_ExpectCorrectResult (line 135) | class Transformation_CIBothDefinedPositive_ExpectCorrectResult(_VimTest):
class Transformation_ConditionalInsertRWEllipsis_ECR (line 141) | class Transformation_ConditionalInsertRWEllipsis_ECR(_VimTest):
class Transformation_ConditionalInConditional_ECR (line 147) | class Transformation_ConditionalInConditional_ECR(_VimTest):
class Transformation_CINewlines_ECR (line 167) | class Transformation_CINewlines_ECR(_VimTest):
class Transformation_CITabstop_ECR (line 173) | class Transformation_CITabstop_ECR(_VimTest):
class Transformation_CIEscapedParensinReplace_ECR (line 179) | class Transformation_CIEscapedParensinReplace_ECR(_VimTest):
class Transformation_OptionIgnoreCase_ECR (line 185) | class Transformation_OptionIgnoreCase_ECR(_VimTest):
class Transformation_OptionMultiline_ECR (line 191) | class Transformation_OptionMultiline_ECR(_VimTest):
class Transformation_OptionReplaceGlobal_ECR (line 197) | class Transformation_OptionReplaceGlobal_ECR(_VimTest):
class Transformation_OptionReplaceGlobalMatchInReplace_ECR (line 203) | class Transformation_OptionReplaceGlobalMatchInReplace_ECR(_VimTest):
class TransformationUsingBackspaceToDeleteDefaultValueInFirstTab_ECR (line 209) | class TransformationUsingBackspaceToDeleteDefaultValueInFirstTab_ECR(_Vi...
class TransformationUsingBackspaceToDeleteDefaultValueInSecondTab_ECR (line 218) | class TransformationUsingBackspaceToDeleteDefaultValueInSecondTab_ECR(_V...
class TransformationUsingBackspaceToDeleteDefaultValueTypeSomethingThen_ECR (line 227) | class TransformationUsingBackspaceToDeleteDefaultValueTypeSomethingThen_...
class TransformationUsingBackspaceToDeleteDefaultValue_ECR (line 233) | class TransformationUsingBackspaceToDeleteDefaultValue_ECR(_VimTest):
class Transformation_TestKill_InsertBefore_NoKill (line 239) | class Transformation_TestKill_InsertBefore_NoKill(_VimTest):
class Transformation_TestKill_InsertAfter_NoKill (line 245) | class Transformation_TestKill_InsertAfter_NoKill(_VimTest):
class Transformation_TestKill_InsertBeginning_Kill (line 251) | class Transformation_TestKill_InsertBeginning_Kill(_VimTest):
class Transformation_TestKill_InsertEnd_Kill (line 257) | class Transformation_TestKill_InsertEnd_Kill(_VimTest):
class Transformation_ConditionalWithEscapedDelimiter (line 263) | class Transformation_ConditionalWithEscapedDelimiter(_VimTest):
class Transformation_ConditionalWithBackslashBeforeDelimiter (line 269) | class Transformation_ConditionalWithBackslashBeforeDelimiter(_VimTest):
class Transformation_ConditionalWithBackslashBeforeDelimiter1 (line 275) | class Transformation_ConditionalWithBackslashBeforeDelimiter1(_VimTest):
FILE: test/test_UltiSnipFunc.py
class _AddFuncBase (line 7) | class _AddFuncBase(_VimTest):
method _before_test (line 10) | def _before_test(self):
class AddFunc_Simple (line 14) | class AddFunc_Simple(_AddFuncBase):
class AddFunc_Opt (line 20) | class AddFunc_Opt(_AddFuncBase):
class TestNonEmptyLangmap_ExpectCorrectResult (line 29) | class TestNonEmptyLangmap_ExpectCorrectResult(_VimTest):
method _extra_vim_config (line 43) | def _extra_vim_config(self, vim_config):
class TestNonEmptyLangmapWithSemi_ExpectCorrectResult (line 50) | class TestNonEmptyLangmapWithSemi_ExpectCorrectResult(_VimTest):
method _before_test (line 64) | def _before_test(self):
class TestLangmapWithUtf8_ExpectCorrectResult (line 71) | class TestLangmapWithUtf8_ExpectCorrectResult(_VimTest):
method _before_test (line 87) | def _before_test(self):
class VerifyVimDict1 (line 93) | class VerifyVimDict1(_VimTest):
class VerifyVimDict2 (line 113) | class VerifyVimDict2(_VimTest):
class VerifyVimDict3 (line 125) | class VerifyVimDict3(_VimTest):
class AddNewSnippetSource (line 137) | class AddNewSnippetSource(_VimTest):
method _extra_vim_config (line 153) | def _extra_vim_config(self, vim_config):
FILE: test/test_Visual.py
class Visual_NoVisualSelection_Ignore (line 5) | class Visual_NoVisualSelection_Ignore(_VimTest):
class Visual_SelectOneWord (line 11) | class Visual_SelectOneWord(_VimTest):
class Visual_SelectOneWordInclusive (line 17) | class Visual_SelectOneWordInclusive(_VimTest):
class Visual_SelectOneWordExclusive (line 23) | class Visual_SelectOneWordExclusive(_VimTest):
method _extra_vim_config (line 28) | def _extra_vim_config(self, vim_config):
class Visual_SelectOneWord_ProblemAfterTab (line 32) | class Visual_SelectOneWord_ProblemAfterTab(_VimTest):
class VisualWithDefault_ExpandWithoutVisual (line 38) | class VisualWithDefault_ExpandWithoutVisual(_VimTest):
class VisualWithDefaultWithSlashes_ExpandWithoutVisual (line 44) | class VisualWithDefaultWithSlashes_ExpandWithoutVisual(_VimTest):
class VisualWithDefault_ExpandWithVisual (line 50) | class VisualWithDefault_ExpandWithVisual(_VimTest):
class Visual_ExpandTwice (line 56) | class Visual_ExpandTwice(_VimTest):
class Visual_SelectOneWord_TwiceVisual (line 62) | class Visual_SelectOneWord_TwiceVisual(_VimTest):
class Visual_SelectOneWord_Inword (line 68) | class Visual_SelectOneWord_Inword(_VimTest):
class Visual_SelectOneWord_TillEndOfLine (line 74) | class Visual_SelectOneWord_TillEndOfLine(_VimTest):
class Visual_SelectOneWordWithTabstop_TillEndOfLine (line 80) | class Visual_SelectOneWordWithTabstop_TillEndOfLine(_VimTest):
class Visual_InDefaultText_SelectOneWord_NoOverwrite (line 100) | class Visual_InDefaultText_SelectOneWord_NoOverwrite(_VimTest):
class Visual_InDefaultText_SelectOneWord (line 106) | class Visual_InDefaultText_SelectOneWord(_VimTest):
class Visual_CrossOneLine (line 112) | class Visual_CrossOneLine(_VimTest):
class Visual_LineSelect_Simple (line 118) | class Visual_LineSelect_Simple(_VimTest):
class Visual_InDefaultText_LineSelect_NoOverwrite (line 124) | class Visual_InDefaultText_LineSelect_NoOverwrite(_VimTest):
class Visual_InDefaultText_LineSelect_Overwrite (line 130) | class Visual_InDefaultText_LineSelect_Overwrite(_VimTest):
class Visual_LineSelect_CheckIndentSimple (line 136) | class Visual_LineSelect_CheckIndentSimple(_VimTest):
class Visual_LineSelect_CheckIndentTwice (line 142) | class Visual_LineSelect_CheckIndentTwice(_VimTest):
class Visual_InDefaultText_IndentSpacesToTabstop_NoOverwrite (line 148) | class Visual_InDefaultText_IndentSpacesToTabstop_NoOverwrite(_VimTest):
class Visual_InDefaultText_IndentSpacesToTabstop_Overwrite (line 154) | class Visual_InDefaultText_IndentSpacesToTabstop_Overwrite(_VimTest):
class Visual_InDefaultText_IndentSpacesToTabstop_NoOverwrite1 (line 160) | class Visual_InDefaultText_IndentSpacesToTabstop_NoOverwrite1(_VimTest):
class Visual_InDefaultText_IndentBeforeTabstop_NoOverwrite (line 166) | class Visual_InDefaultText_IndentBeforeTabstop_NoOverwrite(_VimTest):
class Visual_LineSelect_WithTabStop (line 172) | class Visual_LineSelect_WithTabStop(_VimTest):
class Visual_LineSelect_CheckIndentWithTS_NoOverwrite (line 178) | class Visual_LineSelect_CheckIndentWithTS_NoOverwrite(_VimTest):
class Visual_LineSelect_DedentLine (line 184) | class Visual_LineSelect_DedentLine(_VimTest):
class VisualTransformation_SelectOneWord (line 201) | class VisualTransformation_SelectOneWord(_VimTest):
class VisualTransformationWithDefault_ExpandWithoutVisual (line 207) | class VisualTransformationWithDefault_ExpandWithoutVisual(_VimTest):
class VisualTransformationWithDefault_ExpandWithVisual (line 213) | class VisualTransformationWithDefault_ExpandWithVisual(_VimTest):
class VisualTransformation_LineSelect_Simple (line 219) | class VisualTransformation_LineSelect_Simple(_VimTest):
class VisualTransformation_InDefaultText_LineSelect_NoOverwrite (line 225) | class VisualTransformation_InDefaultText_LineSelect_NoOverwrite(_VimTest):
class VisualTransformation_InDefaultText_LineSelect_Overwrite (line 231) | class VisualTransformation_InDefaultText_LineSelect_Overwrite(_VimTest):
FILE: test/util.py
function running_on_windows (line 11) | def running_on_windows():
function no_unidecode_available (line 16) | def no_unidecode_available():
FILE: test/vim_interface.py
function wait_until_file_exists (line 14) | def wait_until_file_exists(file_path, times=None, interval=0.01):
function _read_text_file (line 24) | def _read_text_file(filename):
function is_process_running (line 30) | def is_process_running(pid):
function create_directory (line 42) | def create_directory(dirname):
class TempFileManager (line 50) | class TempFileManager:
method __init__ (line 51) | def __init__(self, name=""):
method name_temp (line 54) | def name_temp(self, file_path):
method write_temp (line 57) | def write_temp(self, file_path, content):
method unique_name_temp (line 64) | def unique_name_temp(self, suffix="", prefix=""):
method clear_temp (line 70) | def clear_temp(self):
class VimInterface (line 75) | class VimInterface(TempFileManager):
method __init__ (line 76) | def __init__(self, vim_executable, name):
method vim_executable (line 81) | def vim_executable(self):
method has_version (line 84) | def has_version(self, major, minor, patchlevel):
method get_buffer_data (line 92) | def get_buffer_data(self):
method send_to_terminal (line 98) | def send_to_terminal(self, s):
method send_to_vim (line 102) | def send_to_vim(self, s):
method launch (line 106) | def launch(self, config=[]):
method leave_with_wait (line 145) | def leave_with_wait(self):
class VimInterfaceTmux (line 151) | class VimInterfaceTmux(VimInterface):
method __init__ (line 152) | def __init__(self, vim_executable, session):
method _send (line 157) | def _send(self, s):
method send_to_terminal (line 169) | def send_to_terminal(self, s):
method send_to_vim (line 172) | def send_to_vim(self, s):
method _check_version (line 175) | def _check_version(self):
class VimInterfaceTmuxNeovim (line 185) | class VimInterfaceTmuxNeovim(VimInterfaceTmux):
method __init__ (line 186) | def __init__(self, vim_executable, session):
method send_to_vim (line 190) | def send_to_vim(self, s):
method launch (line 207) | def launch(self, config=[]):
class VimInterfaceWindows (line 215) | class VimInterfaceWindows(VimInterface):
method __init__ (line 235) | def __init__(self):
method is_focused (line 243) | def is_focused(self, title=None):
method focus (line 249) | def focus(self, title=None):
method convert_keys (line 254) | def convert_keys(self, keys):
method send (line 262) | def send(self, keys):
FILE: test/vim_test_case.py
function plugin_cache_dir (line 16) | def plugin_cache_dir():
class VimTestCase (line 21) | class VimTestCase(unittest.TestCase, TempFileManager):
method __init__ (line 41) | def __init__(self, *args, **kwargs):
method runTest (line 45) | def runTest(self):
method _extra_vim_config (line 63) | def _extra_vim_config(self, vim_config):
method _before_test (line 66) | def _before_test(self):
method _create_file (line 73) | def _create_file(self, file_path, content):
method _link_file (line 81) | def _link_file(self, source, relative_destination):
method setUp (line 88) | def setUp(self):
method tearDown (line 216) | def tearDown(self):
FILE: test_all.py
function plugin_cache_dir (line 29) | def plugin_cache_dir():
function clone_plugin (line 34) | def clone_plugin(plugin):
function setup_other_plugins (line 59) | def setup_other_plugins(all_plugins):
function parse_args (line 71) | def parse_args():
function flatten_test_suite (line 189) | def flatten_test_suite(suite):
function main (line 198) | def main():
Condensed preview — 119 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (619K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 15,
"preview": "github: SirVer\n"
},
{
"path": ".github/issue_template.md",
"chars": 1403,
"preview": "<!--\nThanks for reporting your issue. Please follow this template closely. Without\nall essential info the issue may be c"
},
{
"path": ".github/workflows/main.yml",
"chars": 1716,
"preview": "on:\n push:\n branches:\n - master\n pull_request:\n branches:\n - master\n\njobs:\n test:\n runs-on: ubuntu"
},
{
"path": ".gitignore",
"chars": 50,
"preview": "*.pyc\n*.swp\ndoc/tags\n/.ropeproject/\n/.mypy_cache/\n"
},
{
"path": "CONTRIBUTING.md",
"chars": 6365,
"preview": "# Contributing to UltiSnips\n\n:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:\n\nThis document w"
},
{
"path": "COPYING.txt",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "ChangeLog",
"chars": 9962,
"preview": "version 3.2 (05-Nov-2019):\n\t- This is the first release done again by @SirVer. And this is also posted\n\t on vim.org aga"
},
{
"path": "Dockerfile",
"chars": 393,
"preview": "ARG PYTHON_IMAGE\n\nFROM python:${PYTHON_IMAGE}\n\nARG VIM_VERSION\n\nCOPY docker/install_packages.sh src/scripts/\nRUN src/scr"
},
{
"path": "Dockerfile.repro",
"chars": 291,
"preview": "ARG BASE_IMAGE\n\nFROM ultisnips:${BASE_IMAGE}\n\nRUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \\\n https://raw.git"
},
{
"path": "Makefile",
"chars": 2872,
"preview": "MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))\nMAKEFILE_DIR := $(dir ${MAKEFILE_PATH})\n\n# Test images as run o"
},
{
"path": "Pipfile",
"chars": 233,
"preview": "[[source]]\nname = \"pypi\"\nurl = \"https://pypi.org/simple\"\nverify_ssl = true\n\n[dev-packages]\nblack = \"*\"\nmypy = \"*\"\npylint"
},
{
"path": "README.md",
"chars": 4020,
"preview": "\n[\n\nif exists(\"b:did_after_plugin_ultisnips_after\")\n "
},
{
"path": "autoload/UltiSnips/map_keys.vim",
"chars": 3409,
"preview": "if exists(\"b:did_autoload_ultisnips_map_keys\")\n finish\nendif\nlet b:did_autoload_ultisnips_map_keys = 1\n\n\" The trigger "
},
{
"path": "autoload/UltiSnips.vim",
"chars": 5902,
"preview": "if exists(\"b:did_autoload_ultisnips\")\n finish\nendif\nlet b:did_autoload_ultisnips = 1\n\n\" Ensure snippets are loaded fo"
},
{
"path": "autoload/neocomplete/sources/ultisnips.vim",
"chars": 798,
"preview": "let s:save_cpo = &cpo\nset cpo&vim\n\nlet s:source = {\n \\ 'name' : 'ultisnips',\n \\ 'kind' : 'keyword',\n \\ 'mark' : '["
},
{
"path": "autoload/unite/sources/ultisnips.vim",
"chars": 2683,
"preview": "let s:save_cpo = &cpo\nset cpo&vim\n\nlet s:unite_source = {\n \\ 'name': 'ultisnips',\n \\ 'hooks': {},\n \\ 'act"
},
{
"path": "ctags/UltiSnips.cnf",
"chars": 97,
"preview": "--langdef=UltiSnips\n--langmap=UltiSnips:.snippets\n--regex-UltiSnips=/^snippet (.*)/\\1/s,snippet/\n"
},
{
"path": "doc/UltiSnips-advanced.txt",
"chars": 4170,
"preview": "*UltiSnips-advanced.txt* Advanced topics for UltiSnips\n\n\n1. Debugging |UltiSnips-A"
},
{
"path": "doc/UltiSnips.txt",
"chars": 83251,
"preview": "*UltiSnips.txt* For Vim version 8.0 or later.\n\n The Ultimate Plugin for Snippets in Vim~\n\nUltiSnips "
},
{
"path": "doc/examples/autojump-if-empty/README.md",
"chars": 2463,
"preview": "# Autojump from tabstop when it's empty\n\nUltiSnips offers enough API to support automatic jump from one tabstop to\nanoth"
},
{
"path": "doc/examples/snippets-aliasing/README.md",
"chars": 1562,
"preview": "# Aliases for snippets\n\n\n\nPlug '/src/UltiSnips'\nPlug 'honza/vim-snippets'\n\nlet g:UltiSnipsExpandTrigger=\"<tab>\""
},
{
"path": "docker/download_vim.sh",
"chars": 305,
"preview": "#!/bin/bash\n\nset -o errexit\nset -o verbose\n\nmkdir -p /src && cd /src\n\nif [[ $VIM_VERSION == \"git\" ]]; then\n git clone "
},
{
"path": "docker/install_packages.sh",
"chars": 137,
"preview": "#!/bin/sh\n\nset -o errexit\nset -o verbose\n\napt-get update\napt-get install -y \\\n g++ \\\n moreutils \\\n tmux \\\n g"
},
{
"path": "docker/run_tests.sh",
"chars": 1122,
"preview": "#!/usr/bin/env bash\n\nset -e -o pipefail\n\nPYTHON_CMD=\"$(which python)\"\nVIM=\"/usr/local/bin/vim\"\nPYTHON_VERSION=$($PYTHON_"
},
{
"path": "docker/snippets/all.snippets",
"chars": 81,
"preview": "snippet example \"Repro case example\"\nThis is a simple snippet example\nendsnippet\n"
},
{
"path": "ftdetect/snippets.vim",
"chars": 107,
"preview": "\" recognize .snippet files\nif has(\"autocmd\")\n autocmd BufNewFile,BufRead *.snippets setf snippets\nendif\n"
},
{
"path": "ftplugin/snippets.vim",
"chars": 3655,
"preview": "\" Set some sane defaults for snippet files\n\nif exists('b:did_ftplugin')\n finish\nendif\nlet b:did_ftplugin = 1\n\nlet s:s"
},
{
"path": "mypy.ini",
"chars": 215,
"preview": "# Global options:\n\n[mypy]\npython_version = 3.7\nwarn_return_any = True\nwarn_unused_configs = True\nmypy_path=pythonx/UltiS"
},
{
"path": "plugin/UltiSnips.vim",
"chars": 1119,
"preview": "if exists('did_plugin_ultisnips') || &cp\n finish\nendif\nlet did_plugin_ultisnips=1\n\nif version < 800\n echohl Warning"
},
{
"path": "pylintrc",
"chars": 8109,
"preview": "[MASTER]\n\n# Python code to execute, usually for sys.path manipulation such as\n# pygtk.require().\ninit-hook='import sys; "
},
{
"path": "pythonx/UltiSnips/__init__.py",
"chars": 143,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Entry point for all things UltiSnips.\"\"\"\n\nfrom UltiSnips.snippet_manager im"
},
{
"path": "pythonx/UltiSnips/buffer_proxy.py",
"chars": 7234,
"preview": "# coding=utf8\n\nimport vim\nfrom UltiSnips import vim_helper\nfrom UltiSnips.diff import diff\nfrom UltiSnips.error import P"
},
{
"path": "pythonx/UltiSnips/compatibility.py",
"chars": 1218,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"This file contains compatibility code to stay compatible with as many pytho"
},
{
"path": "pythonx/UltiSnips/debug.py",
"chars": 1303,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Convenience methods that help with debugging.\n\nThey should never be used in"
},
{
"path": "pythonx/UltiSnips/diff.py",
"chars": 10562,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Commands to compare text objects and to guess how to transform from one to\n"
},
{
"path": "pythonx/UltiSnips/err_to_scratch_buffer.py",
"chars": 2919,
"preview": "# coding=utf8\n\nfrom functools import wraps\nimport traceback\nimport re\nimport sys\nimport time\nfrom bdb import BdbQuit\n\nfr"
},
{
"path": "pythonx/UltiSnips/error.py",
"chars": 255,
"preview": "#!/usr/bin/env python\n# encoding: utf-8\n\n\nclass PebkacError(RuntimeError):\n \"\"\"An error that was caused by a misconfi"
},
{
"path": "pythonx/UltiSnips/indent_util.py",
"chars": 1428,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"See module doc.\"\"\"\n\nfrom UltiSnips import vim_helper\n\n\nclass IndentUtil:\n\n "
},
{
"path": "pythonx/UltiSnips/position.py",
"chars": 2308,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\nfrom enum import Enum\n\n\nclass JumpDirection(Enum):\n FORWARD = 1\n BACKWAR"
},
{
"path": "pythonx/UltiSnips/remote_pdb.py",
"chars": 3199,
"preview": "import sys\nimport threading\nfrom bdb import BdbQuit\n\nfrom UltiSnips import vim_helper\n\n\nclass RemotePDB(object):\n \"\"\""
},
{
"path": "pythonx/UltiSnips/snippet/__init__.py",
"chars": 32,
"preview": "\"\"\"Code related to snippets.\"\"\"\n"
},
{
"path": "pythonx/UltiSnips/snippet/definition/__init__.py",
"chars": 211,
"preview": "\"\"\"In memory representation of snippet definitions.\"\"\"\n\nfrom UltiSnips.snippet.definition.ulti_snips import UltiSnipsSni"
},
{
"path": "pythonx/UltiSnips/snippet/definition/base.py",
"chars": 17048,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Snippet representation after parsing.\"\"\"\n\nimport re\n\nimport vim\nimport text"
},
{
"path": "pythonx/UltiSnips/snippet/definition/snipmate.py",
"chars": 800,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"A snipMate snippet after parsing.\"\"\"\n\nfrom UltiSnips.snippet.definition.bas"
},
{
"path": "pythonx/UltiSnips/snippet/definition/ulti_snips.py",
"chars": 446,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"A UltiSnips snippet after parsing.\"\"\"\n\nfrom UltiSnips.snippet.definition.ba"
},
{
"path": "pythonx/UltiSnips/snippet/parsing/__init__.py",
"chars": 50,
"preview": "\"\"\"Code related to turning text into snippets.\"\"\"\n"
},
{
"path": "pythonx/UltiSnips/snippet/parsing/base.py",
"chars": 2612,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Common functionality of the snippet parsing codes.\"\"\"\n\nfrom UltiSnips.posit"
},
{
"path": "pythonx/UltiSnips/snippet/parsing/lexer.py",
"chars": 11998,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Not really a lexer in the classical sense, but code to convert snippet\ndefi"
},
{
"path": "pythonx/UltiSnips/snippet/parsing/snipmate.py",
"chars": 1381,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Parses a snipMate snippet definition and launches it into Vim.\"\"\"\n\nfrom Ult"
},
{
"path": "pythonx/UltiSnips/snippet/parsing/ulti_snips.py",
"chars": 2155,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Parses a UltiSnips snippet definition and launches it into Vim.\"\"\"\n\nfrom Ul"
},
{
"path": "pythonx/UltiSnips/snippet/source/__init__.py",
"chars": 438,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Sources of snippet definitions.\"\"\"\n\nfrom UltiSnips.snippet.source.base impo"
},
{
"path": "pythonx/UltiSnips/snippet/source/added.py",
"chars": 385,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Handles manually added snippets UltiSnips_Manager.add_snippet().\"\"\"\n\nfrom U"
},
{
"path": "pythonx/UltiSnips/snippet/source/base.py",
"chars": 3359,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Base class for snippet sources.\"\"\"\n\nfrom collections import defaultdict\n\nfr"
},
{
"path": "pythonx/UltiSnips/snippet/source/file/__init__.py",
"chars": 43,
"preview": "\"\"\"Snippet sources that are file based.\"\"\"\n"
},
{
"path": "pythonx/UltiSnips/snippet/source/file/base.py",
"chars": 3319,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Code to provide access to UltiSnips files from disk.\"\"\"\n\nfrom collections i"
},
{
"path": "pythonx/UltiSnips/snippet/source/file/common.py",
"chars": 1012,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Common code for snipMate and UltiSnips snippet files.\"\"\"\n\nimport os.path\n\n\n"
},
{
"path": "pythonx/UltiSnips/snippet/source/file/snipmate.py",
"chars": 4173,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Parses snipMate files.\"\"\"\n\nimport os\nimport glob\n\nfrom UltiSnips import vim"
},
{
"path": "pythonx/UltiSnips/snippet/source/file/ulti_snips.py",
"chars": 7199,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Parsing of snippet files.\"\"\"\n\nfrom collections import defaultdict\nimport gl"
},
{
"path": "pythonx/UltiSnips/snippet/source/snippet_dictionary.py",
"chars": 2026,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Implements a container for parsed snippets.\"\"\"\n\n\nclass SnippetDictionary:\n\n"
},
{
"path": "pythonx/UltiSnips/snippet_manager.py",
"chars": 37641,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Contains the SnippetManager facade used by all Vim Functions.\"\"\"\n\nfrom coll"
},
{
"path": "pythonx/UltiSnips/test_diff.py",
"chars": 4539,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n# pylint: skip-file\n\nimport unittest\n\nfrom diff import diff, guess_edit\nfrom p"
},
{
"path": "pythonx/UltiSnips/test_position.py",
"chars": 1740,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n# pylint: skip-file\n\nimport unittest\n\nfrom position import Position\n\n\nclass _M"
},
{
"path": "pythonx/UltiSnips/text.py",
"chars": 2086,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Utilities to deal with text.\"\"\"\n\n\ndef unescape(text):\n \"\"\"Removes '\\\\' e"
},
{
"path": "pythonx/UltiSnips/text_objects/__init__.py",
"chars": 649,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Public facing classes for TextObjects.\"\"\"\n\nfrom UltiSnips.text_objects.esca"
},
{
"path": "pythonx/UltiSnips/text_objects/base.py",
"chars": 13258,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Base classes for all text objects.\"\"\"\n\nfrom UltiSnips import vim_helper\nfro"
},
{
"path": "pythonx/UltiSnips/text_objects/choices.py",
"chars": 5621,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Choices are enumeration values you can choose, by selecting index number.\nI"
},
{
"path": "pythonx/UltiSnips/text_objects/escaped_char.py",
"chars": 419,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"See module comment.\"\"\"\n\nfrom UltiSnips.text_objects.base import Noneditable"
},
{
"path": "pythonx/UltiSnips/text_objects/mirror.py",
"chars": 873,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"A Mirror object contains the same text as its related tabstop.\"\"\"\n\nfrom Ult"
},
{
"path": "pythonx/UltiSnips/text_objects/python_code.py",
"chars": 8507,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Implements `!p ` interpolation.\"\"\"\n\nimport os\nfrom collections import named"
},
{
"path": "pythonx/UltiSnips/text_objects/shell_code.py",
"chars": 2266,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Implements `echo hi` shell code interpolation.\"\"\"\n\nimport os\nimport platfor"
},
{
"path": "pythonx/UltiSnips/text_objects/snippet_instance.py",
"chars": 6302,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"A Snippet instance is an instance of a Snippet Definition.\n\nThat is, when t"
},
{
"path": "pythonx/UltiSnips/text_objects/tabstop.py",
"chars": 1191,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"This is the most important TextObject.\n\nA TabStop is were the cursor comes "
},
{
"path": "pythonx/UltiSnips/text_objects/transformation.py",
"chars": 5641,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Implements TabStop transformations.\"\"\"\n\nimport re\nimport sys\n\nfrom UltiSnip"
},
{
"path": "pythonx/UltiSnips/text_objects/viml_code.py",
"chars": 528,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Implements `!v ` VimL interpolation.\"\"\"\n\nfrom UltiSnips import vim_helper\nf"
},
{
"path": "pythonx/UltiSnips/text_objects/visual.py",
"chars": 2036,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"A ${VISUAL} placeholder that will use the text that was last visually\nselec"
},
{
"path": "pythonx/UltiSnips/vim_helper.py",
"chars": 11111,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Wrapper functionality around the functions we need from Vim.\"\"\"\n\nfrom conte"
},
{
"path": "pythonx/UltiSnips/vim_state.py",
"chars": 5616,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"Some classes to conserve Vim's state for comparing over time.\"\"\"\n\nfrom coll"
},
{
"path": "rplugin/python3/deoplete/sources/ultisnips.py",
"chars": 696,
"preview": "from deoplete.base.source import Base\n\n\nclass Source(Base):\n def __init__(self, vim):\n Base.__init__(self, vim"
},
{
"path": "syntax/snippets.vim",
"chars": 11464,
"preview": "\" Syntax highlighting for snippet files (used for UltiSnips.vim)\n\" Revision: 26/03/11 19:53:33\n\nif exists(\"b:current_syn"
},
{
"path": "syntax/snippets_snipmate.vim",
"chars": 1774,
"preview": "\" Syntax highlighting variant used for snipmate snippets files\n\" The snippets.vim file sources this if it wants snipmate"
},
{
"path": "test/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "test/constant.py",
"chars": 443,
"preview": "# Some constants for better reading\nBS = \"\\x7f\"\nESC = \"\\x1b\"\nARR_L = \"\\x1bOD\"\nARR_R = \"\\x1bOC\"\nARR_U = \"\\x1bOA\"\nARR_D = "
},
{
"path": "test/test_AnonymousExpansion.py",
"chars": 1638,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass _AnonBase(_VimTest):\n args"
},
{
"path": "test/test_Autocommands.py",
"chars": 1336,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Autocommand"
},
{
"path": "test/test_Autotrigger.py",
"chars": 2361,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Autotrigger_CanMatchSimpleTri"
},
{
"path": "test/test_Chars.py",
"chars": 5301,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\nfrom test.util impo"
},
{
"path": "test/test_Choices.py",
"chars": 3344,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Choices_WillBeExpandedToInlin"
},
{
"path": "test/test_Completion.py",
"chars": 1280,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Completion_SimpleExample_ECR("
},
{
"path": "test/test_ContextSnippets.py",
"chars": 5433,
"preview": "from test.constant import *\nfrom test.vim_test_case import VimTestCase as _VimTest\n\n\nclass ContextSnippets_SimpleSnippet"
},
{
"path": "test/test_Editing.py",
"chars": 3718,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Undo_RemoveMultilineSnippet(_"
},
{
"path": "test/test_Expand.py",
"chars": 3548,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass _SimpleExpands(_VimTest):\n "
},
{
"path": "test/test_Fixes.py",
"chars": 3712,
"preview": "import unittest\n\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Bug1251994(_"
},
{
"path": "test/test_Folding.py",
"chars": 1592,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass FoldingEnabled_SnippetWithFol"
},
{
"path": "test/test_Format.py",
"chars": 4553,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\nfrom test.util import running_on_wind"
},
{
"path": "test/test_Interpolation.py",
"chars": 11981,
"preview": "# encoding: utf-8\nimport os\n\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import EX, JF, ES"
},
{
"path": "test/test_ListSnippets.py",
"chars": 1344,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass _ListAllSnippets(_VimTest):\n "
},
{
"path": "test/test_Mirror.py",
"chars": 9709,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass TextTabStopTextAfterTab_Expec"
},
{
"path": "test/test_Movement.py",
"chars": 2712,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass CursorMovement_Multiline_ECR("
},
{
"path": "test/test_MultipleMatches.py",
"chars": 2322,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass _MultipleMatches(_VimTest):\n "
},
{
"path": "test/test_ParseSnippets.py",
"chars": 8817,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass ParseSnippets_SimpleSnippet(_"
},
{
"path": "test/test_Plugin.py",
"chars": 935,
"preview": "import sys\n\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Plugin_SuperTab_S"
},
{
"path": "test/test_Recursive.py",
"chars": 9313,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass RecTabStops_SimpleCase_Expect"
},
{
"path": "test/test_Selection.py",
"chars": 3006,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n# Test for bug 427298 #\n\n\nclass _Sel"
},
{
"path": "test/test_SnipMate.py",
"chars": 5348,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass snipMate_Si"
},
{
"path": "test/test_SnippetActions.py",
"chars": 10116,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass SnippetActions_PreActionModif"
},
{
"path": "test/test_SnippetOptions.py",
"chars": 9208,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\nfrom test.util impo"
},
{
"path": "test/test_SnippetPriorities.py",
"chars": 4205,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import EX, ESC\n\n\nclass SnippetPriorities_Multi"
},
{
"path": "test/test_TabStop.py",
"chars": 14443,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass TabStopSimpleReplace_ExpectCo"
},
{
"path": "test/test_Transformation.py",
"chars": 9067,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\nfrom test.util impo"
},
{
"path": "test/test_UltiSnipFunc.py",
"chars": 4666,
"preview": "# encoding: utf-8\nfrom test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\nfrom test.util impo"
},
{
"path": "test/test_Visual.py",
"chars": 7548,
"preview": "from test.vim_test_case import VimTestCase as _VimTest\nfrom test.constant import *\n\n\nclass Visual_NoVisualSelection_Igno"
},
{
"path": "test/util.py",
"chars": 343,
"preview": "import platform\n\ntry:\n import unidecode\n\n UNIDECODE_IMPORTED = True\nexcept ImportError:\n UNIDECODE_IMPORTED = F"
},
{
"path": "test/vim_interface.py",
"chars": 8662,
"preview": "# encoding: utf-8\n\nimport os\nimport re\nimport shutil\nimport subprocess\nimport tempfile\nimport textwrap\nimport time\n\nfrom"
},
{
"path": "test/vim_test_case.py",
"chars": 8285,
"preview": "# encoding: utf-8\n\n# pylint: skip-file\n\nimport os\nimport subprocess\nimport tempfile\nimport textwrap\nimport time\nimport u"
},
{
"path": "test_all.py",
"chars": 8803,
"preview": "#!/usr/bin/env python3\n# encoding: utf-8\n#\n# See CONTRIBUTING.md for an explanation of this file.\n#\n# NOTE: The test sui"
}
]
About this extraction
This page contains the full source code of the SirVer/ultisnips GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 119 files (564.4 KB), approximately 153.4k tokens, and a symbol index with 1163 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.