Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 253 lines (219 sloc) 8.976 kb
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
1 module VIM
88e9c0d @tmm1 snipmate plugin (thx @pointcom)
tmm1 authored
2 Dirs = %w[ after autoload doc plugin ruby snippets syntax ftdetect ftplugin colors indent ]
fe9b707 Added command-t to the Rakefile
Carl Lerche authored
3 end
4
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
5 directory "tmp"
6 VIM::Dirs.each do |dir|
7 directory(dir)
fe9b707 Added command-t to the Rakefile
Carl Lerche authored
8 end
9
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
10 def vim_plugin_task(name, repo=nil)
11 cwd = File.expand_path("../", __FILE__)
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
12 dir = File.expand_path("tmp/#{name}")
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
13 subdirs = VIM::Dirs
14
15 namespace(name) do
16 if repo
17 file dir => "tmp" do
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
18 if repo =~ /git$/
19 sh "git clone #{repo} #{dir}"
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
20
0dfc20a @tmm1 hack in support for vimballs
tmm1 authored
21 elsif repo =~ /download_script/
22 if filename = `curl --silent --head #{repo} | grep attachment`[/filename=(.+)/,1]
23 filename.strip!
24 sh "curl #{repo} > tmp/#{filename}"
25 else
26 raise ArgumentError, 'unable to determine script type'
27 end
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
28
0dfc20a @tmm1 hack in support for vimballs
tmm1 authored
29 elsif repo =~ /(tar|gz|vba|zip)$/
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
30 filename = File.basename(repo)
0dfc20a @tmm1 hack in support for vimballs
tmm1 authored
31 sh "curl #{repo} > tmp/#{filename}"
32
33 else
34 raise ArgumentError, 'unrecognized source url for plugin'
35 end
36
37 case filename
38 when /zip$/
39 sh "unzip -o tmp/#{filename} -d #{dir}"
40
41 when /tar\.gz$/
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
42 dirname = File.basename(filename, '.tar.gz')
43
44 sh "tar zxvf tmp/#{filename}"
45 sh "mv #{dirname} #{dir}"
46
0dfc20a @tmm1 hack in support for vimballs
tmm1 authored
47 when /vba(\.gz)?$/
6ae5611 @tmm1 pure ruby installer for vimball archives
tmm1 authored
48 if filename =~ /gz$/
49 sh "gunzip -f tmp/#{filename}"
50 filename = File.basename(filename, '.gz')
51 end
52
53 # TODO: move this into the install task
54 mkdir_p dir
55 lines = File.readlines("tmp/#{filename}")
56 current = lines.shift until current =~ /finish$/ # find finish line
57
58 while current = lines.shift
fe8e7a9 @tmm1 Refine vimball extraction code (thx to @bronson)
tmm1 authored
59 # first line is the filename (possibly followed by garbage)
60 # some vimballs use win32 style path separators
61 path = current[/^(.+?)(\t\[{3}\d)?$/, 1].gsub '\\', '/'
6ae5611 @tmm1 pure ruby installer for vimball archives
tmm1 authored
62
63 # then the size of the payload in lines
64 current = lines.shift
65 num_lines = current[/^(\d+)$/, 1].to_i
66
67 # the data itself
1eac448 @ahk Fix for ZoomWin not being written correctly on ruby 1.9.2
ahk authored
68 data = lines.slice!(0, num_lines).join
6ae5611 @tmm1 pure ruby installer for vimball archives
tmm1 authored
69
70 # install the data
71 Dir.chdir dir do
fe8e7a9 @tmm1 Refine vimball extraction code (thx to @bronson)
tmm1 authored
72 mkdir_p File.dirname(path)
73 File.open(path, 'w'){ |f| f.write(data) }
6ae5611 @tmm1 pure ruby installer for vimball archives
tmm1 authored
74 end
75 end
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
76 end
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
77 end
78
79 task :pull => dir do
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
80 if repo =~ /git$/
81 Dir.chdir dir do
82 sh "git pull"
83 end
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
84 end
85 end
86
87 task :install => [:pull] + subdirs do
88 Dir.chdir dir do
89 if File.exists?("Rakefile") and `rake -T` =~ /^rake install/
90 sh "rake install"
91 elsif File.exists?("install.sh")
92 sh "sh install.sh"
93 else
94 subdirs.each do |subdir|
95 if File.exists?(subdir)
96 sh "cp -rf #{subdir}/* #{cwd}/#{subdir}/"
97 end
98 end
99 end
100 end
101
102 yield if block_given?
103 end
104 else
105 task :install => subdirs do
106 yield if block_given?
107 end
3585c73 @wycats Add markdown preview
wycats authored
108 end
109 end
110
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
111 desc "Install #{name} plugin"
112 task name do
113 puts
114 puts "*" * 40
115 puts "*#{"Installing #{name}".center(38)}*"
116 puts "*" * 40
117 puts
118 Rake::Task["#{name}:install"].invoke
3585c73 @wycats Add markdown preview
wycats authored
119 end
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
120 task :default => name
3585c73 @wycats Add markdown preview
wycats authored
121 end
122
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
123 vim_plugin_task "ack.vim", "git://github.com/mileszs/ack.vim.git"
03a3952 Replacing the http://www.vim.org/scripts/ links to git://github.com/vim-...
viktor authored
124 vim_plugin_task "color-sampler", "git://github.com/vim-scripts/Color-Sampler-Pack.git"
d945734 @tmm1 use conque 1.1 (HEAD seems unstable)
tmm1 authored
125 vim_plugin_task "conque", "http://conque.googlecode.com/files/conque_1.1.tar.gz"
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
126 vim_plugin_task "fugitive", "git://github.com/tpope/vim-fugitive.git"
127 vim_plugin_task "git", "git://github.com/tpope/vim-git.git"
128 vim_plugin_task "haml", "git://github.com/tpope/vim-haml.git"
129 vim_plugin_task "indent_object", "git://github.com/michaeljsmith/vim-indent-object.git"
130 vim_plugin_task "javascript", "git://github.com/pangloss/vim-javascript.git"
0e8deb4 @wycats Add jslint
wycats authored
131 vim_plugin_task "jslint", "git://github.com/hallettj/jslint.vim.git"
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
132 vim_plugin_task "markdown_preview", "git://github.com/robgleeson/vim-markdown-preview.git"
1c7c0da @wycats Switch to wycats fork of nerdtree
wycats authored
133 vim_plugin_task "nerdtree", "git://github.com/wycats/nerdtree.git"
9c61b22 @tmm1 Use fork of NERDCommenter that does textmate style comment formatting
tmm1 authored
134 vim_plugin_task "nerdcommenter", "git://github.com/ddollar/nerdcommenter.git"
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
135 vim_plugin_task "surround", "git://github.com/tpope/vim-surround.git"
03a3952 Replacing the http://www.vim.org/scripts/ links to git://github.com/vim-...
viktor authored
136 vim_plugin_task "taglist", "git://github.com/vim-scripts/taglist.vim.git"
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
137 vim_plugin_task "vividchalk", "git://github.com/tpope/vim-vividchalk.git"
138 vim_plugin_task "supertab", "git://github.com/ervandew/supertab.git"
139 vim_plugin_task "cucumber", "git://github.com/tpope/vim-cucumber.git"
140 vim_plugin_task "textile", "git://github.com/timcharper/textile.vim.git"
141 vim_plugin_task "rails", "git://github.com/tpope/vim-rails.git"
142 vim_plugin_task "rspec", "git://github.com/taq/vim-rspec.git"
03a3952 Replacing the http://www.vim.org/scripts/ links to git://github.com/vim-...
viktor authored
143 vim_plugin_task "zoomwin", "git://github.com/vim-scripts/ZoomWin.git"
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
144 vim_plugin_task "snipmate", "git://github.com/msanders/snipmate.vim.git"
145 vim_plugin_task "markdown", "git://github.com/tpope/vim-markdown.git"
146 vim_plugin_task "align", "git://github.com/tsaleh/vim-align.git"
572076f @tmm1 Merge remote branch 'zeedunk/add_text_bubbling'
tmm1 authored
147 vim_plugin_task "unimpaired", "git://github.com/tpope/vim-unimpaired.git"
8869aab @wycats Added searchfold and some upgrade
wycats authored
148 vim_plugin_task "searchfold", "git://github.com/vim-scripts/searchfold.vim.git"
71cc1dc @tmm1 Add endwise plugin for automatic ends in ruby
tmm1 authored
149 vim_plugin_task "endwise", "git://github.com/tpope/vim-endwise.git"
c2af37f @wycats Add irblack as default theme
wycats authored
150 vim_plugin_task "irblack", "git://github.com/wgibbs/vim-irblack.git"
510895a @jeffkreeftmeijer Add the vim-coffee-script plugin
jeffkreeftmeijer authored
151 vim_plugin_task "vim-coffee-script","git://github.com/kchmck/vim-coffee-script.git"
5231505 @tmm1 Add syntastic
tmm1 authored
152 vim_plugin_task "syntastic", "git://github.com/scrooloose/syntastic.git"
4c1a7e4 @tmm1 puppet-vim
tmm1 authored
153 vim_plugin_task "puppet", "git://github.com/ajf/puppet-vim.git"
a740c2e @johanhammar Added support for Scala
johanhammar authored
154 vim_plugin_task "scala", "git://github.com/bdd/vim-scala.git"
d51ed64 @jodell add gist-vim plugin
jodell authored
155 vim_plugin_task "gist-vim", "git://github.com/mattn/gist-vim.git"
f0cfc3d @jhchabran Add VimClojure and MatchIt
authored
156 vim_plugin_task "vimclojure", "git://github.com/vim-scripts/VimClojure.git"
157 vim_plugin_task "matchit", "git://github.com/javanthropus/vim-matchit.git"
0cbffd0 @jhchabran Add autoclose and a fix against an issue with zsh / fugitive
authored
158 vim_plugin_task "autoclose", "git://github.com/Townk/vim-autoclose.git"
ebf906b Force wrapping at 78 chars when writing markdown
Carl Lerche authored
159
0896d1b @tmm1 Use git urls because older git binaries dont support http urls
tmm1 authored
160 vim_plugin_task "command_t", "git://github.com/wincent/Command-T.git" do
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
161 sh "find ruby -name '.gitignore' | xargs rm"
162 Dir.chdir "ruby/command-t" do
9adb69a @tmm1 prefer ruby1.8 on deb based systems, since vim is built against it
tmm1 authored
163 if File.exists?("/usr/bin/ruby1.8") # prefer 1.8 on *.deb systems
164 sh "/usr/bin/ruby1.8 extconf.rb"
165 elsif File.exists?("/usr/bin/ruby") # prefer system rubies
f6a93ea @tmm1 always use /usr/bin/ruby if it exists (since it is likely "system" ruby,...
tmm1 authored
166 sh "/usr/bin/ruby extconf.rb"
167 elsif `rvm > /dev/null 2>&1` && $?.exitstatus == 0
e720913 @tmm1 attempt to detect if rvm before using it
tmm1 authored
168 sh "rvm system ruby extconf.rb"
169 end
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
170 sh "make clean && make"
ce949f3 @wycats Add markdown
wycats authored
171 end
172 end
173
ef39b4e @tmm1 jellybeans+ tweaked color scheme
tmm1 authored
174 vim_plugin_task "janus_themes" do
175 # custom version of railscasts theme
5edbd68 @wycats Create a railscast+ theme that also sets the fillchars and makes the spl...
wycats authored
176 File.open(File.expand_path("../colors/railscasts+.vim", __FILE__), "w") do |file|
087579b @wuputah avoid accidentally removing space by using <SP>
wuputah authored
177 file.puts <<-VIM.gsub(/^ +/, "").gsub("<SP>", " ")
5edbd68 @wycats Create a railscast+ theme that also sets the fillchars and makes the spl...
wycats authored
178 runtime colors/railscasts.vim
179 let g:colors_name = "railscasts+"
180
087579b @wuputah avoid accidentally removing space by using <SP>
wuputah authored
181 set fillchars=vert:\\<SP>
182 set fillchars=stl:\\<SP>
183 set fillchars=stlnc:\\<SP>
5edbd68 @wycats Create a railscast+ theme that also sets the fillchars and makes the spl...
wycats authored
184 hi StatusLine guibg=#cccccc guifg=#000000
185 hi VertSplit guibg=#dddddd
186 VIM
187 end
ef39b4e @tmm1 jellybeans+ tweaked color scheme
tmm1 authored
188
189 # custom version of jellybeans theme
190 File.open(File.expand_path("../colors/jellybeans+.vim", __FILE__), "w") do |file|
191 file.puts <<-VIM.gsub(/^ /, "")
192 runtime colors/jellybeans.vim
193 let g:colors_name = "jellybeans+"
194
195 hi VertSplit guibg=#888888
196 hi StatusLine guibg=#cccccc guifg=#000000
197 hi StatusLineNC guibg=#888888 guifg=#000000
198 VIM
199 end
ebdf17f Add a Mustache syntax
Carl Lerche authored
200 end
201
af82793 @tmm1 molokai theme
tmm1 authored
202 vim_plugin_task "molokai" do
f5cb8f4 @ckoehn Fixed source url of molokai theme
ckoehn authored
203 sh "curl https://github.com/mrtazz/molokai.vim/raw/master/colors/molokai.vim > colors/molokai.vim"
af82793 @tmm1 molokai theme
tmm1 authored
204 end
c42aded @tmm1 Fix typo (closes #61)
tmm1 authored
205 vim_plugin_task "mustache" do
22f9639 @myronmarston Use the new https github URL for mustache.
myronmarston authored
206 sh "curl https://github.com/defunkt/mustache/raw/master/contrib/mustache.vim > syntax/mustache.vim"
43dc9d5 @myronmarston Setup mustache file autodetection based on https://gist.github.com/32362...
myronmarston authored
207 File.open(File.expand_path('../ftdetect/mustache.vim', __FILE__), 'w') do |file|
208 file << "au BufNewFile,BufRead *.mustache setf mustache"
209 end
72f09bf @tmm1 install vim-fugitive
tmm1 authored
210 end
05212a4 @achiu update arduino to use vim-script git mirror
achiu authored
211 vim_plugin_task "arduino","git://github.com/vim-scripts/Arduino-syntax-file.git" do
7d3768c @achiu add Arduino syntax
achiu authored
212 File.open(File.expand_path('../ftdetect/arduino.vim', __FILE__), 'w') do |file|
213 file << "au BufNewFile,BufRead *.pde setf arduino"
214 end
215 end
5a030a2 @tmm1 Add vwilight color scheme
tmm1 authored
216 vim_plugin_task "vwilight" do
b9f7fd0 @tmm1 Revert "Use http since some curl installations dont support ssl"
tmm1 authored
217 sh "curl https://gist.github.com/raw/796172/724c7ca237a7f6b8d857c4ac2991cfe5ffb18087/vwilight.vim > colors/vwilight.vim"
5a030a2 @tmm1 Add vwilight color scheme
tmm1 authored
218 end
72f09bf @tmm1 install vim-fugitive
tmm1 authored
219
6b7d2c5 @wycats Improve installation
wycats authored
220 desc "Update the documentation"
221 task :update_docs do
222 puts "Updating VIM Documentation..."
223 system "vim -e -s <<-EOF\n:helptags ~/.vim/doc\n:quit\nEOF"
224 end
225
226 desc "link vimrc to ~/.vimrc"
227 task :link_vimrc do
9ef5dce @tmm1 link gvimrc to enable apple-t for CommandT in MacVIM
tmm1 authored
228 %w[ vimrc gvimrc ].each do |file|
229 dest = File.expand_path("~/.#{file}")
230 unless File.exist?(dest)
b887fda @tmm1 use symlink instead of hardlink
tmm1 authored
231 ln_s(File.expand_path("../#{file}", __FILE__), dest)
9ef5dce @tmm1 link gvimrc to enable apple-t for CommandT in MacVIM
tmm1 authored
232 end
6b7d2c5 @wycats Improve installation
wycats authored
233 end
234 end
235
92b901a @wycats Add useful stuff to the Rakefile
wycats authored
236 task :clean do
237 system "git clean -dfx"
238 end
239
3c864e0 @wycats Add a description for git pull
wycats authored
240 desc "Pull the latest"
92b901a @wycats Add useful stuff to the Rakefile
wycats authored
241 task :pull do
242 system "git pull"
243 end
244
c46d689 @tmm1 refactor Rakefile and add some more plugins
tmm1 authored
245 task :default => [
6b7d2c5 @wycats Improve installation
wycats authored
246 :update_docs,
247 :link_vimrc
d015525 Add ack.vim
Carl Lerche authored
248 ]
8869aab @wycats Added searchfold and some upgrade
wycats authored
249
c8a85f6 @wycats Add desc to rake upgrade
wycats authored
250 desc "Clear out all build artifacts and rebuild the latest Janus"
8869aab @wycats Added searchfold and some upgrade
wycats authored
251 task :upgrade => [:clean, :pull, :default]
252
Something went wrong with that request. Please try again.