Ⅰ. 插件描述
V8 interface to VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/if-v8'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/if-v8'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/if-v8'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/if_v8
Ⅳ. 文档说明
V8 is Google's open source JavaScript engine.
Requirements:
linux or windows.
Vim executable file with some exported symbol that if_v8 requires.
On linux:
Compile with gcc's -rdynamic option.
On windows (msvc):
Use vim_export.def and add linker flag "/DEF:vim_export.def".
nmake -f Make_mvc.mak linkdebug=/DEF:vim_export.def
Usage:
:source /path/to/if_v8/init.vim
:V8 print('hello, world')
=> hello, world
:V8 3 + 4
=> 7
:V8 vim.execute('version')
=> ... version message
:V8 var tw = vim.eval('&tw')
:V8 tw
=> 78
:V8 vim.let('&tw', '40')
:echo &tw
=> 40
:V8 load('foo.js')