Sublime Forum

Is it possible to select text and drag it to a new location

#1

I LOVE sublimetext and it is serious my favorite program as of right now, however I find myself still using old editors a lot because of 1 feature that is missing.

When I select some text in a document, in my other editors I am able to click down n the mouse and drag the selected text to a new location in the document, it is something I use all the time as it is so much easier then "select text, copy text, delete selected text, go to new location and paste text) Keep in mind I am not talking about dragging selected text to a new document, I mean all in the same document, just re-arranging text by selectings it, clicking down on it and dragging it, once you release the click, the text is dropped where ever the mouse pointer has moved.

Is this something that is currently possible by changing a settings? If not, is it something that is possible to get added in?

1 Like

#2

It’s currently not possible and is unlikely to be included.

Why not just select some text, press command/control + x then go to the new location and press command/control + v?

0 Likes

#3

[quote=“C0D312”]

Why not just select some text, press command/control + x then go to the new location and press command/control + v?[/quote]

Because it sometimes would be more convenient to drag text around. It is also a standard feature of almost all modern editors.

0 Likes

#4

[quote=“svenax”]

Why not just select some text, press command/control + x then go to the new location and press command/control + v?

Because it sometimes would be more convenient to drag text around. It is also a standard feature of almost all modern editors.[/quote]

I understand the use of the feature, I was merely implying that jasondavis could use keyboard shortcuts to speed up the cut and paste process. Also because he said “copy text then delete text” which could be simplified to cut.

0 Likes

#5

Dragging text avoids overwriting the clipboard. Cutting and pasting isn’t the same thing. Yes, there’s a clipboard history plugin, but that’s just not the same.

0 Likes

#6

I made a plugin to provide an equivalent to the drag or ctrl+drag function : bitbucket.org/Clams/pasteselonclick/
Instead of dragging you just alt+right click to move selection or alt+ctrl+right click to copy selection where you click : it’s not perfect but at least it provides the basic functionnality of being able to copy or move a bunch of text without overwritting the clipboard.
This does not support the copy from one tab to another, i’ll have to understand better the API for that … (if some have an idea, please share :smile: )

0 Likes

#7

+1 for this feature request. One of my favorite features of Notepad++ that is missing from Sublime Text. craigpatik is dead right – I’ve often got something ELSE in my clipboard that I don’t want to overwrite, just move the current text around. Ctrl-shift-up/Ctrl-shift-down are good too, but sometimes I just want to drag with the mouse.

0 Likes

#8

I came here looking for the same feature.

What’s funny is that the EXACT same conversion can be found in the Eclipse forums when it was young and immature. OP, Cut/Paste suggestion, plugin offerings, everything :smile:

The 3.0+ builds (I think?) included the feature and I immediately switched to it from other editors. (I’m considering sublime as Eclipse is a bit heavy weight for simple tasks.)

Please include this feature ASAP. Copy/Paste is not an alternative.

0 Likes

#9

Ctrl+Shift+Up and Ctrl+Shift+Down works pretty well. It will move the line or block up and down in the documents, passing through the other lines.

0 Likes

#10

+1 from me too. I miss this feature.

0 Likes

#11

+1 for this feature from me too! I’ve also put a request in the request section.

0 Likes

#12

I reckon that a feature like this could be useful; however, I disagree with the fact that the mouse is the only way to use it. When coding you should keep your hands always on the keyboard, so why not make it a key combination similar to the “move line up/down” or “indent/unindent”.

0 Likes

#13

That key combination already exists, ctrl+shift+up/down.

Sometimes using the mouse makes sense. Just as sometimes not using the mouse makes sense. I just want the option either way.

0 Likes

#14

Now in Dev Build 2182 :smile:

0 Likes

#15

I just noticed something that doesn’t work.

If I click and drag some text, I am no longer able to use my mouse wheel to scroll down the page to where I want to drop the text.

A little annoying if I have something saved in my clipboard that I want to copy and paste in addition to this long drag and drop.

0 Likes

#16

[quote=“kabadesu”]I just noticed something that doesn’t work.

If I click and drag some text, I am no longer able to use my mouse wheel to scroll down the page to where I want to drop the text.[/quote]

That’s just the current behaviour sorry. Jon has never got round to changing that.

0 Likes

#17

I know this old threads but looks like nobody since ~8 years looks into it , I just search for drag and drop and this was first result ,
In short having drag and drop is very important to any text editor/developer tools . without it I’ll be distracted from my work flow trying to look for Ctrl x and Ctrl v ( that 4 moves ) , this will becomes more annoying when you do cut and paste a lot into your work flow , I wish somebody take look at this .

0 Likes

#18

I’m not sure what problem you’ve having, but drag and drop of text has been supported for quite some time (roughly 8 years I would guess, based on the post in the thread above noting that it was added).

The only platform on which it historically hasn’t worked all this time is Linux, but support for that was added in build 4050, so this should now be available everywhere.

1 Like