在使用 Eclipse 时,我经常使用键盘箭头浏览包资源管理器树。
在 Windows 中,我可以通过按 → 键来展开折叠的节点。在 Linux 中,我需要按 Shift + →。有没有办法重新配置它以便不需要 Shift?
最佳答案
把它放到你的 ~/.gtkrc-2.0
中,你就可以开始了。左行和右行进行了请求的更改,其余的只是我个人添加的,以使 TreeView 的行为更像 vim。希望对您有所帮助!
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"
然后重新启动 Eclipse 以应用新的绑定(bind)
关于linux - 是否可以单独使用箭头键在 Linux 上的 Eclipse 中的包资源管理器中伸展树(Splay Tree)节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4747264/