netbeans.txt ForVim version 9.2. Last change: 2026 Feb 14VIM REFERENCE MANUAL by Gordon Prieur et al.netbeansNetBeansnetbeans-supportVimNetBeans Protocol:a socketinterface for Vim integration into an IDE.1. Introductionnetbeans-intro2. Integration featuresnetbeans-integration3. Configuring Vim forNetBeansnetbeans-configure4. Error Messagesnetbeans-messages5. Running Vim inNetBeans modenetbeans-run6.NetBeans protocolnetbeans-protocol7.NetBeans commandsnetbeans-commands8. Known problemsnetbeans-problems9. DebuggingNetBeans protocolnetbeans-debugging10.NetBeans External Editor 10.1. DownloadingNetBeansnetbeans-download 10.2.NetBeans Key Bindingsnetbeans-keybindings 10.3. PreparingNetBeans for Vimnetbeans-preparation 10.4. Obtaining the External Editor Moduleobtaining-exted 10.5. Setting upNetBeans to run with Vimnetbeans-setup{only available when compiled with the |+netbeans_intg| feature}==============================================================================1. Introductionnetbeans-introTheNetBeansinterface was initially developed to integrate Vim into theNetBeans Java IDE, using the external editor plugin. ThisNetBeansplugin nolonger exists for recent versions ofNetBeans but the protocol was developedin sucha way that any IDE can useit to integrate Vim.TheNetBeans protocol of Vimisa text based communication protocol, overaclassical TCP socket. Thereis no dependency on Java or NetBeans. Anylanguage or environment providinga socketinterface cancontrol Vim usingthis protocol. There are existing implementations in C, C++,Python and Java.The nameNetBeansis kept today for historical reasons.Active project using theNetBeans protocol of Vim:- Eclim, (dead link) eclim.org/VimIntegration, description ofvarious projects doing Vim Integration:(dead link) www.freehackers.org/VimIntegrationProjects using theNetBeans protocol of Vim are or were:- Agide, an IDE for the AAP project, written inPython (now replaced by:Termdebug):http://www.a-a-p.org (link now dead)- Clewn,agdb integration into Vim, written in C:http://clewn.sourceforge.net/- Pyclewn,agdb integration into Vim, written in Python:http://pyclewn.sourceforge.net/- VimWrapper, library toeasy Vim integration into IDE:(dead link) freehackers.org/VimWrapperOutdated projects (links don't work):- VimPlugin, integration of Vim inside Eclipse:http://vimplugin.sourceforge.net/wiki/pmwiki.php- PIDA, IDE written inPython integrating Vim:http://pida.co.uk/Check the specific project pages to see how to use Vim with these projects.An alternativeis to usea channel, seechannel.In the rest of thishelp page, we will use the term "Vim Controller" todescribe the program controlling Vim through theNetBeans socket interface.About the NetBeans IDENetBeansis an open source Integrated Development Environment developedjointly by Sun Microsystems, Inc. and the netbeans.org developer community.Initially justa Java IDE,NetBeans has had C, C++, and Fortran support addedin recent releases.For more information visit the mainNetBeans web sitehttp://www.netbeans.org.The External Editoris now, unfortunately, declared obsolete. See (link seemsdead): externaleditor.netbeans.org.Sun Microsystems, Inc. also shipsNetBeans under the name Sun ONE Studio.Visithttp://www.sun.com for more information regarding the Sun ONE Studioproduct line.Current releases ofNetBeans provide full support for Java and limited supportfor C, C++, and Fortran. Current releases of Sun ONE Studio provide fullsupport for Java, C, C++, and Fortran.==============================================================================2. Integration featuresnetbeans-integrationTheNetBeans socketinterface of Vim allows to get information from Vim or toask Vim to perform specific actions:- get information about buffer: buffer name, cursor position, buffer content, etc.- be notified whenbuffers are open or closed- be notified of how the buffer contentis modified- load and save files- modify the buffer content- installing special key bindings- raise the window,control thewindow geometryFor sending key strokes to Vim or for evaluatingfunctions in Vim, youmustuse theclientserver interface.==============================================================================3. Configuring Vim forNetBeansnetbeans-configureFor morehelp about installing Vim, please readusr_90.txt in the VimUserManual.On Unix:--------When running configure without arguments theNetBeansinterface should beincluded. That is, if the configure check to find out if your system supportsthe required features succeeds.Incase youdo not want theNetBeansinterface you can disableit byuncommentinga line with "--disable-netbeans" in the Makefile.Currently theNetBeansinterfaceis supported by Vim running inaterminal andbygvim whenitis run with one of the following GUIs: GTK, GNOME, Windowsand Motif.netbeans-xpmIfMotif supportis required the usermust supply XPM libraries.The XPM libraryis required to show images within Vim with Motif.Withoutit the toolbar andsigns will be disabled.The XPM libraryis provided by Arnaud Le Hors of the French National Institutefor Research in Computer Science and Control. It can be downloaded fromhttps://ftp.nluug.nl/ftp/windowing/X/contrib/libraries/. The current release,as of this writing,is xpm-3.4k-solaris.tgz, whichisa gzip'edtar file. Ifyou create the directory /usr/local/xpm and untar the file there you can usethe uncommented lines in the Makefile withoutchanging them. If you useanother xpm directory you will need to change the XPM_DIR in src/Makefile.On MS-Windows:--------------TheWin32 supportis now in beta stage.To use XPMsigns onWin32 (e.g. when using with NetBeans) you can compileXPM by yourself or use precompiled libraries from (link seems dead):iamphet.nm.ru/misc/ (for MSVisual C++) orhttp://gnuwin32.sourceforge.net (for MinGW).Enable debugging:-----------------To enable debugging of Vim and of theNetBeans protocol, the "NBDEBUG"macroneeds to be defined. Search in the Makefile of the platform you are using for"NBDEBUG" to see what line needs to be uncommented. This effectively adds"-DNBDEBUG" to the compile command. Also seenetbeans-debugging==============================================================================4. Error Messagesnetbeans-messagesThese errormessages are specific toNetBeans socket protocol:E463Regionis guarded, cannot modifyThe Vim Controller has defined guarded areas in the text,which you cannot change. Also sets the current buffer, ifnecessary.E532The defineAnnoType highlighting color nameis too longThe maximum length of the "fg" or "bg" color argument in thedefineAnnoType commandis 32 characters.New in version 2.5.E656Writes of unmodifiedbuffers forbiddenWrites of unmodifiedbuffers that were opened from theVim Controller are not possible.E657Partial writes disallowedPartial writes forbuffers that were opened from theVim Controller are not allowed.E658Connection lost for this bufferThe Vim Controller has become confused about the state ofthis file. Rather than risk data corruption,it has severedthe connection for this file. Vim will take overresponsibility for saving changes to this file and theVim Controller will no longer know of these changes.E744Read-only fileVim normally allows changes toa read-only file and onlyenforces the read-only rule if you try to write the file.However,NetBeans does not let you make changes toa filewhichis read-only and becomes confused if Vim does this.So Vim does not allow modifications to files when runinNetBeans mode.==============================================================================5. Running Vim inNetBeans modenetbeans-runThere are two different ways to run Vim inNetBeans mode:+ an IDE may start Vim with the-nb command line argument+NetBeans can be started from within Vim with the:nbstart commandVim usesa 3 second timeout on trying to make the connection.netbeans-parametersThree forms can be used to setup theNetBeans connection parameters.When started from the command line, the-nb command line argument may be:-nb={fname}froma file-nb:{hostname}:{addr}:{password}directly-nbfroma file or environmentWhen started from within Vim, the:nbstart optional argument may be:={fname}froma file:{hostname}:{addr}:{password} directly<MISSING ARGUMENT>froma file or environmentE660E668WhenNetBeansis started from the command line, for security reasons, the bestmethodis to write the information ina file readable only by the user. Thename of the file can be passed with the "-nb={fname}" argument or, when "-nb"is used withouta parameter, the environment variable "__NETBEANS_CONINFO".The filemust contain these three lines, in any order:host={hostname}port={addr}auth={password}Other lines are ignored. The Vim Controlleris responsible fordeleting thefile afterwards.{hostname}is the name of the machine where Vim Controlleris running. Whenomitted the environment variable "__NETBEANS_HOST"is used or the default"localhost".{addr}is the port number for theNetBeans interface. When omitted theenvironment variable "__NETBEANS_SOCKET"is used or the default 3219.{password}is the password for connecting to NetBeans. When omitted theenvironment variable "__NETBEANS_VIM_PASSWORD"is used or "changeme".Vim will initiatea socket connection (client side) to the specified host andport upon startup. The password will be sent with the AUTH event when theconnection has been established.==============================================================================6.NetBeans protocolnetbeans-protocolThe communication between the Vim Controller and Vim uses plain textmessages. This protocol was first designed to work with the external editormodule of NetBeans. Laterit was extended to work with Agide (A-A-PGUI IDE,formerlyhttp://www.a-a-p.org, link now dead) and then with other IDE.The extensions are marked with "version 2.1".Version 2.2 of the protocol has several minor changes which should only affectNetBeans users (ie, not Agide users). However,a bug was fixed which couldcause confusion. The netbeans_saved() function senta "save" protocolcommand. In protocol version 2.1 and earlier this was incorrectly interpretedasa notification thata write had taken place. In reality,it toldNetBeansto save the file so multiple writes were being done. This causedvariousproblems and has been fixed in 2.2. To decrease the likelihood of thisconfusion happening again, netbeans_saved() has been renamed tonetbeans_save_buffer().We are nowat version 2.5. For the differences between 2.4 and 2.5 search for"2.5" below.Themessages are currently sent overa socket. Since themessages are inplainUTF-8 text this protocol could also be used with any other communicationmechanism.Netbeansmessages are processed when Vimis idle, waiting for user input.When Vimis run in non-interactive mode, for example when running an automatedtestcase that sourcesa Vim script, the idle loop may not be called oftenenough. In that case,insert:sleep commands in the Vim script. The:sleepcommand does invoke Netbeansmessages processing.6.1 Kinds ofmessagesnb-messages6.2 Termsnb-terms6.3 Commandsnb-commands6.4 Functions and Repliesnb-functions6.5 Eventsnb-events6.6Specialmessagesnb-special6.7 Protocolerrorsnb-protocol_errors6.1 Kinds ofmessagesnb-messagesThere are four kinds of messages:kinddirectioncommentCommandIDE-> editorno reply necessaryFunctionIDE-> editoreditormust send backa replyReplyeditor-> IDEonly in response toa FunctionEventeditor-> IDEno reply necessaryThemessages are sentasa single line witha terminating newline character.Arguments are separated bya single space. The first item of the messagedepends on the kind of message:kindfirst itemexampleCommandbufID:name!seqno11:showBalloon!123 "text"FunctionbufID:name/seqno11:getLength/123Replyseqno123 5000EventbufID:name=seqno11:keyCommand=123 "S-F2"6.2 Termsnb-termsbufIDBuffer number.A message may be either fora specific bufferor generic. Genericmessages usea bufID of zero.NOTE: thisbuffer IDis assigned by the IDE,itis not Vim's buffernumber. The bufIDmust bea sequentially rising number,startingat one. When the'switchbuf' optionis set to"usetab" and the "bufID" bufferis not found in the currenttab page, thenetbeans commands andfunctions that set thisbufferas the current buffer will jump to the first openwindow that contains this buffer in othertab pages instead ofreplacing the buffer in the current window.seqnoThe IDE usesa sequence number for Commands and Functions.AReplymust use the sequence number of the Function thatitisassociated with.A zero sequence number can be used forEvents (the seqno of the last received Command or Function canalso be used).stringArgument in double quotes. Textis inUTF-8 encoding. Thismeans ASCIIis passed as-is.Special characters arerepresented witha backslash:\"doublequote\nnewline\rcarriage-return\ttab (optional, also works literally)\\backslashNUL bytes are not allowed!booleanArgument with two possible values:TtrueFfalsenumberArgument witha decimal number.colorArgument with eithera decimal number, "none" (without thequotes) or the name ofa color (without the quotes) definedboth in the colorlist inhighlight-ctermfg and in the colorlist ingui-colors.New in version 2.5.offsetA number argument that indicatesa byte position ina buffer.The first byte has offset zero. Line breaks are counted forhow they appear in the file (CR/LF counts for two bytes).Note thatamultibyte characteris counted for the number ofbytesit takes.lnum/colArgument witha line number and column number position. Theline number starts with one, the columnis the byte position,starting with zero.Note thatamultibyte character countsfor several columns.pathnameString argument: file name with full path.6.3 Commandsnb-commandsactionMenuItemNot implemented.actionSensitivityNot implemented.addAnno serNum typeNum off lenPlace an annotation in this buffer.Arguments: serNumnumberserial number of this placedannotation, used to be able to removeit typeNumnumbersequence number of the annotationdefined with defineAnnoType for thisbuffer offnumberoffset where annotationis to beplaced lennumbernot usedIn version 2.1 "lnum/col" can be used instead of "off".balloonResult textNot implemented.closeClose the buffer. This leaves us without current buffer, verydangerous to use!createCreatesa buffer withouta name. Replaces the current buffer(it's hidden whenit was changed).The Vim Controller should use thisas the first command forafile thatis being opened. The sequence of commands could be:createsetCaretListener(ignored)setModified(no effect)setContentType(ignored)startDocumentListensetTitlesetFullNamedefineAnnoType typeNum typeName tooltip glyphFile fg bgDefinea type of annotation for this buffer.Arguments: typeNumnumbersequence number (not really used) typeNamestringname that identifies this annotation tooltipstringnot used glyphFilestringname of icon file fgcolorforeground color for line highlighting bgcolorbackground color for line highlightingVim will definea sign for the annotation.When colorisa number, thisis the "#rrggbb" Red, Green andBlue values of the color (seegui-colors) and thehighlightingis only defined for gVim.When colorisa name, this coloris defined both for Vimrunning ina colorterminal and for gVim.When both "fg" and "bg" are "none" no line highlightingisused (new in version 2.1).When "glyphFile"is empty, no text signis used (new inversion 2.1).When "glyphFile"is one or two characters long,a text signisdefined (new in version 2.1).Note: the annotations will be defined in sequence, and thesequence numberis later used with addAnno.editFile pathnameSet the name for the buffer and edit the file "pathname",astring argument.Normal way for the IDE to tell the editor to edita file.Youmust seta bufId different of0 with this command toassigna bufId to the buffer. It will trigger an eventfileOpened witha bufId of0 but the buffer has been assigned.If the IDEis going to pass the file text to the editor usethese commands instead:setFullNameinsertinitDoneNew in version 2.1.enableBalloonEvalNot implemented.endAtomicEnd an atomic operation. The changes between "startAtomic"and "endAtomic" can be undoneas one operation. But it's notimplemented yet. Redraw when necessary.guard off lenMark an area in the bufferas guarded. This meansit cannotbe edited. "off" and "len" are numbers and specify the textto be guarded.initDoneMark the bufferas ready for use. Implicitly makes the bufferthe current buffer. Fires theBufReadPostautocommand event.insertDone starteol readonlySent by Vim Controller to tell Vim an initial fileinsertisdone. This triggersa read message being printed. If"starteol"is "F" then the last line doesn't havea EOL. If"readonly"is "T" then the fileis markedas readonly. Priorto version 2.3, no readmessages were displayed after openinga file. New in version 2.3.moveAnnoToFront serNumNot implemented.netbeansBuffer isNetbeansBufferIf "isNetbeansBuffer"is "T" then this bufferis "owned" byNetBeans.New in version 2.2.putBufferNumber pathnameAssociatea buffer number with the Vim buffer by the name"pathname",astring argument. To be used when the editorreported editing another file to the IDE and the IDE needs totell the editor what buffer numberit will use for this file.Also marks the bufferas initialized.New in version 2.1.raiseBring the editor to the foreground.Only when Vimis run witha GUI.New in version 2.1.removeAnno serNumRemovea previously placed annotation for this buffer."serNum"is the same number used in addAnno.saveSave the buffer whenit was modified. The other side of theinterfaceis expected to write the buffer and invoke"setModified" to reset the "changed" flag of the buffer.Thewritingis skipped when one of these conditionsis true:-'write'is not set- the bufferis read-only- the buffer does not havea file name-'buftype' disallowswritingNew in version 2.2.saveDoneSent by Vim Controller to tell Vima saveis done. Thistriggersa save message being printed. Prior to version 2.3,no savemessages were displayed aftera save.New in version 2.3.setAsUserNot implemented.setBufferNumber pathnameAssociatea buffer number with Vim buffer by the name"pathname". To be used when the editor reported editinganother file to the IDE and the IDE needs to tell the editorwhat buffer numberit will use for this file.Has the side effect of making the buffer the current buffer.See "putBufferNumber" fora more useful command.setContentTypeNot implemented.setDot offMake the buffer the current buffer and set the cursorat thespecified position. If the bufferis open in anotherwindowthan make thatwindow the current window.If there arefolds they are opened to make the cursor linevisible.In version 2.1 "lnum/col" can be used instead of "off".setExitDelay secondsSet the delay forexiting to "seconds",a number.This delayis used to give the IDEa chance to handle thingsbefore really exiting. The default delayis two seconds.New in version 2.1.Obsolete in version 2.3.setFullName pathnameSet the file name to be used fora buffer to "pathname",astring argument.Used when the IDE wants to edita file undercontrol of theIDE. This makes the buffer the current buffer, but does notread the file. "insert" commands will be used next to set thecontents.setLocAndSizeNot implemented.setMarkNot implemented.setModified modifiedWhen theboolean argument "modified"is "T"mark the bufferasmodified, whenitis "F"markitas unmodified.setModtime timeUpdateabuffers modification time after the file has beensaved directly by the Vim Controller.New in version 2.3.setReadOnly readonlyWhen theboolean argument "readonly"is "T" for True,mark thebufferas readonly, whenitis "F" for False,markitas notreadonly. Implemented in version 2.3.setStyleNot implemented.setTitle nameSet the title for the buffer to "name",astring argument.The titleis only used for the Vim Controller functions, notby Vim.setVisible visibleWhen theboolean argument "visible"is "T", goto the buffer.The "F" argument does nothing.showBalloon textShowa balloon (popup window)at the mouse pointer position,containing "text",astring argument. The balloon shoulddisappear when the mouseis moved more thana few pixels.Only when Vimis run witha GUI.New in version 2.1.specialKeysMapa set of keys (mostly function keys) to be passed backto the Vim Controller for processing. This lets regular IDEhotkeys be used from Vim.Implemented in version 2.3.startAtomicBegin an atomic operation. The screen will not be updateduntil "endAtomic"is given.startCaretListenNot implemented.startDocumentListenMark the buffer to report changes to the IDE with the"insert" and "remove" events. The defaultis to reportchanges.stopCaretListenNot implemented.stopDocumentListenMark the buffer to stop reporting changes to the IDE.Opposite of startDocumentListen.NOTE: if "netbeansBuffer" was used tomark this bufferasaNetBeans buffer, then the bufferis deleted in Vim. Thisisfor compatibility with Sun Studio 10.unguard off lenOpposite of "guard", remove guarding fora text area.Also sets the current buffer, if necessary.versionNot implemented.6.4 Functions and Repliesnb-functionsgetDotNot implemented.getCursorReturn the current buffer and cursor position.The reply is:seqno bufID lnum col offseqno= sequence number of the functionbufID= buffer ID of the current buffer (if thisis unknown -1is used)lnum= line number of the cursor (first lineis one)col= column number of the cursor (in bytes, zero based)off= offset of the cursor in the buffer (in bytes)New in version 2.1.getLengthReturn the length of the buffer in bytes.Reply example fora buffer with 5000 bytes:123 5000TODO: explain use ofpartial line.getMarkNot implemented.getAnno serNumReturn the line number of the annotation in the buffer.Argument:serNumserial number of this placedannotationThe reply is:123 lnumline number of the annotation1230invalid annotation serial numberNew in version 2.4.getModifiedWhena bufferis specified: Return zero if the buffer does nothave changes, one ifit does have changes.When no bufferis specified (buffer number zero): Return thenumber ofbuffers with changes. When the resultis zero it'ssafe to tell Vim to exit.New in version 2.1.getTextReturn the contents of the bufferasa string.Reply example fora buffer with two lines123 "first line\nsecond line\n"NOTE: docs indicate an offset and length argument, but thisisnot implemented.insert off textInsert "text" before position "off". "text"isastringargument, "off"a number."text" should havea "\n" (newline)at theend of each line.Or "\r\n" when'fileformat'is "dos". When using "insert" inan empty buffer Vim will set'fileformat' accordingly.When "off" points to the start ofa line the textis insertedabove this line. Thus when "off"is zero lines are insertedbefore the first line.When "off" points after the start ofa line, possibly on theNULat theend ofa line, the first line of textis appendedto this line. Further lines come below it.Possible replies:123no problem123 !messagefailedNote that the message in the replyis not quoted.Also sets the current buffer, if necessary.Does not move the cursor to the changed text.Resetsundo information.remove off lengthDelete "length" bytes of textat position "off". Botharguments are numbers.Possible replies:123no problem123 !messagefailedNote that the message in the replyis not quoted.Also sets the current buffer, if necessary.saveAndExitPerform the equivalent of closing Vim: ":confirm qall".If there are no changed files or the user does not cancel theoperation Vim exits and no resultis sent back. The IDE canconsider closing the connectionasa successful result.If the user cancels the operation the number of modifiedbuffers that remainsis returned and Vim does not exit.New in version 2.1.6.5 Eventsnb-eventsballoonEval off len typeThe mouse pointer rests on text fora short while. When "len"is zero, thereis no selection and the pointerisat position"off". When "len"is non-zero the text from position "off" to"off"+ "len"is selected.Only sent after "enableBalloonEval" was used for this buffer."type"is not yet defined.Not implemented yet.balloonText textUsed when'ballooneval'is set and the mouse pointer rests onsome text fora moment. "text"isa string, the text underthe mouse pointer.Only when Vimis run witha GUI.New in version 2.1.buttonRelease button lnum colReport which button was pressed and the location of the cursorat the time of the release. Only forbuffers that are ownedby the Vim Controller. This eventis not sent if the buttonwas released while the mouse was in the status line or inaseparator line. If colisless than 1 the button release wasin the sign area.New in version 2.2.disconnectTell the Vim Controller that Vimisexiting and not to try andread or write more commands.New in version 2.3.fileClosedNot implemented.fileModifiedNot implemented.fileOpened pathname open modifiedA file was opened by the user.Arguments: pathnamestring name of the file openboolean always "T" modifiedboolean always "F"geometry cols rowsxyReport the size and position of the editor window.Arguments: colsnumber number of text columns rowsnumber number of text rowsxnumber pixel position on screenynumber pixel position on screenOnly works for Motif.insert off textText "text" has been inserted in Vimat position "off".Only fired when enabled, see "startDocumentListen".invokeActionNot implemented.keyCommand keyNameReportsa special key being pressed with name "keyName", whichisa string.Supported key names:F1function key 1F2function key 2...F12function key 12''space (without the quotes)!exclamationmark...any other ASCII printable character~tildeXany unrecognized keyThe key may be prepended by "C", "S" and/or "M" for Control,Shift and Meta (Alt) modifiers. If thereisa modifiera dashis used to separateit from the key name. For example:"C-F2".ASCII characters are new in version 2.1.keyAtPos keyName lnum/colLike "keyCommand" and also report the line number and columnof the cursor.New in version 2.1.killedA file was deleted or wiped out by the user and the bufferannotations have been removed. The bufID number for thisbuffer has become invalid. Only for files that have beenassigneda bufID number by the IDE.newDotAndMark off offReports the position of the cursor beingat "off" bytes intothe buffer. Only sent just beforea "keyCommand" event.quitNot implemented.remove off lenText was deleted in Vimat position "off" with byte length"len".Only fired when enabled, see "startDocumentListen".revertNot implemented.saveThe buffer has been saved andis now unmodified.Only fired when enabled, see "startDocumentListen".startupDoneThe editor has finished itsstartup work andis ready forediting files.New in version 2.1.unmodifiedThe bufferis now unmodified.Only fired when enabled, see "startDocumentListen".version versReport the version of theinterface implementation. Vimreports "2.4" (including the quotes).6.6Specialmessagesnb-specialThesemessagesdo not follow the style of themessages above. They areterminated bya newline character.ACCEPTNot used.AUTH passwordeditor-> IDE: First message that the editor sends to the IDE.Must contain the password for the socket server,as specifiedwith the-nb argument. Noquotes are used!DISCONNECTIDE-> editor: break the connection. The editor will exit.The IDEmust only send this message when there are no unsavedchanges!DETACHIDE-> editor: break the connection withoutexiting theeditor. Used when the IDE exits without bringing down theeditoras well.New in version 2.1.REJECTNot used.6.7 Protocolerrorsnb-protocol_errorsTheseerrors occur whena message violates the protocol:E627E628E629E632E633E634E635E636E637E638E639E640E641E642E643E644E645E646E647E648E650E651E652==============================================================================7.NetBeans commandsnetbeans-commands:nbstartE511E838:nbs[tart]{connection}Starta new Netbeans session with{connection}as thesocket connection parameters. The format of{connection}is described innetbeans-parameters.At any time, one may check if thenetbeans socketisconnected by running the command:':echo has("netbeans_enabled")':nbclose:nbc[lose]Close the currentNetBeans session. Remove all placedsigns.:nbkey:nb[key]{key}Pass the{key} to the Vim Controller for processing.Whena hot-key has been installed with the specialKeyscommand, this command can be used to generatea hotkeymessage to the Vim Controller.This command can also be used to pass any text to theVim Controller. Itis used by Pyclewn, for example,to build the complete set ofgdb commandsas Vim usercommands.The events newDotAndMark, keyCommand and keyAtPos aregenerated (in this order).==============================================================================8. Known problemsnetbeans-problemsNUL bytes are not possible. For editor-> IDE they will appearas NLcharacters. For IDE-> editor they cannot be inserted.ANetBeans session may be initiated with Vim running ina terminal, andcontinued later inaGUI environment after running the:gui command. In thiscase, the highlighting defined for theNetBeans annotations may be clearedwhen the ":gui" command sources.gvimrc and this file loadsa colorschemethat runs the command ":highlight clear".New in version 2.5.==============================================================================9. DebuggingNetBeans protocolnetbeans-debuggingTo debug the Vim protocol, youmust first compile Vim with debugging supportandNetBeans debugging support. Seenetbeans-configure for instructionsabout Vim compiling and how to enable debug support.When running Vim, set the following environment variables: export SPRO_GVIM_DEBUG=netbeans.log export SPRO_GVIM_DLEVEL=0xffffffffVim will then log all the incoming and outgoingmessages of theNetBeansprotocol to the file netbeans.log.The content of netbeans.log aftera session looks like this:Tue May 20 17:19:27 2008EVT: 0:startupDone=0CMD 1: (1) createCMD 2: (1) setTitle "testfile1.txt"CMD 3: (1) setFullName "testfile1.txt"EVT(suppressed): 1:remove=30 -1EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt"TFCMD 4: (1) initDoneFUN 5: (0) getCursorREP 5: 1 100CMD 6: (2) createCMD 7: (2) setTitle "testfile2.txt"CMD 8: (2) setFullName "testfile2.txt"EVT(suppressed): 2:remove=80 -1EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt"TFCMD 9: (2) initDone==============================================================================10.NetBeans External EditorNOTE: This informationis obsolete! Only relevant if you are using an oldversion of NetBeans.10.1. DownloadingNetBeansnetbeans-downloadTheNetBeans IDEis available fordownload from netbeans.org. You candownloada released version,download sources, or use CVS todownload thecurrent source tree. If you choose todownload sources, follow directionsfrom netbeans.org on building NetBeans.Depending on the version ofNetBeans you download, you may need todo furtherwork to get the required External Editor module. Thisis the module whichletsNetBeans work withgvim (or xemacs :-). See (dead link)externaleditor.netbeans.orgfor details on downloading this module if yourNetBeans release does not haveit.For C, C++, and Fortran support you will also need the cpp module. Seecpp.netbeans.org (link seems dead) for information regarding thismodule.You can alsodownload Sun ONE Studio from Sun Microsystems, Inc fora 30 dayfree trial. Seehttp://www.sun.com for further details.10.2.NetBeans Key Bindingsnetbeans-keybindingsVim understandsa number of key bindings that executeNetBeans commands.These are typically all the Function key combinations. To executeaNetBeanscommand, the usermust press the Pause key followed byaNetBeans key binding.For example, in order to compilea Java file, theNetBeans key bindingis"F9". So, while in vim, press "Pause F9" to compilea java file. Totoggleabreakpointat the current line, press "Pause Shift F8".The Pause keyis Function key 21. If you don't havea working Pause key andwant to use F8 instead, use::map <F8> <F21>The External Editor module dynamically reads theNetBeans key bindings so vimshould always have the latest key bindings, even whenNetBeans changes them.10.3. PreparingNetBeans for Vimnetbeans-preparationIn order forNetBeans to work with vim, theNetBeans External Editor modulemust be loaded and enabled. If you havea Sun ONE Studio Enterprise Editionthen this module should be loaded and enabled. If you haveaNetBeans releaseyou may need to find another way of obtaining this open source module.You can check if you have this module by opening the Tools->Optionsdialogand drilling down to the "Modules"list (IDE Configuration->System->Modules).If your Moduleslist has an entry for "External Editor" youmust make sureitis enabled (the "Enabled" property should have the value "True"). If yourModuleslist has no External Editor see the nextsection onobtaining-exted.10.4. Obtaining the External Editor Moduleobtaining-extedThere are 2 ways of obtaining the External Editor module. The easiest wayis to use theNetBeans Update Center todownload andinstall the module.Unfortunately, some versionsdo not have this module in their updatecenter. If you cannotdownload via the update center you will need todownload sources and build the module.I will try and get the moduleavailable from theNetBeans Update Center so building will be unnecessary.Also check (dead link) externaleditor.netbeans.orgfor other availability options.Todownload the External Editor sources via CVS and build your own module,see (dead link) externaleditor.netbeans.org andhttp://www.netbeans.org.Unfortunately, thisis nota trivial procedure.10.5. Setting upNetBeans to run with Vimnetbeans-setupAssuming you have loaded and enabled theNetBeans External Editor moduleas described innetbeans-preparation all you need todois verify thatthegvim command lineis properly configured for your environment.Open the Tools->Optionsdialog and open the Editing category.Select theExternal Editor. The right hand pane should containa Propertiestab andan Expert tab. In the Propertiestab make sure the "Editor Type"is setto "Vim". In the Experttab make sure the "Vim Command"is correct.You should be careful if you change the "Vim Command". There are commandlineoptions there whichmust be there for the connection to be properlyset up. You can change the command name but that's about it. If yourgvimcan be found by your $PATH then the Vim Command can start with "gvim". Ifyou don't wantgvim searched from your $PATH then hard code in the fullUnix path name. At this point you should getagvim for any source fileyou open in NetBeans.If some files come up ingvim and others (with different file suffixes) comeup in the defaultNetBeans editor you should verify the MIME type in theExperttab MIME Type property.NetBeansis MIME oriented and the ExternalEditor will only open MIME types specified in this property. vim:tw=78:ts=8:noet:ft=help:norl: