sponsor Vim development Vim logo Vim Book Ad

voodu.vim : Framework for implementing Object Oriented Programming with Vim Scripts

 script karma  Rating 5/2, Downloaded by 477  Comments, bugs, improvements  Vim wiki

created by
Ian Tegebo
 
script type
utility
 
description
This is an implementation of OOP with a decisively Perl flavor utilizing Vim 7.0's dictionary representation of objects.  More extensive documentation will be added at a later date.  I'm also aware of vimscript #1034 but it was pre-7.0 and thus doesn't utilize many of the features involved with Voodu.  For now, you can do the following:

let s:AD = tv#series#comedy#New('Arrested Development')
let s:TO = tv#series#comedy#New('The Office')

echo s:AD.name()
echo s:AD.type()
echo s:TO.name()." is a ".s:TO.type()

let s:SS = tv#series#comedy#New('The Simpsons')

" An example of Class Method accessing Class Data
echo tv#series#Names()

let s:dailyshow = tv#New('News Parody')
echo s:dailyshow.type()

--------------------------------------- Future Plans ---------------------------------------

I want to demonstrate the usefulness of this utility plugin by implementing generic tab/window/buffer classes that can hide a lot of the work I see plugin authors performing, e.g. wincommander, WinWalker, SideBar.

Additionally, I believe I can add functionality similar to Perl's Class::Accessor or Ruby's attr_reader:, namely automatic provision of simple accessor methods.
 
install details
$ cd ~/.vim
$ tar xzvf voodu-0.0.1.tar.gz

And then you can test with:

$ vim -c ':so %' tv.vim
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
voodu-0.0.1.tar.gz 0.0.1 2007-04-29 7.0 Ian Tegebo Initial upload
ip used for rating: 18.188.61.223

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github