0

I'm using vim lately & codepad. There's a nice plugin for vim which works like a charm. My problem is that, sometimes I need just to paste a function not the entire script/program.

CPPaste plugin page states: to send the current buffer to http://codepad.org, open your pasted code in your webbrowser, and copy the URL of the pasted snippet to the clipboard.

So how do I manage to set the current buffer to a specific selection of lines/rows (made with v/V for example)?

Cheers

CharlesB
  • 86,532
  • 28
  • 194
  • 218
patm
  • 1,420
  • 14
  • 19
  • 1
    It sounds to me like you want the [NrrwRgn](http://www.vim.org/scripts/script.php?script_id=3075) plugin. I've never used it but I believe it does what you want. – Randy Morris Jan 13 '12 at 14:08

1 Answers1

2

I use the NrrwRgn plug-in to create a temporary buffer with a specific sub-set of lines, and then send that to codepad:

  • V
  • Select region you want to paste
  • :NR<CR> (because of the selection the command-line will read :'<,'>NR)
  • Split buffer opens
  • :CP<Tab><CR>

It might not be the perfect solution, but works well enough. Also, the NrrwRgn plug-in is also very useful for editing parts of big files.

Walter
  • 7,809
  • 1
  • 30
  • 30
  • Thanks for the answer and the detailed shortcuts example. At the beginning it looked like kinda complicated, but once I did it a couple of times worked awesomely well :-) – patm Jan 13 '12 at 14:51