Sublime Forum

Why Sublime doesn't support BLOCKS operations

#9

It is available directly in package control (package install -> Paste as column)

Like you I was missing this feature when I started using Sublime, but after a while I notice that I did not needed it anymore, except in some very rare cases.

0 Likes

#10

I can copy and paste a column of text if this is what you are after. I use the middle mouse button to select a box of text and then you can paste it in as a block on its own by moving the cursor to where you want to insert and then pasting or within another block of text if you select the same number of lines in the destination and paste there. The status line gives you the number of selection regions you have in selected in the copy stage and it is wise to note this before pasting. Try experimenting to master.

0 Likes

#11

I am afraid it is not working to me. I am sending you 2 examples. I tried what you wrote i ST obteined huge mess in my code and how I do it in Kedit - simply, fast and intuitibe. Any more coment from you?

0 Likes

#12

Hello Leszpol,
The column selection mode is documented at:
https://www.sublimetext.com/docs/2/column_selection.html
and
http://docs.sublimetext.info/en/latest/editing/editing.html
under column selection.

Once selected, you can copy and paste using the normal control/command keys. A description of this is at:

I don’t have a global accessible file sharing so cannot make a video to demonstrate. Your videos wouldn’t play for me.

Undo will cope with the unwanted changes.

Regards.

0 Likes

#13

Sorry …and now - do you have acces to mp4

0 Likes

#14

Hello Leszpol, Sorry I don’t have access now either.
Did the documentation links help? Have you been able to select a block of text in Sublime? Once you can do this then I suggest you copy it and paste it into a new file. I will try some screen shots to assist.

0 Likes

#15

Here is a block of selected text. On windows I can select Ctrl-C to copy this text.

Block_Selected

Here I have moved the cursor to line 749 and hit Ctrl-V to paste. The selected block is pasted at the cursor position.

Repeating this I re-select the same block and hit Ctrl-C top copy. I then select 32 lines as a block of 32x1 cursor (this is shown as the highlighted line numbers - cursor gets hidden during screen captures).

Destination_Selected

When I hit Crtl-V to paste, the block of text is inserted at the set of cursors.

Block_Pasted_2

The red markers are linting syntax failures - you can ignore these.

0 Likes

#16

No,I think it is no the same like in Kedit.

Can you try https://drive.google.com/open?id=1CJ5eYcGpMaxA1ZbwKWaEj-24oNhkZHa3

0 Likes

#17

Hello Leszpol,
Yes you can do that in Sublime. I downloaded the videos in the end. The trick in the pasting is to select a column of text of the same number of lines as the selected region before pasting. Then you can paste a block of code into the text.

0 Likes

#18

I put new films in the same place. Problem is that I can’t paste any text on the right empty field or where I like like I can in the Kedit - Why ? because ST recognize end of line :frowning: but Kedit doesn’t care about it. Where I put my cursor I can write, move text or what ever and it not demolish my code ! It is my problem in ST.

https://drive.google.com/open?id=1CJ5eYcGpMaxA1ZbwKWaEj-24oNhkZHa3

0 Likes

#19

Ah I understand now. What you are saying is that you cannot insert a block of code at the end of existing text after the end of the proceeding line. I have added a function to my code to create appended comments at the end of a line and I needed to make a plug in python package to do this. If you want this exact functionality then you will probably need to craft or add in a package. I defer to Clams answer. I’ve never needed to paste code at the end, just within other text blocks.

0 Likes

#20

You see. No problem. Thank you for help and converstion. People using ST propably to html, www coding or programing and it is great editor nowadays in Wondows and Mac and Linux !!!. ST has many useful option like dynamic focus and many more. But as you saw…using to block data operation like columns there is no better than KEDIT. Xedit was symiliar a long ago and it is said that ST couldn’t have taken the best from the past together mix it could make a the best editor.

0 Likes

#21

You can use the Alignment package to add space characters in every line with a caret so that they line up. Assuming what you intend to paste has no leading spaces, this will result in effectively allowing you to paste lines as a “block”.

I didn’t watch the videos, so this suggestion is solely based on your conversation here.

0 Likes

#22

Thanks.

The video is awailable here

https://drive.google.com/drive/folders/1CJ5eYcGpMaxA1ZbwKWaEj-24oNhkZHa3

I am trying most of triks but it is hard job and still no the same like in Kedit.

Thank you.

0 Likes

#23

Have you tried the plugin I linked ? because it does exactly what you are showing in your video .

0 Likes

#24

I have installed it but can use it - how to copy block and paste on the right ? There are end of lines and I can go there and paste anythink ?

0 Likes

#25

Just press space, to get your cursor to the correct position.

Or in fact just install the Virtual Space Plugin which include my plugin.
Edit: Apparently this plugin is not available anymore :frowning:

0 Likes

#26

I tend to agree with @leszpol, block selections and operations should belong to the native multi-cursor editing features of ST. One of ST strong points is, after all, multi-cursor support, and his proposal would enhance the current state of how ST can handle complex selections and operations.

At least, IMO, these type of block operations is what one would expect from operations on these type of selections, except that they are not currently supported. I don’t see this as belonging to the list of the aforementioned missing features that every user would like to see implemented, it might actually be more a case of an already available feature needing to be perfectioned.

Of course, this feature would also change the core behavior of ST in many contexts, which might not be to everyone’s liking, but I’d bet it would be seen as an improvement by most.

It would be nice to have a central place for a features wish-list, were users could propose the features they’d like to see implemented, and other could vote in favor or against, so that we could have a clear picture of what might be coming (or not) in the future. ST dev team could mark features that were accepted and are pending, as well as others which are rejected, and such a central place for features request could also serve the devs as a reference to see how popular any such feature is among the userbase.

0 Likes

#27

Yes. It is it.

Regards.

0 Likes

#28

It doesn’t work- sorry :(. By press space, to get your cursor to the correct position nd crt+v it gives block at the beginning of the lines :frowning:

0 Likes