I’ll second that. This thread seems especially interesting and useful in a generic way. More like this please.

On 22 Sep 2014, at 00:30, Phil Christensen <phil@bubblehouse.org> wrote:

Alan/Ryan,

Thanks much for this post. Not a very specific reason, except that now I finally get how to use Transpose.

-phil

On Sep 20, 2014, at 4:38 AM, "Allan Odgaard" <mailinglist@textmate.org> wrote:

On 20 Sep 2014, at 0:06, Ryan Fitzer wrote:

  1. Using the same combo as before, ⌘E then ⌥⌘F, is there a shortcut for jumping through each match without deselecting the matches?

If you press ⌃W then it will select the current word, but if there already is a selection, then it’ll extend the selection to include the next occurrence of what’s currently selected.

This is a very powerful feature that probably gets very little mention, not only to quickly replace multiple instances of the same thing, but also to quickly get multiple carets in locations that are not otherwise easy to get (via the other ways to break into multiple carets).

Take this snippet:

if(!something)
{
    performActionY();
}
else
{
    performActionX();
}

Say we want to get rid of the negation and swap the two blocks. We could use copy/paste with a lot of arrow up/down, since we first have to copy the block, then the ‘else’ line.

Alternatively, select first open-brace, press ⌃W, and then press →. Now we have a caret in each block:

if(!something)
{‸
    performActionY();
}
else
{‸
    performActionX();
}

To swap the blocks, press ⇧⌘B (Edit → Select → Enclosing Typing Pairs) and then swap with ⌃T (Text → Transpose).

The Transpose feature is another action that deserves more mention as it’s quite versatile, but I’ll leave that for another post.

As for your other questions, I’m afraid the answer is no to those. I don’t use the incremental search myself, which means it’s generally last on the list of things I’d work on, but also that I’d be open to pull requests to change its behavior (since I don’t really care how it works).


_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate

_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate