vim-nicktears 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/vim-nicktears +184 -0
  2. metadata +67 -0
data/bin/vim-nicktears ADDED
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ HOME = File.expand_path('~')
7
+ VIM_PATH = "#{HOME}/.vim"
8
+ TEARS_PATH = "#{VIM_PATH}/tears"
9
+
10
+ def pathogen
11
+ File.read(__FILE__).split("__END__", 3).last.strip
12
+ end
13
+
14
+ if ARGV[0] == 'setup'
15
+ if File.exists?(VIM_PATH)
16
+ count = Dir["#{VIM_PATH}.tears*"].length
17
+ puts " :'( ~/.vim already exists, so I'm moving it to ~/.vim.tears.#{count}"
18
+ mv(VIM_PATH, "#{VIM_PATH}.tears.#{count}")
19
+ end
20
+
21
+ puts " :'( making ~/.vim/autoload directory"
22
+
23
+ mkdir_p("#{VIM_PATH}/autoload")
24
+ mkdir_p("#{TEARS_PATH}/gems")
25
+
26
+ ln_s "#{TEARS_PATH}/gems", "#{VIM_PATH}/bundle"
27
+
28
+ File.open("#{VIM_PATH}/autoload/pathogen.vim", 'w') {|file| file.print(pathogen) }
29
+
30
+ File.open("#{VIM_PATH}/vimrc", 'w') do |f|
31
+ f.print <<-VIMSTUFF
32
+ filetype off
33
+ call pathogen#runtime_append_all_bundles()
34
+ VIMSTUFF
35
+ end
36
+ touch "#{VIM_PATH}/gvimrc"
37
+
38
+ puts " :'( add the following to your ~/.vimrc file"
39
+ puts " source ~/.vim/vimrc"
40
+ else
41
+ ENV['GEM_HOME'] = TEARS_PATH
42
+ ENV['GEM_PATH'] = ''
43
+
44
+ unless File.directory?(TEARS_PATH)
45
+ abort " :'( Run `vim-nicktears setup` first"
46
+ end
47
+
48
+ system "gem", *ARGV
49
+ system "gem", "cleanup" if ARGV.include?("install")
50
+ end
51
+
52
+ __END__
53
+ " pathogen.vim - path option manipulation
54
+ " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
55
+ " Version: 1.2
56
+
57
+ " Install in ~/.vim/autoload (or ~\vimfiles\autoload).
58
+ "
59
+ " API is documented below.
60
+
61
+ if exists("g:loaded_pathogen") || &cp
62
+ finish
63
+ endif
64
+ let g:loaded_pathogen = 1
65
+
66
+ " Split a path into a list.
67
+ function! pathogen#split(path) abort " {{{1
68
+ if type(a:path) == type([]) | return a:path | endif
69
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
70
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
71
+ endfunction " }}}1
72
+
73
+ " Convert a list to a path.
74
+ function! pathogen#join(...) abort " {{{1
75
+ if type(a:1) == type(1) && a:1
76
+ let i = 1
77
+ let space = ' '
78
+ else
79
+ let i = 0
80
+ let space = ''
81
+ endif
82
+ let path = ""
83
+ while i < a:0
84
+ if type(a:000[i]) == type([])
85
+ let list = a:000[i]
86
+ let j = 0
87
+ while j < len(list)
88
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
89
+ let path .= ',' . escaped
90
+ let j += 1
91
+ endwhile
92
+ else
93
+ let path .= "," . a:000[i]
94
+ endif
95
+ let i += 1
96
+ endwhile
97
+ return substitute(path,'^,','','')
98
+ endfunction " }}}1
99
+
100
+ " Convert a list to a path with escaped spaces for 'path', 'tag', etc.
101
+ function! pathogen#legacyjoin(...) abort " {{{1
102
+ return call('pathogen#join',[1] + a:000)
103
+ endfunction " }}}1
104
+
105
+ " Remove duplicates from a list.
106
+ function! pathogen#uniq(list) abort " {{{1
107
+ let i = 0
108
+ let seen = {}
109
+ while i < len(a:list)
110
+ if has_key(seen,a:list[i])
111
+ call remove(a:list,i)
112
+ else
113
+ let seen[a:list[i]] = 1
114
+ let i += 1
115
+ endif
116
+ endwhile
117
+ return a:list
118
+ endfunction " }}}1
119
+
120
+ " \ on Windows unless shellslash is set, / everywhere else.
121
+ function! pathogen#separator() abort " {{{1
122
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
123
+ endfunction " }}}1
124
+
125
+ " Convenience wrapper around glob() which returns a list.
126
+ function! pathogen#glob(pattern) abort " {{{1
127
+ let files = split(glob(a:pattern),"\n")
128
+ return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
129
+ endfunction "}}}1
130
+
131
+ " Like pathogen#glob(), only limit the results to directories.
132
+ function! pathogen#glob_directories(pattern) abort " {{{1
133
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
134
+ endfunction "}}}1
135
+
136
+ " Prepend all subdirectories of path to the rtp, and append all after
137
+ " directories in those subdirectories.
138
+ function! pathogen#runtime_prepend_subdirectories(path) " {{{1
139
+ let sep = pathogen#separator()
140
+ let before = pathogen#glob_directories(a:path.sep."*[^~]")
141
+ let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after")
142
+ let rtp = pathogen#split(&rtp)
143
+ let path = expand(a:path)
144
+ call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
145
+ let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
146
+ return &rtp
147
+ endfunction " }}}1
148
+
149
+ " For each directory in rtp, check for a subdirectory named dir. If it
150
+ " exists, add all subdirectories of that subdirectory to the rtp, immediately
151
+ " after the original directory. If no argument is given, 'bundle' is used.
152
+ " Repeated calls with the same arguments are ignored.
153
+ function! pathogen#runtime_append_all_bundles(...) " {{{1
154
+ let sep = pathogen#separator()
155
+ let name = a:0 ? a:1 : 'bundle'
156
+ if "\n".s:done_bundles =~# "\\M\n".name."\n"
157
+ return ""
158
+ endif
159
+ let s:done_bundles .= name . "\n"
160
+ let list = []
161
+ for dir in pathogen#split(&rtp)
162
+ if dir =~# '\<after$'
163
+ let list += pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after') + [dir]
164
+ else
165
+ let list += [dir] + pathogen#glob_directories(dir.sep.name.sep.'*[^~]')
166
+ endif
167
+ endfor
168
+ let &rtp = pathogen#join(pathogen#uniq(list))
169
+ return 1
170
+ endfunction
171
+
172
+ let s:done_bundles = ''
173
+ " }}}1
174
+
175
+ " Invoke :helptags on all non-$VIM doc directories in runtimepath.
176
+ function! pathogen#helptags() " {{{1
177
+ for dir in pathogen#split(&rtp)
178
+ if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
179
+ helptags `=dir.'/doc'`
180
+ endif
181
+ endfor
182
+ endfunction " }}}1
183
+
184
+ " vim:set ft=vim ts=8 sw=2 sts=2:
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vim-nicktears
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Carl Lerche
13
+ - Terence Lee
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-18 00:00:00 -07:00
19
+ default_executable: vim-nicktears
20
+ dependencies: []
21
+
22
+ description: I'm betting that nick is crying now
23
+ email:
24
+ - me@carllerche.com
25
+ - hone02@gmail.com
26
+ executables:
27
+ - vim-nicktears
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - bin/vim-nicktears
34
+ has_rdoc: true
35
+ homepage: http://github.com/carllerche/vim-nicktears
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options: []
40
+
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ segments:
49
+ - 0
50
+ version: "0"
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ requirements: []
60
+
61
+ rubyforge_project: vim-nicktears
62
+ rubygems_version: 1.3.7
63
+ signing_key:
64
+ specification_version: 3
65
+ summary: Use rubygems & rubygems.org for vim plugins
66
+ test_files: []
67
+