This isn't an official plugin reimplementation. I am not in any way affiliated with UltiSnips developer(s).
I needed this functionality in Vis, and UltiSnips seemed powerful and mature enough, and had plenty of templates available.
-
copy
snippets.lua
into your.config/vis/plugins
directory -
(optional) if you don't already have snippets, get them. You can clone https://github.com/honza/vim-snippets
-
in
snippets.lua
modify thesnippetfiles
value so that it points to the absolute path where you keep your UltiSnip snippets. Trailing slash is necessary
In insert mode, hit <C-j>
to show vis-menu
with all snippets found
for the currently set syntax - it literally looks for a file in your path
called <syntax>.lua
. You can also pre-type the snippet tabtrigger that
you're looking for.
When snippet is expanded, all of its tags will be added to the selection
jumplist. You can use Vis motions g<
and g>
to navigate between them.
You can:
- get a list of snippets per syntax
- insert the snippet
- navigate around its anchor points
- Multiple selections for same tag numbers (only figured out half an hour ago a solution to multiple selections)
-
python interpolations, date interpolations, etc etc etc
-
nested tags (correctly parsed, but not correctly inserted)
-
options
-
Parsing of more complex snippets. Lpeg grammar for this is quite complex (I'm looking at you, nested tags feature)
-
vis-menu
for one or the other reason corrupts my terminal when invoked. This might be plugin doing something its not supposed to - but I don't know what. If you do, please PR. Mind you, dmenu has no such problems. -
who knows??? This was supposed to be few hours project max, ended up being a rabbit hole!
All of this, because muscle memory from vim made me remember I can't
just insert {-# LANGUAGE ...#-}
pragma via template.
And I didn't like that.
So I spent upwards of 15h writing this plugin.
Go figure.