I'm doing some cut and paste from a lot of different data sources. I'm trying to insert code in multiple lines in a multiple line code so that for the first line of the pasted code go between two specific points of the original code and the same for the second and so on. It's something like insert blocks of code between splitted multiple lines of code. The picture .gif below show what I mean:
How can I do that? I'm trying with VIM CTRL+V but I can't paste multi lines code.
Here is the sample:
VIOLET=SpectralBand([0.380,0.450],'violet')
BLUE= SpectralBand([0.450,0.495],'b')
GREEN= SpectralBand([0.495,0.570],'g')
YELLOW=SpectralBand([0.570,0.590],'y')
ORANGE=SpectralBand([0.590,0.620],'orange')
RED= SpectralBand([0.620,0.750],'r')
"viol3et", 45839,
"bl3ue" , 43903,
"gre3en" , 28392,
"y3ellow", 23049,
"o3range", 12389,
"r3ed" , 32840,
You can just Alt + click for additional cursors. And as already mentioned, Ctrl + Alt + ↑ or ↓ . And you can use Alt+Shift+click to select two lines and every line in between.
Use Shift+Enter to start a new line after the current line.
You may use copy-rectangle-as-kill
(C-x r M-w) and yank-rectangle
(C-x r y) to achieve the behavior you describe.
See the Rectangles section in emacs manual for details.
How Vim behaves during paste is determined by the type of selection during yank. Be sure to select the viol3et
block in blockwise visual mode: Ctrl + V (or Q on many Windows installations).
Alternatively, you can use my UnconditionalPaste plugin to just yank / delete the entire lines (e.g. 6dd
while on the viol3et
line), and then paste (between the target lines) with gbp
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With