blob: 3ac503ad79aee4b56ff463daceb63143005f4610 [file] [log] [blame]
Bram Moolenaar9e368db2007-05-12 13:25:01 +00001*netbeans.txt* For Vim version 7.1. Last change: 2006 Nov 14
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Gordon Prieur
5
6
7NetBeans ExternalEditor Integration Features *netbeans*
8 *netbeans-support*
91. Introduction |netbeans-intro|
102. NetBeans Key Bindings |netbeans-keybindings|
113. Configuring Vim for NetBeans |netbeans-configure|
124. Downloading NetBeans |netbeans-download|
135. Preparing NetBeans for Vim |netbeans-preparation|
146. Obtaining the External Editor Module |obtaining-exted|
157. Setting up NetBeans to run with Vim |netbeans-setup|
168. Messages |netbeans-messages|
179. Running Vim from NetBeans |netbeans-run|
1810. NetBeans protocol |netbeans-protocol|
Bram Moolenaar65c1b012005-01-31 19:02:28 +00001911. NetBeans commands |netbeans-commands|
2012. Known problems |netbeans-problems|
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
22{Vi does not have any of these features}
23{only available when compiled with the |+netbeans_intg| feature}
24
25==============================================================================
261. Introduction *netbeans-intro*
27
28NetBeans is an open source Integrated Development Environment developed
29jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
30Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
31in recent releases.
32
33For more information visit the main NetBeans web site http://www.netbeans.org
34or the NetBeans External Editor site at http://externaleditor.netbeans.org.
35
36Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
37Visit http://www.sun.com for more information regarding the Sun ONE Studio
38product line.
39
40Current releases of NetBeans provide full support for Java and limited support
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000041for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
Bram Moolenaar071d4272004-06-13 20:20:40 +000042support for Java, C, C++, and Fortran.
43
44The interface to NetBeans is also supported by Agide, the A-A-P GUI IDE.
45Agide is very different from NetBeans:
46- Based on Python instead of Java, much smaller footprint and fast startup.
47- Agide is a framework in which many different tools can work together.
48See the A-A-P website for information: http://www.A-A-P.org.
49
50==============================================================================
512. NetBeans Key Bindings *netbeans-keybindings*
52
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000053Vim understands a number of key bindings that execute NetBeans commands.
54These are typically all the Function key combinations. To execute a NetBeans
55command, the user must press the Pause key followed by a NetBeans key binding.
56For example, in order to compile a Java file, the NetBeans key binding is
57"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a
58breakpoint at the current line, press "Pause Shift F8".
Bram Moolenaar071d4272004-06-13 20:20:40 +000059
60The Pause key is Function key 21. If you don't have a working Pause key and
61want to use F8 instead, use: >
62
63 :map <F8> <F21>
64
65The External Editor module dynamically reads the NetBeans key bindings so vim
66should always have the latest key bindings, even when NetBeans changes them.
67
68==============================================================================
693. Configuring Vim for NetBeans *netbeans-configure*
70
71For more help installing vim, please read |usr_90.txt| in the Vim User Manual.
72
73
74On Unix
75
76When running configure without arguments the NetBeans interface should be
77included. That is, if the configure check to find out if your system supports
78the required features succeeds.
79
80In case you do not want the NetBeans interface you can disable it by
81uncommenting a line with "--disable-netbeans" in the Makefile.
82
83Currently, only gvim is supported in this integration as NetBeans does not
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000084have means to supply a terminal emulator for the vim command. Furthermore,
Bram Moolenaar071d4272004-06-13 20:20:40 +000085there is only GUI support for GTK, GNOME, and Motif.
86
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000087If Motif support is required the user must supply XPM libraries. See
Bram Moolenaar071d4272004-06-13 20:20:40 +000088|workshop-xpm| for details on obtaining the latest version of XPM.
89
90
91On MS-Windows
92
93The Win32 support is now in beta stage.
94
95To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
96XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/
97(for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
98
99==============================================================================
1004. Downloading NetBeans *netbeans-download*
101
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000102The NetBeans IDE is available for download from netbeans.org. You can download
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103a released version, download sources, or use CVS to download the current
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000104source tree. If you choose to download sources, follow directions from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105netbeans.org on building NetBeans.
106
107Depending on the version of NetBeans you download, you may need to do further
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000108work to get the required External Editor module. This is the module which lets
109NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
Bram Moolenaar071d4272004-06-13 20:20:40 +0000110for details on downloading this module if your NetBeans release does not have
111it.
112
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000113For C, C++, and Fortran support you will also need the cpp module. See
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114http://cpp.netbeans.org for information regarding this module.
115
116You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000117free trial. See http://www.sun.com for further details.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118
119==============================================================================
1205. Preparing NetBeans for Vim *netbeans-preparation*
121
122In order for NetBeans to work with vim, the NetBeans External Editor module
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000123must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
124then this module should be loaded and enabled. If you have a NetBeans release
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125you may need to find another way of obtaining this open source module.
126
127You can check if you have this module by opening the Tools->Options dialog
128and drilling down to the "Modules" list (IDE Configuration->System->Modules).
129If your Modules list has an entry for "External Editor" you must make sure
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000130it is enabled (the "Enabled" property should have the value "True"). If your
Bram Moolenaar071d4272004-06-13 20:20:40 +0000131Modules list has no External Editor see the next section on |obtaining-exted|.
132
133==============================================================================
1346. Obtaining the External Editor Module *obtaining-exted*
135
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000136There are 2 ways of obtaining the External Editor module. The easiest way
Bram Moolenaar071d4272004-06-13 20:20:40 +0000137is to use the NetBeans Update Center to download and install the module.
138Unfortunately, some versions do not have this module in their update
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000139center. If you cannot download via the update center you will need to
140download sources and build the module. I will try and get the module
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141available from the NetBeans Update Center so building will be unnecessary.
142Also check http://externaleditor.netbeans.org for other availability options.
143
144To download the External Editor sources via CVS and build your own module,
145see http://externaleditor.netbeans.org and http://www.netbeans.org.
146Unfortunately, this is not a trivial procedure.
147
148==============================================================================
1497. Setting up NetBeans to run with Vim *netbeans-setup*
150
151Assuming you have loaded and enabled the NetBeans External Editor module
152as described in |netbeans-preparation| all you need to do is verify that
153the gvim command line is properly configured for your environment.
154
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000155Open the Tools->Options dialog and open the Editing category. Select the
156External Editor. The right hand pane should contain a Properties tab and
157an Expert tab. In the Properties tab make sure the "Editor Type" is set
158to "Vim". In the Expert tab make sure the "Vim Command" is correct.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000159
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000160You should be careful if you change the "Vim Command". There are command
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161line options there which must be there for the connection to be properly
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000162set up. You can change the command name but that's about it. If your gvim
163can be found by your $PATH then the VIM Command can start with "gvim". If
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164you don't want gvim searched from your $PATH then hard code in the full
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000165Unix path name. At this point you should get a gvim for any source file
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166you open in NetBeans.
167
168If some files come up in gvim and others (with different file suffixes) come
169up in the default NetBeans editor you should verify the MIME type in the
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000170Expert tab MIME Type property. NetBeans is MIME oriented and the External
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171Editor will only open MIME types specified in this property.
172
173==============================================================================
1748. Messages *netbeans-messages*
175
176These messages are specific for NetBeans:
177
178 *E463*
179Region is guarded, cannot modify
180 NetBeans defines guarded areas in the text, which you cannot
181 change.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000182 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183
184 *E656*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000185NetBeans disallows writes of unmodified buffers
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186 NetBeans does not support writes of unmodified buffers that
187 were opened from NetBeans.
188
189 *E657*
190Partial writes disallowed for NetBeans buffers
191 NetBeans does not support partial writes for buffers that were
192 opened from NetBeans.
193
194 *E658*
195NetBeans connection lost for this buffer
196 NetBeans has become confused about the state of this file.
Bram Moolenaar371d5402006-03-20 21:47:49 +0000197 Rather than risk data corruption, NetBeans has severed the
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000198 connection for this file. Vim will take over responsibility
Bram Moolenaar071d4272004-06-13 20:20:40 +0000199 for saving changes to this file and NetBeans will no longer
200 know of these changes.
201
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000202 *E744*
203NetBeans does not allow changes in read-only files
204 Vim normally allows changes to a read-only file and only
205 enforces the read-only rule if you try to write the file.
206 However, NetBeans does not let you make changes to a file
207 which is read-only and becomes confused if vim does this.
208 So vim does not allow modifications to files when run with
209 NetBeans.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000210==============================================================================
2119. Running Vim from NetBeans *netbeans-run*
212
213NetBeans starts Vim with the |-nb| argument. Three forms can be used, that
214differ in the way the information for the connection is specified:
215
216 -nb={fname} from a file
217 -nb:{hostname}:{addr}:{password} directly
218 -nb from a file or environment
219
220 *E660* *E668*
221For security reasons, the best method is to write the information in a file
222readable only by the user. The name of the file can be passed with the
223"-nb={fname}" argument or, when "-nb" is used without a parameter, the
224environment variable "__NETBEANS_CONINFO". The file must contain these three
225lines, in any order:
226
227 host={hostname}
228 port={addr}
229 auth={password}
230
231Other lines are ignored. The caller of Vim is responsible for deleting the
232file afterwards.
233
234{hostname} is the name of the machine where NetBeans is running. When omitted
235the environment variable "__NETBEANS_HOST" is used or the default "localhost".
236
237{addr} is the port number for NetBeans. When omitted the environment variable
238"__NETBEANS_SOCKET" is used or the default 3219.
239
240{password} is the password for connecting to NetBeans. When omitted the
241environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
242
243==============================================================================
24410. NetBeans protocol *netbeans-protocol*
245
246The communication between NetBeans and Vim uses plain text messages. This
247protocol was first designed to work with the external editor module of
248NetBeans (see http://externaleditor.netbeans.org). Later it was extended to
249work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org). The extensions are
250marked with "version 2.1".
251
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000252Version 2.2 of the protocol has several minor changes which should only affect
253NetBeans users (ie, not Agide users). However, a bug was fixed which could
254cause confusion. The netbeans_saved() function sent a "save" protocol
255command. In protocol version 2.1 and earlier this was incorrectly interpreted
256as a notification that a write had taken place. In reality, it told NetBeans
257to save the file so multiple writes were being done. This caused various
258problems and has been fixed in 2.2. To decrease the likelihood of this
Bram Moolenaar071d4272004-06-13 20:20:40 +0000259confusion happening again, netbeans_saved() has been renamed to
260netbeans_save_buffer().
261
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000262We are now at version 2.4. For the differences between 2.3 and 2.4 search for
263"2.4" below.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000264
Bram Moolenaar071d4272004-06-13 20:20:40 +0000265The messages are currently sent over a socket. Since the messages are in
266plain UTF-8 text this protocol could also be used with any other communication
267mechanism.
268
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000269To see an example implementation look at the gvim tool in Agide. Currently
270found here:
271 http://cvs.sf.net/viewcvs.py/a-a-p/Agide/Tools/GvimTool.py?view=markup
272
273
274
Bram Moolenaar071d4272004-06-13 20:20:40 +000027510.1 Kinds of messages |nb-messages|
27610.2 Terms |nb-terms|
27710.3 Commands |nb-commands|
27810.4 Functions and Replies |nb-functions|
27910.5 Events |nb-events|
28010.6 Special messages |nb-special|
281
282*E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636*
283*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
284*E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654*
285These errors occur when a message violates the protocol.
286
287
28810.1 Kinds of messages *nb-messages*
289
290There are four kinds of messages:
291
292kind direction comment ~
293Command IDE -> editor no reply necessary
294Function IDE -> editor editor must send back a reply
295Reply editor -> IDE only in response to a Function
296Event editor -> IDE no reply necessary
297
298The messages are sent as a single line with a terminating newline character.
299Arguments are separated by a single space. The first item of the message
300depends on the kind of message:
301
302kind first item example ~
303Command bufID:name!seqno 11:showBalloon!123 "text"
304Function bufID:name/seqno 11:getLength/123
305Reply seqno 123 5000
306Event bufID:name=123 11:keyCommand=123 "S-F2"
307
308
30910.2 Terms *nb-terms*
310
311bufID Buffer number. A message may be either for a specific buffer
312 or generic. Generic messages use a bufID of zero. NOTE: this
313 buffer ID is assigned by the IDE, it is not Vim's buffer
314 number. The bufID must be a sequentially rising number,
315 starting at one.
316
317seqno The IDE uses a sequence number for Commands and Functions. A
318 Reply must use the sequence number of the Function that it is
319 associated with. A zero sequence number can be used for
320 Events (the seqno of the last received Command or Function can
321 also be used).
322
323string Argument in double quotes. Text is in UTF-8 encoding. This
324 means ASCII is passed as-is. Special characters are
325 represented with a backslash:
326 \" double quote
327 \n newline
328 \r carriage-return
329 \t tab (optional, also works literally)
330 \\ backslash
331 NUL bytes are not allowed!
332
333boolean Argument with two possible values:
334 T true
335 F false
336
337number Argument with a decimal number.
338
339optnum Argument with either a decimal number or "none" (without the
340 quotes).
341
342offset A number argument that indicates a byte position in a buffer.
343 The first byte has offset zero. Line breaks are counted for
344 how they appear in the file (CR/LF counts for two bytes).
345 Note that a multi-byte character is counted for the number of
346 bytes it takes.
347
348lnum/col Argument with a line number and column number position. The
349 line number starts with one, the column is the byte position,
350 starting with zero. Note that a multi-byte character counts
351 for several columns.
352
353pathname String argument: file name with full path.
354
355
35610.3 Commands *nb-commands*
357
358actionMenuItem Not implemented.
359
360actionSensitivity
361 Not implemented.
362
363addAnno serNum typeNum off len
364 Place an annotation in this buffer.
365 Arguments:
366 serNum number serial number of this placed
367 annotation, used to be able to remove
368 it
369 typeNum number sequence number of the annotation
370 defined with defineAnnoType for this
371 buffer
372 off number offset where annotation is to be placed
373 len number not used
374 In version 2.1 "lnum/col" can be used instead of "off".
375
376balloonResult text
377 Not implemented.
378
379close Close the buffer. This leaves us without current buffer, very
380 dangerous to use!
381
382create Creates a buffer without a name. Replaces the current buffer
383 (it's hidden when it was changed).
384 NetBeans uses this as the first command for a file that is
385 being opened. The sequence of commands could be:
386 create
387 setCaretListener (ignored)
388 setModified (no effect)
389 setContentType (ignored)
390 startDocumentListen
391 setTitle
392 setFullName
393
394defineAnnoType typeNum typeName tooltip glyphFile fg bg
395 Define a type of annotation for this buffer.
396 Arguments:
397 typeNum number sequence number (not really used)
398 typeName string name that identifies this annotation
399 tooltip string not used
400 glyphFile string name of icon file
401 fg optnum foreground color for line highlighting
402 bg optnum background color for line highlighting
403 Vim will define a sign for the annotation.
404 When both "fg" and "bg" are "none" no line highlighting is
405 used (new in version 2.1).
406 When "glyphFile" is empty, no text sign is used (new in
407 version 2.1).
408 When "glyphFile" is one or two characters long, a text sign is
409 defined (new in version 2.1).
410 Note: the annotations will be defined in sequence, and the
411 sequence number is later used with addAnno.
412
413editFile pathname
414 Set the name for the buffer and edit the file "pathname", a
415 string argument.
416 Normal way for the IDE to tell the editor to edit a file. If
417 the IDE is going to pass the file text to the editor use these
418 commands instead:
419 setFullName
420 insert
421 initDone
422 New in version 2.1.
423
424enableBalloonEval
425 Not implemented.
426
427endAtomic End an atomic operation. The changes between "startAtomic"
428 and "endAtomic" can be undone as one operation. But it's not
429 implemented yet. Redraw when necessary.
430
431guard off len
432 Mark an area in the buffer as guarded. This means it cannot
433 be edited. "off" and "len" are numbers and specify the text
434 to be guarded.
435
436initDone Mark the buffer as ready for use. Implicitly makes the buffer
437 the current buffer. Fires the BufReadPost autocommand event.
438
Bram Moolenaar009b2592004-10-24 19:18:58 +0000439insertDone
440 Sent by NetBeans to tell vim an initial file insert is done.
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000441 This triggers a read message being printed. Prior to version
Bram Moolenaar009b2592004-10-24 19:18:58 +0000442 2.3, no read messages were displayed after opening a file.
443 New in version 2.3.
444
Bram Moolenaar071d4272004-06-13 20:20:40 +0000445moveAnnoToFront serNum
446 Not implemented.
447
448netbeansBuffer isNetbeansBuffer
449 If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by
450 NetBeans.
451 New in version 2.2.
452
453putBufferNumber pathname
454 Associate a buffer number with the Vim buffer by the name
455 "pathname", a string argument. To be used when the editor
456 reported editing another file to the IDE and the IDE needs to
457 tell the editor what buffer number it will use for this file.
458 Also marks the buffer as initialized.
459 New in version 2.1.
460
461raise Bring the editor to the foreground.
462 New in version 2.1.
463
464removeAnno serNum
465 Remove a previously place annotation for this buffer.
466 "serNum" is the same number used in addAnno.
467
468save Save the buffer when it was modified. The other side of the
469 interface is expected to write the buffer and invoke
470 "setModified" to reset the "changed" flag of the buffer.
471 The writing is skipped when one of these conditions is true:
472 - 'write' is not set
473 - the buffer is read-only
474 - the buffer does not have a file name
475 - 'buftype' disallows writing
476 New in version 2.2.
477
Bram Moolenaar009b2592004-10-24 19:18:58 +0000478saveDone
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000479 Sent by NetBeans to tell vim a save is done. This triggers
480 a save message being printed. Prior to version 2.3, no save
Bram Moolenaar009b2592004-10-24 19:18:58 +0000481 messages were displayed after a save.
482 New in version 2.3.
483
Bram Moolenaar071d4272004-06-13 20:20:40 +0000484setAsUser Not implemented.
485
486setBufferNumber pathname
487 Associate a buffer number with Vim buffer by the name
488 "pathname". To be used when the editor reported editing
489 another file to the IDE and the IDE needs to tell the editor
490 what buffer number it will use for this file.
491 Has the side effect of making the buffer the current buffer.
492 See "putBufferNumber" for a more useful command.
493
494setContentType
495 Not implemented.
496
497setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000498 specified position. If the buffer is open in another window
499 than make that window the current window.
500 If there are folds they are opened to make the cursor line
501 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502 In version 2.1 "lnum/col" can be used instead of "off".
503
504setExitDelay seconds
505 Set the delay for exiting to "seconds", a number.
506 This delay is used to give the IDE a chance to handle things
507 before really exiting. The default delay is two seconds.
508 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000509 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000510
511setFullName pathname
512 Set the file name to be used for a buffer to "pathname", a
513 string argument.
514 Used when the IDE wants to edit a file under control of the
515 IDE. This makes the buffer the current buffer, but does not
516 read the file. "insert" commands will be used next to set the
517 contents.
518
519setLocAndSize Not implemented.
520
521setMark Not implemented.
522
523setModified modified
524 When the boolean argument "modified" is "T" mark the buffer as
525 modified, when it is "F" mark it as unmodified.
526
Bram Moolenaar009b2592004-10-24 19:18:58 +0000527setModtime time
528 Update a buffers modification time after NetBeans saves the
529 file.
530 New in version 2.3.
531
532setReadOnly
533 Passed by NetBeans to tell vim a file is readonly.
534 Implemented in verion 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000535
536setStyle Not implemented.
537
538setTitle name
539 Set the title for the buffer to "name", a string argument.
540 The title is only used for NetBeans functions, not by Vim.
541
542setVisible visible
543 When the boolean argument "visible" is "T", goto the buffer.
544 The "F" argument does nothing.
545
546showBalloon text
547 Show a balloon (popup window) at the mouse pointer position,
548 containing "text", a string argument. The balloon should
549 disappear when the mouse is moved more than a few pixels.
550 New in version 2.1.
551
Bram Moolenaar009b2592004-10-24 19:18:58 +0000552specialKeys
553 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000554 to NetBeans for processing. This lets NetBeans hotkeys be
Bram Moolenaar009b2592004-10-24 19:18:58 +0000555 used from vim.
556 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000557
558startAtomic Begin an atomic operation. The screen will not be updated
559 until "endAtomic" is given.
560
561startCaretListen
562 Not implemented.
563
564startDocumentListen
565 Mark the buffer to report changes to the IDE with the
566 "insert" and "remove" events. The default is to report
567 changes.
568
569stopCaretListen
570 Not implemented.
571
572stopDocumentListen
573 Mark the buffer to stop reporting changes to the IDE.
574 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000575 NOTE: if "netbeansBuffer" was used to mark this buffer as a
576 NetBeans buffer, then the buffer is deleted in Vim. This is
577 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578
579unguard off len
580 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000581 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582
583version Not implemented.
584
585
58610.4 Functions and Replies *nb-functions*
587
588getDot Not implemented.
589
590getCursor Return the current buffer and cursor position.
591 The reply is:
592 seqno bufID lnum col off
593 seqno = sequence number of the function
594 bufID = buffer ID of the current buffer (if this is unknown -1
595 is used)
596 lnum = line number of the cursor (first line is one)
597 col = column number of the cursor (in bytes, zero based)
598 off = offset of the cursor in the buffer (in bytes)
599 New in version 2.1.
600
601getLength Return the length of the buffer in bytes.
602 Reply example for a buffer with 5000 bytes:
603 123 5000
604 TODO: explain use of partial line.
605
606getMark Not implemented.
607
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000608getAnno serNum
609 Return the line number of the annotation in the buffer.
610 Argument:
611 serNum serial number of this placed annotation
612 The reply is:
613 123 lnum line number of the annotation
614 123 0 invalid annotation serial number
615 New in version 2.4.
616
Bram Moolenaar071d4272004-06-13 20:20:40 +0000617getModified When a buffer is specified: Return zero if the buffer does not
618 have changes, one if it does have changes.
619 When no buffer is specified (buffer number zero): Return the
620 number of buffers with changes. When the result is zero it's
621 safe to tell Vim to exit.
622 New in version 2.1.
623
624getText Return the contents of the buffer as a string.
625 Reply example for a buffer with two lines
626 123 "first line\nsecond line\n"
627 NOTE: docs indicate an offset and length argument, but this is
628 not implemented.
629
630insert off text
631 Insert "text" before position "off". "text" is a string
632 argument, "off" a number.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000633 "off" should have a "\n" (newline) at the end of each line.
634 Or "\r\n" when 'fileformat' is "dos". When using "insert" in
635 an empty buffer Vim will set 'fileformat' accordingly.
636 When "off" points to the start of a line the text is inserted
637 above this line. Thus when "off" is zero lines are inserted
638 before the first line.
639 When "off" points after the start of a line, possibly on the
640 NUL at the end of a line, the first line of text is appended
641 to this line. Further lines come below it.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642 Possible replies:
643 123 no problem
644 123 !message failed
645 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000646 Also sets the current buffer, if necessary.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000647 Does not move the cursor to the changed text.
648 Resets undo information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000649
650remove off length
651 Delete "length" bytes of text at position "off". Both
652 arguments are numbers.
653 Possible replies:
654 123 no problem
655 123 !message failed
656 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000657 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000658
659saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
660 If there are no changed files or the user does not cancel the
661 operation Vim exits and no result is sent back. The IDE can
662 consider closing the connection as a successful result.
663 If the user cancels the operation the number of modified
664 buffers that remains is returned and Vim does not exit.
665 New in version 2.1.
666
667
66810.5 Events *nb-events*
669
670balloonEval off len type
671 The mouse pointer rests on text for a short while. When "len"
672 is zero, there is no selection and the pointer is at position
673 "off". When "len" is non-zero the text from position "off" to
674 "off" + "len" is selected.
675 Only sent after "enableBalloonEval" was used for this buffer.
676 "type" is not yet defined.
677 Not implemented yet.
678
679balloonText text
680 Used when 'ballooneval' is set and the mouse pointer rests on
681 some text for a moment. "text" is a string, the text under
682 the mouse pointer.
683 New in version 2.1.
684
685buttonRelease button lnum col
686 Report which button was pressed and the location of the cursor
687 at the time of the release. Only for buffers that are owned
688 by NetBeans. This event is not sent if the button was
689 released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000690 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000691 in the sign area.
692 New in version 2.2.
693
Bram Moolenaar009b2592004-10-24 19:18:58 +0000694disconnect
695 Tell NetBeans that vim is exiting and not to try and read or
696 write more commands.
697 New in version 2.3.
698
Bram Moolenaar071d4272004-06-13 20:20:40 +0000699fileClosed Not implemented.
700
701fileModified Not implemented.
702
703fileOpened pathname open modified
704 A file was opened by the user.
705 Arguments:
706 pathname string name of the file
707 open boolean always "T"
708 modified boolean always "F"
709
710geometry cols rows x y
711 Report the size and position of the editor window.
712 Arguments:
713 cols number number of text columns
714 rows number number of text rows
715 x number pixel position on screen
716 y number pixel position on screen
717 Only works for Motif.
718
719insert off text
720 Text "text" has been inserted in Vim at position "off".
721 Only fired when enabled, see "startDocumentListen".
722
723invokeAction Not implemented.
724
725keyCommand keyName
726 Reports a special key being pressed with name "keyName", which
727 is a string.
728 Supported key names:
729 F1 function key 1
730 F2 function key 2
731 ...
732 F12 function key 12
733
734 ' ' space (without the quotes)
735 ! exclamation mark
736 ... any other ASCII printable character
737 ~ tilde
738
739 X any unrecognized key
740
741 The key may be prepended by "C", "S" and/or "M" for Control,
742 Shift and Meta (Alt) modifiers. If there is a modifier a dash
743 is used to separate it from the key name. For example:
744 "C-F2".
745 ASCII characters are new in version 2.1.
746
747keyAtPos keyName lnum/col
748 Like "keyCommand" and also report the line number and column
749 of the cursor.
750 New in version 2.1.
751
752killed A file was closed by the user. Only for files that have been
753 assigned a number by the IDE.
754
755newDotAndMark off off
756 Reports the position of the cursor being at "off" bytes into
757 the buffer. Only sent just before a "keyCommand" event.
758
759quit Not implemented.
760
761remove off len
762 Text was deleted in Vim at position "off" with byte length
763 "len".
764 Only fired when enabled, see "startDocumentListen".
765
766revert Not implemented.
767
768save The buffer has been saved and is now unmodified.
769 Only fired when enabled, see "startDocumentListen".
770
771startupDone The editor has finished its startup work and is ready for
772 editing files.
773 New in version 2.1.
774
775unmodified The buffer is now unmodified.
776 Only fired when enabled, see "startDocumentListen".
777
778version vers Report the version of the interface implementation. Vim
779 reports "2.2" (including the quotes).
780
781
78210.6 Special messages *nb-special*
783
784These messages do not follow the style of the messages above. They are
785terminated by a newline character.
786
787ACCEPT Not used.
788
789AUTH password editor -> IDE: First message that the editor sends to the IDE.
790 Must contain the password for the socket server, as specified
791 with the |-nb| argument. No quotes are used!
792
793DISCONNECT IDE -> editor: break the connection. The editor will exit.
794 The IDE must only send this message when there are no unsaved
795 changes!
796
797DETACH IDE -> editor: break the connection without exiting the
798 editor. Used when the IDE exits without bringing down the
799 editor as well.
800 New in version 2.1.
801
802REJECT Not used.
803
804==============================================================================
Bram Moolenaar65c1b012005-01-31 19:02:28 +000080511. NetBeans Commands *netbeans-commands*
806
807 *:nbkey*
808:nbkey key Pass the key to NetBeans for processing
809
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000810Pass the key to NetBeans for hot-key processing. You should not need to use
811this command directly. However, NetBeans passes a list of hot-keys to Vim at
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000812startup and when one of these keys is pressed, this command is generated to
813send the key press back to NetBeans.
814
815==============================================================================
81612. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000817
818NUL bytes are not possible. For editor -> IDE they will appear as NL
819characters. For IDE -> editor they cannot be inserted.
820
821
822 vim:tw=78:ts=8:ft=help:norl: