Re:Disassembling Sublime Text
by wishinghand on Sunday December 04, 2016 @03:08PM
(#13101532)
By multi-line edit do you mean multiple cursors at once? Does it have a fancy regular expressions generator to replace it? Otherwise that's a non-starter for me, simultaneous editing is too valuable.
[ Parent
| on HN ]
It's there, it's just bound to alt-click instead of ctrl-click. And currently you can't rebind any keybinding with a mouse click on it, so you have to use alt-click.
What are the main use cases of multiple cursors? It seemed like an interesting feature, and I'm curious why it would be considered essential.
I use them very often in Emacs instead of keyboard macros. They are useful whenever you have to perform the exact same operations in several places simultaneously visible on the screen[0]. By operations I mean both simple ones, like writing something, and more complex ones, like navigating/deleting whole words (of different length), etc.
Mostly I use it for quick renaming of variables, string fixes, and some structural changes in code.
--
[0] - multiple cursors, at least in Emacs, can work off-screen too, but I don't like not seeing what's going on when I do changes.
Re:Disassembling Sublime Text
by NoGravitas on Monday December 05, 2016 @07:55AM
(#13105035)
I also do this, though I use iedit-mode rather than multiple-cursor-mode.
However, I do like to point out that it's really just eye-candy for stuff I was already able to do in emacs. Previously, I would have used either keyboard macros or query-replace-regexp to do the same things.
I second it. I too used either keyboard macros or query-replace- commands before. Multiple cursors is just nicer for these particular things.
Re:Disassembling Sublime Text
by wishinghand on Sunday December 04, 2016 @03:39PM
(#13101669)
It's basically a visual regular expressions. So I'll caveat my original statement that if you don't know regex, you need it. I never learned regex because I came from a self-taught, web development oriented background. So if I need to replace all instances of a variable, then go to the end of the line they were on and type in a different variable name or add a semi-colin, that's what I use.
Re:Disassembling Sublime Text
by madeofpalk on Sunday December 04, 2016 @04:09PM
(#13101787)
Lots of little things. Select a multiple lines of an object/hash/dict, break into multiple cursors, rewrite line (copying and pasting as needed, it works that out as well) to change to variable declarations, or to add a comma, or to... whatever.
I often use "multiple cursors" as vertical cursors, to indent or dedent a whole block of code 1 space at a time. Often useful for contexts when shift+tab/tab doesn't work.
For me it's mainly part of this sequence:
Ctrl-F <search query> SelectAll <edit with multiple cursors>
Do it all the time.
Re:Disassembling Sublime Text
by heartbreak on Monday December 05, 2016 @12:54AM
(#13103650)
I love the CTRL+CMD+G route as well. Use it constantly when refactoring.