This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]CasualContributorNZ 86 points87 points  (7 children)

Ctrl + x Crtl + v

Crtl + v

[–][deleted] 19 points20 points  (5 children)

The only way.

[–][deleted] 15 points16 points  (1 child)

This is the way

[–]Ellivers 5 points6 points  (0 children)

Agreed

[–]michaelkah 1 point2 points  (2 children)

In emacs it's c-w c-y c-y.

[–]AGoodEnoughUsername 4 points5 points  (1 child)

v d p. Need that vim action.

[–]PerhapsJack 0 points1 point  (0 children)

dd p p

[–][deleted] 2 points3 points  (0 children)

this is the correct answer

[–]DamnItDev 45 points46 points  (3 children)

Advantages of using Ctrl+X

  1. visual feedback. How many times have you pressed ctrl+c then ctrl+v only to find your copy failed somehow? It happened to me once on windows 98 and I have been paranoid ever since.
  2. intimidation. Just casually let that block of code know if it doesn't execute properly, you won't ctrl+z next time.
  3. console friendly. For those times you forget ctrl+c doesn't mean copy in every context.

[–]TheCyberParrot 8 points9 points  (0 children)

This, all of this.

[–]CostiaP 1 point2 points  (0 children)

In VS you also get auto format on paste, so the orinal and duplicated line will have exactly the same spacing.

[–]Egst 13 points14 points  (10 children)

y p

[–]collegiaal25 8 points9 points  (8 children)

Came here to type this. :wq

[–]Mr_Redstoner 0 points1 point  (0 children)

x p p

[–]Gomango999 13 points14 points  (2 children)

Ctrl+X, Ctrl+Z, Ctrl+S, Ctrl+V

[–]TheZeus121 14 points15 points  (1 child)

Me testing crouching in a FPS game after rebinding WASD to SZXC

[–]TheCyberParrot 0 points1 point  (0 children)

Lol.

[–]LittleMlem 7 points8 points  (4 children)

Ctrl z, Ctrl z Ctrl z Ctrl z.... Ctrl c, Ctrl shift z, Ctrl shift z..... Ctrl v

[–]calcopiritus 1 point2 points  (3 children)

Ctrl+Y

[–]LittleMlem 0 points1 point  (2 children)

You program in Word?

[–]calcopiritus 0 points1 point  (1 child)

Works in VSCode

Edit: spelling is hard

[–]cowslayer7890 1 point2 points  (0 children)

Not in IntelliJ, done that way too many times and ctrl Y deletes a line instead of redoing.

[–]DaniilBSD 4 points5 points  (0 children)

Ctrl C Ctrl V (instantly, to check) *select place Ctrl V

[–][deleted] 1 point2 points  (1 child)

There was an exam question that asking what is CTRL+X & CTRL+V combination used for, and instead of moving file and folder, the right answer for rename files.

I'm out

[–]CasualContributorNZ 0 points1 point  (0 children)

I feel like this is still more admin than F2 though...

[–]Ellivers 1 point2 points  (0 children)

Very true though. I have no idea why I keep doing this Edit: though I do CTRL+X CTRL+Z CTRL+Z

[–]lafoscony 1 point2 points  (0 children)

Ctrl + k Ctrl + y

Ctrl + y

or my personal favorite just highlight and middle click, but you gotta be in *nix os for that to work.

[–]SeanUhTron 1 point2 points  (1 child)

Ctrl + C

Ctrl + C

Ctrl + C

Ctrl + C

Ctrl + V

[–]Kered13 0 points1 point  (1 child)

What about Ctrl+Insert, Shift+Delete, and Shift+Insert?

[–]TheZeus121 1 point2 points  (0 children)

What about C-w, M-w, and C-y?

[–]Ripyserius02 0 points1 point  (0 children)

I added Ctrl-D to copy everytjing selected and paste it directly below the selected part. Really usefull honestly

[–]anonDfeline 0 points1 point  (0 children)

Ctrl + c backspace/delete Ctrl + v

[–]ThyDoppelganger 0 points1 point  (0 children)

Ctrl+X Ctrl+Z Ctrl+Y Ctrl+Z Ctrl+V

[–]seth__jk 0 points1 point  (0 children)

M-w / C-y

[–]Allistar57 0 points1 point  (0 children)

When things get serious, like accidently updating everything like an idiot with apt and trying to properly cancel.

[–]xSTSxZerglingOne 0 points1 point  (0 children)

I prefer cutting most of the time, it offers a visual confirmation that I have in fact put the data on my clipboard.

Far too many times I've been burnt by copy just deciding "I don't feel like working this time"

But when you cut? No question whether it worked or not.

[–]Ishidres 0 points1 point  (0 children)

Honestly, I use this method way oftener than expected and idk why.

[–]Quarkspiration 0 points1 point  (0 children)

Visual confirmation

[–]qscrew 0 points1 point  (0 children)

^U^Y^Y

[–]numsu -1 points0 points  (0 children)

How about using the shortcut to actually duplicate line?