Skip to main content

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
-1 votes
0 answers
30 views

Why Vim is throwing an error when using tab key? [closed]

While editing a .go file, pressing the tab key errors with: function UltiSnips#ExpandSnippetOrJump error happened: Line 2: <global-snippets>:9: SyntaxWarning: invalid escape sequence '\(' Please ...
Alpin Cleopatra's user avatar
0 votes
0 answers
24 views

How can write snippet with arguments to extent?

I have write an small snippet for html-table to extend when editing rst file: vim .vim/bundle/vim-snippets/UltiSnips/rst.snippets snippet html-table "put html" i .. raw:: html <...
showkey's user avatar
  • 1,140
1 vote
0 answers
23 views

UltiSnips : how to expand the content of a snippet with the content of a register

In UltiSnips, it is possible to use the ${VISUAL} inside of a snippet to directly paste some text inside a snippet. The behaviour works as follow : Select the text to paste in visual mode Press Tab(...
Statistic Dean's user avatar
0 votes
0 answers
72 views

Contextual Snippets not working in inline mathmode of vimwiki

I am trying to use the snippets in math context inside vimwiki filetypes. The math contextual snippets are working fine for ".tex" files, but not for ".wiki" files. However all the ...
vishal rao's user avatar
0 votes
0 answers
15 views

Help me remove feature in NVim [duplicate]

I've just used NVim lately and install some plugins Plugin List And every function have some params name behind it . Anyone know where this comes from and how to remove it ? Thanks!
Max's user avatar
  • 1
3 votes
1 answer
156 views

What is the meaning of [LS] and other symbols in Vim completion menu?

I installed coc.nvim, vim-snippets and ultisnips for my snippets in my Vim (gVim on Windows). I don't know the meaning of [LS] , [B] , m, S and [S] in this picture. This picture shows part of my ...
mohamadi_arch's user avatar
1 vote
1 answer
443 views

How can I see a list of snippets in my Vim?

I installed vim-snippets, ultisnips and coc.nvim in my Vim (gVim on Windows). How can I see a list of snippets that I can use in my current open file? For example, when I'm editing a .js file, I want ...
mohamadi_arch's user avatar
1 vote
1 answer
48 views

UltiSnips snippet for automatic subscript

I stole Gilles Castel's snippet for automatic subscript, and I tried to extend it to automatically subscript an i or j that follows any character. Here is my attempt snippet '([A-Za-z])(?:\d|[ij])' &...
Alvaro Neto's user avatar
0 votes
0 answers
58 views

UltiSnips Latex snippet does not work correctly when wrapped around due to textwidth setting

Given snippet: snippet mm "Inline Math" wA \\( $1 \\) $0 endsnippet which inserts inline math mode in LaTeX: \( | \) where cursor position is | and following .vimrc: "-------------Load ...
Tryer's user avatar
  • 247
3 votes
2 answers
87 views

Undo-joining a mapping that uses the expression register

I'm trying to make semi-automatic parentheses work using vim-arpeggio and ultisnips. Everything works fine except the undo story. What I have now is this: Arpeggioinoremap () ()<c-r>=UltiSnips#...
user3240588's user avatar
-1 votes
1 answer
51 views

How can make the expansion to take effect in any type of file?

If I add the following lines in html.snippets: snippet "(\S+)(\d+)" "Repeat token n times" r `!p snip.rv = int(match.group(2)) * match.group(1)` endsnippet #5 can expand to #####. ...
newview's user avatar
  • 291
1 vote
1 answer
37 views

How can make the trigger_word as argument to python?

The syntax of UltiSnips's snippet is as below: snippet trigger_word [ "description" [ options ] ] The upper method can convert all characters in the string into upper case: "string&...
newview's user avatar
  • 291
0 votes
1 answer
103 views

How can call python in snippet?

I want to expand ptest into welcome python in file ending with html. Add these lines in html.snippets(located in vim-snippets/UltiSnips): snippet ptest !p print("welcome python") endsnippet ...
newview's user avatar
  • 291
0 votes
1 answer
92 views

Detecting conflicting snippet trigger keyboard shortcut

Is there a way to detect incompatible snippet triggers? Say: snippet st "superscript" iA <---snippet body---> endsnippet vs snippet bst "binary spanning tree data" iA <---...
Tryer's user avatar
  • 247
1 vote
0 answers
101 views

Why can't I jump backforward when pressing Shift+Tab key in Ultisnips?

I have added the line in .vimrc: let g:UltiSnipsJumpBackwardTrigger="<s-tab>" Edit a test.py, type ifee and Tab to expand it; upon pressing Tab, the cursor jumps into next region. Why ...
newview's user avatar
  • 291
3 votes
1 answer
389 views

What does ${VISUAL} do in snippets?

What is the difference between them? With ${VISUAL} : snippet if "if ... then (if)" b if [[ ${1:condition} ]]; then ${0:${VISUAL}} fi endsnippet Without ${VISUAL} : snippet if "if ....
newview's user avatar
  • 291
1 vote
1 answer
137 views

Which python.snippets file will be called?

There are two python.snippets in vim-snippets folder: debian@debian:~/.vim/bundle$ ls vim-snippets/snippets | grep python python.snippets debian@debian:~/.vim/bundle$ ls vim-snippets/UltiSnips | ...
newview's user avatar
  • 291
1 vote
1 answer
112 views

Ultisnips dynamic tabstop generation with custom justified option

It seems possible to have ultisnips produce a dynamically sized array as specified here: https://github.com/SirVer/ultisnips/blob/master/doc/examples/tabstop-generation/README.md The array environment ...
Tryer's user avatar
  • 247
2 votes
1 answer
70 views

Snippet lookahead trigger

Using UltiSnips, I'm wondering if it's possible to do some lookahead assertion when detecting the trigger. For example, this works: snippet "dv" "derivative" ir \dv{$1}{$2}$0 ...
Alex867's user avatar
  • 33
1 vote
1 answer
217 views

Mapping snippet trigger in visual mode

I'm using the UltiSnips plugin. When selecting text, you can press the trigger key to enter Insert mode, and the deleted text can then be used in a subsequent snippet. The snippet I'm using is as ...
Alex867's user avatar
  • 33
3 votes
1 answer
102 views

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( ...
Joachim Favre's user avatar
1 vote
1 answer
1k views

The python library could not be loaded

I am trying to get UltiSnips to work with gVim on my Windows 10 machine and for some reason I keep getting the error: Error detected while processing function UltiSnips #TrackChange: line 1: E370: ...
ConlangBabble's user avatar
4 votes
1 answer
1k views

Moving from Ultisnips to LuaSnip?

I recently decided to switch my init.vim to init.lua as I'm using Neovim and opted to use LuaSnip over UltiSnips - previously, CoC autocomplete and UltiSnips were clashing over the same tab triggers. ...
Revise's user avatar
  • 201
1 vote
1 answer
362 views

giving one snippet priority over another

I would like to use two custom snippets whose endings are the same: snippet ah "\aH for ta marbuta" i \\aH${0} endsnippet snippet iyyah "\iyyah" i \\iyyah${0} endsnippet How can ...
Alex Roberts's user avatar
2 votes
2 answers
118 views

How to have both Ultisnips and Emmet-Vim depending of the filetype

I often use UltiSnips for other file types, but for HTML I'd like to use Emmet-vim. However, I'd like to use the same trigger for both. For this I have let g:user_emmet_expandabbr_key='<C-j>' ...
ElPC's user avatar
  • 31
2 votes
1 answer
87 views

UtliSnips - dynamically add placeholders along the way

I have a snippet defined as followed: data ${1:Type} = ${2:Constructor} | ${3:Constructor} I'd like to have new cases added along the way: data T = A " <Tab> | B " <Tab> ...
GlinesMome's user avatar
0 votes
0 answers
64 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 ...
UnKnoWnZ's user avatar
1 vote
1 answer
81 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 ...
Maths Wizzard's user avatar
1 vote
1 answer
190 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 ...
Maths Wizzard's user avatar
1 vote
1 answer
148 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?
Lai32290's user avatar
  • 275
0 votes
1 answer
321 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 ...
Chris Stryczynski's user avatar
1 vote
0 answers
445 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() ...
grepgrok's user avatar
1 vote
2 answers
306 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 ...
fxmarty's user avatar
  • 11
0 votes
0 answers
316 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 ...
Isky Mathews's user avatar
1 vote
0 answers
120 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 ...
Sage Stark's user avatar
2 votes
2 answers
2k 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 /...
Rhi's user avatar
  • 121
0 votes
1 answer
63 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' ...
listout's user avatar
3 votes
1 answer
613 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 ...
AvidSeeker's user avatar
0 votes
1 answer
74 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? ...
codepoet's user avatar
  • 101
0 votes
0 answers
28 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 ...
BaRud's user avatar
  • 481
1 vote
1 answer
233 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{$...
boink's user avatar
  • 111
3 votes
1 answer
406 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}})$...
jfab's user avatar
  • 31
4 votes
1 answer
231 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&...
BaRud's user avatar
  • 481
1 vote
1 answer
97 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 ...
BaRud's user avatar
  • 481
1 vote
2 answers
78 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 ...
Prasanna Venkatesan's user avatar
3 votes
1 answer
643 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 ...
Nitin's user avatar
  • 235
1 vote
1 answer
448 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 :...
Nitin's user avatar
  • 235
2 votes
0 answers
142 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 ...
mahbubweb's user avatar
  • 602
1 vote
0 answers
70 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 ...
Qinsheng Zhang's user avatar
2 votes
0 answers
121 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}, ...
Frid Fu's user avatar
  • 21