Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: command or search argument to quickly expand to the nth occurence of word #12

Open
certainlyakey opened this issue Jan 24, 2015 · 7 comments

Comments

@certainlyakey
Copy link

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.

@xavi-
Copy link
Owner

xavi- commented Jan 26, 2015

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.

@certainlyakey
Copy link
Author

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?

@xavi-
Copy link
Owner

xavi- commented Jan 26, 2015

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
.

@Grokzen
Copy link

Grokzen commented Sep 20, 2015

@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.

@adzenith
Copy link
Contributor

Could you instead rely on the amount of indentation that you expect? Like:

/^    endf/

@ptim
Copy link

ptim commented Mar 18, 2016

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

@FichteFoll
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants