blob: 972b93c48ba60b5587feb40c5fc8574640d9e5d4 [file] [log] [blame]
Bram Moolenaar207f0092020-08-30 17:20:20 +02001*netbeans.txt* For Vim version 8.2. Last change: 2020 Aug 15
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.
Bram Moolenaarc236c162008-07-13 17:41:49 +000080The External Editor is now, unfortunately, declared obsolete. See
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000081 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 Moolenaar6aa8cea2017-06-05 14:44:35 +0200127by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
Bram Moolenaar173c9852010-09-29 17:27:01 +0200128Athena and 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.
132The XPM library is required to show images within Vim with Motif or Athena.
133Without 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
150XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/
151(for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
152
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000153Enable debugging:
154-----------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000156To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro
157needs to be defined. Search in the Makefile of the platform you are using for
158"NBDEBUG" to see what line needs to be uncommented. This effectively adds
159"-DNBDEBUG" to the compile command. Also see |netbeans-debugging|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000160
161==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001624. Error Messages *netbeans-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000164These error messages are specific to NetBeans socket protocol:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165
166 *E463*
167Region is guarded, cannot modify
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000168 The Vim Controller has defined guarded areas in the text,
169 which you cannot change. Also sets the current buffer, if
170 necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171
Bram Moolenaar67c53842010-05-22 18:28:27 +0200172 *E532*
173The defineAnnoType highlighting color name is too long
174 The maximum length of the "fg" or "bg" color argument in the
175 defineAnnoType command is 32 characters.
176 New in version 2.5.
177
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178 *E656*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000179Writes of unmodified buffers forbidden
180 Writes of unmodified buffers that were opened from the
181 Vim Controller are not possible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182
183 *E657*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000184Partial writes disallowed
185 Partial writes for buffers that were opened from the
186 Vim Controller are not allowed.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000187
188 *E658*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000189Connection lost for this buffer
190 The Vim Controller has become confused about the state of
191 this file. Rather than risk data corruption, it has severed
192 the connection for this file. Vim will take over
193 responsibility for saving changes to this file and the
194 Vim Controller will no longer know of these changes.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000195
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000196 *E744*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000197Read-only file
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000198 Vim normally allows changes to a read-only file and only
199 enforces the read-only rule if you try to write the file.
200 However, NetBeans does not let you make changes to a file
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000201 which is read-only and becomes confused if Vim does this.
202 So Vim does not allow modifications to files when run
203 in NetBeans mode.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000204
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000205==============================================================================
2065. Running Vim in NetBeans mode *netbeans-run*
207
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200208There are two different ways to run Vim in NetBeans mode:
209
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200210 + an IDE may start Vim with the |-nb| command line argument
211 + NetBeans can be started from within Vim with the |:nbstart| command
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200212
Bram Moolenaare0fa3742016-02-20 15:47:01 +0100213Vim uses a 3 second timeout on trying to make the connection.
214
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200215 *netbeans-parameters*
216Three forms can be used to setup the NetBeans connection parameters.
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200217When started from the command line, the |-nb| command line argument may be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000218
219 -nb={fname} from a file
220 -nb:{hostname}:{addr}:{password} directly
221 -nb from a file or environment
222
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200223When started from within Vim, the |:nbstart| optional argument may be:
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200224
225 ={fname} from a file
226 :{hostname}:{addr}:{password} directly
227 <MISSING ARGUMENT> from a file or environment
228
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229 *E660* *E668*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200230When NetBeans is started from the command line, for security reasons, the best
231method is to write the information in a file readable only by the user. The
232name of the file can be passed with the "-nb={fname}" argument or, when "-nb"
233is used without a parameter, the environment variable "__NETBEANS_CONINFO".
234The file must contain these three lines, in any order:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235
236 host={hostname}
237 port={addr}
238 auth={password}
239
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200240Other lines are ignored. The Vim Controller is responsible for deleting the
Bram Moolenaar071d4272004-06-13 20:20:40 +0000241file afterwards.
242
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000243{hostname} is the name of the machine where Vim Controller is running. When
244omitted the environment variable "__NETBEANS_HOST" is used or the default
245"localhost".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000247{addr} is the port number for the NetBeans interface. When omitted the
248environment variable "__NETBEANS_SOCKET" is used or the default 3219.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000249
250{password} is the password for connecting to NetBeans. When omitted the
251environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
252
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000253Vim will initiate a socket connection (client side) to the specified host and
254port upon startup. The password will be sent with the AUTH event when the
255connection has been established.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000256
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000257
258==============================================================================
2596. NetBeans protocol *netbeans-protocol*
260
261The communication between the Vim Controller and Vim uses plain text
262messages. This protocol was first designed to work with the external editor
263module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE,
264see http://www.a-a-p.org) and then with other IDE. The extensions are marked
265with "version 2.1".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000266
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000267Version 2.2 of the protocol has several minor changes which should only affect
268NetBeans users (ie, not Agide users). However, a bug was fixed which could
269cause confusion. The netbeans_saved() function sent a "save" protocol
270command. In protocol version 2.1 and earlier this was incorrectly interpreted
271as a notification that a write had taken place. In reality, it told NetBeans
272to save the file so multiple writes were being done. This caused various
273problems and has been fixed in 2.2. To decrease the likelihood of this
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274confusion happening again, netbeans_saved() has been renamed to
275netbeans_save_buffer().
276
Bram Moolenaar67c53842010-05-22 18:28:27 +0200277We are now at version 2.5. For the differences between 2.4 and 2.5 search for
278"2.5" below.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000279
Bram Moolenaar071d4272004-06-13 20:20:40 +0000280The messages are currently sent over a socket. Since the messages are in
281plain UTF-8 text this protocol could also be used with any other communication
282mechanism.
283
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200284Netbeans messages are processed when Vim is idle, waiting for user input.
285When Vim is run in non-interactive mode, for example when running an automated
286test case that sources a Vim script, the idle loop may not be called often
Bram Moolenaarb8ff1fb2012-02-04 21:59:01 +0100287enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep|
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200288command does invoke Netbeans messages processing.
289
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002906.1 Kinds of messages |nb-messages|
2916.2 Terms |nb-terms|
2926.3 Commands |nb-commands|
2936.4 Functions and Replies |nb-functions|
2946.5 Events |nb-events|
2956.6 Special messages |nb-special|
2966.7 Protocol errors |nb-protocol_errors|
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000297
298
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002996.1 Kinds of messages *nb-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000300
301There are four kinds of messages:
302
303kind direction comment ~
304Command IDE -> editor no reply necessary
305Function IDE -> editor editor must send back a reply
306Reply editor -> IDE only in response to a Function
307Event editor -> IDE no reply necessary
308
309The messages are sent as a single line with a terminating newline character.
310Arguments are separated by a single space. The first item of the message
311depends on the kind of message:
312
313kind first item example ~
314Command bufID:name!seqno 11:showBalloon!123 "text"
315Function bufID:name/seqno 11:getLength/123
316Reply seqno 123 5000
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000317Event bufID:name=seqno 11:keyCommand=123 "S-F2"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318
319
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000320
3216.2 Terms *nb-terms*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000322
323bufID Buffer number. A message may be either for a specific buffer
324 or generic. Generic messages use a bufID of zero. NOTE: this
325 buffer ID is assigned by the IDE, it is not Vim's buffer
326 number. The bufID must be a sequentially rising number,
Bram Moolenaar5837f1f2015-03-21 18:06:14 +0100327 starting at one. When the 'switchbuf' option is set to
328 "usetab" and the "bufID" buffer is not found in the current
329 tab page, the netbeans commands and functions that set this
330 buffer as the current buffer will jump to the first open
331 window that contains this buffer in other tab pages instead of
332 replacing the buffer in the current window.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000333
334seqno The IDE uses a sequence number for Commands and Functions. A
335 Reply must use the sequence number of the Function that it is
336 associated with. A zero sequence number can be used for
337 Events (the seqno of the last received Command or Function can
338 also be used).
339
340string Argument in double quotes. Text is in UTF-8 encoding. This
341 means ASCII is passed as-is. Special characters are
342 represented with a backslash:
343 \" double quote
344 \n newline
345 \r carriage-return
346 \t tab (optional, also works literally)
347 \\ backslash
348 NUL bytes are not allowed!
349
350boolean Argument with two possible values:
351 T true
352 F false
353
354number Argument with a decimal number.
355
Bram Moolenaar67c53842010-05-22 18:28:27 +0200356color Argument with either a decimal number, "none" (without the
357 quotes) or the name of a color (without the quotes) defined
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200358 both in the color list in |highlight-ctermfg| and in the color
359 list in |gui-colors|.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200360 New in version 2.5.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000361
362offset A number argument that indicates a byte position in a buffer.
363 The first byte has offset zero. Line breaks are counted for
364 how they appear in the file (CR/LF counts for two bytes).
Bram Moolenaar207f0092020-08-30 17:20:20 +0200365 Note that a multibyte character is counted for the number of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366 bytes it takes.
367
368lnum/col Argument with a line number and column number position. The
369 line number starts with one, the column is the byte position,
Bram Moolenaar207f0092020-08-30 17:20:20 +0200370 starting with zero. Note that a multibyte character counts
Bram Moolenaar071d4272004-06-13 20:20:40 +0000371 for several columns.
372
373pathname String argument: file name with full path.
374
375
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00003766.3 Commands *nb-commands*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000377
378actionMenuItem Not implemented.
379
380actionSensitivity
381 Not implemented.
382
383addAnno serNum typeNum off len
384 Place an annotation in this buffer.
385 Arguments:
386 serNum number serial number of this placed
387 annotation, used to be able to remove
388 it
389 typeNum number sequence number of the annotation
390 defined with defineAnnoType for this
391 buffer
392 off number offset where annotation is to be placed
393 len number not used
394 In version 2.1 "lnum/col" can be used instead of "off".
395
396balloonResult text
397 Not implemented.
398
399close Close the buffer. This leaves us without current buffer, very
400 dangerous to use!
401
402create Creates a buffer without a name. Replaces the current buffer
403 (it's hidden when it was changed).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000404 The Vim Controller should use this as the first command for a
405 file that is being opened. The sequence of commands could be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000406 create
407 setCaretListener (ignored)
408 setModified (no effect)
409 setContentType (ignored)
410 startDocumentListen
411 setTitle
412 setFullName
413
414defineAnnoType typeNum typeName tooltip glyphFile fg bg
415 Define a type of annotation for this buffer.
416 Arguments:
417 typeNum number sequence number (not really used)
418 typeName string name that identifies this annotation
419 tooltip string not used
420 glyphFile string name of icon file
Bram Moolenaar67c53842010-05-22 18:28:27 +0200421 fg color foreground color for line highlighting
422 bg color background color for line highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000423 Vim will define a sign for the annotation.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200424 When color is a number, this is the "#rrggbb" Red, Green and
425 Blue values of the color (see |gui-colors|) and the
Bram Moolenaarb477af22018-07-15 20:20:18 +0200426 highlighting is only defined for gVim.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200427 When color is a name, this color is defined both for Vim
Bram Moolenaarb477af22018-07-15 20:20:18 +0200428 running in a color terminal and for gVim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000429 When both "fg" and "bg" are "none" no line highlighting is
430 used (new in version 2.1).
431 When "glyphFile" is empty, no text sign is used (new in
432 version 2.1).
433 When "glyphFile" is one or two characters long, a text sign is
434 defined (new in version 2.1).
435 Note: the annotations will be defined in sequence, and the
436 sequence number is later used with addAnno.
437
438editFile pathname
439 Set the name for the buffer and edit the file "pathname", a
440 string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000441 Normal way for the IDE to tell the editor to edit a file.
442
443 You must set a bufId different of 0 with this command to
444 assign a bufId to the buffer. It will trigger an event
445 fileOpened with a bufId of 0 but the buffer has been assigned.
446
447 If the IDE is going to pass the file text to the editor use
448 these commands instead:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000449 setFullName
450 insert
451 initDone
452 New in version 2.1.
453
454enableBalloonEval
455 Not implemented.
456
457endAtomic End an atomic operation. The changes between "startAtomic"
458 and "endAtomic" can be undone as one operation. But it's not
459 implemented yet. Redraw when necessary.
460
461guard off len
462 Mark an area in the buffer as guarded. This means it cannot
463 be edited. "off" and "len" are numbers and specify the text
464 to be guarded.
465
466initDone Mark the buffer as ready for use. Implicitly makes the buffer
467 the current buffer. Fires the BufReadPost autocommand event.
468
Bram Moolenaar173d8412020-04-19 14:02:26 +0200469insertDone starteol readonly
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000470 Sent by Vim Controller to tell Vim an initial file insert is
Bram Moolenaar173d8412020-04-19 14:02:26 +0200471 done. This triggers a read message being printed. If
472 "starteol" is "F" then the last line doesn't have a EOL. If
473 "readonly" is "T" then the file is marked as readonly. Prior
474 to version 2.3, no read messages were displayed after opening
475 a file. New in version 2.3.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000476
Bram Moolenaar071d4272004-06-13 20:20:40 +0000477moveAnnoToFront serNum
478 Not implemented.
479
480netbeansBuffer isNetbeansBuffer
Bram Moolenaarc236c162008-07-13 17:41:49 +0000481 If "isNetbeansBuffer" is "T" then this buffer is "owned" by
Bram Moolenaar071d4272004-06-13 20:20:40 +0000482 NetBeans.
483 New in version 2.2.
484
485putBufferNumber pathname
486 Associate a buffer number with the Vim buffer by the name
487 "pathname", a string argument. To be used when the editor
488 reported editing another file to the IDE and the IDE needs to
489 tell the editor what buffer number it will use for this file.
490 Also marks the buffer as initialized.
491 New in version 2.1.
492
493raise Bring the editor to the foreground.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200494 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000495 New in version 2.1.
496
497removeAnno serNum
Bram Moolenaar3a991dd2014-10-02 01:41:41 +0200498 Remove a previously placed annotation for this buffer.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499 "serNum" is the same number used in addAnno.
500
501save Save the buffer when it was modified. The other side of the
502 interface is expected to write the buffer and invoke
503 "setModified" to reset the "changed" flag of the buffer.
504 The writing is skipped when one of these conditions is true:
505 - 'write' is not set
506 - the buffer is read-only
507 - the buffer does not have a file name
508 - 'buftype' disallows writing
509 New in version 2.2.
510
Bram Moolenaar009b2592004-10-24 19:18:58 +0000511saveDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000512 Sent by Vim Controller to tell Vim a save is done. This
513 triggers a save message being printed. Prior to version 2.3,
514 no save messages were displayed after a save.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000515 New in version 2.3.
516
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517setAsUser Not implemented.
518
519setBufferNumber pathname
520 Associate a buffer number with Vim buffer by the name
521 "pathname". To be used when the editor reported editing
522 another file to the IDE and the IDE needs to tell the editor
523 what buffer number it will use for this file.
524 Has the side effect of making the buffer the current buffer.
525 See "putBufferNumber" for a more useful command.
526
527setContentType
528 Not implemented.
529
530setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000531 specified position. If the buffer is open in another window
532 than make that window the current window.
533 If there are folds they are opened to make the cursor line
534 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000535 In version 2.1 "lnum/col" can be used instead of "off".
536
537setExitDelay seconds
538 Set the delay for exiting to "seconds", a number.
539 This delay is used to give the IDE a chance to handle things
540 before really exiting. The default delay is two seconds.
541 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000542 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000543
544setFullName pathname
545 Set the file name to be used for a buffer to "pathname", a
546 string argument.
547 Used when the IDE wants to edit a file under control of the
548 IDE. This makes the buffer the current buffer, but does not
549 read the file. "insert" commands will be used next to set the
550 contents.
551
552setLocAndSize Not implemented.
553
554setMark Not implemented.
555
556setModified modified
557 When the boolean argument "modified" is "T" mark the buffer as
558 modified, when it is "F" mark it as unmodified.
559
Bram Moolenaar009b2592004-10-24 19:18:58 +0000560setModtime time
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000561 Update a buffers modification time after the file has been
562 saved directly by the Vim Controller.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000563 New in version 2.3.
564
565setReadOnly
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000566 Set a file as readonly
567 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000568
569setStyle Not implemented.
570
571setTitle name
572 Set the title for the buffer to "name", a string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000573 The title is only used for the Vim Controller functions, not
574 by Vim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000575
576setVisible visible
577 When the boolean argument "visible" is "T", goto the buffer.
578 The "F" argument does nothing.
579
580showBalloon text
581 Show a balloon (popup window) at the mouse pointer position,
582 containing "text", a string argument. The balloon should
583 disappear when the mouse is moved more than a few pixels.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200584 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000585 New in version 2.1.
586
Bram Moolenaar009b2592004-10-24 19:18:58 +0000587specialKeys
588 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000589 to the Vim Controller for processing. This lets regular IDE
590 hotkeys be used from Vim.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000591 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592
593startAtomic Begin an atomic operation. The screen will not be updated
594 until "endAtomic" is given.
595
596startCaretListen
597 Not implemented.
598
599startDocumentListen
600 Mark the buffer to report changes to the IDE with the
601 "insert" and "remove" events. The default is to report
602 changes.
603
604stopCaretListen
605 Not implemented.
606
607stopDocumentListen
608 Mark the buffer to stop reporting changes to the IDE.
609 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000610 NOTE: if "netbeansBuffer" was used to mark this buffer as a
611 NetBeans buffer, then the buffer is deleted in Vim. This is
612 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000613
614unguard off len
615 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000616 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000617
618version Not implemented.
619
620
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006216.4 Functions and Replies *nb-functions*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000622
623getDot Not implemented.
624
625getCursor Return the current buffer and cursor position.
626 The reply is:
627 seqno bufID lnum col off
628 seqno = sequence number of the function
629 bufID = buffer ID of the current buffer (if this is unknown -1
630 is used)
631 lnum = line number of the cursor (first line is one)
632 col = column number of the cursor (in bytes, zero based)
633 off = offset of the cursor in the buffer (in bytes)
634 New in version 2.1.
635
636getLength Return the length of the buffer in bytes.
637 Reply example for a buffer with 5000 bytes:
638 123 5000
639 TODO: explain use of partial line.
640
641getMark Not implemented.
642
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000643getAnno serNum
644 Return the line number of the annotation in the buffer.
645 Argument:
646 serNum serial number of this placed annotation
647 The reply is:
648 123 lnum line number of the annotation
649 123 0 invalid annotation serial number
650 New in version 2.4.
651
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652getModified When a buffer is specified: Return zero if the buffer does not
653 have changes, one if it does have changes.
654 When no buffer is specified (buffer number zero): Return the
655 number of buffers with changes. When the result is zero it's
656 safe to tell Vim to exit.
657 New in version 2.1.
658
659getText Return the contents of the buffer as a string.
660 Reply example for a buffer with two lines
661 123 "first line\nsecond line\n"
662 NOTE: docs indicate an offset and length argument, but this is
663 not implemented.
664
665insert off text
666 Insert "text" before position "off". "text" is a string
667 argument, "off" a number.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000668 "text" should have a "\n" (newline) at the end of each line.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000669 Or "\r\n" when 'fileformat' is "dos". When using "insert" in
670 an empty buffer Vim will set 'fileformat' accordingly.
671 When "off" points to the start of a line the text is inserted
672 above this line. Thus when "off" is zero lines are inserted
673 before the first line.
674 When "off" points after the start of a line, possibly on the
675 NUL at the end of a line, the first line of text is appended
676 to this line. Further lines come below it.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677 Possible replies:
678 123 no problem
679 123 !message failed
680 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000681 Also sets the current buffer, if necessary.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000682 Does not move the cursor to the changed text.
683 Resets undo information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000684
685remove off length
686 Delete "length" bytes of text at position "off". Both
687 arguments are numbers.
688 Possible replies:
689 123 no problem
690 123 !message failed
691 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000692 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000693
694saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
695 If there are no changed files or the user does not cancel the
696 operation Vim exits and no result is sent back. The IDE can
697 consider closing the connection as a successful result.
698 If the user cancels the operation the number of modified
699 buffers that remains is returned and Vim does not exit.
700 New in version 2.1.
701
702
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00007036.5 Events *nb-events*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000704
705balloonEval off len type
706 The mouse pointer rests on text for a short while. When "len"
707 is zero, there is no selection and the pointer is at position
708 "off". When "len" is non-zero the text from position "off" to
709 "off" + "len" is selected.
710 Only sent after "enableBalloonEval" was used for this buffer.
711 "type" is not yet defined.
712 Not implemented yet.
713
714balloonText text
715 Used when 'ballooneval' is set and the mouse pointer rests on
716 some text for a moment. "text" is a string, the text under
717 the mouse pointer.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200718 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000719 New in version 2.1.
720
721buttonRelease button lnum col
722 Report which button was pressed and the location of the cursor
723 at the time of the release. Only for buffers that are owned
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000724 by the Vim Controller. This event is not sent if the button
725 was released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000726 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000727 in the sign area.
728 New in version 2.2.
729
Bram Moolenaar009b2592004-10-24 19:18:58 +0000730disconnect
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000731 Tell the Vim Controller that Vim is exiting and not to try and
732 read or write more commands.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000733 New in version 2.3.
734
Bram Moolenaar071d4272004-06-13 20:20:40 +0000735fileClosed Not implemented.
736
737fileModified Not implemented.
738
739fileOpened pathname open modified
740 A file was opened by the user.
741 Arguments:
742 pathname string name of the file
743 open boolean always "T"
744 modified boolean always "F"
745
746geometry cols rows x y
747 Report the size and position of the editor window.
748 Arguments:
749 cols number number of text columns
750 rows number number of text rows
751 x number pixel position on screen
752 y number pixel position on screen
753 Only works for Motif.
754
755insert off text
756 Text "text" has been inserted in Vim at position "off".
757 Only fired when enabled, see "startDocumentListen".
758
759invokeAction Not implemented.
760
761keyCommand keyName
762 Reports a special key being pressed with name "keyName", which
763 is a string.
764 Supported key names:
765 F1 function key 1
766 F2 function key 2
767 ...
768 F12 function key 12
769
770 ' ' space (without the quotes)
771 ! exclamation mark
772 ... any other ASCII printable character
773 ~ tilde
774
775 X any unrecognized key
776
777 The key may be prepended by "C", "S" and/or "M" for Control,
778 Shift and Meta (Alt) modifiers. If there is a modifier a dash
779 is used to separate it from the key name. For example:
780 "C-F2".
781 ASCII characters are new in version 2.1.
782
783keyAtPos keyName lnum/col
784 Like "keyCommand" and also report the line number and column
785 of the cursor.
786 New in version 2.1.
787
Bram Moolenaard7f8f5c2009-01-06 15:14:30 +0000788killed A file was deleted or wiped out by the user and the buffer
789 annotations have been removed. The bufID number for this
790 buffer has become invalid. Only for files that have been
791 assigned a bufID number by the IDE.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000792
793newDotAndMark off off
794 Reports the position of the cursor being at "off" bytes into
795 the buffer. Only sent just before a "keyCommand" event.
796
797quit Not implemented.
798
799remove off len
800 Text was deleted in Vim at position "off" with byte length
801 "len".
802 Only fired when enabled, see "startDocumentListen".
803
804revert Not implemented.
805
806save The buffer has been saved and is now unmodified.
807 Only fired when enabled, see "startDocumentListen".
808
809startupDone The editor has finished its startup work and is ready for
810 editing files.
811 New in version 2.1.
812
813unmodified The buffer is now unmodified.
814 Only fired when enabled, see "startDocumentListen".
815
816version vers Report the version of the interface implementation. Vim
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000817 reports "2.4" (including the quotes).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000818
819
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008206.6 Special messages *nb-special*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000821
822These messages do not follow the style of the messages above. They are
823terminated by a newline character.
824
825ACCEPT Not used.
826
827AUTH password editor -> IDE: First message that the editor sends to the IDE.
828 Must contain the password for the socket server, as specified
829 with the |-nb| argument. No quotes are used!
830
831DISCONNECT IDE -> editor: break the connection. The editor will exit.
832 The IDE must only send this message when there are no unsaved
833 changes!
834
835DETACH IDE -> editor: break the connection without exiting the
836 editor. Used when the IDE exits without bringing down the
837 editor as well.
838 New in version 2.1.
839
840REJECT Not used.
841
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000842
8436.7 Protocol errors *nb-protocol_errors*
844
845These errors occur when a message violates the protocol:
Bram Moolenaar5e9b2fa2016-02-01 22:37:05 +0100846*E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000847*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +0200848*E647* *E648* *E649* *E650* *E651* *E652*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000849
850
Bram Moolenaar071d4272004-06-13 20:20:40 +0000851==============================================================================
Bram Moolenaarb26e6322010-05-22 21:34:09 +02008527. NetBeans commands *netbeans-commands*
853
Bram Moolenaar4a748032010-09-30 21:47:56 +0200854 *:nbstart* *E511* *E838*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200855:nbs[tart] {connection} Start a new Netbeans session with {connection} as the
856 socket connection parameters. The format of
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200857 {connection} is described in |netbeans-parameters|.
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200858 At any time, one may check if the netbeans socket is
859 connected by running the command:
860 ':echo has("netbeans_enabled")'
861
862 *:nbclose*
863:nbc[lose] Close the current NetBeans session. Remove all placed
864 signs.
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000865
866 *:nbkey*
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200867:nb[key] {key} Pass the {key} to the Vim Controller for processing.
868 When a hot-key has been installed with the specialKeys
869 command, this command can be used to generate a hotkey
870 message to the Vim Controller.
871 This command can also be used to pass any text to the
872 Vim Controller. It is used by Pyclewn, for example,
873 to build the complete set of gdb commands as Vim user
874 commands.
875 The events newDotAndMark, keyCommand and keyAtPos are
876 generated (in this order).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000877
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000878
879==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008808. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881
882NUL bytes are not possible. For editor -> IDE they will appear as NL
883characters. For IDE -> editor they cannot be inserted.
884
Bram Moolenaar67c53842010-05-22 18:28:27 +0200885A NetBeans session may be initiated with Vim running in a terminal, and
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200886continued later in a GUI environment after running the |:gui| command. In this
Bram Moolenaar67c53842010-05-22 18:28:27 +0200887case, the highlighting defined for the NetBeans annotations may be cleared
888when the ":gui" command sources .gvimrc and this file loads a colorscheme
889that runs the command ":highlight clear".
890New in version 2.5.
891
Bram Moolenaar071d4272004-06-13 20:20:40 +0000892
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000893==============================================================================
8949. Debugging NetBeans protocol *netbeans-debugging*
895
896To debug the Vim protocol, you must first compile Vim with debugging support
897and NetBeans debugging support. See |netbeans-configure| for instructions
898about Vim compiling and how to enable debug support.
899
900When running Vim, set the following environment variables:
901
902 export SPRO_GVIM_DEBUG=netbeans.log
903 export SPRO_GVIM_DLEVEL=0xffffffff
904
905Vim will then log all the incoming and outgoing messages of the NetBeans
906protocol to the file netbeans.log .
907
908The content of netbeans.log after a session looks like this:
909Tue May 20 17:19:27 2008
910EVT: 0:startupDone=0
911CMD 1: (1) create
912CMD 2: (1) setTitle "testfile1.txt"
913CMD 3: (1) setFullName "testfile1.txt"
914EVT(suppressed): 1:remove=3 0 -1
915EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F
916CMD 4: (1) initDone
917FUN 5: (0) getCursor
918REP 5: 1 1 0 0
919CMD 6: (2) create
920CMD 7: (2) setTitle "testfile2.txt"
921CMD 8: (2) setFullName "testfile2.txt"
922EVT(suppressed): 2:remove=8 0 -1
923EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F
924CMD 9: (2) initDone
925
926
927==============================================================================
92810. NetBeans External Editor
929
930NOTE: This information is obsolete! Only relevant if you are using an old
931version of NetBeans.
932
933
93410.1. Downloading NetBeans *netbeans-download*
935
936The NetBeans IDE is available for download from netbeans.org. You can download
937a released version, download sources, or use CVS to download the current
938source tree. If you choose to download sources, follow directions from
939netbeans.org on building NetBeans.
940
941Depending on the version of NetBeans you download, you may need to do further
942work to get the required External Editor module. This is the module which lets
943NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
944for details on downloading this module if your NetBeans release does not have
945it.
946
947For C, C++, and Fortran support you will also need the cpp module. See
948http://cpp.netbeans.org for information regarding this module.
949
950You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
951free trial. See http://www.sun.com for further details.
952
953
95410.2. NetBeans Key Bindings *netbeans-keybindings*
955
956Vim understands a number of key bindings that execute NetBeans commands.
957These are typically all the Function key combinations. To execute a NetBeans
958command, the user must press the Pause key followed by a NetBeans key binding.
959For example, in order to compile a Java file, the NetBeans key binding is
960"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a
961breakpoint at the current line, press "Pause Shift F8".
962
963The Pause key is Function key 21. If you don't have a working Pause key and
964want to use F8 instead, use: >
965
966 :map <F8> <F21>
967
968The External Editor module dynamically reads the NetBeans key bindings so vim
969should always have the latest key bindings, even when NetBeans changes them.
970
971
97210.3. Preparing NetBeans for Vim *netbeans-preparation*
973
974In order for NetBeans to work with vim, the NetBeans External Editor module
975must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
976then this module should be loaded and enabled. If you have a NetBeans release
977you may need to find another way of obtaining this open source module.
978
979You can check if you have this module by opening the Tools->Options dialog
980and drilling down to the "Modules" list (IDE Configuration->System->Modules).
981If your Modules list has an entry for "External Editor" you must make sure
982it is enabled (the "Enabled" property should have the value "True"). If your
983Modules list has no External Editor see the next section on |obtaining-exted|.
984
985
98610.4. Obtaining the External Editor Module *obtaining-exted*
987
988There are 2 ways of obtaining the External Editor module. The easiest way
989is to use the NetBeans Update Center to download and install the module.
990Unfortunately, some versions do not have this module in their update
991center. If you cannot download via the update center you will need to
992download sources and build the module. I will try and get the module
993available from the NetBeans Update Center so building will be unnecessary.
994Also check http://externaleditor.netbeans.org for other availability options.
995
996To download the External Editor sources via CVS and build your own module,
997see http://externaleditor.netbeans.org and http://www.netbeans.org.
998Unfortunately, this is not a trivial procedure.
999
1000
100110.5. Setting up NetBeans to run with Vim *netbeans-setup*
1002
1003Assuming you have loaded and enabled the NetBeans External Editor module
1004as described in |netbeans-preparation| all you need to do is verify that
1005the gvim command line is properly configured for your environment.
1006
1007Open the Tools->Options dialog and open the Editing category. Select the
1008External Editor. The right hand pane should contain a Properties tab and
1009an Expert tab. In the Properties tab make sure the "Editor Type" is set
1010to "Vim". In the Expert tab make sure the "Vim Command" is correct.
1011
1012You should be careful if you change the "Vim Command". There are command
1013line options there which must be there for the connection to be properly
1014set up. You can change the command name but that's about it. If your gvim
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +02001015can be found by your $PATH then the Vim Command can start with "gvim". If
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001016you don't want gvim searched from your $PATH then hard code in the full
1017Unix path name. At this point you should get a gvim for any source file
1018you open in NetBeans.
1019
1020If some files come up in gvim and others (with different file suffixes) come
1021up in the default NetBeans editor you should verify the MIME type in the
1022Expert tab MIME Type property. NetBeans is MIME oriented and the External
1023Editor will only open MIME types specified in this property.
1024
1025
Bram Moolenaar91f84f62018-07-29 15:07:52 +02001026 vim:tw=78:ts=8:noet:ft=help:norl: