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
3
votes
2answers
97 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 ...
0
votes
0answers
15 views

Vim E370 error caused by attempting to load wrong version of Python [duplicate]

I recently loaded the plugin UltiSnips using Vim-Plug but quickly found that even attempting to type a single character in insert mode yields a large number of error messages-- all seemingly stemming ...
2
votes
1answer
22 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, ...
1
vote
1answer
45 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 | ...
0
votes
0answers
18 views

=UltiSnips#ExpandSnippet() not working with tex

My setup works as expected in my python files, but not in tex. The snipppets themselves show up in insert mode, but not only does the mapping I use not work, but if I manually go <c-r> =...
2
votes
1answer
163 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 ...
1
vote
1answer
15 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:...
0
votes
0answers
29 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 ...
0
votes
0answers
27 views

UltiSnips unexpected behaviour

I have the following two snippets snippet mm "Math" wA \(${1}\)`!p if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: snip.rv = ' ' else: snip.rv = '' `$2 endsnippet Which puts me in math ...
1
vote
1answer
44 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 ...
0
votes
0answers
38 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 ...
2
votes
1answer
35 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 ...
2
votes
1answer
40 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 ...
1
vote
1answer
98 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 ...
1
vote
0answers
26 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 ...
1
vote
0answers
75 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 ...
3
votes
1answer
109 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+))?" "...
0
votes
1answer
72 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, ...
2
votes
1answer
55 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 ...
1
vote
1answer
35 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 ...
1
vote
1answer
274 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 '...
3
votes
3answers
154 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 ...
1
vote
2answers
211 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. ...
0
votes
0answers
88 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 ...
2
votes
1answer
237 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 ...
2
votes
1answer
85 views

Stop Snippet from Triggering Inside Other Snippet

I am using ultisnips with Gilles Castel's subscript snippet along with a snippet I found on SE to create matrices in latex rather quickly. Unfortunately, I can't use the matrices snippet because it ...
1
vote
1answer
285 views

Same plugins for every .vimrc file (vim-plug)

I have a question regarding the following situation: I want to use a default .vimrc and a vimrc (name it .vimrc2) for a special purpose. However, when I start vim with vim -u ~/.vimrc2 I have the ...
0
votes
1answer
91 views

Ultisnips Sinppets in current scope on blank line

Background I'm using UltiSnips in conjunction with some autocomplete plugins. I have this line controlling the behavior of enter inoremap <expr> <cr> \ !empty(UltiSnips#...
0
votes
1answer
103 views

custom snippet extender Ultisnips

Suppose I have a snippet: snippet prg !This is file : `!v expand('%:t:r')` ! Author= `!v expand($USER)` ! Started at: `date +%d.%m.%y` ! Last Modified : Sun 16 Jun 2019 12:30:58 IST ...
1
vote
1answer
90 views

How do I use a previous word in my snippet?

I'm coding a lot in go these days and one pattern I use often is iterating over slices and would like to use a snippet for this. There are generic for loop snippets that work well, but I'd like to ...
1
vote
0answers
109 views

Vimscript infinite loop

I'm trying to combine fzf-bibtex with UltiSnips so that I can search my bibliography file and insert a BibTeX key automatically. I use the following function from fzf-bibtex (which calls the binaries ...
0
votes
1answer
839 views

tab trigger not working for ultisnips

I have tried other solutions proposed of this question but still none of them worked. Related config: Plugin 'SirVer/ultisnips' " Optional: Plugin 'honza/vim-snippets' let g:...
2
votes
2answers
331 views

UltiSnips not working with VimWiki

I have been trying to make UltiSnips work with VimWiki to no avail, as they share mappings for expand snippet/next link (on <tab>). I tried setting VimWiki's bindings to something else by using ...
2
votes
1answer
2k views

Integrating autocomplete and snippets

I'm trying to set up an autocompletion/snippet workflow that's a bit complicated. This is stemming from needing a better workflow for latex. Right now I'm using coc.nvim and UltiSnippets but I am ...
1
vote
0answers
196 views

Trigger doesn't expand my keywords [closed]

I am a complete vim noob, that tries to get some Snippets with UltiSnips running. My minimal .vimrc is: syntax on call plug#begin('~/.vim/plugged') Plug 'lervag/vimtex' let g:tex_flavor='latex' let ...
1
vote
1answer
173 views

How to capture the name of a function on ultisnips plugin?

I have created a guard snippet (ultisnips) in order to add on my existing functions: snippet guard "add guard to functions" b if !exists('*${1:func_name}') ${VISUAL} endif ${0:jump here <C-j>...
0
votes
0answers
417 views

UltiSnips: snippets not expanding

This is a noob question. I just installed UltiSnip to make use of the TeX snippets. Here is the relevant part of my init.vim: " Specify a directory for plugins (powered by vim-plug) call plug#begin('~...
1
vote
0answers
285 views

UltiSnips not work all the time [closed]

I have configured UltiSnips for vim as described in the documentation of UltiSnips " Track the engine. Plugin 'SirVer/ultisnips' " Snippets are separated from the engine. Add this if you want them: ...
3
votes
1answer
931 views

UltiSnips, Context and Tex

For best experience, I want to enable some snippets to be expanded only in Tex Math environments. A wonderful person, lacygoill helped me on GitHub to achieve just this with the following setup: Let ...
0
votes
0answers
69 views

Vim doesn't understand <Tab>, <Enter>

I have UltiSnips plugin's options in .vimrc: let g:UltiSnipsExpandTrigger="<Enter>" let g:UltiSnipsJumpForwardTrigger = "<Tab>" let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>" With ...
1
vote
0answers
119 views

Toggle UltiSnips

I have this following mapping in my .vimrc " Toggle search next with blink and without blink let s:enabled = 0 function! NextMatchToggle() if s:enabled unmap <buffer> n ...
3
votes
1answer
358 views

Some function keys switch cases of letters under and after the cursor

Foreword I use UltiSnips and have the following definitions in my .vimrc file let g:UltiSnipsExpandTrigger="<F8>" let g:UltiSnipsJumpForwardTrigger="<F8>" let g:...
1
vote
0answers
46 views

Automatically create files based on expanding snippets?

when developing for web (in Vim) I'm always using the BEM methodology. I have identified that I always go through the same steps when adding a new block element, and I'm looking for ways to automate ...
2
votes
1answer
368 views

Trigger reindentation after snippet has expanded to word in 'indentkeys'

The ftplugin vimtex provides the file indent/tex.vim with following line setlocal indentkeys+=[,(,{,),},],\&,=item,=else,=fi 'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e") ...
1
vote
1answer
899 views

How to use UltiSnips with SpaceVim?

I'm trying SpaceVim and I would like to use the plugin UltiSnips with it, instead of Neosnippets that comes with it as default. Based on what I found in http://spacevim.org/documentation, https://...
1
vote
1answer
825 views

UltiSnips does not map to ExpandsTrigger

I installed UltiSnips with Vundle by placing Plugin 'SirVer/ultisnips'¬ Plugin 'honza/vim-snippets' in my .vimrc as well as this as it says in the readme let g:UltiSnipsExpandTrigger="<tab>" ...
0
votes
1answer
182 views

Debug ultisnip snippet

I have ultisnips installed and when I type ve in normal mode it changes the word. Let's say I have: word When I type ve to select until the end of the word it does the following Plese also help me ...
2
votes
1answer
1k views

LaTeX: Ultisnips

I'm new to Vim and setting up LaTeX with vimtex. Now, I am looking for a Snippet-Manager and decided to give UltiSnips a try. It seems to be very handy. But it doesn't come with a lot snippets (honza/...
2
votes
0answers
193 views

Comprehesive support for graphviz (linting/autocompletion/snippets)

Vim comes with some support (syntax highlighting) out of the box for the DOT language (graphviz) In addition, I found the plugin: https://github.com/wannesm/wmgraphviz.vim, which provides integrated ...
0
votes
1answer
607 views

tex and rails snippets do not expand in ultisnips?

I am new to using plugins with Vim. I mostly work with rails, ruby, latex and html code. I have already installed UltiSnips and vim-snippets plugins using pathogen. I would like corresponding snippets ...