Search code examples
vimnetbeansplugins

Is there a vi/vim like editor for Netbeans 11?


So far I've been developing PHP code without any real tools, using vi and my own set of debugging and project management techniques. But I've taken that as far as it will go, so I just installed Netbeans 11 and am in the process of learning how to drive it.

My first problem is that I've been exclusively using vi as my sole editor for over 30 years to the point where I struggle to use anything else. My fingers simply insist on using vi commands for cursor navigation, editing and saving. I've had several cases already where inserting :w somewhere breaks my code. I also rely frequently on using regular expressions to edit code.

There used to be a vi/vim (ish) plugin called jVi for Netbeans up to 8.2, but that seems to have been discontinued.

Is there any other way I can integrate a vi-like editor into Netbeans 11, or is that maybe a built-in feature now that I can't find in any documentation which caused the plug-in to be discontinued?


Solution

  • There is an Edit Externally plugin for NetBeans that allows launching on demand an external editor for the current file.

    Configure it: Tools -> Options -> Miscellaneous -> Edit Externally.

    Fill in a command name followed by any of recognised placeholders, e.g.:

    Edit externally command: /usr/bin/gvim ${file} "+call cursor(${line}, ${column})"
    Open externally command: /usr/bin/gvim ${file}

    Add a keyboard shortcut (e.g. Alt+v Alt+v) to launch the external editor: Tools -> Options -> Keymap. Look for the "Edit Externally" action.

    See also an old page that summarises Vim integration projects.