Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
973 views
in Technique[技术] by (71.8m points)

visual studio code - Pasting data in multiple cursor mode

in vs code I have the following file

1
2
3

a
b
c

Now I do the following steps

  1. cut the lines a b c.
  2. select the lines 1, 2, 3 and then go into multiple cursor mode (shift, alt I).
  3. go to the end of the each number press and type a , and then do a paste.

The result is

1, a
b
c
2, a
b
c
3, a
b
c

but the result I wanted is

1, a
2, b
3, c
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Check out Mark's good answer as well. There have been some updates to VS Code he mentions that should be considered as well.

Using Shift+Alt+I, you need to cut the text in multiple cursor mode as well:

1Enter2Enter3EnterEnteraEnterbEnterc

Shift+

Shift+Alt+I

Shift+

Ctrl+X

,?

Ctrl+V

enter image description here

As of the 1.23.1 April update, a more convenient, middle mouse button selection can be used.

With the cursor and keyboard, Instead of cutting the lines like normal, select from the end of the cursor to the beginning while in multi-cursor mode while holding Ctrl+Shift. After cutting the text with Ctrl+X, select with multiple cursors again by holding Ctrl+Shift. Then, type ,? and paste with Ctrl+V like you described.

enter image description here

You can also use Ctrl+Alt+Shift and the direction arrows to select with multiple cursors,

keyboard demo


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...