문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top