Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.

#44 Multiple-editor pane support (Ctrl-w)

NetBeans (18)
Joel Smith

While vim's window support isn't exactly analogous to NetBeans' split panes, they are very similar, and if possible, it would be great to have the vim window keys "do the right thing" in jVi and NetBeans.

The most important feature is the ability to jump between two panes while editing. For example, if you have one pane on top and one on the bottom, Hitting Ctrl-w j would take the focus from the top pane and shift it to the bottom one, and Ctrl-w k would move the focus to the pane above. Likewise, for side-by-side panes, h and l could be used to go left and right (when preceded by a Ctrl-w, of course). Ctrl-w w should cycle through all open panes, Ctrl-w t and Ctrl-w b should go to the top and bottom panes. Honestly, just having Ctrl-w w alone would be awesome because it would be enough to keep me from having to use the mouse to switch focus.

I tried to emulate this by mapping the "Back" and "Forward" in NetBeans to Ctrl-w+Ctrl-k and Ctrl-w+Ctrl-j, but Back and forward aren't exactly analogous to vim's Ctrl-w (h/j/k/l/w/t/b) since it also seems to also cycle between files that have been opened when using Ctrl-].

A less important feature is the ability to open and close panes and resize them. These commands are :split, :new, :close, :only, :vsplit, :vnew,
and Ctrl-w n and Ctrl-w H. Some of those take numbers for an initial size. For resizing, <number> Ctrl-W (+/-/</>) will increase or decrease horizontal or vertical window size. Of course, these are commands that are infrequently used in an editing session, so it's not the end of the world to perform them with a mouse, so these features aren't high priority in my mind.


  • Ernie Rael

    Ernie Rael - 2009-06-12

    The :close and :only commands should already work. Most of the rest require some NB API support.

    NB's Issue 135385 http://www.netbeans.org/issues/show_bug.cgi?id=135385 is a feature request for some NB API that would would allow support for some Ctrl-w split commands (at least within the NB framework). You can add comments to the issue and/or encourage people to vote for it.

    > The most important feature is the ability to jump between two panes

    You can use ':e#' for this (you may want to turn "auto popup after :e#" option off). Also, Ctrl-space after entering ':e#' brings up a list window like code completion with all the open files listed; this is handy for going to a particular open file; the 'gt' and 'gT' vim commands are implemented which helps moving between tabs.

    > Ctrl-w w should cycle through all open panes,

    I assume you mean "visible" not "open". The various editor tabs are open.

    > Ctrl-w t and Ctrl-w b should go to the top and bottom panes.

    I hadn't really thought about it, but the Ctrl-w commands that move the focus could probably be implemented. I would really like that as well; I generally have two windows open left-right.

    Once there is API support, figuring out how to map things to the NB framework will be interesting.

  • Ernie Rael

    Ernie Rael - 2009-06-12
    • assigned_to: nobody --> err
    • status: open --> open-accepted
  • Ernie Rael

    Ernie Rael - 2009-07-08

    I've checked into CVS an imperfect, but usable, Ctrl-W_Ctrl-W. Will be in the upcoming beta2.

  • Ernie Rael

    Ernie Rael - 2009-07-14

    nbvi-1.2.6.beta2.zip has the Ctrl-W_Ctrl-W command. Great feature, thanks. It is imperfect, the order is arbitrary but fixed; at some point it should take into account the geometric relationship of the windows.

    I'll leave this feature request open to cover the some of the other Ctrl-W features, most of which require some NetBeans API support.

  • Ernie Rael

    Ernie Rael - 2010-03-09

    Available in jVi-1.3, now in VCS mercurial repository. Note this only applies to traversal commands. The window manipulation commands, e.g. Ctrl-W_Ctrl-S split window, need NB API support.

  • Ernie Rael

    Ernie Rael - 2010-03-09
    • status: open-accepted --> open-fixed
  • Ernie Rael

    Ernie Rael - 2010-11-23
    • status: open-fixed --> closed-fixed

Log in to post a comment.