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

Alternative to "go to parent/child/sibling" navigation #104

Open
micouy opened this issue Apr 2, 2021 · 2 comments
Open

Alternative to "go to parent/child/sibling" navigation #104

micouy opened this issue Apr 2, 2021 · 2 comments

Comments

@micouy
Copy link

micouy commented Apr 2, 2021

I saw there was an issue about Leap Technology #44. I admit I haven't read the whole discussion but I agree with @kneasle it seems just like / and ? in vi. I don't use / for navigation because identical words often repeat throughout the code. On the other hand I also agree with the author of the issue that navigating the tree is much more tedious than using a mouse or just a cursor.

I propose an alternative solution I fell in love with which is used in amp. amp has a jump mode. In this mode it displays overlapping ids on top of the code. Each item you can jump (basically every word) is assigned a short id (2/3 letters). When you type the id, amp instantly moves the cursor to the beginning of this item. This solves the problem of identical words.

This solution is also used in browser extensions which enable "vim mode".

jump mode

@kneasle
Copy link
Owner

kneasle commented May 26, 2021

Aha yes I've seen this and it looks really awesome! I should install it and try it out, actually....

Something like this would, I think, make a good plugin (a plugin that could be shipped by default). Also, sorry for the suuuuuper slow reply - stuff's been kinda insane recently and I had to backburner Sapling for a while... I've had some new ideas recently so I'll hopefully come back to it soon.

@xa888s
Copy link

xa888s commented Jun 10, 2021

jump mode

This is cool, also it might be good to differentiate the IDs more in the first character (while still keeping these near the home row) to allow jumping to be quicker (having to press less keys to narrow down your "jump search"). It would also make sense to make the "words" or "nodes" that are farther from the cursor/selected node have shorter IDs, as generally if you need to jump you are trying to move a farther distance (if it is closer you can just do jj or kk or whatever). Finally, attempting to make jumps mnemonic based could be helpful (i.e. if you are trying to jump to a function it could be something like {CHANGE_MODE} f {FIRST_LETTER_OF_FUNCTION_NAME}{OTHER_EASY_TO_TYPE_CHARACTERS_IF_THERE_IS_AMBIGUITY}). I'll try to help with this if possible because this project is really exciting :)

EDIT: For the mnemonic thing having the currently used keyboard layout be configurable would allow this to also be ergonomic for dvorak or other keyboard layouts (making the suggestions be closer to their home row as well), but that is thinking into the far future :P

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

3 participants