Skip to content

Commit

Permalink
search for bundle/snipmat.vim/snippets as a snippets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
cutalion committed Jul 5, 2011
1 parent 15cb6bf commit 51eeccc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Rakefile
Expand Up @@ -4,8 +4,13 @@
namespace :snippets_dir do
task :find do
vim_dir = File.join(ENV['VIMFILES'] || ENV['HOME'] || ENV['USERPROFILE'], RUBY_PLATFORM =~ /mswin|msys|mingw32/ ? "vimfiles" : ".vim")
pathogen_dir = File.join(vim_dir, "bundle")
@snippets_dir = File.directory?(pathogen_dir) ? File.join(pathogen_dir, "snipmate", "snippets") : File.join(vim_dir, "snippets")
possible_dirs = [
File.join(vim_dir, 'snippets'),
File.join(vim_dir, 'bundle', 'snipmate', 'snippets'),
File.join(vim_dir, 'bundle', 'snipmate.vim', 'snippets')
]

@snippets_dir = possible_dirs.find{ |dir| File.directory? dir }
end

desc "Purge the contents of the vim snippets directory"
Expand Down

0 comments on commit 51eeccc

Please sign in to comment.