2

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?

  • Possible duplicate of [Is it possible to use VI or VIM keymap in NetBeans?](https://stackoverflow.com/questions/483962/is-it-possible-to-use-vi-or-vim-keymap-in-netbeans) – phd May 21 '19 at 11:14
  • https://stackoverflow.com/questions/tagged/netbeans+vi – phd May 21 '19 at 11:14
  • Just out of pure curiosity as someone who's been using vim for almost 2 years, what made you use vi solely for 30 years and then suddenly want to switch? And why specifically netbeans instead of some other editor with a vi-mode? – Stun Brick May 22 '19 at 08:11
  • To me, vi and vim are to all intents and purposes the same as they both operate on the bases if 'vi' keystroke commands (i, j, k, l for cursor control, :w to save, dd do delete a line, etc.) I'm looking for an editor that can do that. Using arrow and delete keys and other combinations (e.g. ctrl-s to save) is a pain because my fingers only remember vi-type keystrokes. – Frank van Wensveen May 22 '19 at 12:07
  • @phd - This was relevant up to Netbeans 8.2 after which the jVi plugin appears to have been discontinued (see my OP) – Frank van Wensveen May 22 '19 at 12:09
  • ViEx (linked in the duplicate answer) is quite active. – phd May 22 '19 at 12:14

3 Answers3

3

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.

2

The jVi plugin still works with Netbeans 11, but requires a manual installation. This process is mentioned briefly on the jVi website. Per the instructions, you'll need to download and unzip the latest nbvi zip file (nbvi-1.5.4), then install all five of the plugin files. (Tools => Plugins => Downloaded, Add Plugins and Install).

Nigel Tufnel
  • 418
  • 3
  • 14
0

jVi can be installed again from the Plugins manager (Tools -> Plugins) by first installing jVi Update Center JDK-11 from the Available Plugins tab, and following the instructions in its description:

  1. select the "Available Plugins" tab. And then you may need to click "Check for Newest".
  2. From the Editing category select
    • "jVi for NetBeans"
    • "Editor Pin" (optional)
  3. install jVi

Note 1: You may need to update your JDK version if it fails to activate when starting Netbeans.

Note 2: To deactivate or uninstall, you will need to check the Show details box in the Installed tab.


Here's a link to its website in case someone wants to check its changelog. As of the time of this answer, it seems more active than ViEx.

DystD
  • 99
  • 4