Can I paste a program's snippet on codepad using CPPaste vim plugin or no?
-
28-10-2019 - |
سؤال
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.