blob: ee227b47538958594295db6fb6c3caf1ac20a8a3 [file] [log] [blame]
Christian Brabandt1c5728e2024-05-11 11:12:40 +02001*netbeans.txt* For Vim version 9.1. Last change: 2024 May 11
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00004 VIM REFERENCE MANUAL by Gordon Prieur et al.
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
6
Bram Moolenaarbb1969b2019-01-17 15:45:25 +01007 *netbeans* *NetBeans* *netbeans-support*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008
9Vim NetBeans Protocol: a socket interface for Vim integration into an IDE.
10
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111. Introduction |netbeans-intro|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000122. Integration features |netbeans-integration|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133. Configuring Vim for NetBeans |netbeans-configure|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000144. Error Messages |netbeans-messages|
155. Running Vim in NetBeans mode |netbeans-run|
166. NetBeans protocol |netbeans-protocol|
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200177. NetBeans commands |netbeans-commands|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000188. Known problems |netbeans-problems|
199. Debugging NetBeans protocol |netbeans-debugging|
2010. NetBeans External Editor
21 10.1. Downloading NetBeans |netbeans-download|
22 10.2. NetBeans Key Bindings |netbeans-keybindings|
23 10.3. Preparing NetBeans for Vim |netbeans-preparation|
24 10.4. Obtaining the External Editor Module |obtaining-exted|
25 10.5. Setting up NetBeans to run with Vim |netbeans-setup|
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
Bram Moolenaar071d4272004-06-13 20:20:40 +000027{only available when compiled with the |+netbeans_intg| feature}
28
29==============================================================================
301. Introduction *netbeans-intro*
31
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000032The NetBeans interface was initially developed to integrate Vim into the
33NetBeans Java IDE, using the external editor plugin. This NetBeans plugin no
34longer exists for recent versions of NetBeans but the protocol was developed
35in such a way that any IDE can use it to integrate Vim.
36
37The NetBeans protocol of Vim is a text based communication protocol, over a
38classical TCP socket. There is no dependency on Java or NetBeans. Any language
39or environment providing a socket interface can control Vim using this
40protocol. There are existing implementations in C, C++, Python and Java. The
41name NetBeans is kept today for historical reasons.
42
Bram Moolenaar173d8412020-04-19 14:02:26 +020043Active project using the NetBeans protocol of Vim:
44- Eclim, http://eclim.org/
45
46VimIntegration, description of various projects doing Vim Integration:
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000047 http://www.freehackers.org/VimIntegration
Bram Moolenaar173d8412020-04-19 14:02:26 +020048
49Projects using the NetBeans protocol of Vim are or were:
50- Agide, an IDE for the AAP project, written in Python (now replaced by
51 |:Termdebug|): http://www.a-a-p.org
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000052- Clewn, a gdb integration into Vim, written in C:
53 http://clewn.sourceforge.net/
Bram Moolenaarb26e6322010-05-22 21:34:09 +020054- Pyclewn, a gdb integration into Vim, written in Python:
55 http://pyclewn.sourceforge.net/
Bram Moolenaar173d8412020-04-19 14:02:26 +020056- VimWrapper, library to easy Vim integration into IDE:
57 http://www.freehackers.org/VimWrapper
58Outdated projects (links don't work):
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000059- VimPlugin, integration of Vim inside Eclipse:
60 http://vimplugin.sourceforge.net/wiki/pmwiki.php
61- PIDA, IDE written in Python integrating Vim:
62 http://pida.co.uk/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000063
64Check the specific project pages to see how to use Vim with these projects.
65
Bram Moolenaar269f5952016-07-15 22:54:41 +020066An alternative is to use a channel, see |channel|.
67
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000068In the rest of this help page, we will use the term "Vim Controller" to
69describe the program controlling Vim through the NetBeans socket interface.
70
71
72About the NetBeans IDE ~
73
Bram Moolenaar071d4272004-06-13 20:20:40 +000074NetBeans is an open source Integrated Development Environment developed
75jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
76Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
77in recent releases.
78
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000079For more information visit the main NetBeans web site http://www.netbeans.org.
Christian Brabandt1c5728e2024-05-11 11:12:40 +020080The External Editor is now, unfortunately, declared obsolete. See (link seems
81dead): http://externaleditor.netbeans.org.
Bram Moolenaar071d4272004-06-13 20:20:40 +000082
83Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
84Visit http://www.sun.com for more information regarding the Sun ONE Studio
85product line.
86
87Current releases of NetBeans provide full support for Java and limited support
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000088for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
Bram Moolenaar071d4272004-06-13 20:20:40 +000089support for Java, C, C++, and Fortran.
90
Bram Moolenaar071d4272004-06-13 20:20:40 +000091==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000922. Integration features *netbeans-integration*
Bram Moolenaar071d4272004-06-13 20:20:40 +000093
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000094The NetBeans socket interface of Vim allows to get information from Vim or to
95ask Vim to perform specific actions:
96- get information about buffer: buffer name, cursor position, buffer content,
97 etc.
98- be notified when buffers are open or closed
99- be notified of how the buffer content is modified
100- load and save files
101- modify the buffer content
102- installing special key bindings
103- raise the window, control the window geometry
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000105For sending key strokes to Vim or for evaluating functions in Vim, you must
106use the |clientserver| interface.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107
Bram Moolenaar071d4272004-06-13 20:20:40 +0000108
109==============================================================================
1103. Configuring Vim for NetBeans *netbeans-configure*
111
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200112For more help about installing Vim, please read |usr_90.txt| in the Vim User
113Manual.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114
115
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000116On Unix:
117--------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118
119When running configure without arguments the NetBeans interface should be
120included. That is, if the configure check to find out if your system supports
121the required features succeeds.
122
123In case you do not want the NetBeans interface you can disable it by
124uncommenting a line with "--disable-netbeans" in the Makefile.
125
Bram Moolenaar67c53842010-05-22 18:28:27 +0200126Currently the NetBeans interface is supported by Vim running in a terminal and
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +0100127by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows
128and Motif.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
Bram Moolenaarbb1969b2019-01-17 15:45:25 +0100130 *netbeans-xpm*
131If Motif support is required the user must supply XPM libraries.
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +0100132The XPM library is required to show images within Vim with Motif.
Bram Moolenaarbb1969b2019-01-17 15:45:25 +0100133Without it the toolbar and signs will be disabled.
134
135The XPM library is provided by Arnaud Le Hors of the French National Institute
136for Research in Computer Science and Control. It can be downloaded from
137http://cgit.freedesktop.org/xorg/lib/libXpm. The current release, as of this
138writing, is xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create
139the directory /usr/local/xpm and untar the file there you can use the
140uncommented lines in the Makefile without changing them. If you use another
141xpm directory you will need to change the XPM_DIR in src/Makefile.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000142
143
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000144On MS-Windows:
145--------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146
147The Win32 support is now in beta stage.
148
149To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
Christian Brabandt1c5728e2024-05-11 11:12:40 +0200150XPM by yourself or use precompiled libraries from (link seems dead):
151http://iamphet.nm.ru/misc/ (for MS Visual C++) or
152http://gnuwin32.sourceforge.net (for MinGW).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000153
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000154Enable debugging:
155-----------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000157To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro
158needs to be defined. Search in the Makefile of the platform you are using for
159"NBDEBUG" to see what line needs to be uncommented. This effectively adds
160"-DNBDEBUG" to the compile command. Also see |netbeans-debugging|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161
162==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001634. Error Messages *netbeans-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000165These error messages are specific to NetBeans socket protocol:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166
167 *E463*
168Region is guarded, cannot modify
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000169 The Vim Controller has defined guarded areas in the text,
170 which you cannot change. Also sets the current buffer, if
171 necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172
Bram Moolenaar67c53842010-05-22 18:28:27 +0200173 *E532*
174The defineAnnoType highlighting color name is too long
175 The maximum length of the "fg" or "bg" color argument in the
176 defineAnnoType command is 32 characters.
177 New in version 2.5.
178
Bram Moolenaar071d4272004-06-13 20:20:40 +0000179 *E656*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000180Writes of unmodified buffers forbidden
181 Writes of unmodified buffers that were opened from the
182 Vim Controller are not possible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183
184 *E657*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000185Partial writes disallowed
186 Partial writes for buffers that were opened from the
187 Vim Controller are not allowed.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188
189 *E658*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000190Connection lost for this buffer
191 The Vim Controller has become confused about the state of
192 this file. Rather than risk data corruption, it has severed
193 the connection for this file. Vim will take over
194 responsibility for saving changes to this file and the
195 Vim Controller will no longer know of these changes.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000196
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000197 *E744*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000198Read-only file
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000199 Vim normally allows changes to a read-only file and only
200 enforces the read-only rule if you try to write the file.
201 However, NetBeans does not let you make changes to a file
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000202 which is read-only and becomes confused if Vim does this.
203 So Vim does not allow modifications to files when run
204 in NetBeans mode.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000205
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000206==============================================================================
2075. Running Vim in NetBeans mode *netbeans-run*
208
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200209There are two different ways to run Vim in NetBeans mode:
210
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200211 + an IDE may start Vim with the |-nb| command line argument
212 + NetBeans can be started from within Vim with the |:nbstart| command
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200213
Bram Moolenaare0fa3742016-02-20 15:47:01 +0100214Vim uses a 3 second timeout on trying to make the connection.
215
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200216 *netbeans-parameters*
217Three forms can be used to setup the NetBeans connection parameters.
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200218When started from the command line, the |-nb| command line argument may be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000219
220 -nb={fname} from a file
221 -nb:{hostname}:{addr}:{password} directly
222 -nb from a file or environment
223
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200224When started from within Vim, the |:nbstart| optional argument may be:
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200225
226 ={fname} from a file
227 :{hostname}:{addr}:{password} directly
228 <MISSING ARGUMENT> from a file or environment
229
Bram Moolenaar071d4272004-06-13 20:20:40 +0000230 *E660* *E668*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200231When NetBeans is started from the command line, for security reasons, the best
232method is to write the information in a file readable only by the user. The
233name of the file can be passed with the "-nb={fname}" argument or, when "-nb"
234is used without a parameter, the environment variable "__NETBEANS_CONINFO".
235The file must contain these three lines, in any order:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236
237 host={hostname}
238 port={addr}
239 auth={password}
240
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200241Other lines are ignored. The Vim Controller is responsible for deleting the
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242file afterwards.
243
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000244{hostname} is the name of the machine where Vim Controller is running. When
245omitted the environment variable "__NETBEANS_HOST" is used or the default
246"localhost".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000247
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000248{addr} is the port number for the NetBeans interface. When omitted the
249environment variable "__NETBEANS_SOCKET" is used or the default 3219.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250
251{password} is the password for connecting to NetBeans. When omitted the
252environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
253
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000254Vim will initiate a socket connection (client side) to the specified host and
255port upon startup. The password will be sent with the AUTH event when the
256connection has been established.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000257
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000258
259==============================================================================
2606. NetBeans protocol *netbeans-protocol*
261
262The communication between the Vim Controller and Vim uses plain text
263messages. This protocol was first designed to work with the external editor
264module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE,
265see http://www.a-a-p.org) and then with other IDE. The extensions are marked
266with "version 2.1".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000267
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000268Version 2.2 of the protocol has several minor changes which should only affect
269NetBeans users (ie, not Agide users). However, a bug was fixed which could
270cause confusion. The netbeans_saved() function sent a "save" protocol
271command. In protocol version 2.1 and earlier this was incorrectly interpreted
272as a notification that a write had taken place. In reality, it told NetBeans
273to save the file so multiple writes were being done. This caused various
274problems and has been fixed in 2.2. To decrease the likelihood of this
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275confusion happening again, netbeans_saved() has been renamed to
276netbeans_save_buffer().
277
Bram Moolenaar67c53842010-05-22 18:28:27 +0200278We are now at version 2.5. For the differences between 2.4 and 2.5 search for
279"2.5" below.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000280
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281The messages are currently sent over a socket. Since the messages are in
282plain UTF-8 text this protocol could also be used with any other communication
283mechanism.
284
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200285Netbeans messages are processed when Vim is idle, waiting for user input.
286When Vim is run in non-interactive mode, for example when running an automated
287test case that sources a Vim script, the idle loop may not be called often
Bram Moolenaarb8ff1fb2012-02-04 21:59:01 +0100288enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep|
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200289command does invoke Netbeans messages processing.
290
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002916.1 Kinds of messages |nb-messages|
2926.2 Terms |nb-terms|
2936.3 Commands |nb-commands|
2946.4 Functions and Replies |nb-functions|
2956.5 Events |nb-events|
2966.6 Special messages |nb-special|
2976.7 Protocol errors |nb-protocol_errors|
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000298
299
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00003006.1 Kinds of messages *nb-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000301
302There are four kinds of messages:
303
304kind direction comment ~
305Command IDE -> editor no reply necessary
306Function IDE -> editor editor must send back a reply
307Reply editor -> IDE only in response to a Function
308Event editor -> IDE no reply necessary
309
310The messages are sent as a single line with a terminating newline character.
311Arguments are separated by a single space. The first item of the message
312depends on the kind of message:
313
314kind first item example ~
315Command bufID:name!seqno 11:showBalloon!123 "text"
316Function bufID:name/seqno 11:getLength/123
317Reply seqno 123 5000
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000318Event bufID:name=seqno 11:keyCommand=123 "S-F2"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000319
320
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000321
3226.2 Terms *nb-terms*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000323
324bufID Buffer number. A message may be either for a specific buffer
325 or generic. Generic messages use a bufID of zero. NOTE: this
326 buffer ID is assigned by the IDE, it is not Vim's buffer
327 number. The bufID must be a sequentially rising number,
Bram Moolenaar5837f1f2015-03-21 18:06:14 +0100328 starting at one. When the 'switchbuf' option is set to
329 "usetab" and the "bufID" buffer is not found in the current
330 tab page, the netbeans commands and functions that set this
331 buffer as the current buffer will jump to the first open
332 window that contains this buffer in other tab pages instead of
333 replacing the buffer in the current window.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334
335seqno The IDE uses a sequence number for Commands and Functions. A
336 Reply must use the sequence number of the Function that it is
337 associated with. A zero sequence number can be used for
338 Events (the seqno of the last received Command or Function can
339 also be used).
340
341string Argument in double quotes. Text is in UTF-8 encoding. This
342 means ASCII is passed as-is. Special characters are
343 represented with a backslash:
344 \" double quote
345 \n newline
346 \r carriage-return
347 \t tab (optional, also works literally)
348 \\ backslash
349 NUL bytes are not allowed!
350
351boolean Argument with two possible values:
352 T true
353 F false
354
355number Argument with a decimal number.
356
Bram Moolenaar67c53842010-05-22 18:28:27 +0200357color Argument with either a decimal number, "none" (without the
358 quotes) or the name of a color (without the quotes) defined
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200359 both in the color list in |highlight-ctermfg| and in the color
360 list in |gui-colors|.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200361 New in version 2.5.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000362
363offset A number argument that indicates a byte position in a buffer.
364 The first byte has offset zero. Line breaks are counted for
365 how they appear in the file (CR/LF counts for two bytes).
Bram Moolenaar207f0092020-08-30 17:20:20 +0200366 Note that a multibyte character is counted for the number of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000367 bytes it takes.
368
369lnum/col Argument with a line number and column number position. The
370 line number starts with one, the column is the byte position,
Bram Moolenaar207f0092020-08-30 17:20:20 +0200371 starting with zero. Note that a multibyte character counts
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372 for several columns.
373
374pathname String argument: file name with full path.
375
376
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00003776.3 Commands *nb-commands*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000378
379actionMenuItem Not implemented.
380
381actionSensitivity
382 Not implemented.
383
384addAnno serNum typeNum off len
385 Place an annotation in this buffer.
386 Arguments:
387 serNum number serial number of this placed
388 annotation, used to be able to remove
389 it
390 typeNum number sequence number of the annotation
391 defined with defineAnnoType for this
392 buffer
393 off number offset where annotation is to be placed
394 len number not used
395 In version 2.1 "lnum/col" can be used instead of "off".
396
397balloonResult text
398 Not implemented.
399
400close Close the buffer. This leaves us without current buffer, very
401 dangerous to use!
402
403create Creates a buffer without a name. Replaces the current buffer
404 (it's hidden when it was changed).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000405 The Vim Controller should use this as the first command for a
406 file that is being opened. The sequence of commands could be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000407 create
408 setCaretListener (ignored)
409 setModified (no effect)
410 setContentType (ignored)
411 startDocumentListen
412 setTitle
413 setFullName
414
415defineAnnoType typeNum typeName tooltip glyphFile fg bg
416 Define a type of annotation for this buffer.
417 Arguments:
418 typeNum number sequence number (not really used)
419 typeName string name that identifies this annotation
420 tooltip string not used
421 glyphFile string name of icon file
Bram Moolenaar67c53842010-05-22 18:28:27 +0200422 fg color foreground color for line highlighting
423 bg color background color for line highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424 Vim will define a sign for the annotation.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200425 When color is a number, this is the "#rrggbb" Red, Green and
426 Blue values of the color (see |gui-colors|) and the
Bram Moolenaarb477af22018-07-15 20:20:18 +0200427 highlighting is only defined for gVim.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200428 When color is a name, this color is defined both for Vim
Bram Moolenaarb477af22018-07-15 20:20:18 +0200429 running in a color terminal and for gVim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000430 When both "fg" and "bg" are "none" no line highlighting is
431 used (new in version 2.1).
432 When "glyphFile" is empty, no text sign is used (new in
433 version 2.1).
434 When "glyphFile" is one or two characters long, a text sign is
435 defined (new in version 2.1).
436 Note: the annotations will be defined in sequence, and the
437 sequence number is later used with addAnno.
438
439editFile pathname
440 Set the name for the buffer and edit the file "pathname", a
441 string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000442 Normal way for the IDE to tell the editor to edit a file.
443
444 You must set a bufId different of 0 with this command to
445 assign a bufId to the buffer. It will trigger an event
446 fileOpened with a bufId of 0 but the buffer has been assigned.
447
448 If the IDE is going to pass the file text to the editor use
449 these commands instead:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450 setFullName
451 insert
452 initDone
453 New in version 2.1.
454
455enableBalloonEval
456 Not implemented.
457
458endAtomic End an atomic operation. The changes between "startAtomic"
459 and "endAtomic" can be undone as one operation. But it's not
460 implemented yet. Redraw when necessary.
461
462guard off len
463 Mark an area in the buffer as guarded. This means it cannot
464 be edited. "off" and "len" are numbers and specify the text
465 to be guarded.
466
467initDone Mark the buffer as ready for use. Implicitly makes the buffer
468 the current buffer. Fires the BufReadPost autocommand event.
469
Bram Moolenaar173d8412020-04-19 14:02:26 +0200470insertDone starteol readonly
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000471 Sent by Vim Controller to tell Vim an initial file insert is
Bram Moolenaar173d8412020-04-19 14:02:26 +0200472 done. This triggers a read message being printed. If
473 "starteol" is "F" then the last line doesn't have a EOL. If
474 "readonly" is "T" then the file is marked as readonly. Prior
475 to version 2.3, no read messages were displayed after opening
476 a file. New in version 2.3.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000477
Bram Moolenaar071d4272004-06-13 20:20:40 +0000478moveAnnoToFront serNum
479 Not implemented.
480
481netbeansBuffer isNetbeansBuffer
Bram Moolenaarc236c162008-07-13 17:41:49 +0000482 If "isNetbeansBuffer" is "T" then this buffer is "owned" by
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483 NetBeans.
484 New in version 2.2.
485
486putBufferNumber pathname
487 Associate a buffer number with the Vim buffer by the name
488 "pathname", a string argument. To be used when the editor
489 reported editing another file to the IDE and the IDE needs to
490 tell the editor what buffer number it will use for this file.
491 Also marks the buffer as initialized.
492 New in version 2.1.
493
494raise Bring the editor to the foreground.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200495 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000496 New in version 2.1.
497
498removeAnno serNum
Bram Moolenaar3a991dd2014-10-02 01:41:41 +0200499 Remove a previously placed annotation for this buffer.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000500 "serNum" is the same number used in addAnno.
501
502save Save the buffer when it was modified. The other side of the
503 interface is expected to write the buffer and invoke
504 "setModified" to reset the "changed" flag of the buffer.
505 The writing is skipped when one of these conditions is true:
506 - 'write' is not set
507 - the buffer is read-only
508 - the buffer does not have a file name
509 - 'buftype' disallows writing
510 New in version 2.2.
511
Bram Moolenaar009b2592004-10-24 19:18:58 +0000512saveDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000513 Sent by Vim Controller to tell Vim a save is done. This
514 triggers a save message being printed. Prior to version 2.3,
515 no save messages were displayed after a save.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000516 New in version 2.3.
517
Bram Moolenaar071d4272004-06-13 20:20:40 +0000518setAsUser Not implemented.
519
520setBufferNumber pathname
521 Associate a buffer number with Vim buffer by the name
522 "pathname". To be used when the editor reported editing
523 another file to the IDE and the IDE needs to tell the editor
524 what buffer number it will use for this file.
525 Has the side effect of making the buffer the current buffer.
526 See "putBufferNumber" for a more useful command.
527
528setContentType
529 Not implemented.
530
531setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000532 specified position. If the buffer is open in another window
533 than make that window the current window.
534 If there are folds they are opened to make the cursor line
535 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 In version 2.1 "lnum/col" can be used instead of "off".
537
538setExitDelay seconds
539 Set the delay for exiting to "seconds", a number.
540 This delay is used to give the IDE a chance to handle things
541 before really exiting. The default delay is two seconds.
542 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000543 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544
545setFullName pathname
546 Set the file name to be used for a buffer to "pathname", a
547 string argument.
548 Used when the IDE wants to edit a file under control of the
549 IDE. This makes the buffer the current buffer, but does not
550 read the file. "insert" commands will be used next to set the
551 contents.
552
553setLocAndSize Not implemented.
554
555setMark Not implemented.
556
557setModified modified
558 When the boolean argument "modified" is "T" mark the buffer as
559 modified, when it is "F" mark it as unmodified.
560
Bram Moolenaar009b2592004-10-24 19:18:58 +0000561setModtime time
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000562 Update a buffers modification time after the file has been
563 saved directly by the Vim Controller.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000564 New in version 2.3.
565
Bram Moolenaardbfa7952020-11-02 20:04:22 +0100566setReadOnly readonly
567 When the boolean argument "readonly" is "T" for True, mark the
568 buffer as readonly, when it is "F" for False, mark it as not
569 readonly. Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000570
571setStyle Not implemented.
572
573setTitle name
574 Set the title for the buffer to "name", a string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000575 The title is only used for the Vim Controller functions, not
576 by Vim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000577
578setVisible visible
579 When the boolean argument "visible" is "T", goto the buffer.
580 The "F" argument does nothing.
581
582showBalloon text
583 Show a balloon (popup window) at the mouse pointer position,
584 containing "text", a string argument. The balloon should
585 disappear when the mouse is moved more than a few pixels.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200586 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000587 New in version 2.1.
588
Bram Moolenaar009b2592004-10-24 19:18:58 +0000589specialKeys
590 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000591 to the Vim Controller for processing. This lets regular IDE
592 hotkeys be used from Vim.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000593 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000594
595startAtomic Begin an atomic operation. The screen will not be updated
596 until "endAtomic" is given.
597
598startCaretListen
599 Not implemented.
600
601startDocumentListen
602 Mark the buffer to report changes to the IDE with the
603 "insert" and "remove" events. The default is to report
604 changes.
605
606stopCaretListen
607 Not implemented.
608
609stopDocumentListen
610 Mark the buffer to stop reporting changes to the IDE.
611 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000612 NOTE: if "netbeansBuffer" was used to mark this buffer as a
613 NetBeans buffer, then the buffer is deleted in Vim. This is
614 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615
616unguard off len
617 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000618 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619
620version Not implemented.
621
622
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006236.4 Functions and Replies *nb-functions*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624
625getDot Not implemented.
626
627getCursor Return the current buffer and cursor position.
628 The reply is:
629 seqno bufID lnum col off
630 seqno = sequence number of the function
631 bufID = buffer ID of the current buffer (if this is unknown -1
632 is used)
633 lnum = line number of the cursor (first line is one)
634 col = column number of the cursor (in bytes, zero based)
635 off = offset of the cursor in the buffer (in bytes)
636 New in version 2.1.
637
638getLength Return the length of the buffer in bytes.
639 Reply example for a buffer with 5000 bytes:
640 123 5000
641 TODO: explain use of partial line.
642
643getMark Not implemented.
644
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000645getAnno serNum
646 Return the line number of the annotation in the buffer.
647 Argument:
648 serNum serial number of this placed annotation
649 The reply is:
650 123 lnum line number of the annotation
651 123 0 invalid annotation serial number
652 New in version 2.4.
653
Bram Moolenaar071d4272004-06-13 20:20:40 +0000654getModified When a buffer is specified: Return zero if the buffer does not
655 have changes, one if it does have changes.
656 When no buffer is specified (buffer number zero): Return the
657 number of buffers with changes. When the result is zero it's
658 safe to tell Vim to exit.
659 New in version 2.1.
660
661getText Return the contents of the buffer as a string.
662 Reply example for a buffer with two lines
663 123 "first line\nsecond line\n"
664 NOTE: docs indicate an offset and length argument, but this is
665 not implemented.
666
667insert off text
668 Insert "text" before position "off". "text" is a string
669 argument, "off" a number.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000670 "text" should have a "\n" (newline) at the end of each line.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000671 Or "\r\n" when 'fileformat' is "dos". When using "insert" in
672 an empty buffer Vim will set 'fileformat' accordingly.
673 When "off" points to the start of a line the text is inserted
674 above this line. Thus when "off" is zero lines are inserted
675 before the first line.
676 When "off" points after the start of a line, possibly on the
677 NUL at the end of a line, the first line of text is appended
678 to this line. Further lines come below it.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000679 Possible replies:
680 123 no problem
681 123 !message failed
682 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000683 Also sets the current buffer, if necessary.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000684 Does not move the cursor to the changed text.
685 Resets undo information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686
687remove off length
688 Delete "length" bytes of text at position "off". Both
689 arguments are numbers.
690 Possible replies:
691 123 no problem
692 123 !message failed
693 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000694 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000695
696saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
697 If there are no changed files or the user does not cancel the
698 operation Vim exits and no result is sent back. The IDE can
699 consider closing the connection as a successful result.
700 If the user cancels the operation the number of modified
701 buffers that remains is returned and Vim does not exit.
702 New in version 2.1.
703
704
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00007056.5 Events *nb-events*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000706
707balloonEval off len type
708 The mouse pointer rests on text for a short while. When "len"
709 is zero, there is no selection and the pointer is at position
710 "off". When "len" is non-zero the text from position "off" to
711 "off" + "len" is selected.
712 Only sent after "enableBalloonEval" was used for this buffer.
713 "type" is not yet defined.
714 Not implemented yet.
715
716balloonText text
717 Used when 'ballooneval' is set and the mouse pointer rests on
718 some text for a moment. "text" is a string, the text under
719 the mouse pointer.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200720 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721 New in version 2.1.
722
723buttonRelease button lnum col
724 Report which button was pressed and the location of the cursor
725 at the time of the release. Only for buffers that are owned
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000726 by the Vim Controller. This event is not sent if the button
727 was released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000728 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000729 in the sign area.
730 New in version 2.2.
731
Bram Moolenaar009b2592004-10-24 19:18:58 +0000732disconnect
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000733 Tell the Vim Controller that Vim is exiting and not to try and
734 read or write more commands.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000735 New in version 2.3.
736
Bram Moolenaar071d4272004-06-13 20:20:40 +0000737fileClosed Not implemented.
738
739fileModified Not implemented.
740
741fileOpened pathname open modified
742 A file was opened by the user.
743 Arguments:
744 pathname string name of the file
745 open boolean always "T"
746 modified boolean always "F"
747
748geometry cols rows x y
749 Report the size and position of the editor window.
750 Arguments:
751 cols number number of text columns
752 rows number number of text rows
753 x number pixel position on screen
754 y number pixel position on screen
755 Only works for Motif.
756
757insert off text
758 Text "text" has been inserted in Vim at position "off".
759 Only fired when enabled, see "startDocumentListen".
760
761invokeAction Not implemented.
762
763keyCommand keyName
764 Reports a special key being pressed with name "keyName", which
765 is a string.
766 Supported key names:
767 F1 function key 1
768 F2 function key 2
769 ...
770 F12 function key 12
771
772 ' ' space (without the quotes)
773 ! exclamation mark
774 ... any other ASCII printable character
775 ~ tilde
776
777 X any unrecognized key
778
779 The key may be prepended by "C", "S" and/or "M" for Control,
780 Shift and Meta (Alt) modifiers. If there is a modifier a dash
781 is used to separate it from the key name. For example:
782 "C-F2".
783 ASCII characters are new in version 2.1.
784
785keyAtPos keyName lnum/col
786 Like "keyCommand" and also report the line number and column
787 of the cursor.
788 New in version 2.1.
789
Bram Moolenaard7f8f5c2009-01-06 15:14:30 +0000790killed A file was deleted or wiped out by the user and the buffer
791 annotations have been removed. The bufID number for this
792 buffer has become invalid. Only for files that have been
793 assigned a bufID number by the IDE.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000794
795newDotAndMark off off
796 Reports the position of the cursor being at "off" bytes into
797 the buffer. Only sent just before a "keyCommand" event.
798
799quit Not implemented.
800
801remove off len
802 Text was deleted in Vim at position "off" with byte length
803 "len".
804 Only fired when enabled, see "startDocumentListen".
805
806revert Not implemented.
807
808save The buffer has been saved and is now unmodified.
809 Only fired when enabled, see "startDocumentListen".
810
811startupDone The editor has finished its startup work and is ready for
812 editing files.
813 New in version 2.1.
814
815unmodified The buffer is now unmodified.
816 Only fired when enabled, see "startDocumentListen".
817
818version vers Report the version of the interface implementation. Vim
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000819 reports "2.4" (including the quotes).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000820
821
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008226.6 Special messages *nb-special*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000823
824These messages do not follow the style of the messages above. They are
825terminated by a newline character.
826
827ACCEPT Not used.
828
829AUTH password editor -> IDE: First message that the editor sends to the IDE.
830 Must contain the password for the socket server, as specified
831 with the |-nb| argument. No quotes are used!
832
833DISCONNECT IDE -> editor: break the connection. The editor will exit.
834 The IDE must only send this message when there are no unsaved
835 changes!
836
837DETACH IDE -> editor: break the connection without exiting the
838 editor. Used when the IDE exits without bringing down the
839 editor as well.
840 New in version 2.1.
841
842REJECT Not used.
843
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000844
8456.7 Protocol errors *nb-protocol_errors*
846
847These errors occur when a message violates the protocol:
Bram Moolenaar5e9b2fa2016-02-01 22:37:05 +0100848*E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000849*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
Christian Brabandt5c233432023-11-27 20:04:24 +0100850*E647* *E648* *E650* *E651* *E652*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000851
852
Bram Moolenaar071d4272004-06-13 20:20:40 +0000853==============================================================================
Bram Moolenaarb26e6322010-05-22 21:34:09 +02008547. NetBeans commands *netbeans-commands*
855
Bram Moolenaar4a748032010-09-30 21:47:56 +0200856 *:nbstart* *E511* *E838*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200857:nbs[tart] {connection} Start a new Netbeans session with {connection} as the
858 socket connection parameters. The format of
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200859 {connection} is described in |netbeans-parameters|.
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200860 At any time, one may check if the netbeans socket is
861 connected by running the command:
862 ':echo has("netbeans_enabled")'
863
864 *:nbclose*
865:nbc[lose] Close the current NetBeans session. Remove all placed
866 signs.
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000867
868 *:nbkey*
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200869:nb[key] {key} Pass the {key} to the Vim Controller for processing.
870 When a hot-key has been installed with the specialKeys
871 command, this command can be used to generate a hotkey
872 message to the Vim Controller.
873 This command can also be used to pass any text to the
874 Vim Controller. It is used by Pyclewn, for example,
875 to build the complete set of gdb commands as Vim user
876 commands.
877 The events newDotAndMark, keyCommand and keyAtPos are
878 generated (in this order).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000879
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000880
881==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008828. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000883
884NUL bytes are not possible. For editor -> IDE they will appear as NL
885characters. For IDE -> editor they cannot be inserted.
886
Bram Moolenaar67c53842010-05-22 18:28:27 +0200887A NetBeans session may be initiated with Vim running in a terminal, and
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200888continued later in a GUI environment after running the |:gui| command. In this
Bram Moolenaar67c53842010-05-22 18:28:27 +0200889case, the highlighting defined for the NetBeans annotations may be cleared
890when the ":gui" command sources .gvimrc and this file loads a colorscheme
891that runs the command ":highlight clear".
892New in version 2.5.
893
Bram Moolenaar071d4272004-06-13 20:20:40 +0000894
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000895==============================================================================
8969. Debugging NetBeans protocol *netbeans-debugging*
897
898To debug the Vim protocol, you must first compile Vim with debugging support
899and NetBeans debugging support. See |netbeans-configure| for instructions
900about Vim compiling and how to enable debug support.
901
902When running Vim, set the following environment variables:
903
904 export SPRO_GVIM_DEBUG=netbeans.log
905 export SPRO_GVIM_DLEVEL=0xffffffff
906
907Vim will then log all the incoming and outgoing messages of the NetBeans
908protocol to the file netbeans.log .
909
910The content of netbeans.log after a session looks like this:
911Tue May 20 17:19:27 2008
912EVT: 0:startupDone=0
913CMD 1: (1) create
914CMD 2: (1) setTitle "testfile1.txt"
915CMD 3: (1) setFullName "testfile1.txt"
916EVT(suppressed): 1:remove=3 0 -1
917EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F
918CMD 4: (1) initDone
919FUN 5: (0) getCursor
920REP 5: 1 1 0 0
921CMD 6: (2) create
922CMD 7: (2) setTitle "testfile2.txt"
923CMD 8: (2) setFullName "testfile2.txt"
924EVT(suppressed): 2:remove=8 0 -1
925EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F
926CMD 9: (2) initDone
927
928
929==============================================================================
93010. NetBeans External Editor
931
932NOTE: This information is obsolete! Only relevant if you are using an old
933version of NetBeans.
934
935
93610.1. Downloading NetBeans *netbeans-download*
937
938The NetBeans IDE is available for download from netbeans.org. You can download
939a released version, download sources, or use CVS to download the current
940source tree. If you choose to download sources, follow directions from
941netbeans.org on building NetBeans.
942
943Depending on the version of NetBeans you download, you may need to do further
944work to get the required External Editor module. This is the module which lets
945NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
946for details on downloading this module if your NetBeans release does not have
947it.
948
949For C, C++, and Fortran support you will also need the cpp module. See
Christian Brabandt1c5728e2024-05-11 11:12:40 +0200950http://cpp.netbeans.org (link seems dead) for information regarding this
951module.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000952
953You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
954free trial. See http://www.sun.com for further details.
955
956
95710.2. NetBeans Key Bindings *netbeans-keybindings*
958
959Vim understands a number of key bindings that execute NetBeans commands.
960These are typically all the Function key combinations. To execute a NetBeans
961command, the user must press the Pause key followed by a NetBeans key binding.
962For example, in order to compile a Java file, the NetBeans key binding is
963"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a
964breakpoint at the current line, press "Pause Shift F8".
965
966The Pause key is Function key 21. If you don't have a working Pause key and
967want to use F8 instead, use: >
968
969 :map <F8> <F21>
970
971The External Editor module dynamically reads the NetBeans key bindings so vim
972should always have the latest key bindings, even when NetBeans changes them.
973
974
97510.3. Preparing NetBeans for Vim *netbeans-preparation*
976
977In order for NetBeans to work with vim, the NetBeans External Editor module
978must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
979then this module should be loaded and enabled. If you have a NetBeans release
980you may need to find another way of obtaining this open source module.
981
982You can check if you have this module by opening the Tools->Options dialog
983and drilling down to the "Modules" list (IDE Configuration->System->Modules).
984If your Modules list has an entry for "External Editor" you must make sure
985it is enabled (the "Enabled" property should have the value "True"). If your
986Modules list has no External Editor see the next section on |obtaining-exted|.
987
988
98910.4. Obtaining the External Editor Module *obtaining-exted*
990
991There are 2 ways of obtaining the External Editor module. The easiest way
992is to use the NetBeans Update Center to download and install the module.
993Unfortunately, some versions do not have this module in their update
994center. If you cannot download via the update center you will need to
995download sources and build the module. I will try and get the module
996available from the NetBeans Update Center so building will be unnecessary.
997Also check http://externaleditor.netbeans.org for other availability options.
998
999To download the External Editor sources via CVS and build your own module,
1000see http://externaleditor.netbeans.org and http://www.netbeans.org.
1001Unfortunately, this is not a trivial procedure.
1002
1003
100410.5. Setting up NetBeans to run with Vim *netbeans-setup*
1005
1006Assuming you have loaded and enabled the NetBeans External Editor module
1007as described in |netbeans-preparation| all you need to do is verify that
1008the gvim command line is properly configured for your environment.
1009
1010Open the Tools->Options dialog and open the Editing category. Select the
1011External Editor. The right hand pane should contain a Properties tab and
1012an Expert tab. In the Properties tab make sure the "Editor Type" is set
1013to "Vim". In the Expert tab make sure the "Vim Command" is correct.
1014
1015You should be careful if you change the "Vim Command". There are command
1016line options there which must be there for the connection to be properly
1017set up. You can change the command name but that's about it. If your gvim
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +02001018can be found by your $PATH then the Vim Command can start with "gvim". If
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001019you don't want gvim searched from your $PATH then hard code in the full
1020Unix path name. At this point you should get a gvim for any source file
1021you open in NetBeans.
1022
1023If some files come up in gvim and others (with different file suffixes) come
1024up in the default NetBeans editor you should verify the MIME type in the
1025Expert tab MIME Type property. NetBeans is MIME oriented and the External
1026Editor will only open MIME types specified in this property.
1027
1028
Bram Moolenaar91f84f62018-07-29 15:07:52 +02001029 vim:tw=78:ts=8:noet:ft=help:norl: