Is it possible to use arrow keys alone to expand tree node in package explorer in Eclipse on Linux?

后端 未结 6 1505
花落未央
花落未央 2020-12-02 05:12

When using Eclipse I browse through the package explorer tree using the keyboard arrows a lot.

In Windows I can expand a collapsed node by pressing the →<

6条回答
  •  孤城傲影
    2020-12-02 05:44

    Put this into your ~/.gtkrc-2.0 and you should be good to go. The Left and Right lines make the requested change, the rest are just my personal additions to make the tree-view act more vim-like. Hope that helps!

    binding "gtk-binding-tree-view" {
        bind "j"        { "move-cursor" (display-lines, 1) }
        bind "k"        { "move-cursor" (display-lines, -1) }
        bind "h"        { "expand-collapse-cursor-row" (1,0,0) }
        bind "l"        { "expand-collapse-cursor-row" (1,1,0) }
        bind "o"        { "move-cursor" (pages, 1) }
        bind "u"        { "move-cursor" (pages, -1) }
        bind "g"        { "move-cursor" (buffer-ends, -1) }
        bind "y"        { "move-cursor" (buffer-ends, 1) }
        bind "p"        { "select-cursor-parent" () }
        bind "Left"     { "expand-collapse-cursor-row" (0,0,0) }
        bind "Right"    { "expand-collapse-cursor-row" (0,1,0) }
        bind "semicolon" { "expand-collapse-cursor-row" (0,1,1) }
        bind "slash"    { "start-interactive-search" () }
    }
    class "GtkTreeView" binding "gtk-binding-tree-view"
    

    then restart your Eclipse to apply new bindings

提交回复
热议问题