[TxMt] Re: Questions on Search/Find Interaction
Allan Odgaard
mailinglist at textmate.org
Sat Sep 20 08:38:23 UTC 2014
On 20 Sep 2014, at 0:06, Ryan Fitzer wrote:
> 3. 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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140920/a6b1722a/attachment-0001.html>
More information about the textmate
mailing list