2022 Developer Survey is open! Take survey.

Questions tagged [plugin-ultisnips]

Adds "Snippets" to Vim, which allows you to quickly add pre-defined pieces of text with only a few keystrokes.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

latex file opens to be empty

I am just starting to learn vim and im using neovim to write latex files. I open an existing file as follows: nvim Personal Notes.tex And the output for this is a blank nvim file. Is this not the way ...
user avatar
1 vote
1 answer
32 views

VIM and UltiSnips delay with pound "#" key

Consider the following snippet context "math()" snippet "([a-zA-Z])#" "Vectors" riA \mathbf{`!p snip.rv=match.group(1)`} endsnippet The expected behaviour is that if I ...
user avatar
1 vote
1 answer
35 views

Ultisnips not working with space

I have the following snippet context "math()" snippet `v([a-zA-Z]) ` "bb" A ``rv = '\\mathbf{' + m[1] + '}'`` endsnippet Now, most of my snippets work, however, snippets with ...
user avatar
1 vote
1 answer
29 views

How to share snippet between typescript and typescriptreact?

I use UltiSnips to manage my snippets and I have a few snippets in typescriptreact but I'm not able to use them in typescript. Is there a way to share snippets between them?
user avatar
  • 163
0 votes
1 answer
63 views

How to create a snipmate snippet with ultisnips?

I'm trying to create a "snipMate" snippet which I've copied an example from https://github.com/honza/vim-snippets/blob/master/snippets/haskell.snippets For example adding: snippet main ...
user avatar
1 vote
0 answers
147 views

Sorry, the command is not available in this version

I am trying to install the UltiSnips plugin using vim-plug (for everything else, vim-plug works just fine). I put this: call plug#begin('~/.vim/plugged') Plug 'sirver/ultisnips' call plug#end() ...
user avatar
0 votes
2 answers
67 views

UltiSnips: how to avoid expanding twice in a row the same snippet?

I have this snippet for latex: # theta --> \theta context "math()" snippet theta "theta" iA \theta endsnippet My problem is that if I type theta, it is transformed ...
user avatar
  • 1
0 votes
0 answers
159 views

Using VimTex "in_mathzone()" in .tid files

I am writing files with the extension ".tid" for a piece of software called TiddlyWiki whose syntax is pretty similar to that of markdown. In these files, I want to be able to write down ...
user avatar
1 vote
0 answers
48 views

:PlugUpdate is required every time I open vim [closed]

I’m setting up my LaTeX environment for vim, but the snippets (Ultisnips + vim-snippets + Gilles Castel’s tex.snippets with some changes) only work after I run :PlugUpdate (using vim-plug). I have to ...
user avatar
1 vote
1 answer
621 views

How to add python3 interface to vim?

I want to use Ultisnips and get the following error: E319: Sorry, the command is not available in this version: py3 import vim Press ENTER or type command to continue Error detected while processing /...
user avatar
  • 111
0 votes
1 answer
40 views

Assign value based on filetype [duplicate]

I want to assign value based on filetype. I am using UltiSnips plugin and want to have one set of bindings for one filetype and another set for everything else. Something like if &ft='vimwiki' ...
user avatar
3 votes
1 answer
246 views

UltiSnips comment variable

VSCode have the following variables that are quite helpful when creating snippets: BLOCK_COMMENT_START Example output: in PHP /* or in HTML <!-- BLOCK_COMMENT_END Example output: in PHP */ or in ...
user avatar
0 votes
1 answer
46 views

Map comma in select mode to exit select mode, enter insert mode, append a comma

Is it possible to remap comma in select mode to exit select mode, enter insert mode, [optionally: go the end of the last selection (which the cursor seems to be for ultisnips)] and append a comma? ...
user avatar
0 votes
0 answers
27 views

snippets visual is not selected when there is overfull warning

Disclmair: this is a question about using vim to write LaTeX. I don't know if this behaviour is visible in other languages also. I use Ultisnips with honza/vim-snippets to expand latex snippets. If ...
user avatar
  • 387
1 vote
1 answer
141 views

UltiSnips autoexpansion doesn't work with YouCompleteMe

I use UltiSnips and YCM, which usually works fine. However, I've noticed an issue for autoexpanded snippets. For example, if I have the snippet snippet beg "begin/end" bA \begin{$1} $0 \end{$...
user avatar
  • 111
1 vote
1 answer
164 views

Ultisnips: autocompletion of (). Make snippet not expand again

I want to make a Ultisnips snippet for auto completion of (), "", {}, etc. I have Tab as my expand and jump forward key. My snippet is: snippet ( "parenthesis" iA (${1:${VISUAL}})$...
user avatar
  • 11
4 votes
1 answer
62 views

Snippets only working when preceeded by space

I have created my snippets in texmath.snippets as: priority -50 snippet \d "dot" Aw \dot{$1} endsnippet snippet ^^ "superscript" A ^{$1} endsnippet snippet __ "subscript&...
user avatar
  • 387
1 vote
1 answer
46 views

Ultisnips capital and lower character in same snippet

I am trying to expand my snippets. I use Ultisnips. ofcourse, I can have snippet 'a "greek alpha" A \alpha endsnippet and snippet 'A "greek alpha" A \Alpha endsnippet and both ...
user avatar
  • 387
1 vote
2 answers
37 views

Extract substrings from the Snippet string in Ultisnips

So I have been working with vim-tex and ultisnips lately. Let us say the snippet is of the form (\d)pder. It is a 5 character snippet and the first character can be accessed by match.group(1). But now ...
user avatar
3 votes
1 answer
432 views

Contextual Snippets in UltiSnips not working

I have been using vimtex with UltiSnips for a while on Linux platform and it has been working just fine. Recently, I switched to MacBook Air M1 for the same and installed the above mentioned plugins ...
user avatar
  • 235
1 vote
1 answer
254 views

UltiSnips loaded but not working by default in MacVim

I am using vim-plug to load many plugins into MacVim running through Rosetta on MacBook Air M1. One of the plugins is UltiSnips by SirVer. The problem is that UltiSnips does load (checked via :...
user avatar
  • 235
2 votes
0 answers
84 views

Conditional mapping for two plugins (UltiSnips and Vimwiki)

Vimwiki table default mappings include <tab> for moving to the next table column in insert mode. Also UltiSnips default mappings include <tab> for expanding snippets in insert mode. Here ...
user avatar
1 vote
0 answers
49 views

SupperTab support list UltiSnips snippets

I install the SperTab and UltiSnips plugins. I want to integrate SuperTab and UltiSnips but fail. Here is an example snippet numpy "import numpy" bw import numpy as np endsnippet snippet nu ...
user avatar
2 votes
0 answers
79 views

Can Ultisnips regular expression match forward?

The question may be also phrased as, can Ultisnips regular expression match after the current cursor? My goal is to have a postfix of curly bracket for LaTeX subscripts. Say I want to type a_{bcd}, ...
user avatar
  • 21
1 vote
0 answers
23 views

With Ultisnips, as soon as I type in insert mode I get "E488: Could not load library function Pyslice_AdjustIndices" [duplicate]

I have Vim 8.2 on Windows with Python 3.6 installed (in the :version menu I see +python/dyn and +python3/dyn). Not only am I unable to use the Ultisnips plugin, I am not able to type in Insert Mode at ...
user avatar
1 vote
1 answer
428 views

UltiSnips regex macthing

I want the possibility of transforming an inline equation in latex to a display equation. So I want $something$ to become $$ something $$ My attempt was this: snippet "$(.+)$" "...
user avatar
5 votes
2 answers
495 views

Where do I define UtliSnips snippets for Python?

I am using UltiSnips for my snippets. I have only used LaTeX snippets with UltiSnips, which I defined in a tex.snippets file inside of an UltiSnips directory in my runtimepath. Now, I would like to ...
user avatar
  • 119
1 vote
0 answers
40 views

Unwanted characters appear in an UltiSnips macro setup

I am new to vim and I am using a mac with vimtex, UltiSnips plugins. I am using the vim latex snippets found here (the tex.snippets file). Whenever I type "()", "{}", the text ...
user avatar
  • 111
4 votes
2 answers
791 views

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 ...
user avatar
  • 139
2 votes
1 answer
42 views

Execute autocommand only if buffer contains a pattern

Concrete example: When using React with Styled Components, I want to load the CSS snippets file. I could achieve this with: autocmd FileType javascript,typescript :UltiSnipsAddFiletypes css However, ...
user avatar
1 vote
1 answer
220 views

UltiSnips: Can I add text outside snippet boundaries? (e.g. Near a search result)

Is there any way that UltiSnips can be made to seek for a text in document and execute some snippet at the position of text? Explanation of Intent :- Say I have the following text file abcde klsdfl | ...
user avatar
  • 235
3 votes
2 answers
4k views

Ultisnips py3 errors

I have these following errors whenever I try to get into insert mode (see images). I am confused about how to resolve them. I did try uninstalling and reinstalling SirVer/ultisnips, but didn't change ...
user avatar
1 vote
1 answer
40 views

UltiSnips not substituting text properly

I am trying to define a snippet which substitutes text in multiple places. As a trivial example see the following which works for me : snippet abc "Testing" bmA \begin{${1:text_here}} $0 \end{${1:...
user avatar
  • 235
0 votes
0 answers
125 views

GVim extremely slow with plugins for long docs

I am using gvim with vimtex (this) with UltiSnips (this) and with conceallevel set to 2. I use the above set-up to write my LaTeX documents. In general, this is slow but if my document is large then ...
user avatar
  • 235
1 vote
1 answer
141 views

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 ...
user avatar
  • 121
0 votes
0 answers
208 views

UltiSnips snippets not expanding in vim

I installed YouCompleteMe and UltiSnips together in order to use snippets. Here is my .vimrc: call plug#begin() Plug 'preservim/NERDTree' Plug 'ycm-core/YouCompleteMe' Plug 'SirVer/ultisnips' call ...
user avatar
2 votes
1 answer
138 views

UltiSnips shows error with Python `If-Else`

I am using UltiSnipswith vimtex as explained here and trying to use the snippet for Inline Math for LaTeX as shown in the link above. Everytime I try to execute the snippet it executes but immediately ...
user avatar
  • 235
2 votes
1 answer
126 views

Vim executing UltiSnips snippet every time I scroll the page

I inserted the 'datetime' snippet from vim-snippets/all.snippet right at the beginning of my document. The problem is that the time keeps on updating whenever I scroll, as if vim is redrawing the ...
user avatar
1 vote
1 answer
485 views

How to use TexMathZones in Markdown Syntax, for Snippets?

I am a recent and very happy Vim User. I write Mathematics and Computer Science Lecture Notes in Markdown Files, organized in a Vimwiki. I use the UltiSnips Snippet Plugin. This plugin provides me ...
user avatar
1 vote
0 answers
58 views

UltiSnips snippet to emulate `<Esc>`

Can someone please tell me how to write a snippet which can emulate/simulate the behaviour of pressing the <Esc> or <Enter> etc keys from keyboard? The following doesn't work snippet ...
user avatar
  • 235
1 vote
0 answers
254 views

Provide arbitrary arguments to a snippet in UltiSnips

There are numerous occasions where you might want to have another optional argument in your snippet. Lets say I want to have a numbered list for example. Preferably I'd call something like enum3 which ...
user avatar
  • 11
3 votes
1 answer
381 views

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+))?" "...
user avatar
  • 51
1 vote
1 answer
262 views

How to type snippet keywords when you need it

I am new to vim, I just wonder if I want to actually type the keyword in some cases, how do I do it? Do I need to disable the snippets? For example, if I use impd as keyword for import pandas as pd, ...
user avatar
  • 121
2 votes
1 answer
108 views

Using Mathematica in Vim produces errors when printing in TeXForm (double backslash, " b'-/n' ")

I've been trying to integrate Mathematica with my Vimtex set-up, inspired by this article: https://castel.dev/post/lecture-notes-1/ The basic idea is to use UltiSnips to run an operation in Wolfram ...
user avatar
  • 21
1 vote
1 answer
51 views

How to make vim-fake compatible with UltiSnips?

For generating different placeholders like emails, names, and passwords, vim-fake looks like a really useful tool. The problem is that I'm using UltiSnips and vim-fake is seemingly designed for ...
user avatar
1 vote
1 answer
882 views

How to insert a snippet with Ultisnips

I am using the setup I found in this answer: https://stackoverflow.com/a/22253548/2241241 namely " if you use Vundle, load plugins: Bundle 'ervandew/supertab' Bundle 'Valloric/YouCompleteMe' Bundle '...
user avatar
  • 389
3 votes
3 answers
782 views

Easiest way to go to the closest closing bracket?

When I'm choosing an option from the autocomplete suggestions, it automatically puts my cursor in the following location: function(|) Then I type the value that I want, and in order to get out of ...
user avatar
  • 145
2 votes
2 answers
564 views

How to change the docstring format of the snippets by Ultisnips?

Using the snippets plugin I'm able to get: class MyClasnippets(object): """Docstring for MyClasnippets. """ def __init__(self): """TODO: to be defined. """ from just typing class. ...
user avatar
0 votes
0 answers
201 views

Ultisnips stopped working this morning

I've been using Vim for about a year now (so still a newbie), but this morning UltiSnips stopped working for me. Any help would be really appreciated! When I run :UltiSnipsEdit! the console returns ...
user avatar
  • 101
2 votes
1 answer
657 views

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 ...
user avatar
  • 1,114