utils 0.0.67 → 0.0.68
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/edit +3 -1
- data/lib/utils/editor.rb +14 -0
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +3 -3
- metadata +3 -74
- data/lib/utils/config/vim/after/syntax/haml.vim +0 -9
- data/lib/utils/config/vim/after/syntax/html.vim +0 -11
- data/lib/utils/config/vim/autoload/Align.vim +0 -1029
- data/lib/utils/config/vim/autoload/AlignMaps.vim +0 -330
- data/lib/utils/config/vim/autoload/ctrlp/bookmarkdir.vim +0 -139
- data/lib/utils/config/vim/autoload/ctrlp/buffertag.vim +0 -238
- data/lib/utils/config/vim/autoload/ctrlp/changes.vim +0 -96
- data/lib/utils/config/vim/autoload/ctrlp/dir.vim +0 -90
- data/lib/utils/config/vim/autoload/ctrlp/line.vim +0 -63
- data/lib/utils/config/vim/autoload/ctrlp/mixed.vim +0 -83
- data/lib/utils/config/vim/autoload/ctrlp/mrufiles.vim +0 -119
- data/lib/utils/config/vim/autoload/ctrlp/quickfix.vim +0 -62
- data/lib/utils/config/vim/autoload/ctrlp/rtscript.vim +0 -49
- data/lib/utils/config/vim/autoload/ctrlp/tag.vim +0 -112
- data/lib/utils/config/vim/autoload/ctrlp/undo.vim +0 -154
- data/lib/utils/config/vim/autoload/ctrlp/utils.vim +0 -72
- data/lib/utils/config/vim/autoload/ctrlp.vim +0 -1772
- data/lib/utils/config/vim/autoload/rails.vim +0 -4570
- data/lib/utils/config/vim/autoload/rubycomplete.vim +0 -801
- data/lib/utils/config/vim/autoload/sqlcomplete.vim +0 -741
- data/lib/utils/config/vim/autoload/vimball.vim +0 -750
- data/lib/utils/config/vim/colors/flori.vim +0 -116
- data/lib/utils/config/vim/compiler/coffee.vim +0 -68
- data/lib/utils/config/vim/compiler/eruby.vim +0 -40
- data/lib/utils/config/vim/compiler/ruby.vim +0 -67
- data/lib/utils/config/vim/compiler/rubyunit.vim +0 -34
- data/lib/utils/config/vim/doc/Decho.txt +0 -372
- data/lib/utils/config/vim/doc/coffee-script.txt +0 -116
- data/lib/utils/config/vim/doc/ctrlp.txt +0 -1113
- data/lib/utils/config/vim/doc/fugitive.txt +0 -257
- data/lib/utils/config/vim/doc/rails.txt +0 -1022
- data/lib/utils/config/vim/doc/xml-plugin.txt +0 -226
- data/lib/utils/config/vim/ftdetect/coffee.vim +0 -8
- data/lib/utils/config/vim/ftdetect/eco.vim +0 -1
- data/lib/utils/config/vim/ftdetect/ragel.vim +0 -2
- data/lib/utils/config/vim/ftdetect/ruby.vim +0 -17
- data/lib/utils/config/vim/ftdetect/slim.vim +0 -2
- data/lib/utils/config/vim/ftplugin/coffee.vim +0 -221
- data/lib/utils/config/vim/ftplugin/eruby.vim +0 -100
- data/lib/utils/config/vim/ftplugin/ruby.vim +0 -260
- data/lib/utils/config/vim/ftplugin/xml.vim +0 -941
- data/lib/utils/config/vim/indent/IndentAnything_html.vim +0 -35
- data/lib/utils/config/vim/indent/coffee.vim +0 -338
- data/lib/utils/config/vim/indent/eruby.vim +0 -77
- data/lib/utils/config/vim/indent/javascript.vim +0 -116
- data/lib/utils/config/vim/indent/ruby.vim +0 -377
- data/lib/utils/config/vim/indent/slim.vim +0 -75
- data/lib/utils/config/vim/plugin/AlignMapsPlugin.vim +0 -242
- data/lib/utils/config/vim/plugin/AlignPlugin.vim +0 -41
- data/lib/utils/config/vim/plugin/Decho.vim +0 -592
- data/lib/utils/config/vim/plugin/IndentAnything.vim +0 -675
- data/lib/utils/config/vim/plugin/bufexplorer.vim +0 -1144
- data/lib/utils/config/vim/plugin/cecutil.vim +0 -508
- data/lib/utils/config/vim/plugin/ctrlp.vim +0 -61
- data/lib/utils/config/vim/plugin/fugitive.vim +0 -2041
- data/lib/utils/config/vim/plugin/lusty-explorer.vim +0 -1509
- data/lib/utils/config/vim/plugin/rails.vim +0 -339
- data/lib/utils/config/vim/plugin/rubyextra.vim +0 -193
- data/lib/utils/config/vim/plugin/surround.vim +0 -628
- data/lib/utils/config/vim/plugin/taglist.vim +0 -4546
- data/lib/utils/config/vim/plugin/test/IndentAnything/test.js +0 -131
- data/lib/utils/config/vim/plugin/vimballPlugin.vim +0 -40
- data/lib/utils/config/vim/syntax/Decho.vim +0 -101
- data/lib/utils/config/vim/syntax/coffee.vim +0 -217
- data/lib/utils/config/vim/syntax/eco.vim +0 -62
- data/lib/utils/config/vim/syntax/eruby.vim +0 -73
- data/lib/utils/config/vim/syntax/javascript.vim +0 -246
- data/lib/utils/config/vim/syntax/ragel.vim +0 -165
- data/lib/utils/config/vim/syntax/ruby.vim +0 -367
- data/lib/utils/config/vim/syntax/slim.vim +0 -117
- data/lib/utils/config/vimrc +0 -540
@@ -1,260 +0,0 @@
|
|
1
|
-
" Vim filetype plugin
|
2
|
-
" Language: Ruby
|
3
|
-
" Maintainer: Gavin Sinclair <gsinclair at gmail.com>
|
4
|
-
" URL: http://vim-ruby.rubyforge.org
|
5
|
-
" Anon CVS: See above site
|
6
|
-
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
7
|
-
" ----------------------------------------------------------------------------
|
8
|
-
"
|
9
|
-
" Original matchit support thanks to Ned Konz. See his ftplugin/ruby.vim at
|
10
|
-
" http://bike-nomad.com/vim/ruby.vim.
|
11
|
-
" ----------------------------------------------------------------------------
|
12
|
-
|
13
|
-
" Only do this when not done yet for this buffer
|
14
|
-
if (exists("b:did_ftplugin"))
|
15
|
-
finish
|
16
|
-
endif
|
17
|
-
let b:did_ftplugin = 1
|
18
|
-
|
19
|
-
let s:cpo_save = &cpo
|
20
|
-
set cpo&vim
|
21
|
-
|
22
|
-
if has("gui_running") && !has("gui_win32")
|
23
|
-
setlocal keywordprg=ri\ -T
|
24
|
-
else
|
25
|
-
setlocal keywordprg=ri
|
26
|
-
endif
|
27
|
-
|
28
|
-
" Matchit support
|
29
|
-
if exists("loaded_matchit") && !exists("b:match_words")
|
30
|
-
let b:match_ignorecase = 0
|
31
|
-
|
32
|
-
let b:match_words =
|
33
|
-
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' .
|
34
|
-
\ ':' .
|
35
|
-
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
36
|
-
\ ':' .
|
37
|
-
\ '\<end\>' .
|
38
|
-
\ ',{:},\[:\],(:)'
|
39
|
-
|
40
|
-
let b:match_skip =
|
41
|
-
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
42
|
-
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
|
43
|
-
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
|
44
|
-
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
|
45
|
-
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
46
|
-
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
|
47
|
-
endif
|
48
|
-
|
49
|
-
setlocal formatoptions-=t formatoptions+=croql
|
50
|
-
|
51
|
-
setlocal include=^\\s*\\<\\(load\\\|\w*require\\)\\>
|
52
|
-
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','')
|
53
|
-
setlocal suffixesadd=.rb
|
54
|
-
|
55
|
-
if exists("&ofu") && has("ruby")
|
56
|
-
setlocal omnifunc=rubycomplete#Complete
|
57
|
-
endif
|
58
|
-
|
59
|
-
" To activate, :set ballooneval
|
60
|
-
if has('balloon_eval') && exists('+balloonexpr')
|
61
|
-
setlocal balloonexpr=RubyBalloonexpr()
|
62
|
-
endif
|
63
|
-
|
64
|
-
|
65
|
-
" TODO:
|
66
|
-
"setlocal define=^\\s*def
|
67
|
-
|
68
|
-
setlocal comments=:#
|
69
|
-
setlocal commentstring=#\ %s
|
70
|
-
|
71
|
-
if !exists("s:rubypath")
|
72
|
-
if has("ruby") && has("win32")
|
73
|
-
ruby VIM::command( 'let s:rubypath = "%s"' % ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,}) )
|
74
|
-
let s:rubypath = '.,' . substitute(s:rubypath, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
|
75
|
-
elseif executable("ruby")
|
76
|
-
let s:code = "print ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,})"
|
77
|
-
if &shellxquote == "'"
|
78
|
-
let s:rubypath = system('ruby -e "' . s:code . '"')
|
79
|
-
else
|
80
|
-
let s:rubypath = system("ruby -e '" . s:code . "'")
|
81
|
-
endif
|
82
|
-
let s:rubypath = '.,' . substitute(s:rubypath, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
|
83
|
-
else
|
84
|
-
" If we can't call ruby to get its path, just default to using the
|
85
|
-
" current directory and the directory of the current file.
|
86
|
-
let s:rubypath = ".,,"
|
87
|
-
endif
|
88
|
-
endif
|
89
|
-
|
90
|
-
let &l:path = s:rubypath
|
91
|
-
|
92
|
-
if has("gui_win32") && !exists("b:browsefilter")
|
93
|
-
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
|
94
|
-
\ "All Files (*.*)\t*.*\n"
|
95
|
-
endif
|
96
|
-
|
97
|
-
let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< kp<"
|
98
|
-
\."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip"
|
99
|
-
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
|
100
|
-
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
101
|
-
|
102
|
-
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
103
|
-
|
104
|
-
noremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b')<CR>
|
105
|
-
noremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','')<CR>
|
106
|
-
noremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b')<CR>
|
107
|
-
noremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','')<CR>
|
108
|
-
|
109
|
-
noremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','b')<CR>
|
110
|
-
noremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','')<CR>
|
111
|
-
noremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','b')<CR>
|
112
|
-
noremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','')<CR>
|
113
|
-
|
114
|
-
let b:undo_ftplugin = b:undo_ftplugin
|
115
|
-
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
116
|
-
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
117
|
-
|
118
|
-
if maparg("\<C-]>",'n') == ''
|
119
|
-
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
120
|
-
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
121
|
-
nnoremap <silent> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
122
|
-
nnoremap <silent> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
123
|
-
nnoremap <silent> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
124
|
-
nnoremap <silent> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
125
|
-
nnoremap <silent> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
126
|
-
nnoremap <silent> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
127
|
-
nnoremap <silent> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
128
|
-
let b:undo_ftplugin = b:undo_ftplugin
|
129
|
-
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
|
130
|
-
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"
|
131
|
-
\."| sil! exe 'nunmap <buffer> <C-W>g<C-]>'| sil! exe 'nunmap <buffer> <C-W>g]'"
|
132
|
-
\."| sil! exe 'nunmap <buffer> <C-W>}'| sil! exe 'nunmap <buffer> <C-W>g}'"
|
133
|
-
endif
|
134
|
-
endif
|
135
|
-
|
136
|
-
let &cpo = s:cpo_save
|
137
|
-
unlet s:cpo_save
|
138
|
-
|
139
|
-
if exists("g:did_ruby_ftplugin_functions")
|
140
|
-
finish
|
141
|
-
endif
|
142
|
-
let g:did_ruby_ftplugin_functions = 1
|
143
|
-
|
144
|
-
function! RubyBalloonexpr()
|
145
|
-
if !exists('s:ri_found')
|
146
|
-
let s:ri_found = executable('ri')
|
147
|
-
endif
|
148
|
-
if s:ri_found
|
149
|
-
let line = getline(v:beval_lnum)
|
150
|
-
let b = matchstr(strpart(line,0,v:beval_col),'\%(\w\|[:.]\)*$')
|
151
|
-
let a = substitute(matchstr(strpart(line,v:beval_col),'^\w*\%([?!]\|\s*=\)\?'),'\s\+','','g')
|
152
|
-
let str = b.a
|
153
|
-
let before = strpart(line,0,v:beval_col-strlen(b))
|
154
|
-
let after = strpart(line,v:beval_col+strlen(a))
|
155
|
-
if str =~ '^\.'
|
156
|
-
let str = substitute(str,'^\.','#','g')
|
157
|
-
if before =~ '\]\s*$'
|
158
|
-
let str = 'Array'.str
|
159
|
-
elseif before =~ '}\s*$'
|
160
|
-
" False positives from blocks here
|
161
|
-
let str = 'Hash'.str
|
162
|
-
elseif before =~ "[\"'`]\\s*$" || before =~ '\$\d\+\s*$'
|
163
|
-
let str = 'String'.str
|
164
|
-
elseif before =~ '\$\d\+\.\d\+\s*$'
|
165
|
-
let str = 'Float'.str
|
166
|
-
elseif before =~ '\$\d\+\s*$'
|
167
|
-
let str = 'Integer'.str
|
168
|
-
elseif before =~ '/\s*$'
|
169
|
-
let str = 'Regexp'.str
|
170
|
-
else
|
171
|
-
let str = substitute(str,'^#','.','')
|
172
|
-
endif
|
173
|
-
endif
|
174
|
-
let str = substitute(str,'.*\.\s*to_f\s*\.\s*','Float#','')
|
175
|
-
let str = substitute(str,'.*\.\s*to_i\%(nt\)\=\s*\.\s*','Integer#','')
|
176
|
-
let str = substitute(str,'.*\.\s*to_s\%(tr\)\=\s*\.\s*','String#','')
|
177
|
-
let str = substitute(str,'.*\.\s*to_sym\s*\.\s*','Symbol#','')
|
178
|
-
let str = substitute(str,'.*\.\s*to_a\%(ry\)\=\s*\.\s*','Array#','')
|
179
|
-
let str = substitute(str,'.*\.\s*to_proc\s*\.\s*','Proc#','')
|
180
|
-
if str !~ '^\w'
|
181
|
-
return ''
|
182
|
-
endif
|
183
|
-
silent! let res = substitute(system("ri -f simple -T \"".str.'"'),'\n$','','')
|
184
|
-
if res =~ '^Nothing known about' || res =~ '^Bad argument:' || res =~ '^More than one method'
|
185
|
-
return ''
|
186
|
-
endif
|
187
|
-
return res
|
188
|
-
else
|
189
|
-
return ""
|
190
|
-
endif
|
191
|
-
endfunction
|
192
|
-
|
193
|
-
function! s:searchsyn(pattern,syn,flags)
|
194
|
-
norm! m'
|
195
|
-
let i = 0
|
196
|
-
let cnt = v:count ? v:count : 1
|
197
|
-
while i < cnt
|
198
|
-
let i = i + 1
|
199
|
-
let line = line('.')
|
200
|
-
let col = col('.')
|
201
|
-
let pos = search(a:pattern,'W'.a:flags)
|
202
|
-
while pos != 0 && s:synname() !~# a:syn
|
203
|
-
let pos = search(a:pattern,'W'.a:flags)
|
204
|
-
endwhile
|
205
|
-
if pos == 0
|
206
|
-
call cursor(line,col)
|
207
|
-
return
|
208
|
-
endif
|
209
|
-
endwhile
|
210
|
-
endfunction
|
211
|
-
|
212
|
-
function! s:synname()
|
213
|
-
return synIDattr(synID(line('.'),col('.'),0),'name')
|
214
|
-
endfunction
|
215
|
-
|
216
|
-
function! RubyCursorIdentifier()
|
217
|
-
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
218
|
-
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
219
|
-
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
220
|
-
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)'
|
221
|
-
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
222
|
-
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
223
|
-
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
224
|
-
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
225
|
-
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
226
|
-
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*:\=','','')
|
227
|
-
return stripped == '' ? expand("<cword>") : stripped
|
228
|
-
endfunction
|
229
|
-
|
230
|
-
"
|
231
|
-
" Instructions for enabling "matchit" support:
|
232
|
-
"
|
233
|
-
" 1. Look for the latest "matchit" plugin at
|
234
|
-
"
|
235
|
-
" http://www.vim.org/scripts/script.php?script_id=39
|
236
|
-
"
|
237
|
-
" It is also packaged with Vim, in the $VIMRUNTIME/macros directory.
|
238
|
-
"
|
239
|
-
" 2. Copy "matchit.txt" into a "doc" directory (e.g. $HOME/.vim/doc).
|
240
|
-
"
|
241
|
-
" 3. Copy "matchit.vim" into a "plugin" directory (e.g. $HOME/.vim/plugin).
|
242
|
-
"
|
243
|
-
" 4. Ensure this file (ftplugin/ruby.vim) is installed.
|
244
|
-
"
|
245
|
-
" 5. Ensure you have this line in your $HOME/.vimrc:
|
246
|
-
" filetype plugin on
|
247
|
-
"
|
248
|
-
" 6. Restart Vim and create the matchit documentation:
|
249
|
-
"
|
250
|
-
" :helptags ~/.vim/doc
|
251
|
-
"
|
252
|
-
" Now you can do ":help matchit", and you should be able to use "%" on Ruby
|
253
|
-
" keywords. Try ":echo b:match_words" to be sure.
|
254
|
-
"
|
255
|
-
" Thanks to Mark J. Reed for the instructions. See ":help vimrc" for the
|
256
|
-
" locations of plugin directories, etc., as there are several options, and it
|
257
|
-
" differs on Windows. Email gsinclair@soyabean.com.au if you need help.
|
258
|
-
"
|
259
|
-
|
260
|
-
" vim: nowrap sw=2 sts=2 ts=8:
|