I'm trying to do this Multiple selection with Sublime on Mac:
I can do it easily with Textmate: https://i.stack.imgur.com/htjDk.gif
But did not found how to do it with Sublime.
With text highlighted (CtrlA for all text): CtrlShiftL will allow you to modify text on all lines simultaneously.
http://www.sublimetext.com/docs/selection
Select the required text and press CommandD multiple times.
Related
Whenever I do a sublime find, at some match I wish to add the text. But is there a shortcut to edit without moving mouse and clicking the text (to bring cursor to that location)
Example gif (issue I'm facing) - https://imgur.com/wTe3vcA
Just press Esc after finding your text.
In Sublime Text I can highlight text between specific locations by holding down shift and clicking the start of the region I want highlighted and then the end.
How do I do this with just the keyboard?
Method 1
Explore the commands in the Edit > Mark submenu.
Move your cursor to the start of the desired selection and run Set Mark (Ctrl+K, Ctrl+space).
Then move your cursor to the end of the desired selection and run Select to Mark (Ctrl+K, Ctrl+A).
Method 2
Or, as noted in the comments, hold down Shift as you move across the desired selection (using arrows, etc.).
Try the key command Ctrl+Shift+End on Windows when you are at the beginning or in the middle somewhere of a document. This works with any program.
I occasionally look through logs or other data where I'm only interested in a small piece of a very large amount of data. I usually just drop it into sublime text and then cut out all the data I'm not interested in. How can I select all the text from the beginning up to my cursor? And all the text from my cursor to the end of the file? That would make reviewing data a little easier. I'd prefer if this answer worked in sublime text 3, but other lightweight text editors would be useful too if it couldn't be done if sublime text 3.
Mac:
Select all text above your cursor: command+shift+up.
Select all text below your cursor: command+shift+down.
Windows:
Select all text above your cursor: ctrl+shift+home.
Select all text below your cursor: ctrl+shift+end.
*This works in all versions of Sublime Text
This question already has answers here:
Sublime Text 2 multiple line edit
(10 answers)
Closed 6 years ago.
I was using Notepad++ and now I want to use the same cool features in Sublime but I don't know how.
I want to edit multiple lines at the same time like this:
But I don't want to Ctrl+Click at each line for this. I want to click at first line and click at last line for one vertical line.
How I can do this?
First, select multiple lines (by dragging mouse, shift+arrow, etc.). Then, press:
CTRL+SHIFT+L
or on MAC: CMD+SHIFT+L (as per comments)
Alternatively you can select lines and go to SELECTION MENU >> SPLIT INTO LINES.
Now you can edit multiple lines, move cursors etc. for all selected lines.
Use CTRL+D at each line and it will find the matching words and select them then you can use multiple cursors.
You can also use find to find all the occurrences and then it would be multiple cursors too.
Thank you for all answers!
I found it! It calls "Column selection (for Sublime)" and "Column Mode Editing (for Notepad++)"
https://www.sublimetext.com/docs/3/column_selection.html
Can I do multiple select same words in Vim as that was in Sublime text 2 with command ctrl+D and then edit selected words?
Yep! Check this out: vim-multiple-cursors
No you can't but someone is working on it.