[TxMt] Re: Questions on Search/Find Interaction

Ryan Fitzer ryan at ryanfitzer.com
Sun Sep 21 23:20:18 UTC 2014


Thanks for the in-depth example! Didn't realize ^W would select the next
occurrence of the current selection. This is a great alternative for the
combo ⌘E then ⌥⌘F, when in short files.

On Sat, Sep 20, 2014 at 1:38 AM, Allan Odgaard <mailinglist at 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 at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140921/b7645325/attachment.html>


More information about the textmate mailing list