From: Logan Capaldo Date: 2006-05-28T07:29:57+09:00 Subject: Re: Automatic code generation in vim. On May 26, 2006, at 3:53 PM, James Britt wrote: > Minkoo Seo wrote: > >> Does anybody have a nice solution for automatic code generation >> for Ruby in VIM? > > > Get the vim stuff for Ruby, and look in ruby-macros.vim > > I used that to learn how to write my own simple autotext stuff. > > > For example: > > # If I enter ifFILE, then vim should call the ifFILE function > iab ifFILE =ifFILE() > > # which is > function! s:ifFILE() > return "if __FILE__ == $0 \o \oend" > endfunction > > > Incidentally, I tried this put and changed it to function! s:ifFILE() return "if __FILE__ == $0 \o \oend\ki" endfunction which sticks the cursor where you would expect it to be. > -- > James Britt > > "The use of anthropomorphic terminology when dealing with > computing systems is a symptom of professional immaturity." > > - Edsger W. Dijkstra >