Issue
In Eclipse IDE, having a current file opened in editor, and having Project Explorer view linked to editor.
I would like to navigate back from parent to parent folder in Explorer view, using keyboard only. (where each folder may have hundreds of files)
Alternately, I would like to toggle (close) parent folder of selected file in Explorer view.
To demonstrate with a screenshot, here is the start state:
and where I want to go, parent folder selected / or closed.
Mouse workaround
As a workaround, my current workflow is use mouse to scroll up explorer until parent folder, then I close it using - button to its left.
Because of linked with editor mode, Explorer view is scrolled down to current file, which makes parent folder not visible in explorer.
Having to do this makes the mouse way not very effective.
Another keyboard workaround
Navigate approximatively to parent using key PAGE-UP to scroll up, but depending on files count, it is also not effective.
Is there an existing keyboard, or a way to do it?
Note: using Oxygen.3a Release (4.7.3a) on Ubuntu 18.04.1 LTS
Solution
Finally, I found the answer! I combined answers from this post, restarted GNOME shell, restarted eclipse and it worked:
Edit ~/.config/gtk-3.0/gtk.css
(create if doesn't exist):
@binding-set MyTreeViewBinding
{
bind "<shift>Left" { "select-cursor-parent" () };
bind "Left" { "expand-collapse-cursor-row" (0,0,0) };
bind "Right" { "expand-collapse-cursor-row" (0,1,0) };
}
treeview
{
-gtk-key-bindings: MyTreeViewBinding;
}
To restart the GNOME shell: hit ALT + F2.
Applying this solution will add the following functionality:
- SHIFT + ←: Go to parent.
- ←: collapse current item.
- →: expand current item.
I came up with the steps of restarting GNOME shell and eclipse. Not sure if just changing the configurations would do the trick right away or not. Haven't tried it :D
I'm using GNU/Linux Ubuntu 18.04.4 LTS.
Answered By - joker
Answer Checked By - Marilyn (JavaFixing Volunteer)