sublime-selectuntil
sublime-selectuntil copied to clipboard
Feature request: command or search argument to quickly expand to the nth occurence of word
I often use selectUntil to quickly select foreach
blocks, therefore I need to put endforeach
(or more concise endf
) as a search query. However, foreach
blocks may contain other foreach'es inside, and it requires an Enter, ctrl+shift+s, Enter chain of keystrokes to go past inner terms and select to the second or more occurence of word.
Is it possible to make a separate bindable command for expanding the selection to the next occurence (while the panel is open) or introduce a search argument for expanding to the nth occurence at once?
For example, the query endf*2
would allow to quickly expand the selection to the end of the following block ignoring inner endf
occurence:
foreach( $events as $post ) : setup_postdata($post);
if ($post->news) {
echo '...';
foreach ( $post->news as $newspiece ) : setup_postdata( $newspiece );
echo '...';
endforeach;
echo '...';
}
endforeach;
Thank you for a great plugin.
I'm a little worried about adding more syntax to the query selector. Perhaps a good middle ground would be to introduce a new shortcut that immediately repeats the previous selection?
Something like ctrl + shift + alt/command + s?
Let me know if that's a good compromise.
Yes, that would be an optimal solution. Is it possible to make it work without closing the panel, so the results could be still previewed like it happens now?
Interesting. Yeah, I'll try that.
On Mon, Jan 26, 2015 at 12:39 PM, certainlyakey [email protected] wrote:
Yes, that would be an optimal solution. Is it possible to make it work without closing the panel, so the results could be still previewed like it happens now?
— Reply to this email directly or view it on GitHub https://github.com/xavi-/sublime-selectuntil/issues/12#issuecomment-71533605 .
@xavi- Any update on this issue? Would love to have this feature in this package.
Have you thought about something simpler like using F3 when you have the text input open? Many other builtin commands use F3 to select/goto next instance of somethiing, for example how incremential search works.
Could you instead rely on the amount of indentation that you expect? Like:
/^ endf/
pumped for this feature :)
an extra shortcut (I'd use shift+ctrl+e
cos g
is too far away) and keeping the panel open for preview would be amazing!
many thanks for the awesome tool! I use it daily
A context-specific binding to ctrl+enter
to skip the current find result (and ctrl+shift+enter
to go back) would be perfect for this.