Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure an ultisnip to override an existing snippet?

Tags:

vim

ultisnips

I use rails.vim but would like to override one or two snippets with my own using ultisnips.

I've created the snippets but since they're already defined by rails.vim a menu now appears when triggered. I'd like my snippets to override the existing one to avoid the menu.

like image 466
Zubin Avatar asked Oct 03 '14 00:10

Zubin


People also ask

How do you make a snippet in UltiSnips?

If you are using the sirver/ultisnips plugin (UltiSnips) the correct way to do this is simply run the :UltiSnipsEdit command which opens up a custom snippets file for the current language / filetype. Thank you! This is the most sensible answer.


1 Answers

The solution is to use priority directive. All snippets default to a priority of 0. Therefore, adding this to the top of my custom snippets solved the issue:

# top of custom snippets file
priority 1
like image 106
Zubin Avatar answered Nov 16 '22 04:11

Zubin