tomkersten-vixploder 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +105 -0
- data/PostInstall.txt +21 -0
- data/README.rdoc +131 -0
- data/Rakefile +21 -0
- data/bin/256colors2.pl +63 -0
- data/bin/colortest +365 -0
- data/bin/vixplode +10 -0
- data/lib/dotfiles/aliases +30 -0
- data/lib/dotfiles/gvimrc +20 -0
- data/lib/dotfiles/vim/.VimballRecord +2 -0
- data/lib/dotfiles/vim/after/ftplugin/actionscript_snippets.vim +9 -0
- data/lib/dotfiles/vim/after/ftplugin/aspvbs_snippets.vim +17 -0
- data/lib/dotfiles/vim/after/ftplugin/c_snippets.vim +58 -0
- data/lib/dotfiles/vim/after/ftplugin/css_snippets.vim +30 -0
- data/lib/dotfiles/vim/after/ftplugin/django_model_snippets.vim +61 -0
- data/lib/dotfiles/vim/after/ftplugin/django_template_snippets.vim +32 -0
- data/lib/dotfiles/vim/after/ftplugin/f-script_snippets.vim +14 -0
- data/lib/dotfiles/vim/after/ftplugin/haskell_snippets.vim +9 -0
- data/lib/dotfiles/vim/after/ftplugin/html_snippets.vim +57 -0
- data/lib/dotfiles/vim/after/ftplugin/java_snippets.vim +52 -0
- data/lib/dotfiles/vim/after/ftplugin/javascript_snippets.vim +10 -0
- data/lib/dotfiles/vim/after/ftplugin/latex_snippets.vim +13 -0
- data/lib/dotfiles/vim/after/ftplugin/logo_snippets.vim +9 -0
- data/lib/dotfiles/vim/after/ftplugin/markdown_snippets.vim +10 -0
- data/lib/dotfiles/vim/after/ftplugin/movable_type_snippets.vim +14 -0
- data/lib/dotfiles/vim/after/ftplugin/objc_snippets.vim +53 -0
- data/lib/dotfiles/vim/after/ftplugin/ocaml_snippets.vim +26 -0
- data/lib/dotfiles/vim/after/ftplugin/perl_snippets.vim +23 -0
- data/lib/dotfiles/vim/after/ftplugin/php_snippets.vim +30 -0
- data/lib/dotfiles/vim/after/ftplugin/phpdoc_snippets.vim +19 -0
- data/lib/dotfiles/vim/after/ftplugin/propel_snippets.vim +14 -0
- data/lib/dotfiles/vim/after/ftplugin/python_snippets.vim +202 -0
- data/lib/dotfiles/vim/after/ftplugin/rails_snippets.vim +54 -0
- data/lib/dotfiles/vim/after/ftplugin/ruby_snippets.vim +32 -0
- data/lib/dotfiles/vim/after/ftplugin/sh_snippets.vim +12 -0
- data/lib/dotfiles/vim/after/ftplugin/slate_snippets.vim +19 -0
- data/lib/dotfiles/vim/after/ftplugin/smarty_snippets.vim +35 -0
- data/lib/dotfiles/vim/after/ftplugin/symfony_snippets.vim +21 -0
- data/lib/dotfiles/vim/after/ftplugin/tcl_snippets.vim +14 -0
- data/lib/dotfiles/vim/after/ftplugin/template_toolkit_snippets.vim +13 -0
- data/lib/dotfiles/vim/after/ftplugin/tex_snippets.vim +13 -0
- data/lib/dotfiles/vim/after/ftplugin/xhtml_snippets.vim +48 -0
- data/lib/dotfiles/vim/autoload/fakeclip.vim +253 -0
- data/lib/dotfiles/vim/autoload/rails.vim +4377 -0
- data/lib/dotfiles/vim/autoload/rubycomplete.vim +802 -0
- data/lib/dotfiles/vim/colors/inkpot.vim +212 -0
- data/lib/dotfiles/vim/colors/ir_black.vim +212 -0
- data/lib/dotfiles/vim/colors/ir_black_mod.vim +213 -0
- data/lib/dotfiles/vim/colors/railscasts.vim +100 -0
- data/lib/dotfiles/vim/colors/rubyblue.vim +74 -0
- data/lib/dotfiles/vim/colors/twilight.vim +75 -0
- data/lib/dotfiles/vim/colors/twilight2.vim +74 -0
- data/lib/dotfiles/vim/colors/wombat256.vim +302 -0
- data/lib/dotfiles/vim/compiler/eruby.vim +41 -0
- data/lib/dotfiles/vim/compiler/ruby.vim +68 -0
- data/lib/dotfiles/vim/compiler/rubyunit.vim +35 -0
- data/lib/dotfiles/vim/doc/NERD_tree.txt +1235 -0
- data/lib/dotfiles/vim/doc/fakeclip.txt +190 -0
- data/lib/dotfiles/vim/doc/matchit.txt +406 -0
- data/lib/dotfiles/vim/doc/project.txt +710 -0
- data/lib/dotfiles/vim/doc/rails.txt +1123 -0
- data/lib/dotfiles/vim/doc/snippets_emu.txt +354 -0
- data/lib/dotfiles/vim/doc/surround.txt +218 -0
- data/lib/dotfiles/vim/doc/tags +433 -0
- data/lib/dotfiles/vim/filetype.vim +13 -0
- data/lib/dotfiles/vim/ftdetect/gist.vim +3 -0
- data/lib/dotfiles/vim/ftdetect/ruby.vim +14 -0
- data/lib/dotfiles/vim/ftplugin/eruby.vim +101 -0
- data/lib/dotfiles/vim/ftplugin/ruby.vim +230 -0
- data/lib/dotfiles/vim/indent/eruby.vim +73 -0
- data/lib/dotfiles/vim/indent/ruby.vim +373 -0
- data/lib/dotfiles/vim/plugin/NERD_tree.vim +3536 -0
- data/lib/dotfiles/vim/plugin/comments.vim +321 -0
- data/lib/dotfiles/vim/plugin/fakeclip.vim +174 -0
- data/lib/dotfiles/vim/plugin/fuzzyfinder.vim +1676 -0
- data/lib/dotfiles/vim/plugin/fuzzyfinder_textmate.vim +150 -0
- data/lib/dotfiles/vim/plugin/gist.vim +241 -0
- data/lib/dotfiles/vim/plugin/gitdiff.vim +141 -0
- data/lib/dotfiles/vim/plugin/matchit.vim +812 -0
- data/lib/dotfiles/vim/plugin/mru.vim +787 -0
- data/lib/dotfiles/vim/plugin/rails.vim +310 -0
- data/lib/dotfiles/vim/plugin/rspec.vim +12 -0
- data/lib/dotfiles/vim/plugin/snippets.vim +17 -0
- data/lib/dotfiles/vim/plugin/snippetsEmu.vim +973 -0
- data/lib/dotfiles/vim/plugin/supertab.vim +531 -0
- data/lib/dotfiles/vim/plugin/surround.vim +632 -0
- data/lib/dotfiles/vim/ref_vimrc +80 -0
- data/lib/dotfiles/vim/ruby/fuzzy_file_finder.rb +353 -0
- data/lib/dotfiles/vim/syntax/eruby.vim +85 -0
- data/lib/dotfiles/vim/syntax/haml.vim +113 -0
- data/lib/dotfiles/vim/syntax/mkd.vim +86 -0
- data/lib/dotfiles/vim/syntax/ruby.vim +324 -0
- data/lib/dotfiles/vim/syntax/sass.vim +93 -0
- data/lib/dotfiles/vimrc +269 -0
- data/lib/vixplode/cli.rb +73 -0
- data/lib/vixploder.rb +6 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/vixplode_cli_spec.rb +15 -0
- data/spec/vixploder_spec.rb +7 -0
- data/tasks/rspec.rake +21 -0
- metadata +202 -8
@@ -0,0 +1,10 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet img ![".st."altText".et."](".st."SRC".et.")".st.et
|
10
|
+
exec "Snippet link [".st."desc".et."](".st."HREF".et.")".st.et
|
@@ -0,0 +1,14 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet cat <$MTCategoryDescription$>".st.et
|
10
|
+
exec "Snippet blog <$MTBlogName$>".st.et
|
11
|
+
exec "Snippet archive <$MTArchiveFile$>".st.et
|
12
|
+
exec "Snippet cal <MTCalendarIfEntries><CR><Tab>".st.et."<CR></MTCalendarIfEntries><CR>".st.et
|
13
|
+
exec "Snippet entry <$MTEntryMore$>".st.et
|
14
|
+
exec "Snippet entries <MTEntriesHeader><CR><Tab>".st.et."<CR></MTEntriesHeader><CR>".st.et
|
@@ -0,0 +1,53 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
function! UpFirst()
|
6
|
+
return substitute(@z,'.','\u&','')
|
7
|
+
endfunction
|
8
|
+
|
9
|
+
function! Count(haystack, needle)
|
10
|
+
let counter = 0
|
11
|
+
let index = match(a:haystack, a:needle)
|
12
|
+
while index > -1
|
13
|
+
let counter = counter + 1
|
14
|
+
let index = match(a:haystack, a:needle, index+1)
|
15
|
+
endwhile
|
16
|
+
return counter
|
17
|
+
endfunction
|
18
|
+
|
19
|
+
function! ObjCArgList(count)
|
20
|
+
let st = g:snip_start_tag
|
21
|
+
let et = g:snip_end_tag
|
22
|
+
|
23
|
+
if a:count == 0
|
24
|
+
return st.et
|
25
|
+
else
|
26
|
+
return st.et.repeat(', '.st.et, a:count)
|
27
|
+
endif
|
28
|
+
endfunction
|
29
|
+
|
30
|
+
|
31
|
+
let st = g:snip_start_tag
|
32
|
+
let et = g:snip_end_tag
|
33
|
+
let cd = g:snip_elem_delim
|
34
|
+
|
35
|
+
exec "Snippet cat @interface ".st."NSObject".et." (".st."Category".et.")<CR><CR>@end<CR><CR><CR>@implementation ".st."NSObject".et." (".st."Category".et.")<CR><CR>".st.et."<CR><CR>@end<CR>".st.et
|
36
|
+
exec "Snippet delacc - (id)delegate;<CR><CR>- (void)setDelegate:(id)delegate;<CR>".st.et
|
37
|
+
exec "Snippet ibo IBOutlet ".st."NSSomeClass".et." *".st."someClass".et.";<CR>".st.et
|
38
|
+
exec "Snippet dict NSMutableDictionary *".st."dict".et." = [NSMutableDictionary dictionary];<CR>".st.et
|
39
|
+
exec "Snippet Imp #import <".st.et.".h><CR>".st.et
|
40
|
+
exec "Snippet objc @interface ".st."class".et." : ".st."NSObject".et."<CR>{<CR>}<CR>@end<CR><CR>@implementation ".st."class".et."<CR>- (id)init<CR>{<CR>self = [super init]; <CR>if (self != nil)<CR>{<CR>".st.et."<CR>}<CR>return self;<CR>}<CR>@end<CR>".st.et
|
41
|
+
exec "Snippet imp #import \"".st.et.".h\"<CR>".st.et
|
42
|
+
exec "Snippet bez NSBezierPath *".st."path".et." = [NSBezierPath bezierPath];<CR>".st.et
|
43
|
+
exec "Snippet acc - (".st."\"unsigned int\"".et.")".st."thing".et."<CR>{<CR>return ".st."fThing".et.";<CR>}<CR><CR>- (void)set".st."thing:UpFirst()".et.":(".st."\"unsigned int\"".et.")new".st."thing:UpFirst()".et."<CR>{<CR>".st."fThing".et." = new".st."thing:UpFirst()".et.";<CR>}<CR>".st.et
|
44
|
+
exec "Snippet format [NSString stringWithFormat:@\"".st.et."\", ".st.et."]".st.et
|
45
|
+
exec "Snippet focus [self lockFocus];<CR><CR>".st.et."<CR><CR>[self unlockFocus];<CR>".st.et
|
46
|
+
exec "Snippet setprefs [[NSUserDefaults standardUserDefaults] setObject:".st."object".et." forKey:".st."key".et."];<CR>".st.et
|
47
|
+
exec "Snippet log NSLog(@\"%s".st."s".et."\", ".st."s:ObjCArgList(Count(@z, '%[^%]'))".et.");".st.et
|
48
|
+
exec "Snippet gsave [NSGraphicsContext saveGraphicsState];<CR>".st.et."<CR>[NSGraphicsContext restoreGraphicsState];<CR>".st.et
|
49
|
+
exec "Snippet forarray for(unsigned int index = 0; index < [".st."array".et." count]; index += 1)<CR>{<CR>".st."id".et."object = [".st."array".et." objectAtIndex:index];<CR>".st.et."<CR>}".st.et
|
50
|
+
exec "Snippet classi @interface ".st."ClassName".et." : ".st."NSObject".et."<CR><CR>{".st.et."<CR><CR>}<CR><CR>".st.et."<CR><CR>@end<CR>".st.et
|
51
|
+
exec "Snippet array NSMutableArray *".st."array".et." = [NSMutableArray array];".st.et
|
52
|
+
exec "Snippet getprefs [[NSUserDefaults standardUserDefaults] objectForKey:<key>];".st.et
|
53
|
+
exec "Snippet cati @interface ".st."NSObject".et." (".st."Category".et.")<CR><CR>".st.et."<CR><CR>@end<CR>".st.et
|
@@ -0,0 +1,26 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet Queue Queue.fold ".st.et." ".st."base".et." ".st."q".et."<CR>".st.et
|
10
|
+
exec "Snippet Nativeint Nativeint.abs ".st."ni".et.st.et
|
11
|
+
exec "Snippet Printexc Printexc.print ".st."fn".et." ".st."x".et.st.et
|
12
|
+
exec "Snippet Sys Sys.Signal_ignore".st.et
|
13
|
+
exec "Snippet Hashtbl Hashtbl.iter ".st.et." ".st."h".et.st.et
|
14
|
+
exec "Snippet Array Array.map ".st.et." ".st."arr".et.st.et
|
15
|
+
exec "Snippet Printf Printf.fprintf ".st."buf".et." \"".st."format".et."\" ".st."args".et.st.et
|
16
|
+
exec "Snippet Stream Stream.iter ".st.et." ".st."stream".et.st.et
|
17
|
+
exec "Snippet Buffer Buffer.add_channel ".st."buf".et." ".st."ic".et." ".st."len".et.st.et
|
18
|
+
exec "Snippet Int32 Int32.abs ".st."i32".et.st.et
|
19
|
+
exec "Snippet List List.rev_map ".st.et." ".st."lst".et.st.et
|
20
|
+
exec "Snippet Scanf Scanf.bscaf ".st."sbuf".et." \"".st."format".et."\" ".st."f".et.st.et
|
21
|
+
exec "Snippet Int64 Int64.abs ".st."i64".et.st.et
|
22
|
+
exec "Snippet Map Map.Make ".st.et
|
23
|
+
exec "Snippet String String.iter ".st.et." ".st."str".et.st.et
|
24
|
+
exec "Snippet Genlex Genlex.make_lexer ".st."\"tok_lst\"".et." ".st."\"char_stream\"".et.st.et
|
25
|
+
exec "Snippet for for ".st."i}".et." = ".st.et." to ".st.et." do<CR>".st.et."<CR>done<CR>".st.et
|
26
|
+
exec "Snippet Stack Stack.iter ".st.et." ".st."stk".et.st.et
|
@@ -0,0 +1,23 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet sub sub ".st."FunctionName".et." {<CR>".st.et."<CR>}<CR>".st.et
|
10
|
+
exec "Snippet class package ".st."ClassName".et.";<CR><CR>".st.et.st."ParentClass".et.st.et.";<CR><CR>sub new {<CR>my \$class = shift;<CR>\$class = ref \$class if ref \$class;<CR>my $self = bless {}, \$class;<CR>\$self;<CR>}<CR><CR>1;<CR>".st.et
|
11
|
+
exec "Snippet xfore ".st."expression".et." foreach @".st."array".et.";".st.et
|
12
|
+
exec "Snippet xwhile ".st."expression".et." while ".st."condition".et.";".st.et
|
13
|
+
exec "Snippet xunless ".st."expression".et." unless ".st."condition".et.";".st.et
|
14
|
+
exec "Snippet slurp my $".st."var".et.";<CR><CR>{ local $/ = undef; local *FILE; open FILE, \"<".st."file".et.">\"; $".st."var".et." = <FILE>; close FILE }".st.et
|
15
|
+
exec "Snippet if if (".st.et.") {<CR>".st.et."<CR>}<CR>".st.et
|
16
|
+
exec "Snippet unless unless (".st.et.") {<CR>".st.et."<CR>}<CR>".st.et
|
17
|
+
exec "Snippet ifee if (".st.et.") {<CR>".st.et."<CR><BS>} elsif (".st.et.") {<CR>".st.et."<CR><BS>} else {<CR>".st.et."<CR>}<CR><CR>".st.et
|
18
|
+
exec "Snippet ife if (".st.et.") {<CR>".st.et."<CR>} else {<CR>".st.et."<CR>}<CR>".st.et
|
19
|
+
exec "Snippet for for (my \$".st."var".et." = 0; \$".st."var".et." < ".st."expression".et."; \$".st."var".et."++) {<CR>".st.et."<CR>}<CR>".st.et
|
20
|
+
exec "Snippet fore foreach my \$".st."var".et." (@".st."array".et.") {<CR>".st.et."<CR>}<CR>".st.et
|
21
|
+
exec "Snippet eval eval {<CR>".st.et."<CR>};<CR>if ($@) {<CR>".st.et."<CR>}<CR>".st.et
|
22
|
+
exec "Snippet while while (".st.et.") {<CR>".st.et."<CR>}<CR>".st.et
|
23
|
+
exec "Snippet xif ".st."expression".et." if ".st."condition".et.";".st.et
|
@@ -0,0 +1,30 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet elseif elseif ( ".st."condition".et." )<CR>{<CR><Tab>".st.et."<CR>}<CR>".st.et
|
10
|
+
exec "Snippet do do<CR>{<CR>".st.et."<CR><CR>} while ( ".st.et." );<CR>".st.et
|
11
|
+
exec "Snippet reql require_once( '".st."file".et."' );<CR>".st.et
|
12
|
+
exec "Snippet if? $".st."retVal".et." = ( ".st."condition".et." ) ? ".st."a".et." : ".st."b".et." ;<CR>".st.et
|
13
|
+
exec "Snippet phpp <?php<CR><CR>".st.et."<CR><CR>?>"
|
14
|
+
exec "Snippet switch switch ( ".st."variable".et." )<CR>{<CR>case '".st."value".et."':<CR>".st.et."<CR>break;<CR><CR>".st.et."<CR><CR>default:<CR>".st.et."<CR>break;<CR>}<CR>".st.et
|
15
|
+
exec "Snippet class #doc<CR>#classname:".st."ClassName".et."<CR>#scope:".st."PUBLIC".et."<CR>#<CR>#/doc<CR><CR>class ".st."ClassName".et." ".st."extendsAnotherClass".et."<CR>{<CR>#internal variables<CR><CR>#Constructor<CR>function __construct ( ".st."argument".et.")<CR>{<CR>".st.et."<CR>}<CR>###<CR><CR>}<CR>###".st.et
|
16
|
+
exec "Snippet incll include_once( '".st."file".et."' );".st.et
|
17
|
+
exec "Snippet incl include( '".st."file".et."' );".st.et
|
18
|
+
exec "Snippet foreach foreach( $".st."variable".et." as $".st."key".et." => $".st."value".et." )<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
19
|
+
exec "Snippet ifelse if ( ".st."condition".et." )<CR>{<CR>".st.et."<CR>}<CR>else<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
20
|
+
exec "Snippet $_ $_REQUEST['".st."variable".et."']<CR>".st.et
|
21
|
+
exec "Snippet case case '".st."variable".et."':<CR>".st.et."<CR>break;<CR>".st.et
|
22
|
+
exec "Snippet print print \"".st."string".et."\"".st.et.";".st.et."<CR>".st.et
|
23
|
+
exec "Snippet function ".st."public".et."function ".st."FunctionName".et." (".st.et.")<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
24
|
+
exec "Snippet if if ( ".st."condition".et." )<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
25
|
+
exec "Snippet else else<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
26
|
+
exec "Snippet array $".st."arrayName".et." = array( '".st.et."',".st.et." );".st.et
|
27
|
+
exec "Snippet -globals $GLOBALS['".st."variable".et."']".st.et.st."something".et.st.et.";<CR>".st.et
|
28
|
+
exec "Snippet req require( '".st."file".et."' );<CR>".st.et
|
29
|
+
exec "Snippet for for ( $".st."i".et."=".st.et."; $".st."i".et." < ".st.et."; $".st."i".et."++ )<CR>{ <CR>".st.et."<CR>}<CR>".st.et
|
30
|
+
exec "Snippet while while ( ".st.et." )<CR>{<CR>".st.et."<CR>}<CR>".st.et
|
@@ -0,0 +1,19 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet doc_d /**<CR>* ".st."undocumentedConstant".et."<CR>**/<CR>define(".st.et.", ".st.et.");".st.et."<CR>".st.et
|
10
|
+
exec "Snippet doc_vp /**<CR>* ".st."undocumentedClassVariable".et."<CR>*<CR>* @var ".st."string".et.st.et."<CR>**/".st.et."<CR>"
|
11
|
+
exec "Snippet doc_f /**<CR>* ".st."undocumentedFunction".et."<CR>*<CR>* @return ".st."void".et."<CR>* @author ".st.et."<CR>**/<CR>".st.et."function ".st.et."(".st.et.")<CR>{".st.et."<CR>}<CR>".st.et
|
12
|
+
exec "Snippet doc_s /**<CR>* ".st."undocumentedFunction".et."<CR>*<CR>* @return ".st."void".et."<CR>* @author ".st.et."<CR>**/<CR>".st.et."function ".st.et."(".st.et.");<CR>".st.et
|
13
|
+
exec "Snippet doc_h /**<CR>* ".st.et."<CR>*<CR>* @author ".st.et."<CR>* @version $Id$<CR>* @copyright ".st.et.", ".st.et."<CR>* @package ".st."default".et."<CR>**/<CR><CR>/**<CR>* Define DocBlock<CR>**/<CR><CR>".st.et
|
14
|
+
exec "Snippet doc_fp /**<CR>* ".st."undocumentedFunction".et."<CR>*<CR>* @return ".st."void".et."<CR>* @author ".st.et."<CR>**/".st.et."<CR>"
|
15
|
+
exec "Snippet doc_i /**<CR>* ".st."undocumentedClass".et."<CR>*<CR>* @package ".st."default".et."<CR>* @author ".st.et."<CR>**/<CR>interface ".st.et."<CR>{".st.et."<CR>} // END interface ".st.et."<CR>".st.et
|
16
|
+
exec "Snippet doc_fp /**<CR>* ".st."undocumentedConstant".et.st.et."<CR>**/".st.et."<CR>".st.et
|
17
|
+
exec "Snippet doc_v /**<CR>* ".st."undocumentedClassVariable".et."<CR>*<CR>* @var ".st."string".et."<CR>**/<CR><var> $".st.et.";".st.et."<CR>".st.et
|
18
|
+
exec "Snippet doc_cp /**<CR>* ".st."undocumentedClass".et."<CR>*<CR>* @package ".st."default".et."<CR>* @author ".st.et."<CR>**/".st.et
|
19
|
+
exec "Snippet doc_c /**<CR>* ".st."undocumentedClass".et."<CR>*<CR>* @package ".st."default".et."<CR>* @author ".st.et."<CR>**/<CR>".st."class".et."class ".st."a".et."<CR>{".st.et."<CR>} // END ".st."class".et."class ".st."a".et."<CR>".st.et
|
@@ -0,0 +1,14 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet <i <index name=\"".st."key".et."_index\"><CR><index-column name=\"".st."key".et."\" /><CR></index><CR>".st.et
|
10
|
+
exec "Snippet <t <table name=\"".st."name".et."\" ".st.et."><CR>".st.et."<CR></table><CR>".st.et
|
11
|
+
exec "Snippet <u <unique name=\"unique_".st."key".et."\"><CR><unique-column name=\"".st."key".et."\" /><CR></unique><CR>".st.et
|
12
|
+
exec "Snippet <c <column name=\"".st."name".et."\" type=\"".st."type".et."\" ".st.et." /><CR>".st.et
|
13
|
+
exec "Snippet <p <column name=\"".st."id".et."\" type=\"".st."integer".et."\" required=\"true\" primaryKey=\"true\" autoincrement=\"true\" /><CR>".st.et
|
14
|
+
exec "Snippet <f <foreign-key foreignTable=\"".st."table".et."\"><CR><reference local=\"".st."table".et."_id\" foreign=\"<id>\"/><CR></foreign-key><CR>".st.et
|
@@ -0,0 +1,202 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
" Given a string containing a list of arguments (e.g. "one, two = 'test'"),
|
6
|
+
" this function cleans it up by removing useless whitespace and commas.
|
7
|
+
function! PyCleanupArgs(text)
|
8
|
+
if a:text == 'args'
|
9
|
+
return ''
|
10
|
+
endif
|
11
|
+
let text = substitute(a:text, '\(\w\)\s\(\w\)', '\1,\2', 'g')
|
12
|
+
return join(split(text, '\s*,\s*'), ', ')
|
13
|
+
endfunction
|
14
|
+
|
15
|
+
" Given a string containing a list of arguments (e.g. "one = 'test', *args,
|
16
|
+
" **kwargs"), this function returns a string containing only the variable
|
17
|
+
" names, separated by spaces, e.g. "one two".
|
18
|
+
function! PyGetVarnamesFromArgs(text)
|
19
|
+
let text = substitute(a:text, 'self,*\s*', '', '')
|
20
|
+
let text = substitute(text, '\*\*\?\k\+', '', 'g')
|
21
|
+
let text = substitute(text, '=.\{-},', '', 'g')
|
22
|
+
let text = substitute(text, '=.\{-}$', '', 'g')
|
23
|
+
let text = substitute(text, '\s*,\s*', ' ', 'g')
|
24
|
+
if text == ' '
|
25
|
+
return ''
|
26
|
+
endif
|
27
|
+
return text
|
28
|
+
endfunction
|
29
|
+
|
30
|
+
" Returns the current indent as a string.
|
31
|
+
function! PyGetIndentString()
|
32
|
+
if &expandtab
|
33
|
+
let tabs = indent('.') / &shiftwidth
|
34
|
+
let tabstr = repeat(' ', &shiftwidth)
|
35
|
+
else
|
36
|
+
let tabs = indent('.') / &tabstop
|
37
|
+
let tabstr = '\t'
|
38
|
+
endif
|
39
|
+
return repeat(tabstr, tabs)
|
40
|
+
endfunction
|
41
|
+
|
42
|
+
" Given a string containing a list of arguments (e.g. "one = 'test', *args,
|
43
|
+
" **kwargs"), this function returns them formatted correctly for the
|
44
|
+
" docstring.
|
45
|
+
function! PyGetDocstringFromArgs(text)
|
46
|
+
let text = PyGetVarnamesFromArgs(a:text)
|
47
|
+
if a:text == 'args' || text == ''
|
48
|
+
return ''
|
49
|
+
endif
|
50
|
+
let indent = PyGetIndentString()
|
51
|
+
let st = g:snip_start_tag
|
52
|
+
let et = g:snip_end_tag
|
53
|
+
let docvars = map(split(text), 'v:val." -- ".st.et')
|
54
|
+
return '\n'.indent.join(docvars, '\n'.indent).'\n'.indent
|
55
|
+
endfunction
|
56
|
+
|
57
|
+
" Given a string containing a list of arguments (e.g. "one = 'test', *args,
|
58
|
+
" **kwargs"), this function returns them formatted as a variable assignment in
|
59
|
+
" the form "self._ONE = ONE", as used in class constructors.
|
60
|
+
function! PyGetVariableInitializationFromVars(text)
|
61
|
+
let text = PyGetVarnamesFromArgs(a:text)
|
62
|
+
if a:text == 'args' || text == ''
|
63
|
+
return ''
|
64
|
+
endif
|
65
|
+
let indent = PyGetIndentString()
|
66
|
+
let st = g:snip_start_tag
|
67
|
+
let et = g:snip_end_tag
|
68
|
+
let assert_vars = map(split(text), '"assert ".v:val." ".st.et')
|
69
|
+
let assign_vars = map(split(text), '"self._".v:val." = ".v:val')
|
70
|
+
let assertions = join(assert_vars, '\n'.indent)
|
71
|
+
let assignments = join(assign_vars, '\n'.indent)
|
72
|
+
return assertions.'\n'.indent.assignments.'\n'.indent
|
73
|
+
endfunction
|
74
|
+
|
75
|
+
" Given a string containing a list of arguments (e.g. "one = 'test', *args,
|
76
|
+
" **kwargs"), this function returns them with the default arguments removed.
|
77
|
+
function! PyStripDefaultValue(text)
|
78
|
+
return substitute(a:text, '=.*', '', 'g')
|
79
|
+
endfunction
|
80
|
+
|
81
|
+
" Returns the number of occurences of needle in haystack.
|
82
|
+
function! Count(haystack, needle)
|
83
|
+
let counter = 0
|
84
|
+
let index = match(a:haystack, a:needle)
|
85
|
+
while index > -1
|
86
|
+
let counter = counter + 1
|
87
|
+
let index = match(a:haystack, a:needle, index+1)
|
88
|
+
endwhile
|
89
|
+
return counter
|
90
|
+
endfunction
|
91
|
+
|
92
|
+
" Returns replacement if the given subject matches the given match.
|
93
|
+
" Returns the subject otherwise.
|
94
|
+
function! PyReplace(subject, match, replacement)
|
95
|
+
if a:subject == a:match
|
96
|
+
return a:replacement
|
97
|
+
endif
|
98
|
+
return a:subject
|
99
|
+
endfunction
|
100
|
+
|
101
|
+
" Returns the % operator with a tuple containing n elements appended, where n
|
102
|
+
" is the given number.
|
103
|
+
function! PyHashArgList(count)
|
104
|
+
if a:count == 0
|
105
|
+
return ''
|
106
|
+
endif
|
107
|
+
let st = g:snip_start_tag
|
108
|
+
let et = g:snip_end_tag
|
109
|
+
return ' % ('.st.et.repeat(', '.st.et, a:count - 1).')'
|
110
|
+
endfunction
|
111
|
+
|
112
|
+
let st = g:snip_start_tag
|
113
|
+
let et = g:snip_end_tag
|
114
|
+
let cd = g:snip_elem_delim
|
115
|
+
|
116
|
+
" Note to users: The following method of defininf snippets is to allow for
|
117
|
+
" changes to the default tags.
|
118
|
+
" Feel free to define your own as so:
|
119
|
+
" Snippet mysnip This is the expansion text.<{}>
|
120
|
+
" There is no need to use exec if you are happy to hardcode your own start and
|
121
|
+
" end tags
|
122
|
+
|
123
|
+
" Properties, setters and getters.
|
124
|
+
exec "Snippet prop ".st."attribute".et." = property(get_".st."attribute".et.", set_".st."attribute".et.st.et.")<CR>".st.et
|
125
|
+
exec "Snippet get def get_".st."name".et."(self):<CR>return self._".st."name".et."<CR>".st.et
|
126
|
+
exec "Snippet set def set_".st."name".et."(self, ".st."value".et."):
|
127
|
+
\<CR>self._".st."name".et." = ".st."value:PyStripDefaultValue(@z)".et."
|
128
|
+
\<CR>".st.et
|
129
|
+
|
130
|
+
" Functions and methods.
|
131
|
+
exec "Snippet def def ".st."fname".et."(".st."args:PyCleanupArgs(@z)".et."):
|
132
|
+
\<CR>\"\"\"
|
133
|
+
\<CR>".st.et."
|
134
|
+
\<CR>".st."args:PyGetDocstringFromArgs(@z)".et."\"\"\"
|
135
|
+
\<CR>".st."pass".et."
|
136
|
+
\<CR>".st.et
|
137
|
+
exec "Snippet cm ".st."class".et." = classmethod(".st."class".et.")<CR>".st.et
|
138
|
+
|
139
|
+
" Class definition.
|
140
|
+
exec "Snippet cl class ".st."ClassName".et."(".st."object".et."):
|
141
|
+
\<CR>\"\"\"
|
142
|
+
\<CR>This class represents ".st.et."
|
143
|
+
\<CR>\"\"\"
|
144
|
+
\<CR>
|
145
|
+
\<CR>def __init__(self, ".st."args:PyCleanupArgs(@z)".et."):
|
146
|
+
\<CR>\"\"\"
|
147
|
+
\<CR>Constructor.
|
148
|
+
\<CR>".st."args:PyGetDocstringFromArgs(@z)".et."\"\"\"
|
149
|
+
\<CR>".st."args:PyGetVariableInitializationFromVars(@z)".et.st.et
|
150
|
+
|
151
|
+
" Keywords
|
152
|
+
exec "Snippet for for ".st."variable".et." in ".st."ensemble".et.":<CR>".st."pass".et."<CR>".st.et
|
153
|
+
exec "Snippet pf print '".st."s".et."'".st."s:PyHashArgList(Count(@z, '%[^%]'))".et."<CR>".st.et
|
154
|
+
exec "Snippet im import ".st."module".et."<CR>".st.et
|
155
|
+
exec "Snippet from from ".st."module".et." import ".st.'name:PyReplace(@z, "name", "*")'.et."<CR>".st.et
|
156
|
+
exec "Snippet % '".st."s".et."'".st."s:PyHashArgList(Count(@z, '%[^%]'))".et.st.et
|
157
|
+
exec "Snippet ass assert ".st."expression".et.st.et
|
158
|
+
" From Kib2
|
159
|
+
exec "Snippet bc \"\"\"<CR>".st.et."<CR>\"\"\"<CR>".st.et
|
160
|
+
|
161
|
+
" Try, except, finally.
|
162
|
+
exec "Snippet trye try:
|
163
|
+
\<CR>".st.et."
|
164
|
+
\<CR>except Exception, e:
|
165
|
+
\<CR>".st.et."
|
166
|
+
\<CR>".st.et
|
167
|
+
|
168
|
+
exec "Snippet tryf try:
|
169
|
+
\<CR>".st.et."
|
170
|
+
\<CR>finally:
|
171
|
+
\<CR>".st.et."
|
172
|
+
\<CR>".st.et
|
173
|
+
|
174
|
+
exec "Snippet tryef try:
|
175
|
+
\<CR>".st.et."
|
176
|
+
\<CR>except Exception, e:
|
177
|
+
\<CR>".st.et."
|
178
|
+
\<CR>finally:
|
179
|
+
\<CR>".st.et."
|
180
|
+
\<CR>".st.et
|
181
|
+
|
182
|
+
" Other multi statement templates
|
183
|
+
" From Panos
|
184
|
+
exec "Snippet ifn if __name__ == '".st."main".et."':<CR>".st.et
|
185
|
+
exec "Snippet ifmain if __name__ == '__main__':<CR>".st.et
|
186
|
+
|
187
|
+
" Shebang
|
188
|
+
exec "Snippet sb #!/usr/bin/env python<CR># -*- coding: ".st."encoding".et." -*-<CR>".st.et
|
189
|
+
exec "Snippet sbu #!/usr/bin/env python<CR># -*- coding: UTF-8 -*-<CR>".st.et
|
190
|
+
" From Kib2
|
191
|
+
exec "Snippet sbl1 #!/usr/bin/env python<CR># -*- coding: Latin-1 -*-<CR>".st.et
|
192
|
+
|
193
|
+
" Unit tests.
|
194
|
+
exec "Snippet unittest if __name__ == '__main__':
|
195
|
+
\<CR>import unittest
|
196
|
+
\<CR>
|
197
|
+
\<CR>class ".st."ClassName".et."Test(unittest.TestCase):
|
198
|
+
\<CR>def setUp(self):
|
199
|
+
\<CR>".st."pass".et."
|
200
|
+
\<CR>
|
201
|
+
\<CR>def runTest(self):
|
202
|
+
\<CR>".st.et
|
@@ -0,0 +1,54 @@
|
|
1
|
+
if !exists('loaded_snippet') || &cp
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let st = g:snip_start_tag
|
6
|
+
let et = g:snip_end_tag
|
7
|
+
let cd = g:snip_elem_delim
|
8
|
+
|
9
|
+
exec "Snippet mrnt rename_table \"".st."oldTableName".et."\", \"".st."newTableName".et."\"".st.et
|
10
|
+
exec "Snippet rfu render :file => \"".st."filepath".et."\", :use_full_path => ".st."false".et.st.et
|
11
|
+
exec "Snippet rns render :nothing => ".st."true".et.", :status => ".st.et.st.et
|
12
|
+
exec "Snippet ri render :inline => \"".st.et."\")>\"".st.et
|
13
|
+
exec "Snippet rt render :text => \"".st.et."\"".st.et
|
14
|
+
exec "Snippet mcc t.column \"".st."title".et."\", :".st."string".et.st.et
|
15
|
+
exec "Snippet rpl render :partial => \"".st."item".et."\", :locals => { :".st."name".et." => \"".st."value".et."\"".st.et." }".st.et
|
16
|
+
exec "Snippet rea redirect_to :action => \"".st."index".et."\"".st.et
|
17
|
+
exec "Snippet rtlt render :text => \"".st.et."\", :layout => ".st."true".et.st.et
|
18
|
+
exec "Snippet ft <%= form_tag :action => \"".st."update".et."\" %>".st.et
|
19
|
+
exec "Snippet forin <% for ".st."item".et." in ".st.et." %><CR><Tab><%= ".st."item".et.".".st."name".et." %><CR><% end %><CR>".st.et
|
20
|
+
exec "Snippet lia <%= link_to \"".st.et."\", :action => \"".st."index".et."\" %>".st.et
|
21
|
+
exec "Snippet rl render :layout => \"".st."layoutname".et."\"".st.et
|
22
|
+
exec "Snippet ra render :action => \"".st."action".et."\"".st.et
|
23
|
+
exec "Snippet mrnc rename_column \"".st."table".et."\", \"".st."oldColumnName".et."\", \"".st."newColumnName".et."\"".st.et
|
24
|
+
exec "Snippet mac add_column \"".st."table".et."\", \"".st."column".et."\", :".st."string".et.st.et
|
25
|
+
exec "Snippet rpc render :partial => \"".st."item".et."\", :collection => ".st."items".et.st.et
|
26
|
+
exec "Snippet rec redirect_to :controller => \"".st."items".et."\"".st.et
|
27
|
+
exec "Snippet rn render :nothing => ".st."true".et.st.et
|
28
|
+
exec "Snippet lic <%= link_to \"".st.et."\", :controller => \"".st.et."\" %>".st.et
|
29
|
+
exec "Snippet rpo render :partial => \"".st."item".et."\", :object => ".st."object".et.st.et
|
30
|
+
exec "Snippet rts render :text => \"".st.et."\", :status => ".st.et
|
31
|
+
exec "Snippet rcea render_component :action => \"".st."index".et."\"".st.et
|
32
|
+
exec "Snippet recai redirect_to :controller => \"".st."items".et."\", :action => \"".st."show".et."\", :id => ".st.et
|
33
|
+
exec "Snippet mcdt create_table \"".st."table".et."\" do |t|<CR><Tab>".st.et."<CR>end<CR>".st.et
|
34
|
+
exec "Snippet ral render :action => \"".st."action".et."\", :layout => \"".st."layoutname".et."\"".st.et
|
35
|
+
exec "Snippet rit render :inline => \"".st.et."\", :type => ".st.et
|
36
|
+
exec "Snippet rceca render_component :controller => \"".st."items".et."\", :action => \"".st."index".et."\"".st.et
|
37
|
+
exec "Snippet licai <%= link_to \"".st.et."\", :controller => \"".st."items".et."\", :action => \"".st."edit".et."\", :id => ".st.et." %>".st.et
|
38
|
+
exec "Snippet verify verify :only => [:".st.et."], :method => :post, :render => {:status => 500, :text => \"use HTTP-POST\"}".st.et
|
39
|
+
exec "Snippet mdt drop_table \"".st."table".et."\"".st.et
|
40
|
+
exec "Snippet rp render :partial => \"".st."item".et."\"".st.et
|
41
|
+
exec "Snippet rcec render_component :controller => \"".st."items".et."\"".st.et
|
42
|
+
exec "Snippet mrc remove_column \"".st."table".et."\", \"".st."column".et."\"".st.et
|
43
|
+
exec "Snippet mct create_table \"".st."table".et."\" do |t|<CR><Tab>".st.et."<CR>end<CR>".st.et
|
44
|
+
exec "Snippet flash flash[:".st."notice".et."] = \"".st.et."\"".st.et
|
45
|
+
exec "Snippet rf render :file => \"".st."filepath".et."\"".st.et
|
46
|
+
exec "Snippet lica <%= link_to \"".st.et."\", :controller => \"".st."items".et."\", :action => \"".st."index".et."\" %>".st.et
|
47
|
+
exec "Snippet liai <%= link_to \"".st.et."\", :action => \"".st."edit".et."\", :id => ".st.et." %>".st.et
|
48
|
+
exec "Snippet reai redirect_to :action => \"".st."show".et."\", :id => ".st.et
|
49
|
+
exec "Snippet logi logger.info \"".st.et."\"".st.et
|
50
|
+
exec "Snippet marc add_column \"".st."table".et."\", \"".st."column".et."\", :".st."string".et."<CR><CR>".st.et."<CR>".st.et
|
51
|
+
exec "Snippet rps render :partial => \"".st."item".et."\", :status => ".st.et
|
52
|
+
exec "Snippet ril render :inline => \"".st.et."\", :locals => { ".st.et." => \"".st."value".et."\"".st.et." }".st.et
|
53
|
+
exec "Snippet rtl render :text => \"".st.et."\", :layout => \"".st.et."\"".st.et
|
54
|
+
exec "Snippet reca redirect_to :controller => \"".st."items".et."\", :action => \"".st."list".et."\"".st.et
|