6

I have the following code:

CList.Add( new CodeStuff(941,"National List Limit
CList.Add( new CodeStuff(945,"Code not used
CList.Add( new CodeStuff(946,"State Building Height Limit
CList.Add( new CodeStuff(993,"Building Material Type
CList.Add( new CodeStuff(1033,"Not used - requirements changed
CList.Add( new CodeStuff(1034,"Current Unacceptable Applications
CList.Add( new CodeStuff(1035,"Historical Unacceptable Applications

I got the first bit using Alt+Shift+mouse button and typing. How do I add "); to the end of each line?

I had to use Notepad++ macro recording to do it and this is the only reason I still hang on to that editor. If someone can tell me how to do it in VSCode, I'd be very grateful.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Paul Slater
  • 65
  • 1
  • 1
  • 2

3 Answers3

13

Not completely sure I understand, but Shift-Alt-I will put a cursor at the end of all selected lines so just select your text and Shift-Alt-I (that is an 'eye' at the end). Then typing "); will put that at the end of each line.

---------------------- Edit -------------------------------

I see that Column Selection Mode (in v1.43) does this nicely now (with Selection/Column Selection Mode enabled) depending on your direction of selection [unfortunately the gif does a poor job of showing the cursors but they are all at the beginning or ends of the lines depending on the direction of selection]:

column selection cursors

Mark
  • 143,421
  • 24
  • 428
  • 436
  • Brilliant, thank you, had been missing this shortcut for a while now and couldn't find it anywhere! – Dash83 Aug 10 '23 at 11:39
1

On Mac Vscode, I believe the trick is to "mouse" select the lines you wish to append, then hit Shift+Option+I.

SandeepJ
  • 123
  • 1
  • 7
1

On Windows 10, if I hit ShiftAltI, all the cursors go to the beginning of each line. To move the cursors to the end of each line, simply hit the End key after that.

Weihui Guo
  • 3,669
  • 5
  • 34
  • 56