sponsor Vim development Vim logo Vim Book Ad

Rcode : Run various types of code against current buffer

 script karma  Rating 3/3, Downloaded by 1435  Comments, bugs, improvements  Vim wiki

created by
lilydjwg
 
script type
utility
 
description
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"
 
install details
Put it in your ~/.vim/plugin.
 

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
rcode.vim 2.0 2011-12-21 7.0 lilydjwg You can save the code now.
rcode.vim 1.0 2011-08-24 7.0 lilydjwg Initial upload
ip used for rating: 18.220.160.216

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