Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (21 sloc) 0.926 kb
0e3cc64 @FlaviuSim Initial commit
authored
1 #require 'fileutils'
2 #include FileUtils
3
4 namespace :snippets_dir do
5 task :find do
6 vim_dir = File.join(ENV['VIMFILES'] || ENV['HOME'] || ENV['USERPROFILE'], RUBY_PLATFORM =~ /mswin|msys|mingw32/ ? "vimfiles" : ".vim")
7 pathogen_dir = File.join(vim_dir, "bundle")
8 @snippets_dir = File.directory?(pathogen_dir) ? File.join(pathogen_dir, "snipmate", "snippets") : File.join(vim_dir, "snippets")
9 end
10
11 desc "Purge the contents of the vim snippets directory"
12 task :purge => ["snippets_dir:find"] do
13 rm_rf @snippets_dir, :verbose => true if File.directory? @snippets_dir
14 mkdir @snippets_dir, :verbose => true
15 end
16 end
17
18 desc "Copy the snippets directories into ~/.vim/snippets"
19 task :deploy_local => ["snippets_dir:purge"] do
20 Dir.foreach(".") do |f|
21 cp_r f, @snippets_dir, :verbose => true if File.directory?(f) && f =~ /^[^\.]/
22 end
23 cp "support_functions.vim", @snippets_dir, :verbose => true
24 end
Something went wrong with that request. Please try again.