Ⅰ. 插件描述
Run various types of code against current bufferⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/rcode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/rcode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/rcode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Rcode
Ⅳ. 文档说明
Rcode enables you to write short script to handle your text. It supports
VimScript, Awk (via external command), Perl, Python 2 & 3, Ruby and Lua.
Usage:
See also at the top of the plugin file as it's formatted better.
Chinese Version (中文版文档) https://blog.lilydjwg.me/2011/12/21/rcode-vim-2-0-released.31390.html
Commands And Maps:
:Rcode Start Rcode. Accept an argument as the language, eg:
vim, awk, etc. Use <C-D> to see all available ones.
A new buffer will be opened for you. Write your code
in it.
You can give a range.
:RcLoad {name} Load a previous saved code snippet.
"name" should be in the form "{lang}/{filename}" so
that the script knows which language it's in. This is
different from ":Save" command.
You can give a range.
:RcSelect List all available code snippets and you can choose
one by number
In Rcode buffer:
<C-CR>
:Run Run your code against the buffer you were.
:Save {name} Save your code so you can later load it with
":RcLoad"
Shortcut:
in Python, 'v' is the 'vim' module, and 'b' is the current buffer,
in Lua, 'b' is the current buffer.
Settings:
g:Rcode_after what to do after running your code.
0 means to do noting, 1 means to close the code buffer
and 2 will throw away your code besides closing the
buffer, or you code will be loaded next time you use
":Rcode".
Default is 1.
g:Rcode_snippet_path Where you saved code snippets will lie.
Default is "$HOME/.vim/rcode"