utils 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/Rakefile +68 -0
  2. data/VERSION +1 -0
  3. data/bin/chroot-exec +12 -0
  4. data/bin/chroot-libs +18 -0
  5. data/bin/classify +37 -0
  6. data/bin/discover +137 -0
  7. data/bin/edit +74 -0
  8. data/bin/errf +32 -0
  9. data/bin/git-empty +8 -0
  10. data/bin/myex +90 -0
  11. data/bin/number_files +26 -0
  12. data/bin/same_files +37 -0
  13. data/bin/search +205 -0
  14. data/bin/sedit +3 -0
  15. data/bin/sshscreen +68 -0
  16. data/bin/term +21 -0
  17. data/bin/unquarantine_apps +8 -0
  18. data/bin/untest +17 -0
  19. data/bin/utils-install-config +10 -0
  20. data/bin/vacuum_firefox_sqlite +22 -0
  21. data/bin/xmp +74 -0
  22. data/lib/utils.rb +8 -0
  23. data/lib/utils/config.rb +23 -0
  24. data/lib/utils/config/gdb/asm +179 -0
  25. data/lib/utils/config/gdb/ruby +528 -0
  26. data/lib/utils/config/gdbinit +8 -0
  27. data/lib/utils/config/irbrc +455 -0
  28. data/lib/utils/config/rdebugrc +2 -0
  29. data/lib/utils/config/screenrc +143 -0
  30. data/lib/utils/config/vim/autoload/Align.vim +1029 -0
  31. data/lib/utils/config/vim/autoload/AlignMaps.vim +330 -0
  32. data/lib/utils/config/vim/autoload/rails.vim +4744 -0
  33. data/lib/utils/config/vim/autoload/rubycomplete.vim +801 -0
  34. data/lib/utils/config/vim/autoload/sqlcomplete.vim +741 -0
  35. data/lib/utils/config/vim/autoload/vimball.vim +750 -0
  36. data/lib/utils/config/vim/colors/flori.vim +113 -0
  37. data/lib/utils/config/vim/compiler/eruby.vim +40 -0
  38. data/lib/utils/config/vim/compiler/ruby.vim +67 -0
  39. data/lib/utils/config/vim/compiler/rubyunit.vim +34 -0
  40. data/lib/utils/config/vim/ftdetect/ragel.vim +2 -0
  41. data/lib/utils/config/vim/ftdetect/ruby.vim +17 -0
  42. data/lib/utils/config/vim/ftplugin/eruby.vim +100 -0
  43. data/lib/utils/config/vim/ftplugin/ruby.vim +260 -0
  44. data/lib/utils/config/vim/ftplugin/xml.vim +941 -0
  45. data/lib/utils/config/vim/indent/IndentAnything_html.vim +35 -0
  46. data/lib/utils/config/vim/indent/eruby.vim +77 -0
  47. data/lib/utils/config/vim/indent/javascript.vim +116 -0
  48. data/lib/utils/config/vim/indent/ruby.vim +377 -0
  49. data/lib/utils/config/vim/plugin/AlignMapsPlugin.vim +242 -0
  50. data/lib/utils/config/vim/plugin/AlignPlugin.vim +41 -0
  51. data/lib/utils/config/vim/plugin/Decho.vim +592 -0
  52. data/lib/utils/config/vim/plugin/IndentAnything.vim +675 -0
  53. data/lib/utils/config/vim/plugin/bufexplorer.vim +1144 -0
  54. data/lib/utils/config/vim/plugin/cecutil.vim +482 -0
  55. data/lib/utils/config/vim/plugin/fugitive.vim +1703 -0
  56. data/lib/utils/config/vim/plugin/lusty-explorer.vim +1509 -0
  57. data/lib/utils/config/vim/plugin/rails.vim +340 -0
  58. data/lib/utils/config/vim/plugin/rubyextra.vim +193 -0
  59. data/lib/utils/config/vim/plugin/surround.vim +628 -0
  60. data/lib/utils/config/vim/plugin/taglist.vim +4546 -0
  61. data/lib/utils/config/vim/plugin/test/IndentAnything/test.js +131 -0
  62. data/lib/utils/config/vim/plugin/vimballPlugin.vim +40 -0
  63. data/lib/utils/config/vim/syntax/Decho.vim +101 -0
  64. data/lib/utils/config/vim/syntax/eruby.vim +73 -0
  65. data/lib/utils/config/vim/syntax/javascript.vim +246 -0
  66. data/lib/utils/config/vim/syntax/ragel.vim +165 -0
  67. data/lib/utils/config/vim/syntax/ruby.vim +367 -0
  68. data/lib/utils/config/vimrc +461 -0
  69. data/lib/utils/file.rb +49 -0
  70. data/lib/utils/find.rb +54 -0
  71. data/lib/utils/md5.rb +23 -0
  72. data/lib/utils/patterns.rb +34 -0
  73. data/lib/utils/version.rb +8 -0
  74. data/utils.gemspec +33 -0
  75. metadata +183 -0
@@ -0,0 +1,461 @@
1
+ " Flori's vimrc
2
+
3
+ " General Settings
4
+ "set autochdir
5
+ "set wildmode=list:full
6
+ "set swapsync=
7
+ set autoindent
8
+ set autowrite
9
+ set backspace=indent,eol,start
10
+ set dictionary=/usr/dict/words
11
+ set digraph
12
+ set encoding=utf8
13
+ set errorformat+=%f:%l
14
+ set expandtab shiftwidth=2 tabstop=2
15
+ set foldcolumn=0
16
+ set formatoptions=cqrt
17
+ set fsync
18
+ set grepformat+=%f
19
+ set grepformat+=%f:%l
20
+ set hidden
21
+ set history=1000
22
+ set hlsearch
23
+ set laststatus=2
24
+ set makeprg=errf
25
+ set modelines=5
26
+ set mouse=nv
27
+ set mousehide
28
+ set nocindent
29
+ set nocompatible
30
+ set nocursorcolumn
31
+ set nocursorline
32
+ set nofoldenable
33
+ set noignorecase
34
+ set noincsearch
35
+ set nojoinspaces
36
+ set nopaste
37
+ set nosmartcase
38
+ set nosmartindent
39
+ set nowrap
40
+ set nonumber
41
+ set ruler
42
+ set shortmess=atI
43
+ set showcmd
44
+ set showmatch
45
+ set showmode
46
+ set smarttab
47
+ set statusline=%<%f%m%r%=%(%Bh=%bd%)@%(%l:%c\%)%4P
48
+ set swapsync="fsync"
49
+ set termencoding=utf8
50
+ set title
51
+ set ttyfast
52
+ set viminfo='20,<50,s10,h,!
53
+ set visualbell t_vb=
54
+ set wildchar=<TAB>
55
+ set wildmenu
56
+ set winminheight=0
57
+
58
+ filetype on
59
+ filetype indent on
60
+ filetype plugin on
61
+ source $VIMRUNTIME/macros/matchit.vim
62
+
63
+ " Configure GUIs
64
+ if has("gui_running")
65
+ set guipty
66
+ colorscheme flori
67
+ hi Pmenu ctermbg=Grey guibg=DarkGrey
68
+ set guioptions-=r
69
+ if exists("+guioptions")
70
+ set guioptions+=c
71
+ end
72
+ if has("gui_win32")
73
+ set guifont=DejaVu\ Sans\ Mono:h12
74
+ "set antialias
75
+ if exists("+guioptions")
76
+ set guioptions-=T
77
+ set guioptions-=m
78
+ set guioptions+=p
79
+ endif
80
+ elseif has("gui_gtk2")
81
+ set guifont=DejaVu\ Sans\ Mono\ 12
82
+ if exists("+guioptions")
83
+ set guioptions-=T
84
+ set guioptions-=m
85
+ set guioptions+=p
86
+ endif
87
+ set guiheadroom=0
88
+ set columns=80
89
+ set lines=59
90
+ elseif has("gui_mac") || has("gui_macvim")
91
+ set guifont=DejaVu\ Sans\ Mono:h14
92
+ if exists("+guioptions")
93
+ set guioptions-=T
94
+ set guioptions-=m
95
+ set guioptions+=p
96
+ endif
97
+ set antialias
98
+ set guiheadroom=0
99
+ "set macatsui
100
+ set columns=80
101
+ set lines=71
102
+ elseif has("x11")
103
+ set guifont=-b&h-lucidatypewriter-*-*-normal-*-17-*-*-*-*-*-iso10646-*
104
+ if exists("+guioptions")
105
+ set guioptions-=T
106
+ set guioptions-=m
107
+ endif
108
+ end
109
+ else
110
+ set background=dark
111
+ hi DiffAdd ctermbg=green
112
+ hi DiffChange ctermbg=blue
113
+ hi DiffText ctermbg=gray
114
+ hi DiffDelete ctermbg=red
115
+ end
116
+
117
+ " Syntax
118
+ let ruby_operators=1
119
+ if has("syntax")
120
+ syntax on
121
+ endif
122
+
123
+ " Browsing
124
+ if has("browse")
125
+ let g:explVertical=0
126
+ " let g:explSplitRight=1
127
+ let g:explSplitBelow=0
128
+ " let g:explStartRight=0
129
+ let g:explStartBelow=1
130
+ let g:explDetailedList=1
131
+ let g:explDateFormat="%Y-%m-%d %H:%M:%S"
132
+ " let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$'
133
+ let g:explUseSeparators=1 " Use separator lines
134
+ endif
135
+
136
+ let g:netrw_longlist=1
137
+ let g:netrw_use_noswf= 0
138
+ let g:netrw_hide=1
139
+ let g:netrw_list_hidee='\..*\.sw[pon]$'
140
+
141
+ let g:rails_statusline=0
142
+ let g:LustyJugglerSuppressRubyWarning=1
143
+
144
+ " CScope
145
+ if has("cscope")
146
+ " set csprg=/usr/local/bin/cscope
147
+ set cscopetagorder=0
148
+ set cscopetag
149
+ set nocsverb
150
+ " add any database in current directory
151
+ if filereadable("cscope.out")
152
+ cs add cscope.out
153
+ " else add database pointed to by environment
154
+ elseif $CSCOPE_DB != ""
155
+ cs add $CSCOPE_DB
156
+ endif
157
+ set csverb
158
+ endif
159
+
160
+ " Mappings
161
+ let mapleader=","
162
+ let maplocalleader=","
163
+ " open another file in this files directory
164
+ map <leader>e :e <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
165
+ map <leader>t :tabe <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
166
+ map <leader>s :split <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
167
+ map <leader>c :cd <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
168
+ " Switch of search highlighting
169
+ map <silent> <F9> :nohlsearch<CR>
170
+ if has("fullscreen")
171
+ set fuoptions=maxhorz,maxvert
172
+ function! Cfullscreen()
173
+ if &fullscreen == "1"
174
+ set nofullscreen
175
+ else
176
+ set fullscreen
177
+ endif
178
+ endfunction
179
+ map <silent> <F11> :call Cfullscreen()<CR>
180
+ endif
181
+ function! Ctoggle()
182
+ if &buftype == "quickfix"
183
+ cclose
184
+ else
185
+ copen
186
+ endif
187
+ endfunction
188
+ nnoremap <silent> <F12> :call Ctoggle()<CR>
189
+
190
+ " Switch Windows
191
+ map <C-j> <C-W>j<C-W>_
192
+ map <C-k> <C-W>k<C-W>_
193
+ " Switch Buffers
194
+ map <C-l> <ESC>:bn<CR>
195
+ map <C-h> <ESC>:bp<CR>
196
+ " Configure navigation keys
197
+ " noremap <Up> <Nop>
198
+ " noremap <Down> <Nop>
199
+ " noremap <Left> <Nop>
200
+ " noremap <Right> <Nop>
201
+ " noremap <Ins> <Nop>
202
+ " noremap <End> <Nop>
203
+ " noremap <Home> <Nop>
204
+ " noremap <End> <Nop>
205
+ " noremap <PageUp> <Nop>
206
+ " noremap <PageDown> <Nop>
207
+ cnoremap <C-A> <Home>
208
+ cnoremap <C-F> <Right>
209
+ cnoremap <C-B> <Left>
210
+ cnoremap <Esc>b <S-Left>
211
+ cnoremap <Esc>f <S-Right>
212
+ vnoremap < <gv
213
+ vnoremap > >gv
214
+ " Marks
215
+ nnoremap ' `
216
+ nnoremap ` '
217
+
218
+ if has("autocmd")
219
+ " Auto Command - Hooks
220
+ augroup gzip
221
+ autocmd!
222
+ autocmd BufReadPre,FileReadPre *.gz setl bin
223
+ autocmd BufReadPost,FileReadPost *.gz '[,']!gzip -d
224
+ autocmd BufReadPost,FileReadPost *.gz setl nobin
225
+ autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
226
+ autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
227
+ autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
228
+ autocmd FileAppendPre *.gz !gzip -d <afile>
229
+ autocmd FileAppendPre *.gz !mv <afile>:r <afile>
230
+ autocmd FileAppendPost *.gz !mv <afile> <afile>:r
231
+ autocmd FileAppendPost *.gz !gzip <afile>:r
232
+ augroup END
233
+
234
+ augroup bzip2
235
+ autocmd!
236
+ autocmd BufReadPre,FileReadPre *.bz2 setl bin
237
+ autocmd BufReadPost,FileReadPost *.bz2 '[,']!bzip2 -d
238
+ autocmd BufReadPost,FileReadPost *.bz2 setl nobin
239
+ autocmd BufReadPost,FileReadPost *.bz2 execute ":doautocmd BufReadPost " . expand("%:r")
240
+ autocmd BufWritePost,FileWritePost *.bz2 !mv <afile> <afile>:r
241
+ autocmd BufWritePost,FileWritePost *.bz2 !bzip2 <afile>:r
242
+ autocmd FileAppendPre *.bz2 !bz2ip -d <afile>
243
+ autocmd FileAppendPre *.bz2 !mv <afile>:r <afile>
244
+ autocmd FileAppendPost *.bz2 !mv <afile> <afile>:r
245
+ autocmd FileAppendPost *.bz2 !bzip2 -d <afile>:r
246
+ augroup END
247
+
248
+ augroup tex
249
+ autocmd!
250
+ autocmd FileType tex map <buffer> <F1> <ESC>:!latex %<CR><CR>
251
+ autocmd FileType tex map <buffer> <F2> <ESC>:!dvips `echo %\|sed -e 's/tex/dvi/'`<CR><CR>
252
+ autocmd FileType tex map <buffer> <F3> <ESC><F1>:!xdvi -s 0 `echo %\|sed -e 's/tex/dvi/'` &<CR><CR>
253
+ autocmd FileType tex map <buffer> <F4> <ESC><F1><F2>:!gv `echo %\|sed -e 's/tex/ps/'` &<CR><CR>
254
+ autocmd FileType tex map <buffer> <F5> <ESC>:!pdflatex %<CR><CR><CR>
255
+ autocmd FileType tex map <buffer> <F6> <ESC><F1>:!acroread `echo %\|sed -e 's/tex/pdf/'`<CR><CR>
256
+ augroup END
257
+
258
+ augroup c
259
+ autocmd!
260
+ autocmd FileType c setl sw=4 ts=4 cinoptions= formatoptions=cqrol cindent
261
+ autocmd FileType c map <buffer> <F1> <ESC>:make<CR>
262
+ autocmd FileType c map <buffer> <F2> <ESC>:%!indent 2>/dev/null -kr -i 4<CR><CR>
263
+ autocmd FileType c map <buffer> <F3> <ESC>:make clean<CR>
264
+ autocmd FileType c map <buffer> <F4> <ESC><Home>i/* <ESC><End>a */<ESC>
265
+ augroup END
266
+
267
+ augroup pascal
268
+ autocmd!
269
+ autocmd FileType pascal setl et st=2 sw=2 autoindent
270
+ autocmd FileType pascal map <buffer> <F1> <ESC>:!gpc -o `echo %\|sed -e 's/\.pas//'` %<CR>
271
+ autocmd FileType pascal map <buffer> <F4> <ESC><Home>i{ <ESC><End>a }<ESC>
272
+ augroup END
273
+
274
+ augroup perl
275
+ autocmd!
276
+ autocmd Filetype perl setl et sw=4 ts=4 autoindent
277
+ autocmd FileType perl map <buffer> <F1> <ESC>:w<CR><ESC>:!perl -c %<CR>
278
+ autocmd FileType perl map <buffer> <F2> <ESC>:w<CR><ESC>:!perl -Tc %<CR>
279
+ autocmd FileType perl map <buffer> <F3> <ESC>:w<CR><ESC>:.!perl -lne '/^(sub\s+\S+\s*\([^)]*\))\s*\{/ and print "$1;"' %<CR>
280
+ autocmd FileType perl map <buffer> <F4> <ESC>:w<CR><ESC>:%!perl -pe 's/(sub \w+ *)\(.*\) */$1/'<CR>
281
+ autocmd FileType perl map <buffer> <F5> <ESC><Home>i#<ESC>
282
+ autocmd FileType perl map <buffer> <F6> <ESC>:w<CR><ESC>:!perl -I lib -I cfg %<CR>
283
+ augroup END
284
+
285
+ augroup ruby
286
+ autocmd!
287
+ autocmd FileType ruby setl et sw=2 ts=2 autoindent keywordprg=ri\ --no-pager
288
+ autocmd FileType ruby map <buffer> <F1> <ESC>:w<CR><ESC>:!RUBYOPT="$RUBYOPT -Iext:lib:test:tests" ruby -wc %<CR>
289
+ autocmd FileType ruby map <buffer> <F2> <ESC>:w<CR><ESC>:!RUBYOPT="$RUBYOPT -Iext:lib:test:tests" ruby % \| ruby -S decolor<CR>
290
+ autocmd FileType ruby map <buffer> <F3> <ESC>:w<CR><ESC>:!rcov -Iext:lib:test:tests %<CR>
291
+ autocmd FileType ruby map <buffer> <F4> <ESC><Home>i#<ESC>
292
+ autocmd FileType ruby map <buffer> <silent> <F5> !xmp ruby<cr>
293
+ autocmd FileType ruby nmap <buffer> <silent> <F5> V<F5>
294
+ autocmd FileType ruby imap <buffer> <silent> <F5> <ESC><F5>a
295
+ autocmd FileType ruby map <buffer> <silent> <F6> <ESC>:w<CR><ESC>:%!xmp ruby -Iext:lib -w<CR>
296
+ autocmd FileType ruby map <buffer> <silent> <F7> <ESC>:w<CR><ESC>:%!RUBYOPT="" xmp /usr/local/ruby-1.9/bin/ruby -Iext:lib -w <CR>
297
+ autocmd FileType ruby map <buffer> <silent> <F8> <ESC>:!exuberant-ctags 2>/dev/null -R .<CR>
298
+ autocmd FileType ruby setl suffixesadd=.rb,.h,.c
299
+ autocmd FileType ruby setl path+=lib/**
300
+ autocmd FileType ruby setl path+=test/**
301
+ autocmd FileType ruby setl path+=tests/**
302
+ autocmd FileType ruby imap <C-l> <C-k>l*
303
+ augroup END
304
+
305
+ augroup javascript
306
+ autocmd!
307
+ autocmd BufNewFile,BufRead *.json setl filetype=javascript
308
+ autocmd FileType javascript setl et sw=2 ts=2 cindent
309
+ augroup end
310
+
311
+ augroup java
312
+ autocmd!
313
+ autocmd FileType java setl cindent et sw=4 ts=4
314
+ autocmd FileType java map <buffer> <F1> <ESC>:w<CR>:!javac -deprecation %<CR>
315
+ autocmd FileType java map <buffer> <F2> <ESC>:w<CR>:!javac %<CR>
316
+ autocmd FileType java map <buffer> <F3> <ESC>:!rm `echo %\|sed -e 's/java/class/'`<CR>
317
+ autocmd FileType java map <buffer> <F4> <ESC><Home>i//<ESC>
318
+ autocmd FileType java map <buffer> <F5> <ESC>:w<CR><ESC>:!astyle -j %<CR>:n %<CR>
319
+ autocmd FileType java nnoremap <buffer> <silent> <F8> :JavaBrowser<CR>
320
+ autocmd FileType java let JavaBrowser_Ctags_Cmd = '/usr/bin/exuberant-ctags'
321
+ autocmd FileType java let JavaBrowser_Sort_Type = "name"
322
+ autocmd FileType java let JavaBrowser_Display_Prototype = 1
323
+ autocmd FileType java let JavaBrowser_Use_SingleClick = 0
324
+ augroup END
325
+
326
+ augroup lisp
327
+ autocmd!
328
+ autocmd FileType lisp setl lisp autoindent
329
+ augroup END
330
+
331
+ augroup scheme
332
+ autocmd!
333
+ autocmd FileType scheme setl lisp autoindent
334
+ augroup END
335
+
336
+ augroup ocaml
337
+ autocmd!
338
+ autocmd FileType ocaml setl et sw=2 ts=2 autoindent
339
+ augroup END
340
+
341
+ augroup xml
342
+ autocmd!
343
+ autocmd BufNewFile,BufRead *.jsf,*.jsp,*.babel,*.konfetti,*.tag,*.tld setl filetype=xml
344
+ autocmd FileType xml setl et sw=2 ts=2 autoindent
345
+ autocmd FileType xml map <buffer> <F1> <ESC>:w<CR><ESC>:!tidy -xml -raw -e %<CR>
346
+ autocmd FileType xml map <buffer> <F2> <ESC>:%!tidy -xml -raw -i 2>/dev/null<CR><CR>
347
+ augroup END
348
+
349
+ augroup html
350
+ autocmd!
351
+ autocmd FileType xml setl et sw=2 ts=2 autoindent
352
+ autocmd FileType html map <buffer> <F1> <ESC>:w<CR><ESC>:!tidy -e %<CR>
353
+ autocmd FileType html map <buffer> <F2> <ESC>:%!tidy -wrap 72 -iu 2>/dev/null<CR><CR>
354
+ augroup END
355
+
356
+ augroup html2
357
+ autocmd!
358
+ autocmd BufReadPre,FileReadPre *.html.* map <buffer> <F1> <ESC>:w<CR><ESC>:!tidy -e %<CR>
359
+ autocmd BufReadPre,FileReadPre *.html.* map <buffer> <F2> <ESC>:%!tidy -wrap 72 -iu 2>/dev/null<CR><CR>
360
+ autocmd BufReadPre,FileReadPre *.html.* so $VIMRUNTIME/syntax/html.vim
361
+ augroup END
362
+
363
+ augroup misc
364
+ autocmd!
365
+ autocmd BufWritePost ~/.vimrc so ~/.vimrc
366
+ augroup END
367
+
368
+ augroup mutt
369
+ autocmd!
370
+ autocmd BufNewFile,BufRead mutt-* setl textwidth=72
371
+ augroup END
372
+ endif
373
+
374
+ function! Cfind(...)
375
+ if a:0 == 0
376
+ let args = [ expand( '<cword>') ]
377
+ else
378
+ let args = copy(a:000)
379
+ endif
380
+ set grepprg=discover
381
+ exec "silent gr -a 'a-zA-Z0-9' -c -i " . join(map(copy(args), 'shellescape(v:val)'), ' ')
382
+ copen
383
+ endfunction
384
+
385
+ function! Cgrep(...)
386
+ if a:0 == 0
387
+ let args = [ expand( '<cword>') ]
388
+ else
389
+ let args = copy(a:000)
390
+ endif
391
+ set grepprg=search
392
+ exec "silent gr -c -i " . join(map(args, 'shellescape(v:val)'), ' ')
393
+ copen
394
+ endfunction
395
+
396
+ function! Ctest(...)
397
+ exec 'w'
398
+ if a:0 == 0
399
+ let name = expand('<cword>')
400
+ else
401
+ let name = a:1
402
+ endif
403
+ exec 'make ' . expand('%') . ' ' . name
404
+ endfunction
405
+
406
+ function! Cclassify(...)
407
+ if a:0 == 0
408
+ let args = [ expand( '<cword>') ]
409
+ else
410
+ let args = copy(a:000)
411
+ endif
412
+ let output = system("classify -b " . join(map(copy(args), 'shellescape(v:val)'), ' '))
413
+ execute "normal a" . output
414
+ endfunction
415
+
416
+ function! CpathClassify(...)
417
+ if a:0 == 0
418
+ let args = [ expand( '<cword>') ]
419
+ else
420
+ let args = copy(a:000)
421
+ endif
422
+ let output = system("classify " . join(map(copy(args), 'shellescape(v:val)'), ' '))
423
+ execute "normal a" . output
424
+ endfunction
425
+
426
+ function! Cdeclassify(...)
427
+ if a:0 == 0
428
+ let args = [ expand( '<cword>') ]
429
+ else
430
+ let args = copy(a:000)
431
+ endif
432
+ let output = system("classify -d " . join(map(copy(args), 'shellescape(v:val)'), ' '))
433
+ execute "normal a" . output
434
+ endfunction
435
+
436
+ comclear
437
+ command -bar -nargs=1 OpenURL :!open <args>
438
+ command -bar -nargs=* -complete=file Find :call Cfind(<f-args>)
439
+ command -bar -nargs=* -complete=file Grep :call Cgrep(<f-args>)
440
+ command -bar -nargs=* -complete=file Test :call Ctest(<f-args>)
441
+ command -bar -nargs=* -complete=file Classify :call Cclassify(<f-args>)
442
+ command -bar -nargs=* -complete=file PathClassify :call CpathClassify(<f-args>)
443
+ command -bar -nargs=* -complete=file Declassify :call Cdeclassify(<f-args>)
444
+
445
+ function! Iexec(cmd)
446
+ let output = system(a:cmd)
447
+ execute "normal a" . output
448
+ endfunction
449
+
450
+ function! Itime(fmt)
451
+ execute "normal a" . strftime(a:fmt)
452
+ endfunction
453
+
454
+ " Abbreviations
455
+ iabclear
456
+ iabbrev I_MFG Mit freundlichen Grüssen,<CR><CR>Florian Frank
457
+ iabbrev I_DATE <ESC>:call Itime("%F")<CR>
458
+ iabbrev I_DATETIME <ESC>:call Itime("%F %T")<CR>
459
+ iabbrev I_TIME <ESC>:call Itime("%T")<CR>
460
+ iabbrev I_KLASS <ESC>:call Iexec("classify -b " . expand('%'))<CR>
461
+ iabbrev I_PATH_KLASS <ESC>:call Iexec("classify " . expand('%'))<CR>