5 ms·
That's definitely informative and interesting. I feel like I'm missing something, though. How exactly does multi-cursor solve the problems you express with ma
by tene 16y ago
That's definitely informative and interesting. I feel like I'm missing something, though. How exactly does multi-cursor solve the problems you express with macros?
it took some thought into making sure I always remember to start at the beginning of the line, always use searches to find the next piece, etc.
Does sublime's multi-cursor support move the cursors around differently? If the next piece isn't positioned the same in the two hunks you're editing, don't you have to use searches to find it with multi-cursors too, or are you suggesting that Sublime has a way of knowing what you're wanting to edit, and moves the cursor around for you?
- edanm 16y agoGood catch - my post was long enough so I didn't get into it. Mostly, this isn't a problem - you can move around using ctrl+arrow keys, which moves by words. Most repetitive code is usually close enough that this solves most problems, though once in a while you'll need to think of some "creative" things to do. These are usually easy, like hitting home, and because you see everything, you can easily see when you need to do it, and what you need to do. Having said that, there are still some things missing from Sublime Text. I think this whole multi-cursor thing is brilliant and the future of text editing, but we still have to discover a lot of the tricks. For example, Sublime has nothing like vim's "forward to char" command. This is an absolute must when using multi-cursors, since there are times when moving by words isn't enough. I had to implement this myself (very easy to extend Sublime), since it's extremely useful. Also, I implemented a few new ways of making multiple selections. For example, I implemented a small function that splits up a selection by a char. So, I can select the inside of a function's variable list (e.g. for "foo(int a, char b)", I'd select the inside of the parans). Then, I use my function and split by the ",", which effectively gives me two selections, one covering "int a", and the other covering "char b". I can then cut these, go to a new line, and paste these on two lines. In this way, I can take a function with 6 variables and easily manipulate each of them, for example assigning them to "this.m_a", etc. This is possible because of a function I implemented for myself, and shows the kind of power I think this kind of editing will have the more people get exposed to it.