blob: 743409347cc616285b9f7aa62701831a67f97dde [file] [log] [blame]
Bram Moolenaar98056532019-12-12 14:18:35 +01001*netbeans.txt* For Vim version 8.2. Last change: 2019 May 05
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
43Current projects using the NetBeans protocol of Vim are:
44- VimIntegration, description of various projects doing Vim Integration:
45 http://www.freehackers.org/VimIntegration
46- Agide, an IDE for the AAP project, written in Python:
47 http://www.a-a-p.org
48- Clewn, a gdb integration into Vim, written in C:
49 http://clewn.sourceforge.net/
Bram Moolenaarb26e6322010-05-22 21:34:09 +020050- Pyclewn, a gdb integration into Vim, written in Python:
51 http://pyclewn.sourceforge.net/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000052- VimPlugin, integration of Vim inside Eclipse:
53 http://vimplugin.sourceforge.net/wiki/pmwiki.php
54- PIDA, IDE written in Python integrating Vim:
55 http://pida.co.uk/
56- VimWrapper, library to easy Vim integration into IDE:
57 http://www.freehackers.org/VimWrapper
58
59Check the specific project pages to see how to use Vim with these projects.
60
Bram Moolenaar269f5952016-07-15 22:54:41 +020061An alternative is to use a channel, see |channel|.
62
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000063In the rest of this help page, we will use the term "Vim Controller" to
64describe the program controlling Vim through the NetBeans socket interface.
65
66
67About the NetBeans IDE ~
68
Bram Moolenaar071d4272004-06-13 20:20:40 +000069NetBeans is an open source Integrated Development Environment developed
70jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
71Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
72in recent releases.
73
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000074For more information visit the main NetBeans web site http://www.netbeans.org.
Bram Moolenaarc236c162008-07-13 17:41:49 +000075The External Editor is now, unfortunately, declared obsolete. See
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000076 http://externaleditor.netbeans.org.
Bram Moolenaar071d4272004-06-13 20:20:40 +000077
78Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
79Visit http://www.sun.com for more information regarding the Sun ONE Studio
80product line.
81
82Current releases of NetBeans provide full support for Java and limited support
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000083for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
Bram Moolenaar071d4272004-06-13 20:20:40 +000084support for Java, C, C++, and Fortran.
85
Bram Moolenaar071d4272004-06-13 20:20:40 +000086==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000872. Integration features *netbeans-integration*
Bram Moolenaar071d4272004-06-13 20:20:40 +000088
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000089The NetBeans socket interface of Vim allows to get information from Vim or to
90ask Vim to perform specific actions:
91- get information about buffer: buffer name, cursor position, buffer content,
92 etc.
93- be notified when buffers are open or closed
94- be notified of how the buffer content is modified
95- load and save files
96- modify the buffer content
97- installing special key bindings
98- raise the window, control the window geometry
Bram Moolenaar071d4272004-06-13 20:20:40 +000099
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000100For sending key strokes to Vim or for evaluating functions in Vim, you must
101use the |clientserver| interface.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103
104==============================================================================
1053. Configuring Vim for NetBeans *netbeans-configure*
106
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200107For more help about installing Vim, please read |usr_90.txt| in the Vim User
108Manual.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109
110
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000111On Unix:
112--------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113
114When running configure without arguments the NetBeans interface should be
115included. That is, if the configure check to find out if your system supports
116the required features succeeds.
117
118In case you do not want the NetBeans interface you can disable it by
119uncommenting a line with "--disable-netbeans" in the Makefile.
120
Bram Moolenaar67c53842010-05-22 18:28:27 +0200121Currently the NetBeans interface is supported by Vim running in a terminal and
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +0200122by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
Bram Moolenaar173c9852010-09-29 17:27:01 +0200123Athena and Motif.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000124
Bram Moolenaarbb1969b2019-01-17 15:45:25 +0100125 *netbeans-xpm*
126If Motif support is required the user must supply XPM libraries.
127The XPM library is required to show images within Vim with Motif or Athena.
128Without it the toolbar and signs will be disabled.
129
130The XPM library is provided by Arnaud Le Hors of the French National Institute
131for Research in Computer Science and Control. It can be downloaded from
132http://cgit.freedesktop.org/xorg/lib/libXpm. The current release, as of this
133writing, is xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create
134the directory /usr/local/xpm and untar the file there you can use the
135uncommented lines in the Makefile without changing them. If you use another
136xpm directory you will need to change the XPM_DIR in src/Makefile.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000137
138
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000139On MS-Windows:
140--------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141
142The Win32 support is now in beta stage.
143
144To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
145XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/
146(for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
147
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000148Enable debugging:
149-----------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000151To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro
152needs to be defined. Search in the Makefile of the platform you are using for
153"NBDEBUG" to see what line needs to be uncommented. This effectively adds
154"-DNBDEBUG" to the compile command. Also see |netbeans-debugging|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
156==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001574. Error Messages *netbeans-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000158
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000159These error messages are specific to NetBeans socket protocol:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000160
161 *E463*
162Region is guarded, cannot modify
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000163 The Vim Controller has defined guarded areas in the text,
164 which you cannot change. Also sets the current buffer, if
165 necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166
Bram Moolenaar67c53842010-05-22 18:28:27 +0200167 *E532*
168The defineAnnoType highlighting color name is too long
169 The maximum length of the "fg" or "bg" color argument in the
170 defineAnnoType command is 32 characters.
171 New in version 2.5.
172
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173 *E656*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000174Writes of unmodified buffers forbidden
175 Writes of unmodified buffers that were opened from the
176 Vim Controller are not possible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177
178 *E657*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000179Partial writes disallowed
180 Partial writes for buffers that were opened from the
181 Vim Controller are not allowed.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182
183 *E658*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000184Connection lost for this buffer
185 The Vim Controller has become confused about the state of
186 this file. Rather than risk data corruption, it has severed
187 the connection for this file. Vim will take over
188 responsibility for saving changes to this file and the
189 Vim Controller will no longer know of these changes.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000190
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000191 *E744*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000192Read-only file
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000193 Vim normally allows changes to a read-only file and only
194 enforces the read-only rule if you try to write the file.
195 However, NetBeans does not let you make changes to a file
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000196 which is read-only and becomes confused if Vim does this.
197 So Vim does not allow modifications to files when run
198 in NetBeans mode.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000199
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000200==============================================================================
2015. Running Vim in NetBeans mode *netbeans-run*
202
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200203There are two different ways to run Vim in NetBeans mode:
204
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200205 + an IDE may start Vim with the |-nb| command line argument
206 + NetBeans can be started from within Vim with the |:nbstart| command
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200207
Bram Moolenaare0fa3742016-02-20 15:47:01 +0100208Vim uses a 3 second timeout on trying to make the connection.
209
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200210 *netbeans-parameters*
211Three forms can be used to setup the NetBeans connection parameters.
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200212When started from the command line, the |-nb| command line argument may be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213
214 -nb={fname} from a file
215 -nb:{hostname}:{addr}:{password} directly
216 -nb from a file or environment
217
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200218When started from within Vim, the |:nbstart| optional argument may be:
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200219
220 ={fname} from a file
221 :{hostname}:{addr}:{password} directly
222 <MISSING ARGUMENT> from a file or environment
223
Bram Moolenaar071d4272004-06-13 20:20:40 +0000224 *E660* *E668*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200225When NetBeans is started from the command line, for security reasons, the best
226method is to write the information in a file readable only by the user. The
227name of the file can be passed with the "-nb={fname}" argument or, when "-nb"
228is used without a parameter, the environment variable "__NETBEANS_CONINFO".
229The file must contain these three lines, in any order:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000230
231 host={hostname}
232 port={addr}
233 auth={password}
234
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200235Other lines are ignored. The Vim Controller is responsible for deleting the
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236file afterwards.
237
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000238{hostname} is the name of the machine where Vim Controller is running. When
239omitted the environment variable "__NETBEANS_HOST" is used or the default
240"localhost".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000241
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000242{addr} is the port number for the NetBeans interface. When omitted the
243environment variable "__NETBEANS_SOCKET" is used or the default 3219.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000244
245{password} is the password for connecting to NetBeans. When omitted the
246environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
247
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000248Vim will initiate a socket connection (client side) to the specified host and
249port upon startup. The password will be sent with the AUTH event when the
250connection has been established.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000251
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000252
253==============================================================================
2546. NetBeans protocol *netbeans-protocol*
255
256The communication between the Vim Controller and Vim uses plain text
257messages. This protocol was first designed to work with the external editor
258module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE,
259see http://www.a-a-p.org) and then with other IDE. The extensions are marked
260with "version 2.1".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000261
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000262Version 2.2 of the protocol has several minor changes which should only affect
263NetBeans users (ie, not Agide users). However, a bug was fixed which could
264cause confusion. The netbeans_saved() function sent a "save" protocol
265command. In protocol version 2.1 and earlier this was incorrectly interpreted
266as a notification that a write had taken place. In reality, it told NetBeans
267to save the file so multiple writes were being done. This caused various
268problems and has been fixed in 2.2. To decrease the likelihood of this
Bram Moolenaar071d4272004-06-13 20:20:40 +0000269confusion happening again, netbeans_saved() has been renamed to
270netbeans_save_buffer().
271
Bram Moolenaar67c53842010-05-22 18:28:27 +0200272We are now at version 2.5. For the differences between 2.4 and 2.5 search for
273"2.5" below.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000274
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275The messages are currently sent over a socket. Since the messages are in
276plain UTF-8 text this protocol could also be used with any other communication
277mechanism.
278
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200279Netbeans messages are processed when Vim is idle, waiting for user input.
280When Vim is run in non-interactive mode, for example when running an automated
281test case that sources a Vim script, the idle loop may not be called often
Bram Moolenaarb8ff1fb2012-02-04 21:59:01 +0100282enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep|
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200283command does invoke Netbeans messages processing.
284
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002856.1 Kinds of messages |nb-messages|
2866.2 Terms |nb-terms|
2876.3 Commands |nb-commands|
2886.4 Functions and Replies |nb-functions|
2896.5 Events |nb-events|
2906.6 Special messages |nb-special|
2916.7 Protocol errors |nb-protocol_errors|
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000292
293
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002946.1 Kinds of messages *nb-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295
296There are four kinds of messages:
297
298kind direction comment ~
299Command IDE -> editor no reply necessary
300Function IDE -> editor editor must send back a reply
301Reply editor -> IDE only in response to a Function
302Event editor -> IDE no reply necessary
303
304The messages are sent as a single line with a terminating newline character.
305Arguments are separated by a single space. The first item of the message
306depends on the kind of message:
307
308kind first item example ~
309Command bufID:name!seqno 11:showBalloon!123 "text"
310Function bufID:name/seqno 11:getLength/123
311Reply seqno 123 5000
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000312Event bufID:name=seqno 11:keyCommand=123 "S-F2"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000313
314
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000315
3166.2 Terms *nb-terms*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000317
318bufID Buffer number. A message may be either for a specific buffer
319 or generic. Generic messages use a bufID of zero. NOTE: this
320 buffer ID is assigned by the IDE, it is not Vim's buffer
321 number. The bufID must be a sequentially rising number,
Bram Moolenaar5837f1f2015-03-21 18:06:14 +0100322 starting at one. When the 'switchbuf' option is set to
323 "usetab" and the "bufID" buffer is not found in the current
324 tab page, the netbeans commands and functions that set this
325 buffer as the current buffer will jump to the first open
326 window that contains this buffer in other tab pages instead of
327 replacing the buffer in the current window.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000328
329seqno The IDE uses a sequence number for Commands and Functions. A
330 Reply must use the sequence number of the Function that it is
331 associated with. A zero sequence number can be used for
332 Events (the seqno of the last received Command or Function can
333 also be used).
334
335string Argument in double quotes. Text is in UTF-8 encoding. This
336 means ASCII is passed as-is. Special characters are
337 represented with a backslash:
338 \" double quote
339 \n newline
340 \r carriage-return
341 \t tab (optional, also works literally)
342 \\ backslash
343 NUL bytes are not allowed!
344
345boolean Argument with two possible values:
346 T true
347 F false
348
349number Argument with a decimal number.
350
Bram Moolenaar67c53842010-05-22 18:28:27 +0200351color Argument with either a decimal number, "none" (without the
352 quotes) or the name of a color (without the quotes) defined
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200353 both in the color list in |highlight-ctermfg| and in the color
354 list in |gui-colors|.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200355 New in version 2.5.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000356
357offset A number argument that indicates a byte position in a buffer.
358 The first byte has offset zero. Line breaks are counted for
359 how they appear in the file (CR/LF counts for two bytes).
360 Note that a multi-byte character is counted for the number of
361 bytes it takes.
362
363lnum/col Argument with a line number and column number position. The
364 line number starts with one, the column is the byte position,
365 starting with zero. Note that a multi-byte character counts
366 for several columns.
367
368pathname String argument: file name with full path.
369
370
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00003716.3 Commands *nb-commands*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372
373actionMenuItem Not implemented.
374
375actionSensitivity
376 Not implemented.
377
378addAnno serNum typeNum off len
379 Place an annotation in this buffer.
380 Arguments:
381 serNum number serial number of this placed
382 annotation, used to be able to remove
383 it
384 typeNum number sequence number of the annotation
385 defined with defineAnnoType for this
386 buffer
387 off number offset where annotation is to be placed
388 len number not used
389 In version 2.1 "lnum/col" can be used instead of "off".
390
391balloonResult text
392 Not implemented.
393
394close Close the buffer. This leaves us without current buffer, very
395 dangerous to use!
396
397create Creates a buffer without a name. Replaces the current buffer
398 (it's hidden when it was changed).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000399 The Vim Controller should use this as the first command for a
400 file that is being opened. The sequence of commands could be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000401 create
402 setCaretListener (ignored)
403 setModified (no effect)
404 setContentType (ignored)
405 startDocumentListen
406 setTitle
407 setFullName
408
409defineAnnoType typeNum typeName tooltip glyphFile fg bg
410 Define a type of annotation for this buffer.
411 Arguments:
412 typeNum number sequence number (not really used)
413 typeName string name that identifies this annotation
414 tooltip string not used
415 glyphFile string name of icon file
Bram Moolenaar67c53842010-05-22 18:28:27 +0200416 fg color foreground color for line highlighting
417 bg color background color for line highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418 Vim will define a sign for the annotation.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200419 When color is a number, this is the "#rrggbb" Red, Green and
420 Blue values of the color (see |gui-colors|) and the
Bram Moolenaarb477af22018-07-15 20:20:18 +0200421 highlighting is only defined for gVim.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200422 When color is a name, this color is defined both for Vim
Bram Moolenaarb477af22018-07-15 20:20:18 +0200423 running in a color terminal and for gVim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424 When both "fg" and "bg" are "none" no line highlighting is
425 used (new in version 2.1).
426 When "glyphFile" is empty, no text sign is used (new in
427 version 2.1).
428 When "glyphFile" is one or two characters long, a text sign is
429 defined (new in version 2.1).
430 Note: the annotations will be defined in sequence, and the
431 sequence number is later used with addAnno.
432
433editFile pathname
434 Set the name for the buffer and edit the file "pathname", a
435 string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000436 Normal way for the IDE to tell the editor to edit a file.
437
438 You must set a bufId different of 0 with this command to
439 assign a bufId to the buffer. It will trigger an event
440 fileOpened with a bufId of 0 but the buffer has been assigned.
441
442 If the IDE is going to pass the file text to the editor use
443 these commands instead:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444 setFullName
445 insert
446 initDone
447 New in version 2.1.
448
449enableBalloonEval
450 Not implemented.
451
452endAtomic End an atomic operation. The changes between "startAtomic"
453 and "endAtomic" can be undone as one operation. But it's not
454 implemented yet. Redraw when necessary.
455
456guard off len
457 Mark an area in the buffer as guarded. This means it cannot
458 be edited. "off" and "len" are numbers and specify the text
459 to be guarded.
460
461initDone Mark the buffer as ready for use. Implicitly makes the buffer
462 the current buffer. Fires the BufReadPost autocommand event.
463
Bram Moolenaar009b2592004-10-24 19:18:58 +0000464insertDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000465 Sent by Vim Controller to tell Vim an initial file insert is
466 done. This triggers a read message being printed. Prior to
467 version 2.3, no read messages were displayed after opening a
468 file. New in version 2.3.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000469
Bram Moolenaar071d4272004-06-13 20:20:40 +0000470moveAnnoToFront serNum
471 Not implemented.
472
473netbeansBuffer isNetbeansBuffer
Bram Moolenaarc236c162008-07-13 17:41:49 +0000474 If "isNetbeansBuffer" is "T" then this buffer is "owned" by
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475 NetBeans.
476 New in version 2.2.
477
478putBufferNumber pathname
479 Associate a buffer number with the Vim buffer by the name
480 "pathname", a string argument. To be used when the editor
481 reported editing another file to the IDE and the IDE needs to
482 tell the editor what buffer number it will use for this file.
483 Also marks the buffer as initialized.
484 New in version 2.1.
485
486raise Bring the editor to the foreground.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200487 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000488 New in version 2.1.
489
490removeAnno serNum
Bram Moolenaar3a991dd2014-10-02 01:41:41 +0200491 Remove a previously placed annotation for this buffer.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000492 "serNum" is the same number used in addAnno.
493
494save Save the buffer when it was modified. The other side of the
495 interface is expected to write the buffer and invoke
496 "setModified" to reset the "changed" flag of the buffer.
497 The writing is skipped when one of these conditions is true:
498 - 'write' is not set
499 - the buffer is read-only
500 - the buffer does not have a file name
501 - 'buftype' disallows writing
502 New in version 2.2.
503
Bram Moolenaar009b2592004-10-24 19:18:58 +0000504saveDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000505 Sent by Vim Controller to tell Vim a save is done. This
506 triggers a save message being printed. Prior to version 2.3,
507 no save messages were displayed after a save.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000508 New in version 2.3.
509
Bram Moolenaar071d4272004-06-13 20:20:40 +0000510setAsUser Not implemented.
511
512setBufferNumber pathname
513 Associate a buffer number with Vim buffer by the name
514 "pathname". To be used when the editor reported editing
515 another file to the IDE and the IDE needs to tell the editor
516 what buffer number it will use for this file.
517 Has the side effect of making the buffer the current buffer.
518 See "putBufferNumber" for a more useful command.
519
520setContentType
521 Not implemented.
522
523setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000524 specified position. If the buffer is open in another window
525 than make that window the current window.
526 If there are folds they are opened to make the cursor line
527 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000528 In version 2.1 "lnum/col" can be used instead of "off".
529
530setExitDelay seconds
531 Set the delay for exiting to "seconds", a number.
532 This delay is used to give the IDE a chance to handle things
533 before really exiting. The default delay is two seconds.
534 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000535 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536
537setFullName pathname
538 Set the file name to be used for a buffer to "pathname", a
539 string argument.
540 Used when the IDE wants to edit a file under control of the
541 IDE. This makes the buffer the current buffer, but does not
542 read the file. "insert" commands will be used next to set the
543 contents.
544
545setLocAndSize Not implemented.
546
547setMark Not implemented.
548
549setModified modified
550 When the boolean argument "modified" is "T" mark the buffer as
551 modified, when it is "F" mark it as unmodified.
552
Bram Moolenaar009b2592004-10-24 19:18:58 +0000553setModtime time
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000554 Update a buffers modification time after the file has been
555 saved directly by the Vim Controller.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000556 New in version 2.3.
557
558setReadOnly
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000559 Set a file as readonly
560 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000561
562setStyle Not implemented.
563
564setTitle name
565 Set the title for the buffer to "name", a string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000566 The title is only used for the Vim Controller functions, not
567 by Vim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000568
569setVisible visible
570 When the boolean argument "visible" is "T", goto the buffer.
571 The "F" argument does nothing.
572
573showBalloon text
574 Show a balloon (popup window) at the mouse pointer position,
575 containing "text", a string argument. The balloon should
576 disappear when the mouse is moved more than a few pixels.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200577 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578 New in version 2.1.
579
Bram Moolenaar009b2592004-10-24 19:18:58 +0000580specialKeys
581 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000582 to the Vim Controller for processing. This lets regular IDE
583 hotkeys be used from Vim.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000584 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000585
586startAtomic Begin an atomic operation. The screen will not be updated
587 until "endAtomic" is given.
588
589startCaretListen
590 Not implemented.
591
592startDocumentListen
593 Mark the buffer to report changes to the IDE with the
594 "insert" and "remove" events. The default is to report
595 changes.
596
597stopCaretListen
598 Not implemented.
599
600stopDocumentListen
601 Mark the buffer to stop reporting changes to the IDE.
602 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000603 NOTE: if "netbeansBuffer" was used to mark this buffer as a
604 NetBeans buffer, then the buffer is deleted in Vim. This is
605 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606
607unguard off len
608 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000609 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000610
611version Not implemented.
612
613
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006146.4 Functions and Replies *nb-functions*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615
616getDot Not implemented.
617
618getCursor Return the current buffer and cursor position.
619 The reply is:
620 seqno bufID lnum col off
621 seqno = sequence number of the function
622 bufID = buffer ID of the current buffer (if this is unknown -1
623 is used)
624 lnum = line number of the cursor (first line is one)
625 col = column number of the cursor (in bytes, zero based)
626 off = offset of the cursor in the buffer (in bytes)
627 New in version 2.1.
628
629getLength Return the length of the buffer in bytes.
630 Reply example for a buffer with 5000 bytes:
631 123 5000
632 TODO: explain use of partial line.
633
634getMark Not implemented.
635
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000636getAnno serNum
637 Return the line number of the annotation in the buffer.
638 Argument:
639 serNum serial number of this placed annotation
640 The reply is:
641 123 lnum line number of the annotation
642 123 0 invalid annotation serial number
643 New in version 2.4.
644
Bram Moolenaar071d4272004-06-13 20:20:40 +0000645getModified When a buffer is specified: Return zero if the buffer does not
646 have changes, one if it does have changes.
647 When no buffer is specified (buffer number zero): Return the
648 number of buffers with changes. When the result is zero it's
649 safe to tell Vim to exit.
650 New in version 2.1.
651
652getText Return the contents of the buffer as a string.
653 Reply example for a buffer with two lines
654 123 "first line\nsecond line\n"
655 NOTE: docs indicate an offset and length argument, but this is
656 not implemented.
657
658insert off text
659 Insert "text" before position "off". "text" is a string
660 argument, "off" a number.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000661 "text" should have a "\n" (newline) at the end of each line.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000662 Or "\r\n" when 'fileformat' is "dos". When using "insert" in
663 an empty buffer Vim will set 'fileformat' accordingly.
664 When "off" points to the start of a line the text is inserted
665 above this line. Thus when "off" is zero lines are inserted
666 before the first line.
667 When "off" points after the start of a line, possibly on the
668 NUL at the end of a line, the first line of text is appended
669 to this line. Further lines come below it.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670 Possible replies:
671 123 no problem
672 123 !message failed
673 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000674 Also sets the current buffer, if necessary.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000675 Does not move the cursor to the changed text.
676 Resets undo information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677
678remove off length
679 Delete "length" bytes of text at position "off". Both
680 arguments are numbers.
681 Possible replies:
682 123 no problem
683 123 !message failed
684 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000685 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686
687saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
688 If there are no changed files or the user does not cancel the
689 operation Vim exits and no result is sent back. The IDE can
690 consider closing the connection as a successful result.
691 If the user cancels the operation the number of modified
692 buffers that remains is returned and Vim does not exit.
693 New in version 2.1.
694
695
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006966.5 Events *nb-events*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000697
698balloonEval off len type
699 The mouse pointer rests on text for a short while. When "len"
700 is zero, there is no selection and the pointer is at position
701 "off". When "len" is non-zero the text from position "off" to
702 "off" + "len" is selected.
703 Only sent after "enableBalloonEval" was used for this buffer.
704 "type" is not yet defined.
705 Not implemented yet.
706
707balloonText text
708 Used when 'ballooneval' is set and the mouse pointer rests on
709 some text for a moment. "text" is a string, the text under
710 the mouse pointer.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200711 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000712 New in version 2.1.
713
714buttonRelease button lnum col
715 Report which button was pressed and the location of the cursor
716 at the time of the release. Only for buffers that are owned
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000717 by the Vim Controller. This event is not sent if the button
718 was released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000719 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000720 in the sign area.
721 New in version 2.2.
722
Bram Moolenaar009b2592004-10-24 19:18:58 +0000723disconnect
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000724 Tell the Vim Controller that Vim is exiting and not to try and
725 read or write more commands.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000726 New in version 2.3.
727
Bram Moolenaar071d4272004-06-13 20:20:40 +0000728fileClosed Not implemented.
729
730fileModified Not implemented.
731
732fileOpened pathname open modified
733 A file was opened by the user.
734 Arguments:
735 pathname string name of the file
736 open boolean always "T"
737 modified boolean always "F"
738
739geometry cols rows x y
740 Report the size and position of the editor window.
741 Arguments:
742 cols number number of text columns
743 rows number number of text rows
744 x number pixel position on screen
745 y number pixel position on screen
746 Only works for Motif.
747
748insert off text
749 Text "text" has been inserted in Vim at position "off".
750 Only fired when enabled, see "startDocumentListen".
751
752invokeAction Not implemented.
753
754keyCommand keyName
755 Reports a special key being pressed with name "keyName", which
756 is a string.
757 Supported key names:
758 F1 function key 1
759 F2 function key 2
760 ...
761 F12 function key 12
762
763 ' ' space (without the quotes)
764 ! exclamation mark
765 ... any other ASCII printable character
766 ~ tilde
767
768 X any unrecognized key
769
770 The key may be prepended by "C", "S" and/or "M" for Control,
771 Shift and Meta (Alt) modifiers. If there is a modifier a dash
772 is used to separate it from the key name. For example:
773 "C-F2".
774 ASCII characters are new in version 2.1.
775
776keyAtPos keyName lnum/col
777 Like "keyCommand" and also report the line number and column
778 of the cursor.
779 New in version 2.1.
780
Bram Moolenaard7f8f5c2009-01-06 15:14:30 +0000781killed A file was deleted or wiped out by the user and the buffer
782 annotations have been removed. The bufID number for this
783 buffer has become invalid. Only for files that have been
784 assigned a bufID number by the IDE.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000785
786newDotAndMark off off
787 Reports the position of the cursor being at "off" bytes into
788 the buffer. Only sent just before a "keyCommand" event.
789
790quit Not implemented.
791
792remove off len
793 Text was deleted in Vim at position "off" with byte length
794 "len".
795 Only fired when enabled, see "startDocumentListen".
796
797revert Not implemented.
798
799save The buffer has been saved and is now unmodified.
800 Only fired when enabled, see "startDocumentListen".
801
802startupDone The editor has finished its startup work and is ready for
803 editing files.
804 New in version 2.1.
805
806unmodified The buffer is now unmodified.
807 Only fired when enabled, see "startDocumentListen".
808
809version vers Report the version of the interface implementation. Vim
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000810 reports "2.4" (including the quotes).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000811
812
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008136.6 Special messages *nb-special*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000814
815These messages do not follow the style of the messages above. They are
816terminated by a newline character.
817
818ACCEPT Not used.
819
820AUTH password editor -> IDE: First message that the editor sends to the IDE.
821 Must contain the password for the socket server, as specified
822 with the |-nb| argument. No quotes are used!
823
824DISCONNECT IDE -> editor: break the connection. The editor will exit.
825 The IDE must only send this message when there are no unsaved
826 changes!
827
828DETACH IDE -> editor: break the connection without exiting the
829 editor. Used when the IDE exits without bringing down the
830 editor as well.
831 New in version 2.1.
832
833REJECT Not used.
834
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000835
8366.7 Protocol errors *nb-protocol_errors*
837
838These errors occur when a message violates the protocol:
Bram Moolenaar5e9b2fa2016-02-01 22:37:05 +0100839*E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000840*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +0200841*E647* *E648* *E649* *E650* *E651* *E652*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000842
843
Bram Moolenaar071d4272004-06-13 20:20:40 +0000844==============================================================================
Bram Moolenaarb26e6322010-05-22 21:34:09 +02008457. NetBeans commands *netbeans-commands*
846
Bram Moolenaar4a748032010-09-30 21:47:56 +0200847 *:nbstart* *E511* *E838*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200848:nbs[tart] {connection} Start a new Netbeans session with {connection} as the
849 socket connection parameters. The format of
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200850 {connection} is described in |netbeans-parameters|.
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200851 At any time, one may check if the netbeans socket is
852 connected by running the command:
853 ':echo has("netbeans_enabled")'
854
855 *:nbclose*
856:nbc[lose] Close the current NetBeans session. Remove all placed
857 signs.
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000858
859 *:nbkey*
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200860:nb[key] {key} Pass the {key} to the Vim Controller for processing.
861 When a hot-key has been installed with the specialKeys
862 command, this command can be used to generate a hotkey
863 message to the Vim Controller.
864 This command can also be used to pass any text to the
865 Vim Controller. It is used by Pyclewn, for example,
866 to build the complete set of gdb commands as Vim user
867 commands.
868 The events newDotAndMark, keyCommand and keyAtPos are
869 generated (in this order).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000870
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000871
872==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008738. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000874
875NUL bytes are not possible. For editor -> IDE they will appear as NL
876characters. For IDE -> editor they cannot be inserted.
877
Bram Moolenaar67c53842010-05-22 18:28:27 +0200878A NetBeans session may be initiated with Vim running in a terminal, and
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200879continued later in a GUI environment after running the |:gui| command. In this
Bram Moolenaar67c53842010-05-22 18:28:27 +0200880case, the highlighting defined for the NetBeans annotations may be cleared
881when the ":gui" command sources .gvimrc and this file loads a colorscheme
882that runs the command ":highlight clear".
883New in version 2.5.
884
Bram Moolenaar071d4272004-06-13 20:20:40 +0000885
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000886==============================================================================
8879. Debugging NetBeans protocol *netbeans-debugging*
888
889To debug the Vim protocol, you must first compile Vim with debugging support
890and NetBeans debugging support. See |netbeans-configure| for instructions
891about Vim compiling and how to enable debug support.
892
893When running Vim, set the following environment variables:
894
895 export SPRO_GVIM_DEBUG=netbeans.log
896 export SPRO_GVIM_DLEVEL=0xffffffff
897
898Vim will then log all the incoming and outgoing messages of the NetBeans
899protocol to the file netbeans.log .
900
901The content of netbeans.log after a session looks like this:
902Tue May 20 17:19:27 2008
903EVT: 0:startupDone=0
904CMD 1: (1) create
905CMD 2: (1) setTitle "testfile1.txt"
906CMD 3: (1) setFullName "testfile1.txt"
907EVT(suppressed): 1:remove=3 0 -1
908EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F
909CMD 4: (1) initDone
910FUN 5: (0) getCursor
911REP 5: 1 1 0 0
912CMD 6: (2) create
913CMD 7: (2) setTitle "testfile2.txt"
914CMD 8: (2) setFullName "testfile2.txt"
915EVT(suppressed): 2:remove=8 0 -1
916EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F
917CMD 9: (2) initDone
918
919
920==============================================================================
92110. NetBeans External Editor
922
923NOTE: This information is obsolete! Only relevant if you are using an old
924version of NetBeans.
925
926
92710.1. Downloading NetBeans *netbeans-download*
928
929The NetBeans IDE is available for download from netbeans.org. You can download
930a released version, download sources, or use CVS to download the current
931source tree. If you choose to download sources, follow directions from
932netbeans.org on building NetBeans.
933
934Depending on the version of NetBeans you download, you may need to do further
935work to get the required External Editor module. This is the module which lets
936NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
937for details on downloading this module if your NetBeans release does not have
938it.
939
940For C, C++, and Fortran support you will also need the cpp module. See
941http://cpp.netbeans.org for information regarding this module.
942
943You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
944free trial. See http://www.sun.com for further details.
945
946
94710.2. NetBeans Key Bindings *netbeans-keybindings*
948
949Vim understands a number of key bindings that execute NetBeans commands.
950These are typically all the Function key combinations. To execute a NetBeans
951command, the user must press the Pause key followed by a NetBeans key binding.
952For example, in order to compile a Java file, the NetBeans key binding is
953"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a
954breakpoint at the current line, press "Pause Shift F8".
955
956The Pause key is Function key 21. If you don't have a working Pause key and
957want to use F8 instead, use: >
958
959 :map <F8> <F21>
960
961The External Editor module dynamically reads the NetBeans key bindings so vim
962should always have the latest key bindings, even when NetBeans changes them.
963
964
96510.3. Preparing NetBeans for Vim *netbeans-preparation*
966
967In order for NetBeans to work with vim, the NetBeans External Editor module
968must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
969then this module should be loaded and enabled. If you have a NetBeans release
970you may need to find another way of obtaining this open source module.
971
972You can check if you have this module by opening the Tools->Options dialog
973and drilling down to the "Modules" list (IDE Configuration->System->Modules).
974If your Modules list has an entry for "External Editor" you must make sure
975it is enabled (the "Enabled" property should have the value "True"). If your
976Modules list has no External Editor see the next section on |obtaining-exted|.
977
978
97910.4. Obtaining the External Editor Module *obtaining-exted*
980
981There are 2 ways of obtaining the External Editor module. The easiest way
982is to use the NetBeans Update Center to download and install the module.
983Unfortunately, some versions do not have this module in their update
984center. If you cannot download via the update center you will need to
985download sources and build the module. I will try and get the module
986available from the NetBeans Update Center so building will be unnecessary.
987Also check http://externaleditor.netbeans.org for other availability options.
988
989To download the External Editor sources via CVS and build your own module,
990see http://externaleditor.netbeans.org and http://www.netbeans.org.
991Unfortunately, this is not a trivial procedure.
992
993
99410.5. Setting up NetBeans to run with Vim *netbeans-setup*
995
996Assuming you have loaded and enabled the NetBeans External Editor module
997as described in |netbeans-preparation| all you need to do is verify that
998the gvim command line is properly configured for your environment.
999
1000Open the Tools->Options dialog and open the Editing category. Select the
1001External Editor. The right hand pane should contain a Properties tab and
1002an Expert tab. In the Properties tab make sure the "Editor Type" is set
1003to "Vim". In the Expert tab make sure the "Vim Command" is correct.
1004
1005You should be careful if you change the "Vim Command". There are command
1006line options there which must be there for the connection to be properly
1007set up. You can change the command name but that's about it. If your gvim
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +02001008can be found by your $PATH then the Vim Command can start with "gvim". If
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001009you don't want gvim searched from your $PATH then hard code in the full
1010Unix path name. At this point you should get a gvim for any source file
1011you open in NetBeans.
1012
1013If some files come up in gvim and others (with different file suffixes) come
1014up in the default NetBeans editor you should verify the MIME type in the
1015Expert tab MIME Type property. NetBeans is MIME oriented and the External
1016Editor will only open MIME types specified in this property.
1017
1018
Bram Moolenaar91f84f62018-07-29 15:07:52 +02001019 vim:tw=78:ts=8:noet:ft=help:norl: