Ⅰ. 插件描述
Framework for implementing Object Oriented Programming with Vim ScriptsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/voodu-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/voodu-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/voodu-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/voodu.vim
Ⅳ. 文档说明
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.