Adds "Snippets" to Vim, which allows you to quickly add pre-defined pieces of text with only a few keystrokes.
Questions tagged [plugin-ultisnips]
126 questions
12
votes
3 answers
How can I use several triggers for the same snippet?
I have made a snippet which I want to give different triggers, so instead of say trigger I also want to trigger it with myothertrigger:
snippet trigger "just an example"
my text ...
endsnippet
Is there an easy way to do this instead of copying the…
agold
- 225
- 3
- 14
5
votes
2 answers
Can this be done with Ultisnips?
I use UltiSnips for many of my TeX snippets, and I'm trying to create one to automatically insert a new \item inside itemize or enumerate environments.
The way it should work is the following: every time I'm done writing an \item, if I press the…
noibe
- 179
- 12
5
votes
1 answer
How does Ultisnips select snippet files for the file I'm currently editing?
I have installed the vim-ultisnips plugin and added some files containing snippets to the ~/.vim/snippets/ directory. (note: these files are in the snipmate format as I am in the process of switching to ultisnips from snipmate)
% ls -1…
the_velour_fog
- 3,335
- 3
- 22
- 40
4
votes
2 answers
Adding a snippet file locally (for this file only)
Using UltiSnips, I'd like to add a set of snippets just for one file or for a set of files in the same directory, maybe using a :vim modeline.
I tried to put
let g:UltiSnipsSnippetDirectories=["UltiSnips", "."]
in my .vimrc and then adding a…
Rmano
- 758
- 5
- 18
4
votes
1 answer
Automatically insert characters with Ultisnips upon exiting Insert mode
In Ultisnips, is there a way to create a snippet that will replace empty space in the snippet with a * character upon exiting Insert mode (or as I type)?
For example, I have a snippet that looks like so:
snippet…
Jin
- 185
- 4
3
votes
1 answer
Ultisnips: using common snippets for C and C++
By default my Ultisnips (or maybe it's Vim) associate .h files with C++ snippets.
I was about to ask how to make how to make Ultisnipps associate .h files with c types, but then I realized that my C snippets are valid for C++, so my question is how…
Nicolas Scotto Di Perto
- 479
- 6
- 14
3
votes
3 answers
Triggering UltiSnips in command-line mode
Is there a way to expand a UltiSnips snippet while in vim command-line mode? I can only expand a snippet in insert mode.
I am using UltiSnips to help inserting unicode characters. And I need to write these characters in the command-line for…
Nasolo Andrianoelina
- 31
- 1
3
votes
1 answer
UltiSnips does not expand automatic snippets when typing too fast
I use gVim and UltiSnips because it helps going way faster to type maths in LaTeX. To do so, I use a lot of snippets which expand automatically, for instance:
snippet ( "" iA
\left(
endsnippet
The problem is that, when I type too fast, some…
Joachim Favre
- 41
- 2
3
votes
1 answer
Ultisnips - Create a placeholder/tabstop inside a python interpolation?
It's possible to create a placeholder inside a python interpolation block?.
I want to do a snippet for my grammar exercises.
I'm currently in this snippet.
snippet "ej(ercicio)?( (\d+))?" "Ejercicios - grammar" br
${1:unidad}.${2:ejercicio}…
Bepitic
- 61
- 6
3
votes
1 answer
UltiSnips: optional line
In this video (at 1:14) UltiSnips is used to insert a snippet with optional arguments. In this case if the default text of the placeholder is deleted not just the placeholder disappears, but the whole line. Afterwards it is possible to jump back to…
Octaviour
- 962
- 6
- 18
2
votes
1 answer
How to activate vim-snippets for UltiSnips and Pathogen?
I've installed the UltiSnips and vim-snippets plugins. In order for the snippets to work, I need to activate vim-snippets for UltiSnips in my .vimrc file.
Vundle version for snipmate looks like this:
ActivateAddons vim-snippets snipmate
I need to…
Glory to Russia
- 217
- 1
- 3
- 9
2
votes
1 answer
Why can't UltiSnips use python while 'python' is enabled?
I want to use the UltiSnips plugin in Vim 7.4 under Windows 10.
When enter :version I see that python is there, but when I launch gVim, it says in a dialog box
UltiSnips requires py >= 2.7 or py3`
How can I make my system compatible with UltiSnips…
Glory to Russia
- 217
- 1
- 3
- 9
2
votes
1 answer
Ultisnips - trigger expansion only at end of line
I have a snippet for C-like languages that looks like this:
snippet { "braces"
{
$0
}
endsnippet
I would like to restrict this snippet to expand only if the tab trigger occurs at the end of the line.
I tried to use a regex trigger instead ({$)…
xsot
- 141
- 4
2
votes
1 answer
Don't trigger an expansion in Ultisnips
Sometimes I want Ultisnip not to expand a snippet because I need this word as it was typed, even though is mapped to a snippet(of course in a perfect world of perfect snippets this wouldn't have happened).
I need to press ESC and 2 times u and even…
eyal karni
- 1,106
- 9
- 33
1
vote
0 answers
Loading ultisnips with NeoBundleLazy
I've found that ultisnips is one of the slowest plugins to load at startup.
How do I use NeoBundleLazy to load ultisnips later, eg upon entering insert mode?
I've tried:
NeoBundleLazy 'SirVer/ultisnips', {
\ 'autoload': {
\ 'insert': 1,
…
Tom Hale
- 2,681
- 14
- 32