blob: 71f8f8e1701b0ebda7c8f0d8b40596874499ca0b [file] [log] [blame]
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001*netbeans.txt* For Vim version 7.0aa. Last change: 2006 Feb 05
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.
197 Rather than risc 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
262The messages are currently sent over a socket. Since the messages are in
263plain UTF-8 text this protocol could also be used with any other communication
264mechanism.
265
26610.1 Kinds of messages |nb-messages|
26710.2 Terms |nb-terms|
26810.3 Commands |nb-commands|
26910.4 Functions and Replies |nb-functions|
27010.5 Events |nb-events|
27110.6 Special messages |nb-special|
272
273*E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636*
274*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
275*E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654*
276These errors occur when a message violates the protocol.
277
278
27910.1 Kinds of messages *nb-messages*
280
281There are four kinds of messages:
282
283kind direction comment ~
284Command IDE -> editor no reply necessary
285Function IDE -> editor editor must send back a reply
286Reply editor -> IDE only in response to a Function
287Event editor -> IDE no reply necessary
288
289The messages are sent as a single line with a terminating newline character.
290Arguments are separated by a single space. The first item of the message
291depends on the kind of message:
292
293kind first item example ~
294Command bufID:name!seqno 11:showBalloon!123 "text"
295Function bufID:name/seqno 11:getLength/123
296Reply seqno 123 5000
297Event bufID:name=123 11:keyCommand=123 "S-F2"
298
299
30010.2 Terms *nb-terms*
301
302bufID Buffer number. A message may be either for a specific buffer
303 or generic. Generic messages use a bufID of zero. NOTE: this
304 buffer ID is assigned by the IDE, it is not Vim's buffer
305 number. The bufID must be a sequentially rising number,
306 starting at one.
307
308seqno The IDE uses a sequence number for Commands and Functions. A
309 Reply must use the sequence number of the Function that it is
310 associated with. A zero sequence number can be used for
311 Events (the seqno of the last received Command or Function can
312 also be used).
313
314string Argument in double quotes. Text is in UTF-8 encoding. This
315 means ASCII is passed as-is. Special characters are
316 represented with a backslash:
317 \" double quote
318 \n newline
319 \r carriage-return
320 \t tab (optional, also works literally)
321 \\ backslash
322 NUL bytes are not allowed!
323
324boolean Argument with two possible values:
325 T true
326 F false
327
328number Argument with a decimal number.
329
330optnum Argument with either a decimal number or "none" (without the
331 quotes).
332
333offset A number argument that indicates a byte position in a buffer.
334 The first byte has offset zero. Line breaks are counted for
335 how they appear in the file (CR/LF counts for two bytes).
336 Note that a multi-byte character is counted for the number of
337 bytes it takes.
338
339lnum/col Argument with a line number and column number position. The
340 line number starts with one, the column is the byte position,
341 starting with zero. Note that a multi-byte character counts
342 for several columns.
343
344pathname String argument: file name with full path.
345
346
34710.3 Commands *nb-commands*
348
349actionMenuItem Not implemented.
350
351actionSensitivity
352 Not implemented.
353
354addAnno serNum typeNum off len
355 Place an annotation in this buffer.
356 Arguments:
357 serNum number serial number of this placed
358 annotation, used to be able to remove
359 it
360 typeNum number sequence number of the annotation
361 defined with defineAnnoType for this
362 buffer
363 off number offset where annotation is to be placed
364 len number not used
365 In version 2.1 "lnum/col" can be used instead of "off".
366
367balloonResult text
368 Not implemented.
369
370close Close the buffer. This leaves us without current buffer, very
371 dangerous to use!
372
373create Creates a buffer without a name. Replaces the current buffer
374 (it's hidden when it was changed).
375 NetBeans uses this as the first command for a file that is
376 being opened. The sequence of commands could be:
377 create
378 setCaretListener (ignored)
379 setModified (no effect)
380 setContentType (ignored)
381 startDocumentListen
382 setTitle
383 setFullName
384
385defineAnnoType typeNum typeName tooltip glyphFile fg bg
386 Define a type of annotation for this buffer.
387 Arguments:
388 typeNum number sequence number (not really used)
389 typeName string name that identifies this annotation
390 tooltip string not used
391 glyphFile string name of icon file
392 fg optnum foreground color for line highlighting
393 bg optnum background color for line highlighting
394 Vim will define a sign for the annotation.
395 When both "fg" and "bg" are "none" no line highlighting is
396 used (new in version 2.1).
397 When "glyphFile" is empty, no text sign is used (new in
398 version 2.1).
399 When "glyphFile" is one or two characters long, a text sign is
400 defined (new in version 2.1).
401 Note: the annotations will be defined in sequence, and the
402 sequence number is later used with addAnno.
403
404editFile pathname
405 Set the name for the buffer and edit the file "pathname", a
406 string argument.
407 Normal way for the IDE to tell the editor to edit a file. If
408 the IDE is going to pass the file text to the editor use these
409 commands instead:
410 setFullName
411 insert
412 initDone
413 New in version 2.1.
414
415enableBalloonEval
416 Not implemented.
417
418endAtomic End an atomic operation. The changes between "startAtomic"
419 and "endAtomic" can be undone as one operation. But it's not
420 implemented yet. Redraw when necessary.
421
422guard off len
423 Mark an area in the buffer as guarded. This means it cannot
424 be edited. "off" and "len" are numbers and specify the text
425 to be guarded.
426
427initDone Mark the buffer as ready for use. Implicitly makes the buffer
428 the current buffer. Fires the BufReadPost autocommand event.
429
Bram Moolenaar009b2592004-10-24 19:18:58 +0000430insertDone
431 Sent by NetBeans to tell vim an initial file insert is done.
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000432 This triggers a read message being printed. Prior to version
Bram Moolenaar009b2592004-10-24 19:18:58 +0000433 2.3, no read messages were displayed after opening a file.
434 New in version 2.3.
435
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436moveAnnoToFront serNum
437 Not implemented.
438
439netbeansBuffer isNetbeansBuffer
440 If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by
441 NetBeans.
442 New in version 2.2.
443
444putBufferNumber pathname
445 Associate a buffer number with the Vim buffer by the name
446 "pathname", a string argument. To be used when the editor
447 reported editing another file to the IDE and the IDE needs to
448 tell the editor what buffer number it will use for this file.
449 Also marks the buffer as initialized.
450 New in version 2.1.
451
452raise Bring the editor to the foreground.
453 New in version 2.1.
454
455removeAnno serNum
456 Remove a previously place annotation for this buffer.
457 "serNum" is the same number used in addAnno.
458
459save Save the buffer when it was modified. The other side of the
460 interface is expected to write the buffer and invoke
461 "setModified" to reset the "changed" flag of the buffer.
462 The writing is skipped when one of these conditions is true:
463 - 'write' is not set
464 - the buffer is read-only
465 - the buffer does not have a file name
466 - 'buftype' disallows writing
467 New in version 2.2.
468
Bram Moolenaar009b2592004-10-24 19:18:58 +0000469saveDone
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000470 Sent by NetBeans to tell vim a save is done. This triggers
471 a save message being printed. Prior to version 2.3, no save
Bram Moolenaar009b2592004-10-24 19:18:58 +0000472 messages were displayed after a save.
473 New in version 2.3.
474
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475setAsUser Not implemented.
476
477setBufferNumber pathname
478 Associate a buffer number with Vim buffer by the name
479 "pathname". To be used when the editor reported editing
480 another file to the IDE and the IDE needs to tell the editor
481 what buffer number it will use for this file.
482 Has the side effect of making the buffer the current buffer.
483 See "putBufferNumber" for a more useful command.
484
485setContentType
486 Not implemented.
487
488setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000489 specified position. If the buffer is open in another window
490 than make that window the current window.
491 If there are folds they are opened to make the cursor line
492 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000493 In version 2.1 "lnum/col" can be used instead of "off".
494
495setExitDelay seconds
496 Set the delay for exiting to "seconds", a number.
497 This delay is used to give the IDE a chance to handle things
498 before really exiting. The default delay is two seconds.
499 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000500 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000501
502setFullName pathname
503 Set the file name to be used for a buffer to "pathname", a
504 string argument.
505 Used when the IDE wants to edit a file under control of the
506 IDE. This makes the buffer the current buffer, but does not
507 read the file. "insert" commands will be used next to set the
508 contents.
509
510setLocAndSize Not implemented.
511
512setMark Not implemented.
513
514setModified modified
515 When the boolean argument "modified" is "T" mark the buffer as
516 modified, when it is "F" mark it as unmodified.
517
Bram Moolenaar009b2592004-10-24 19:18:58 +0000518setModtime time
519 Update a buffers modification time after NetBeans saves the
520 file.
521 New in version 2.3.
522
523setReadOnly
524 Passed by NetBeans to tell vim a file is readonly.
525 Implemented in verion 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000526
527setStyle Not implemented.
528
529setTitle name
530 Set the title for the buffer to "name", a string argument.
531 The title is only used for NetBeans functions, not by Vim.
532
533setVisible visible
534 When the boolean argument "visible" is "T", goto the buffer.
535 The "F" argument does nothing.
536
537showBalloon text
538 Show a balloon (popup window) at the mouse pointer position,
539 containing "text", a string argument. The balloon should
540 disappear when the mouse is moved more than a few pixels.
541 New in version 2.1.
542
Bram Moolenaar009b2592004-10-24 19:18:58 +0000543specialKeys
544 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000545 to NetBeans for processing. This lets NetBeans hotkeys be
Bram Moolenaar009b2592004-10-24 19:18:58 +0000546 used from vim.
547 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548
549startAtomic Begin an atomic operation. The screen will not be updated
550 until "endAtomic" is given.
551
552startCaretListen
553 Not implemented.
554
555startDocumentListen
556 Mark the buffer to report changes to the IDE with the
557 "insert" and "remove" events. The default is to report
558 changes.
559
560stopCaretListen
561 Not implemented.
562
563stopDocumentListen
564 Mark the buffer to stop reporting changes to the IDE.
565 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000566 NOTE: if "netbeansBuffer" was used to mark this buffer as a
567 NetBeans buffer, then the buffer is deleted in Vim. This is
568 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000569
570unguard off len
571 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000572 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000573
574version Not implemented.
575
576
57710.4 Functions and Replies *nb-functions*
578
579getDot Not implemented.
580
581getCursor Return the current buffer and cursor position.
582 The reply is:
583 seqno bufID lnum col off
584 seqno = sequence number of the function
585 bufID = buffer ID of the current buffer (if this is unknown -1
586 is used)
587 lnum = line number of the cursor (first line is one)
588 col = column number of the cursor (in bytes, zero based)
589 off = offset of the cursor in the buffer (in bytes)
590 New in version 2.1.
591
592getLength Return the length of the buffer in bytes.
593 Reply example for a buffer with 5000 bytes:
594 123 5000
595 TODO: explain use of partial line.
596
597getMark Not implemented.
598
599getModified When a buffer is specified: Return zero if the buffer does not
600 have changes, one if it does have changes.
601 When no buffer is specified (buffer number zero): Return the
602 number of buffers with changes. When the result is zero it's
603 safe to tell Vim to exit.
604 New in version 2.1.
605
606getText Return the contents of the buffer as a string.
607 Reply example for a buffer with two lines
608 123 "first line\nsecond line\n"
609 NOTE: docs indicate an offset and length argument, but this is
610 not implemented.
611
612insert off text
613 Insert "text" before position "off". "text" is a string
614 argument, "off" a number.
615 Possible replies:
616 123 no problem
617 123 !message failed
618 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000619 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000620
621remove off length
622 Delete "length" bytes of text at position "off". Both
623 arguments are numbers.
624 Possible replies:
625 123 no problem
626 123 !message failed
627 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000628 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000629
630saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
631 If there are no changed files or the user does not cancel the
632 operation Vim exits and no result is sent back. The IDE can
633 consider closing the connection as a successful result.
634 If the user cancels the operation the number of modified
635 buffers that remains is returned and Vim does not exit.
636 New in version 2.1.
637
638
63910.5 Events *nb-events*
640
641balloonEval off len type
642 The mouse pointer rests on text for a short while. When "len"
643 is zero, there is no selection and the pointer is at position
644 "off". When "len" is non-zero the text from position "off" to
645 "off" + "len" is selected.
646 Only sent after "enableBalloonEval" was used for this buffer.
647 "type" is not yet defined.
648 Not implemented yet.
649
650balloonText text
651 Used when 'ballooneval' is set and the mouse pointer rests on
652 some text for a moment. "text" is a string, the text under
653 the mouse pointer.
654 New in version 2.1.
655
656buttonRelease button lnum col
657 Report which button was pressed and the location of the cursor
658 at the time of the release. Only for buffers that are owned
659 by NetBeans. This event is not sent if the button was
660 released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000661 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000662 in the sign area.
663 New in version 2.2.
664
Bram Moolenaar009b2592004-10-24 19:18:58 +0000665disconnect
666 Tell NetBeans that vim is exiting and not to try and read or
667 write more commands.
668 New in version 2.3.
669
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670fileClosed Not implemented.
671
672fileModified Not implemented.
673
674fileOpened pathname open modified
675 A file was opened by the user.
676 Arguments:
677 pathname string name of the file
678 open boolean always "T"
679 modified boolean always "F"
680
681geometry cols rows x y
682 Report the size and position of the editor window.
683 Arguments:
684 cols number number of text columns
685 rows number number of text rows
686 x number pixel position on screen
687 y number pixel position on screen
688 Only works for Motif.
689
690insert off text
691 Text "text" has been inserted in Vim at position "off".
692 Only fired when enabled, see "startDocumentListen".
693
694invokeAction Not implemented.
695
696keyCommand keyName
697 Reports a special key being pressed with name "keyName", which
698 is a string.
699 Supported key names:
700 F1 function key 1
701 F2 function key 2
702 ...
703 F12 function key 12
704
705 ' ' space (without the quotes)
706 ! exclamation mark
707 ... any other ASCII printable character
708 ~ tilde
709
710 X any unrecognized key
711
712 The key may be prepended by "C", "S" and/or "M" for Control,
713 Shift and Meta (Alt) modifiers. If there is a modifier a dash
714 is used to separate it from the key name. For example:
715 "C-F2".
716 ASCII characters are new in version 2.1.
717
718keyAtPos keyName lnum/col
719 Like "keyCommand" and also report the line number and column
720 of the cursor.
721 New in version 2.1.
722
723killed A file was closed by the user. Only for files that have been
724 assigned a number by the IDE.
725
726newDotAndMark off off
727 Reports the position of the cursor being at "off" bytes into
728 the buffer. Only sent just before a "keyCommand" event.
729
730quit Not implemented.
731
732remove off len
733 Text was deleted in Vim at position "off" with byte length
734 "len".
735 Only fired when enabled, see "startDocumentListen".
736
737revert Not implemented.
738
739save The buffer has been saved and is now unmodified.
740 Only fired when enabled, see "startDocumentListen".
741
742startupDone The editor has finished its startup work and is ready for
743 editing files.
744 New in version 2.1.
745
746unmodified The buffer is now unmodified.
747 Only fired when enabled, see "startDocumentListen".
748
749version vers Report the version of the interface implementation. Vim
750 reports "2.2" (including the quotes).
751
752
75310.6 Special messages *nb-special*
754
755These messages do not follow the style of the messages above. They are
756terminated by a newline character.
757
758ACCEPT Not used.
759
760AUTH password editor -> IDE: First message that the editor sends to the IDE.
761 Must contain the password for the socket server, as specified
762 with the |-nb| argument. No quotes are used!
763
764DISCONNECT IDE -> editor: break the connection. The editor will exit.
765 The IDE must only send this message when there are no unsaved
766 changes!
767
768DETACH IDE -> editor: break the connection without exiting the
769 editor. Used when the IDE exits without bringing down the
770 editor as well.
771 New in version 2.1.
772
773REJECT Not used.
774
775==============================================================================
Bram Moolenaar65c1b012005-01-31 19:02:28 +000077611. NetBeans Commands *netbeans-commands*
777
778 *:nbkey*
779:nbkey key Pass the key to NetBeans for processing
780
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000781Pass the key to NetBeans for hot-key processing. You should not need to use
782this command directly. However, NetBeans passes a list of hot-keys to Vim at
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000783startup and when one of these keys is pressed, this command is generated to
784send the key press back to NetBeans.
785
786==============================================================================
78712. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000788
789NUL bytes are not possible. For editor -> IDE they will appear as NL
790characters. For IDE -> editor they cannot be inserted.
791
792
793 vim:tw=78:ts=8:ft=help:norl: