Ⅰ. 插件描述
Simple event looping in vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ardagnir/eventloop-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ardagnir/eventloop-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ardagnir/eventloop-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ardagnir/eventloop.vim
Ⅳ. 文档说明
EventLoop.vim
This is just an EventLoop framework I built for pterosaur. I'm keeping it in a seperate plugin so other people can use it.
Basic Usage
EventLoop uses a syntax similar to vim's autocommands
- :ElGroup <groupname> starts editing an EventLoop group
- :ElCmd adds a command to the EventLoop group. This command will be repeated every .2(configurable) seconds.
- :ElGroup END ends group editing
- :ElGroup! <groupname> removes a group and all its commands
- :ElSetting timer <time> changes the time between function calls of the current group to <time>*100 milliseconds.
Example
ElGroup! pterosaur
ElGroup pterosaur
ElSetting timer 4
ElCmd call CheckConsole()
ElCmd call OutputMessages()
ElGroup END
Requirements
- Vim with +clientserver
- GNU/Linux or OS X. Probably works on other unix-like systems too.
Installation
Use pathogen.
cd ~/.vim/bundle
git clone https://github.com/ardagnir/eventloop.vim
Notes
- Timers are rounded up to the nearest even number and are a best-case value. (Your function won't get called faster than the timer, but it might get called slower.)
Bugs
- Using EventLoop hides the cursor when typing ex commands.
License
EventLoop is licensed under the AGPL v3