I can select a column in MS Visual Studio code with shift-alt and drag, but how do I paste a column? I can't find that anywhere. The column mode options on the keyboard cheat shortcuts list do not list this.
-
Yep, this will be a great feature, cant find it either – megalucio Oct 12 '18 at 16:19
3 Answers
Column copied using shift + alt can be pasted as a column if you start cursor at exactly same number of lines as that of number of lines in your copied column contents.
Example:
Say the 2nd column in the following text is copied. (it has 2 rows)
foo foo1 bar bar1
Now, using same shift + alt, place cursors on two different rows. Say after 2 and 3 in below text:
1 2 3 4
Once you paste, the column will be pasted properly.
1 2foo1 3bar1 4
- 241
-
Can paste a "blob" (previously copied rectangular area) without causing any of the text on the right to shift? – Meryan Mar 25 '23 at 19:35
The lines you copied in the column must be exactly the same number as the places you selected to insert. Or the column will be inserted in every place you selected.
- 41
-
Life-saver comment, I would never have guessed that! I guess that warrants opening a GitHub issue… or using this plugin: https://marketplace.visualstudio.com/items?itemName=johnguo.columnpaste – lapo Feb 18 '22 at 10:44
If I'm understanding Bharat's reply, that's not very useful, is it? That means if I want to compare 2 columns side by side and one column doesn't have as many rows as the other then I can't do it. Or I can do it only if I first count the number of rows in the shorter column so that I can highlight that many rows and then paste into that selection.
- 1
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review – CentrixDE Nov 03 '21 at 21:13
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Nov 03 '21 at 21:53