From 68048232a7212d8d7166adca19c672995581a27d Mon Sep 17 00:00:00 2001 From: "Christopher H. Laco" Date: Mon, 31 Jan 2011 16:40:38 -0500 Subject: [PATCH] Use runtimepath and pathogen#split to find jasmine directory and load local snippets --- ftplugin/jasmine.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ftplugin/jasmine.vim b/ftplugin/jasmine.vim index cea3cea..5f846d9 100644 --- a/ftplugin/jasmine.vim +++ b/ftplugin/jasmine.vim @@ -3,7 +3,19 @@ if exists("b:did_ftplugin") endif if !exists("g:loaded_jasmine_snippets") - call ExtractSnips("~/.vim/bundle/jasmine/snippets", "jasmine") + if exists("g:loaded_pathogen") + + if !exists("g:jasmine_snippets_dir") + for dir in pathogen#split(&rtp) + if dir =~ "jasmine$" && isdirectory(dir."/snippets") + let g:jasmine_snippets_dir = dir."/snippets" + endif + endfor + endif + + call ExtractSnips(g:jasmine_snippets_dir, "jasmine") + end + let g:loaded_jasmine_snippets = 1 endif