-
Notifications
You must be signed in to change notification settings - Fork 91
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
Multi Caret Selection Mode #279
Comments
That issue does aim to achieve the same goal but I think the implementation is different from mine. If I understand right, the main difference is suggesting we type the tag for each match. I think this won't scale well to many real life examples. The goal for the mode I described here is to be almost an extension to the * The reason it could be good to not immediately toggle the first match is that this mode could also double as a navigation tool! When leaving the mode with 0 selections toggled, the caret should remain at the final location, that way we can navigate the caret between matches. Coupled with a key to cycle through the last few searches (while already in the mode) it could potentially hold a powerful new way to navigate code. Gotta try it to know for sure though. Additional Notes:
It is reinventing the wheel a bit in a way since this is basically the CTRL-F bar of the editor, but then again AceJump by default is also reinventing the mouse too. I think dedicated modes like these which integrate well into the keyboard to create a seamless workflow with low hand motion are the reason Vim and other similar editors flourish even today. The advantage of doing it this way is that we don't have to bind a bunch of crazy shortcuts to use convoluted actions from the search bar, you simply shift into a cool new contextual keyboard mode that has its own properties and easy shortcuts. Our hand is almost always hovering above the arrows, so the mode can be entered with a shortcut of the left-hand and then we can navigate straight away with UP and DOWN for example. Plus we get to reuse AceJump's efficient tagging system for all kinds of purposes. |
Hi, I have submitted to YouTrack a draft for a flexible and specialized code navigator which Jetbrains could add to their base platform https://youtrack.jetbrains.com/issue/RIDER-26434. This navigator at its core would allow navigation of a list of stops. It could also support a selection mode exactly as described in this AceJump issue which is why I'm linking this here as well. The default behaviour of picking the word under the caret explained here doesn't have to be an AceJump feature, it can simply be a base functionality of the IDE which uses the navigator. However, further features could be added such as typing a random word in the file (using AceJump's tagging system) and converting the matches to navigator stops. AceJump would simply have to use the navigator api to start it using its own custom list of stops to navigate through. AceJump could also offer a shortcut to convert navigator stops to tags and back and forth (acts as a toggle), that way it would result in a seamless experience between the navigator and AceJump. This comment will certainly make more sense after reading the YouTrack article above but I should warn you, it's also really really long. I believe only Resharper and Rider have Structural Navigation so far (C# only) so you may have to look it up to understand what it looks like exactly, since this also a suggested precursor to Structural Navigation. |
Hi Nicolas, thank you for the detailed feature proposal. While I cannot promise to implement this, I can see the value of your proposal and AceJump welcomes contributions. Please let me know if you would be interested in working on this feature. If so, MultiCaretCodeInsightAction is a good place to get started. |
I noticed that IdeaVim's multi-caret selection mode has recently improved. As discussed here, I am a little hesitant to add features that overlap with IdeaVim functionality, although it may be possible to offer a smoother multi-caret integration. In any case, let's merge this discussion with #350. Thank you for the suggestion! |
Just an idea which I thought could work perfectly with AceJump's other existing features, and fits the name "AceJump" quite well I think. There is a shortcut I use religiously which is "Add Selection for Next Occurence". AceJump could have a mode which enters by pressing a different shortcut, and let's you navigate occurrences of the current word under the caret using:
When leaving the multi-caret editing (e.g. when pressing escape) the editor must return to a default caret. Usually this is the beginning location before leaving single-caret editing. For this mode, it could be done in many ways:
I think this would be an insane editing tool because you could selectively discard occurrences (leave holes) which is a very common jerk in the workflow.
The text was updated successfully, but these errors were encountered: