From fc080b4fd5428a72ef69bc5026a9d03f025989f2 Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Sat, 6 Dec 2014 23:53:19 +0600 Subject: [PATCH] add g:UltiSnipsEnableSnipMate --- doc/UltiSnips.txt | 9 +++++++++ pythonx/UltiSnips/snippet_manager.py | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index e2ab9d2..94098c6 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -193,6 +193,14 @@ g:UltiSnipsSnippetsDir directories named "snippets" are reserved for snipMate snippets and cannot be used. + *g:UltiSnipsEnableSnipMate* +g:UltiSnipsEnableSnipMate + Enable looking for SnipMate snippets in + &runtimepath. UltiSnips will search only for + directories named 'snippets' while looking for + SnipMate snippets. Defaults to "1", so UltiSnips + will look for SnipMate snippets. + *:UltiSnipsAddFiletypes* The UltiSnipsAddFiletypes command allows for explicit merging of other snippet @@ -1411,6 +1419,7 @@ individuals have contributed to UltiSnips (in chronological order): Kevin Ballard - kballard Ahbong Chang - cwahbong Glenn Griffin - ggriffiniii + Stanislav Seletskiy - seletskiy Thank you for your support. diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index d33c8ab..0b9a06a 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -91,7 +91,13 @@ class SnippetManager(object): self._added_snippets_source = AddedSnippetsSource() self.register_snippet_source("ultisnips_files", UltiSnipsFileSource()) self.register_snippet_source("added", self._added_snippets_source) - self.register_snippet_source("snipmate_files", SnipMateFileSource()) + + enable_snipmate = True + if _vim.eval("exists('g:UltiSnipsEnableSnipMate')") == "1": + enable_snipmate = _vim.eval("g:UltiSnipsEnableSnipMate") + if enable_snipmate: + self.register_snippet_source("snipmate_files", + SnipMateFileSource()) self._reinit()