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
1answer
21 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
39 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 ...
0
votes
0answers
29 views

context for multiple snippets

I have a function that determines whether I am in a mathmatical context within latex, using ultisnips. I want to this to be applied to many snippets at once. context "math()" snippet fun "function" ...
1
vote
1answer
48 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
29 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
88 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:...
1
vote
1answer
41 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 ...
0
votes
1answer
192 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
69 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
66 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
75 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
85 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: ...
2
votes
1answer
221 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
44 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
98 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
161 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
42 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 ...
0
votes
1answer
148 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
533 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
465 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
120 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 ...
1
vote
1answer
669 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/...
1
vote
0answers
123 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
437 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 ...
1
vote
1answer
52 views

Make UltiSnips perform XML encoding on tabstop text

I'm writing an XML document where I frequently produce markup like this: We can exit Terminal mode by pressing <keystroke>&lt;C-\&gt;&lt;C-n&gt;</keystroke>. I'd like to ...
2
votes
1answer
1k views

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 ...
0
votes
1answer
641 views

Vim UltiSnips for python not working

Maybe it's a stupid question, but I can't figure it out. I have installed the UltiSnips plugin. I followed all the instructions on setting it up. I added this into my .vimrc file but it's not working: ...
4
votes
1answer
173 views

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 ...
3
votes
1answer
370 views

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 ...
1
vote
1answer
380 views

Add current directory to UltiSnips search directory

I want to have some specific snippets for each file that I am editing. Like, I want to type "ppp" just for "proper point groups", or "iff" for "if and only if". To be more specific, I want an ...
2
votes
1answer
2k views

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: ...
2
votes
1answer
2k views

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 ...
1
vote
0answers
149 views

How can I uninstall a plugin I erroneously installed multiple times?

I had difficulties in using UltiSnips, so I fear I installed it multiple times with different plugin managers. At the moment tree -d in .vim folder gives the following result, showing that I ...
0
votes
0answers
138 views

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/...
1
vote
1answer
283 views

Assign keybinding to invoke my Ultisnip snippet

Is it possible to assign a key combination to a snippet in Ultisnip? I tried something hacky like nnoremap KEYKOMBO iULTISNIPTRIGGER<TAB> but it doesn't trigger my snippet like it would, if I ...
23
votes
4answers
13k views

What is the difference between the vim snippets plugins?

There is a great number of snippets plugins for vim: ultisnips, snipmate, xptemplate, neosnippet and a lot more. They all have pros and cons and more or less dependencies. So far I've been using ...
1
vote
1answer
183 views

UltiSnip: Insert matched regex

I have a ultisnip that looks like this: snippet "[A-Z]+-[0-9]+" "Jira Link" r [`!p snip.rv = match.group(0)`](https://ellation.atlassian.net/browse/`!p snip.rv = match.group(0)`) endsnippet This ...
2
votes
0answers
37 views

:mksession session file includes nonprintable characters

I have been having some problems using UltiSnips with vim. It seems that :mksession is adding a bunch of nonprintable characters to my session file(s). When this is sourced to restore my session, ...
3
votes
1answer
2k views

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 ...
4
votes
0answers
271 views

Ultisnips causes problem with unmapped f-keys in nvim insert mode

With F2 unmapped, for instance, I get a load of error messages (see below). I realized I can fix this by mapping the f-keys, but I'm curious: are they mapped to something by Ultisnips, that doesn't ...
11
votes
2answers
624 views

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 ...
5
votes
1answer
1k views

Is there a snippet plugin compatible with Supertab?

I used Suptertab for a while and I really like it. Recently I tried to add a snippet management plugin but I wasn't successful in getting them to work with Supertab. I tried SnipMate and Ultisnips. ...
4
votes
1answer
398 views

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=["...
3
votes
1answer
92 views

neovim doesn't show expansion “list” of completions

In this example, when class is typed, a list of potential expansions is shown. The snippet itself works in my nvim, but the list is not shown. Commenting out my whole init.vim (the vimrc of neovim), ...
1
vote
0answers
323 views

Ultisnips not working on first load of python file

I've installed the Ultisnips plugin with Pathogen. All in all it seems to be working fine. My problem is that it doesn't seem to work for the first python file I load, but it works for all the rest. ...
0
votes
1answer
536 views

Tab keep triggering jump backward in ultisnips

I have a problem with UltiSnips. It keeps jump backwards even tough I didn't map it in my .vimrc file. My .vimrc look like this let g:UltiSnipsExpandTrigger="<C-l>" ...
0
votes
1answer
759 views

How to Write File Name Specific Snippets Using UltiSnips or Otherwise

I have been using the plugin called Ultisnips and it is great. But I am looking for the following feature. Suppose I have two files history.tex and geography.tex which I edit regularly. I want to ...
3
votes
1answer
267 views

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 ...
4
votes
1answer
775 views

How do I change directory for UltiSnips snippets

What is the correct way to change where UltiSnips searches for snippets? I tried the lines below with no success: let g:UltiSnipsSnippetsDir = "/newfolder/snippets/" let g:UltiSnipsSnippetDirectories=...
1
vote
0answers
274 views

Problem using LaTex .bib file with UltiSnips completion

Environment Ubuntu 14.04 Vim 7 Tmux I'm just trying to create some snippets for UltiSnips and writing bib files. What I want To create custom snippets that will make writing bib files (that I can'...