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

integrate into package explorer, etc? #173

Closed
nhajratw opened this issue Mar 5, 2013 · 3 comments
Closed

integrate into package explorer, etc? #173

nhajratw opened this issue Mar 5, 2013 · 3 comments

Comments

@nhajratw
Copy link

nhajratw commented Mar 5, 2013

Maybe a longshot, but is there any way to integrate vrapper so we can use vim navigation in other views like package explorer, problems, search, etc?

@keforbes
Copy link
Contributor

keforbes commented Mar 6, 2013

I'm going to take the coward's way out and say "it's an open source project, you're welcome to implement it yourself and submit a Pull Request!" ;-)

Honestly, I'm sure this type of thing is possible but it goes beyond my knowledge of Eclipse programming. You would need to add listeners to each of those views and perform certain Eclipse operations based on key presses. That isn't much more than what Vrapper does now except it only listens for AbstractTextEditor instances. I don't know how to add listeners to other views and perform operations relevant to those views.

@bdetweiler
Copy link
Contributor

I kind of like the idea. You could use j/k to move up and down, and l/h to expand/collapse projects. Maybe {/} to jump to different working sets. I'd give that a shot if I could find some decent documentation on the Eclipse API.

albertdev added a commit to albertdev/vrapper that referenced this issue Dec 20, 2018
We have had requests from people for easier ways to navigate the package
explorer, preferably using the HJKL keys like Vim does.

This commit adds a "Vrapper Up Arrow Map" command (and so on for the
other 3 arrows) to the General > Keys preference page which can be bound
to HJKL.

Do note that it should be bound to the "Vrapper Enabled on a View"
context to be safe; otherwise you would be unable to type HJKL in any
dialog or entry box.

As a safety measure the code will also fall back to just inserting the
bound keys if Vrapper is disabled or when the focused control is a
textbox. Other controls have not been tested because they're not
commonly available in Eclipse Views.

Fixes vrapper#173.
@albertdev
Copy link
Member

We now have something for this in our Unstable Update Site after #820 got merged.

Go to the Keyboard shortcuts section in Preferences and search for "Arrow Map" (the screenshot below shows slightly more so ignore the other things):

issue_108_config_defaultscheme

Now select the "Vrapper Down Arrow Map" shortcut and click in the "Binding" text field, then use it to replace F15, J by J (or whatever key you want). Repeat for the other 3 shortcuts.

Alternatively you can select "Vim's key bindings" from the Scheme dropdown at the top, but that introduces Vim keybindings for everything (you might want to export your settings before choosing that or you could loose your finely-honed set of key bindings).

Anyway, once you click Apply and close the Preferences dialog you can now use those keys to navigate through the package explorer. It emulates the arrow keys, so H and L can be used to open / close the + nodes in trees, then J and K can be used to step in them.

Let us know what you think, at least if you are still using Eclipse at this point.

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

No branches or pull requests

4 participants