Drag and drop code

hi there,
i’m asking myself why drag&drop of some marked code is not possible. is it just with me or is this gernerally impossible?
if there’s no reason against this feature i would be really pleased if it would be possible!

thanks :smiley:

Hi there @ksch,

I’m not actually sure of what kind of workflow you’re referring to. I don’t think I’ve ever personally used drag and drop of code. Is this interaction typically for moving the code like you could reproduce with cut and paste?

One thing we do have which might be interesting to you are the shortcuts:

  • C-M-n - Move line or selection down
  • C-M-p - Move line or selection up

Which can let you take highlighted sections and move them up or down through the code.

The shortcut C-M-n can be broken down to holding the following three keys at the same time:

  1. C - control,
  2. M - command (macOS) or alt (Win/Lin),
  3. n - the n key

For more shortcuts like this see the full shortcut cheatsheet:


thanks for that fast reply!

yes, i’m more into using the mouse, marking and moving code.

but it’s also because of i’m not used to these shortcuts so far.

your mentioned shortcuts are what i am looking for, but it’s uncomfortable so far to me :rofl:

i’ll give it a try as long as drag&drop is not available.
i was just wondering because every IDE i know is giving this feature.

1 Like

hi @ksch

Personnaly i never use drag and drop with mouse it’s not good for your wrists and not accurate.

I’m discovering this shortcuts to move to (n)ext or (p)revious line a line or a selection. But it would be cool if we can then use ctrl + z to undo this move.
And a ctrl + f to find some text would be nicer. But life is life.


1 Like