Skip to content

Instantly share code, notes, and snippets.

@anderscarling
Created May 15, 2009 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anderscarling/112155 to your computer and use it in GitHub Desktop.
Save anderscarling/112155 to your computer and use it in GitHub Desktop.
This is how you use ruby as your vim pasteboard buffer. For fun, and profit
" Because we can use ruby as our pasteboard buffer (w/o support for newlines), damnit!
" Copy all lines
:1rubydo $x=""
:rubydo $x << $_;
" Will paste on line 6, the line needs to exist
:6rubydo $_=$x
" Copy from line 1 to line 6. Please note that you can even use instance variables.
:1rubydo temp=$_
:6rubydo $_=temp
" This _is_ rather useful, in some way.. I'll just figure it out. Maybe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment