1. Is there a way to use the current selection for "Incremental Search" (⌃S)? It would be great to have "Use Selection for Find" (⌘E) to do the same for "Incremental Search".
2. When using the combo of "Use Selection for Find" (⌘E) and "Find All" (⌥⌘F), the file is scrolled to the last match. If you're at the top of a long file, having it scrolled to the bottom can be pretty disorienting. Is there a way to reverse this to have the file scrolled to the first match?
3. Using the same combo as before, ⌘E then ⌥⌘F, is there a shortcut for jumping through each match without deselecting the matches?
4. Is there a way to enable "Incremental Search" (⌃S) to highlight all matches as you type, instead of just the first?
Thanks, Ryan
On 20 Sep 2014, at 0:06, Ryan Fitzer wrote:
- 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).
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@textmate.org wrote:
On 20 Sep 2014, at 0:06, Ryan Fitzer wrote:
- 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
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:
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
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:
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