ChatGPT解决这个技术问题 Extra ChatGPT

使用 SublimeText2 选择所有和多个光标

I have a text file with 100's of news articles. I need to Select All > Take cursor to the beginning of each line and have the 'multiple cursors' open so I can add some data.

Since the new articles do not have the same begging character, I can not use CTRL+F3.

Is there a way to [CTRL] + [A] (Select All) then > Go to the begging of each line with 'multiple cursors' open ?


R
Riccardo Marotti

You should select all with ctrl+A.

Then split the selection into one selection per line with ctrl+shift+L.

Then press the left arrow key.

Now you should be able to type data at the beginning of each line.


cmd+shift+L for mac
To type at the beginning of each line press HOME button instead of Left arrow key.
Works great in Sublime Text 3 on OSX Sierra! Thank you.
ctrl + L , if you wish to select the other side.
C
Community

Let me add some answer, ( work in sublime 2 / sublime 3 )

i try with @Riccardo Marotti step , but when the article have tab it will lead to the very far first line

So I make some fix , To make cursor in every front line or every end of line :

ctrl+A // select all ctrl+Shift+L // Add cursor to all line Shift+Home // put cursor to first word in the line

to get the end of line no need to do the first step again if you are in the first line, just do this one :

Shift+End // put cursor to end of line, then click "right arrow" to remove the drag

or you can try this one (really an experimental works)

Just use you center of mouse, click it (the center roll of your mouse), then drag, this will lead to add more cursor , then just press left/right

or try to seek more here :

sublime-text-multiple-cursor-shortcut override-shortcut-for-multiple-cursors

hope this help


Why do you need Shift+End in the first place if you want to get to the end of the line? Just press End lol
O
Orin MacGregor

I think ctrl+alt+down (or up) when your cursor is at the beginning of a line might be what you're looking for. It will put the cursor on multiple lines, and what you type will be duplicated on each.


Ha, that's weird. I'm using win7 as well and it works just fine. In fact, whenever I try that to mess with others' computers it never works.