blob: 495f0d4bafda620741e71f1432cdf5d41ea5efa1 [file] [log] [blame]
Bram Moolenaarbb1969b2019-01-17 15:45:25 +01001*netbeans.txt* For Vim version 8.1. Last change: 2019 Jan 17
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
27{Vi does not have any of these features}
28{only available when compiled with the |+netbeans_intg| feature}
29
30==============================================================================
311. Introduction *netbeans-intro*
32
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000033The NetBeans interface was initially developed to integrate Vim into the
34NetBeans Java IDE, using the external editor plugin. This NetBeans plugin no
35longer exists for recent versions of NetBeans but the protocol was developed
36in such a way that any IDE can use it to integrate Vim.
37
38The NetBeans protocol of Vim is a text based communication protocol, over a
39classical TCP socket. There is no dependency on Java or NetBeans. Any language
40or environment providing a socket interface can control Vim using this
41protocol. There are existing implementations in C, C++, Python and Java. The
42name NetBeans is kept today for historical reasons.
43
44Current projects using the NetBeans protocol of Vim are:
45- VimIntegration, description of various projects doing Vim Integration:
46 http://www.freehackers.org/VimIntegration
47- Agide, an IDE for the AAP project, written in Python:
48 http://www.a-a-p.org
49- Clewn, a gdb integration into Vim, written in C:
50 http://clewn.sourceforge.net/
Bram Moolenaarb26e6322010-05-22 21:34:09 +020051- Pyclewn, a gdb integration into Vim, written in Python:
52 http://pyclewn.sourceforge.net/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000053- VimPlugin, integration of Vim inside Eclipse:
54 http://vimplugin.sourceforge.net/wiki/pmwiki.php
55- PIDA, IDE written in Python integrating Vim:
56 http://pida.co.uk/
57- VimWrapper, library to easy Vim integration into IDE:
58 http://www.freehackers.org/VimWrapper
59
60Check the specific project pages to see how to use Vim with these projects.
61
Bram Moolenaar269f5952016-07-15 22:54:41 +020062An alternative is to use a channel, see |channel|.
63
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000064In the rest of this help page, we will use the term "Vim Controller" to
65describe the program controlling Vim through the NetBeans socket interface.
66
67
68About the NetBeans IDE ~
69
Bram Moolenaar071d4272004-06-13 20:20:40 +000070NetBeans is an open source Integrated Development Environment developed
71jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
72Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
73in recent releases.
74
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000075For more information visit the main NetBeans web site http://www.netbeans.org.
Bram Moolenaarc236c162008-07-13 17:41:49 +000076The External Editor is now, unfortunately, declared obsolete. See
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000077 http://externaleditor.netbeans.org.
Bram Moolenaar071d4272004-06-13 20:20:40 +000078
79Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
80Visit http://www.sun.com for more information regarding the Sun ONE Studio
81product line.
82
83Current releases of NetBeans provide full support for Java and limited support
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000084for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
Bram Moolenaar071d4272004-06-13 20:20:40 +000085support for Java, C, C++, and Fortran.
86
Bram Moolenaar071d4272004-06-13 20:20:40 +000087==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000882. Integration features *netbeans-integration*
Bram Moolenaar071d4272004-06-13 20:20:40 +000089
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000090The NetBeans socket interface of Vim allows to get information from Vim or to
91ask Vim to perform specific actions:
92- get information about buffer: buffer name, cursor position, buffer content,
93 etc.
94- be notified when buffers are open or closed
95- be notified of how the buffer content is modified
96- load and save files
97- modify the buffer content
98- installing special key bindings
99- raise the window, control the window geometry
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000101For sending key strokes to Vim or for evaluating functions in Vim, you must
102use the |clientserver| interface.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
105==============================================================================
1063. Configuring Vim for NetBeans *netbeans-configure*
107
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200108For more help about installing Vim, please read |usr_90.txt| in the Vim User
109Manual.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000110
111
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000112On Unix:
113--------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114
115When running configure without arguments the NetBeans interface should be
116included. That is, if the configure check to find out if your system supports
117the required features succeeds.
118
119In case you do not want the NetBeans interface you can disable it by
120uncommenting a line with "--disable-netbeans" in the Makefile.
121
Bram Moolenaar67c53842010-05-22 18:28:27 +0200122Currently the NetBeans interface is supported by Vim running in a terminal and
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +0200123by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
Bram Moolenaar173c9852010-09-29 17:27:01 +0200124Athena and Motif.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125
Bram Moolenaarbb1969b2019-01-17 15:45:25 +0100126 *netbeans-xpm*
127If Motif support is required the user must supply XPM libraries.
128The XPM library is required to show images within Vim with Motif or Athena.
129Without it the toolbar and signs will be disabled.
130
131The XPM library is provided by Arnaud Le Hors of the French National Institute
132for Research in Computer Science and Control. It can be downloaded from
133http://cgit.freedesktop.org/xorg/lib/libXpm. The current release, as of this
134writing, is xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create
135the directory /usr/local/xpm and untar the file there you can use the
136uncommented lines in the Makefile without changing them. If you use another
137xpm directory you will need to change the XPM_DIR in src/Makefile.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138
139
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000140On MS-Windows:
141--------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000142
143The Win32 support is now in beta stage.
144
145To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
146XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/
147(for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
148
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000149Enable debugging:
150-----------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000152To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro
153needs to be defined. Search in the Makefile of the platform you are using for
154"NBDEBUG" to see what line needs to be uncommented. This effectively adds
155"-DNBDEBUG" to the compile command. Also see |netbeans-debugging|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156
157==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001584. Error Messages *netbeans-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000159
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000160These error messages are specific to NetBeans socket protocol:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161
162 *E463*
163Region is guarded, cannot modify
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000164 The Vim Controller has defined guarded areas in the text,
165 which you cannot change. Also sets the current buffer, if
166 necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000167
Bram Moolenaar67c53842010-05-22 18:28:27 +0200168 *E532*
169The defineAnnoType highlighting color name is too long
170 The maximum length of the "fg" or "bg" color argument in the
171 defineAnnoType command is 32 characters.
172 New in version 2.5.
173
Bram Moolenaar071d4272004-06-13 20:20:40 +0000174 *E656*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000175Writes of unmodified buffers forbidden
176 Writes of unmodified buffers that were opened from the
177 Vim Controller are not possible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178
179 *E657*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000180Partial writes disallowed
181 Partial writes for buffers that were opened from the
182 Vim Controller are not allowed.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183
184 *E658*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000185Connection lost for this buffer
186 The Vim Controller has become confused about the state of
187 this file. Rather than risk data corruption, it has severed
188 the connection for this file. Vim will take over
189 responsibility for saving changes to this file and the
190 Vim Controller will no longer know of these changes.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000191
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000192 *E744*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000193Read-only file
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000194 Vim normally allows changes to a read-only file and only
195 enforces the read-only rule if you try to write the file.
196 However, NetBeans does not let you make changes to a file
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000197 which is read-only and becomes confused if Vim does this.
198 So Vim does not allow modifications to files when run
199 in NetBeans mode.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000200
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000201==============================================================================
2025. Running Vim in NetBeans mode *netbeans-run*
203
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200204There are two different ways to run Vim in NetBeans mode:
205
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200206 + an IDE may start Vim with the |-nb| command line argument
207 + NetBeans can be started from within Vim with the |:nbstart| command
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200208
Bram Moolenaare0fa3742016-02-20 15:47:01 +0100209Vim uses a 3 second timeout on trying to make the connection.
210
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200211 *netbeans-parameters*
212Three forms can be used to setup the NetBeans connection parameters.
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200213When started from the command line, the |-nb| command line argument may be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214
215 -nb={fname} from a file
216 -nb:{hostname}:{addr}:{password} directly
217 -nb from a file or environment
218
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200219When started from within Vim, the |:nbstart| optional argument may be:
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200220
221 ={fname} from a file
222 :{hostname}:{addr}:{password} directly
223 <MISSING ARGUMENT> from a file or environment
224
Bram Moolenaar071d4272004-06-13 20:20:40 +0000225 *E660* *E668*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200226When NetBeans is started from the command line, for security reasons, the best
227method is to write the information in a file readable only by the user. The
228name of the file can be passed with the "-nb={fname}" argument or, when "-nb"
229is used without a parameter, the environment variable "__NETBEANS_CONINFO".
230The file must contain these three lines, in any order:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231
232 host={hostname}
233 port={addr}
234 auth={password}
235
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200236Other lines are ignored. The Vim Controller is responsible for deleting the
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237file afterwards.
238
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000239{hostname} is the name of the machine where Vim Controller is running. When
240omitted the environment variable "__NETBEANS_HOST" is used or the default
241"localhost".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000243{addr} is the port number for the NetBeans interface. When omitted the
244environment variable "__NETBEANS_SOCKET" is used or the default 3219.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000245
246{password} is the password for connecting to NetBeans. When omitted the
247environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
248
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000249Vim will initiate a socket connection (client side) to the specified host and
250port upon startup. The password will be sent with the AUTH event when the
251connection has been established.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000252
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000253
254==============================================================================
2556. NetBeans protocol *netbeans-protocol*
256
257The communication between the Vim Controller and Vim uses plain text
258messages. This protocol was first designed to work with the external editor
259module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE,
260see http://www.a-a-p.org) and then with other IDE. The extensions are marked
261with "version 2.1".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000263Version 2.2 of the protocol has several minor changes which should only affect
264NetBeans users (ie, not Agide users). However, a bug was fixed which could
265cause confusion. The netbeans_saved() function sent a "save" protocol
266command. In protocol version 2.1 and earlier this was incorrectly interpreted
267as a notification that a write had taken place. In reality, it told NetBeans
268to save the file so multiple writes were being done. This caused various
269problems and has been fixed in 2.2. To decrease the likelihood of this
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270confusion happening again, netbeans_saved() has been renamed to
271netbeans_save_buffer().
272
Bram Moolenaar67c53842010-05-22 18:28:27 +0200273We are now at version 2.5. For the differences between 2.4 and 2.5 search for
274"2.5" below.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000275
Bram Moolenaar071d4272004-06-13 20:20:40 +0000276The messages are currently sent over a socket. Since the messages are in
277plain UTF-8 text this protocol could also be used with any other communication
278mechanism.
279
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200280Netbeans messages are processed when Vim is idle, waiting for user input.
281When Vim is run in non-interactive mode, for example when running an automated
282test case that sources a Vim script, the idle loop may not be called often
Bram Moolenaarb8ff1fb2012-02-04 21:59:01 +0100283enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep|
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200284command does invoke Netbeans messages processing.
285
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002866.1 Kinds of messages |nb-messages|
2876.2 Terms |nb-terms|
2886.3 Commands |nb-commands|
2896.4 Functions and Replies |nb-functions|
2906.5 Events |nb-events|
2916.6 Special messages |nb-special|
2926.7 Protocol errors |nb-protocol_errors|
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000293
294
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002956.1 Kinds of messages *nb-messages*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000296
297There are four kinds of messages:
298
299kind direction comment ~
300Command IDE -> editor no reply necessary
301Function IDE -> editor editor must send back a reply
302Reply editor -> IDE only in response to a Function
303Event editor -> IDE no reply necessary
304
305The messages are sent as a single line with a terminating newline character.
306Arguments are separated by a single space. The first item of the message
307depends on the kind of message:
308
309kind first item example ~
310Command bufID:name!seqno 11:showBalloon!123 "text"
311Function bufID:name/seqno 11:getLength/123
312Reply seqno 123 5000
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000313Event bufID:name=seqno 11:keyCommand=123 "S-F2"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000314
315
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000316
3176.2 Terms *nb-terms*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318
319bufID Buffer number. A message may be either for a specific buffer
320 or generic. Generic messages use a bufID of zero. NOTE: this
321 buffer ID is assigned by the IDE, it is not Vim's buffer
322 number. The bufID must be a sequentially rising number,
Bram Moolenaar5837f1f2015-03-21 18:06:14 +0100323 starting at one. When the 'switchbuf' option is set to
324 "usetab" and the "bufID" buffer is not found in the current
325 tab page, the netbeans commands and functions that set this
326 buffer as the current buffer will jump to the first open
327 window that contains this buffer in other tab pages instead of
328 replacing the buffer in the current window.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329
330seqno The IDE uses a sequence number for Commands and Functions. A
331 Reply must use the sequence number of the Function that it is
332 associated with. A zero sequence number can be used for
333 Events (the seqno of the last received Command or Function can
334 also be used).
335
336string Argument in double quotes. Text is in UTF-8 encoding. This
337 means ASCII is passed as-is. Special characters are
338 represented with a backslash:
339 \" double quote
340 \n newline
341 \r carriage-return
342 \t tab (optional, also works literally)
343 \\ backslash
344 NUL bytes are not allowed!
345
346boolean Argument with two possible values:
347 T true
348 F false
349
350number Argument with a decimal number.
351
Bram Moolenaar67c53842010-05-22 18:28:27 +0200352color Argument with either a decimal number, "none" (without the
353 quotes) or the name of a color (without the quotes) defined
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200354 both in the color list in |highlight-ctermfg| and in the color
355 list in |gui-colors|.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200356 New in version 2.5.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000357
358offset A number argument that indicates a byte position in a buffer.
359 The first byte has offset zero. Line breaks are counted for
360 how they appear in the file (CR/LF counts for two bytes).
361 Note that a multi-byte character is counted for the number of
362 bytes it takes.
363
364lnum/col Argument with a line number and column number position. The
365 line number starts with one, the column is the byte position,
366 starting with zero. Note that a multi-byte character counts
367 for several columns.
368
369pathname String argument: file name with full path.
370
371
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00003726.3 Commands *nb-commands*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000373
374actionMenuItem Not implemented.
375
376actionSensitivity
377 Not implemented.
378
379addAnno serNum typeNum off len
380 Place an annotation in this buffer.
381 Arguments:
382 serNum number serial number of this placed
383 annotation, used to be able to remove
384 it
385 typeNum number sequence number of the annotation
386 defined with defineAnnoType for this
387 buffer
388 off number offset where annotation is to be placed
389 len number not used
390 In version 2.1 "lnum/col" can be used instead of "off".
391
392balloonResult text
393 Not implemented.
394
395close Close the buffer. This leaves us without current buffer, very
396 dangerous to use!
397
398create Creates a buffer without a name. Replaces the current buffer
399 (it's hidden when it was changed).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000400 The Vim Controller should use this as the first command for a
401 file that is being opened. The sequence of commands could be:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000402 create
403 setCaretListener (ignored)
404 setModified (no effect)
405 setContentType (ignored)
406 startDocumentListen
407 setTitle
408 setFullName
409
410defineAnnoType typeNum typeName tooltip glyphFile fg bg
411 Define a type of annotation for this buffer.
412 Arguments:
413 typeNum number sequence number (not really used)
414 typeName string name that identifies this annotation
415 tooltip string not used
416 glyphFile string name of icon file
Bram Moolenaar67c53842010-05-22 18:28:27 +0200417 fg color foreground color for line highlighting
418 bg color background color for line highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000419 Vim will define a sign for the annotation.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200420 When color is a number, this is the "#rrggbb" Red, Green and
421 Blue values of the color (see |gui-colors|) and the
Bram Moolenaarb477af22018-07-15 20:20:18 +0200422 highlighting is only defined for gVim.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200423 When color is a name, this color is defined both for Vim
Bram Moolenaarb477af22018-07-15 20:20:18 +0200424 running in a color terminal and for gVim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425 When both "fg" and "bg" are "none" no line highlighting is
426 used (new in version 2.1).
427 When "glyphFile" is empty, no text sign is used (new in
428 version 2.1).
429 When "glyphFile" is one or two characters long, a text sign is
430 defined (new in version 2.1).
431 Note: the annotations will be defined in sequence, and the
432 sequence number is later used with addAnno.
433
434editFile pathname
435 Set the name for the buffer and edit the file "pathname", a
436 string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000437 Normal way for the IDE to tell the editor to edit a file.
438
439 You must set a bufId different of 0 with this command to
440 assign a bufId to the buffer. It will trigger an event
441 fileOpened with a bufId of 0 but the buffer has been assigned.
442
443 If the IDE is going to pass the file text to the editor use
444 these commands instead:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000445 setFullName
446 insert
447 initDone
448 New in version 2.1.
449
450enableBalloonEval
451 Not implemented.
452
453endAtomic End an atomic operation. The changes between "startAtomic"
454 and "endAtomic" can be undone as one operation. But it's not
455 implemented yet. Redraw when necessary.
456
457guard off len
458 Mark an area in the buffer as guarded. This means it cannot
459 be edited. "off" and "len" are numbers and specify the text
460 to be guarded.
461
462initDone Mark the buffer as ready for use. Implicitly makes the buffer
463 the current buffer. Fires the BufReadPost autocommand event.
464
Bram Moolenaar009b2592004-10-24 19:18:58 +0000465insertDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000466 Sent by Vim Controller to tell Vim an initial file insert is
467 done. This triggers a read message being printed. Prior to
468 version 2.3, no read messages were displayed after opening a
469 file. New in version 2.3.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000470
Bram Moolenaar071d4272004-06-13 20:20:40 +0000471moveAnnoToFront serNum
472 Not implemented.
473
474netbeansBuffer isNetbeansBuffer
Bram Moolenaarc236c162008-07-13 17:41:49 +0000475 If "isNetbeansBuffer" is "T" then this buffer is "owned" by
Bram Moolenaar071d4272004-06-13 20:20:40 +0000476 NetBeans.
477 New in version 2.2.
478
479putBufferNumber pathname
480 Associate a buffer number with the Vim buffer by the name
481 "pathname", a string argument. To be used when the editor
482 reported editing another file to the IDE and the IDE needs to
483 tell the editor what buffer number it will use for this file.
484 Also marks the buffer as initialized.
485 New in version 2.1.
486
487raise Bring the editor to the foreground.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200488 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000489 New in version 2.1.
490
491removeAnno serNum
Bram Moolenaar3a991dd2014-10-02 01:41:41 +0200492 Remove a previously placed annotation for this buffer.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000493 "serNum" is the same number used in addAnno.
494
495save Save the buffer when it was modified. The other side of the
496 interface is expected to write the buffer and invoke
497 "setModified" to reset the "changed" flag of the buffer.
498 The writing is skipped when one of these conditions is true:
499 - 'write' is not set
500 - the buffer is read-only
501 - the buffer does not have a file name
502 - 'buftype' disallows writing
503 New in version 2.2.
504
Bram Moolenaar009b2592004-10-24 19:18:58 +0000505saveDone
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000506 Sent by Vim Controller to tell Vim a save is done. This
507 triggers a save message being printed. Prior to version 2.3,
508 no save messages were displayed after a save.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000509 New in version 2.3.
510
Bram Moolenaar071d4272004-06-13 20:20:40 +0000511setAsUser Not implemented.
512
513setBufferNumber pathname
514 Associate a buffer number with Vim buffer by the name
515 "pathname". To be used when the editor reported editing
516 another file to the IDE and the IDE needs to tell the editor
517 what buffer number it will use for this file.
518 Has the side effect of making the buffer the current buffer.
519 See "putBufferNumber" for a more useful command.
520
521setContentType
522 Not implemented.
523
524setDot off Make the buffer the current buffer and set the cursor at the
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000525 specified position. If the buffer is open in another window
526 than make that window the current window.
527 If there are folds they are opened to make the cursor line
528 visible.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000529 In version 2.1 "lnum/col" can be used instead of "off".
530
531setExitDelay seconds
532 Set the delay for exiting to "seconds", a number.
533 This delay is used to give the IDE a chance to handle things
534 before really exiting. The default delay is two seconds.
535 New in version 2.1.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000536 Obsolete in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000537
538setFullName pathname
539 Set the file name to be used for a buffer to "pathname", a
540 string argument.
541 Used when the IDE wants to edit a file under control of the
542 IDE. This makes the buffer the current buffer, but does not
543 read the file. "insert" commands will be used next to set the
544 contents.
545
546setLocAndSize Not implemented.
547
548setMark Not implemented.
549
550setModified modified
551 When the boolean argument "modified" is "T" mark the buffer as
552 modified, when it is "F" mark it as unmodified.
553
Bram Moolenaar009b2592004-10-24 19:18:58 +0000554setModtime time
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000555 Update a buffers modification time after the file has been
556 saved directly by the Vim Controller.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000557 New in version 2.3.
558
559setReadOnly
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000560 Set a file as readonly
561 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000562
563setStyle Not implemented.
564
565setTitle name
566 Set the title for the buffer to "name", a string argument.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000567 The title is only used for the Vim Controller functions, not
568 by Vim.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000569
570setVisible visible
571 When the boolean argument "visible" is "T", goto the buffer.
572 The "F" argument does nothing.
573
574showBalloon text
575 Show a balloon (popup window) at the mouse pointer position,
576 containing "text", a string argument. The balloon should
577 disappear when the mouse is moved more than a few pixels.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200578 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000579 New in version 2.1.
580
Bram Moolenaar009b2592004-10-24 19:18:58 +0000581specialKeys
582 Map a set of keys (mostly function keys) to be passed back
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000583 to the Vim Controller for processing. This lets regular IDE
584 hotkeys be used from Vim.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000585 Implemented in version 2.3.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000586
587startAtomic Begin an atomic operation. The screen will not be updated
588 until "endAtomic" is given.
589
590startCaretListen
591 Not implemented.
592
593startDocumentListen
594 Mark the buffer to report changes to the IDE with the
595 "insert" and "remove" events. The default is to report
596 changes.
597
598stopCaretListen
599 Not implemented.
600
601stopDocumentListen
602 Mark the buffer to stop reporting changes to the IDE.
603 Opposite of startDocumentListen.
Bram Moolenaar748bf032005-02-02 23:04:36 +0000604 NOTE: if "netbeansBuffer" was used to mark this buffer as a
605 NetBeans buffer, then the buffer is deleted in Vim. This is
606 for compatibility with Sun Studio 10.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000607
608unguard off len
609 Opposite of "guard", remove guarding for a text area.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000610 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000611
612version Not implemented.
613
614
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006156.4 Functions and Replies *nb-functions*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000616
617getDot Not implemented.
618
619getCursor Return the current buffer and cursor position.
620 The reply is:
621 seqno bufID lnum col off
622 seqno = sequence number of the function
623 bufID = buffer ID of the current buffer (if this is unknown -1
624 is used)
625 lnum = line number of the cursor (first line is one)
626 col = column number of the cursor (in bytes, zero based)
627 off = offset of the cursor in the buffer (in bytes)
628 New in version 2.1.
629
630getLength Return the length of the buffer in bytes.
631 Reply example for a buffer with 5000 bytes:
632 123 5000
633 TODO: explain use of partial line.
634
635getMark Not implemented.
636
Bram Moolenaarc65c4912006-11-14 17:29:46 +0000637getAnno serNum
638 Return the line number of the annotation in the buffer.
639 Argument:
640 serNum serial number of this placed annotation
641 The reply is:
642 123 lnum line number of the annotation
643 123 0 invalid annotation serial number
644 New in version 2.4.
645
Bram Moolenaar071d4272004-06-13 20:20:40 +0000646getModified When a buffer is specified: Return zero if the buffer does not
647 have changes, one if it does have changes.
648 When no buffer is specified (buffer number zero): Return the
649 number of buffers with changes. When the result is zero it's
650 safe to tell Vim to exit.
651 New in version 2.1.
652
653getText Return the contents of the buffer as a string.
654 Reply example for a buffer with two lines
655 123 "first line\nsecond line\n"
656 NOTE: docs indicate an offset and length argument, but this is
657 not implemented.
658
659insert off text
660 Insert "text" before position "off". "text" is a string
661 argument, "off" a number.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000662 "text" should have a "\n" (newline) at the end of each line.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000663 Or "\r\n" when 'fileformat' is "dos". When using "insert" in
664 an empty buffer Vim will set 'fileformat' accordingly.
665 When "off" points to the start of a line the text is inserted
666 above this line. Thus when "off" is zero lines are inserted
667 before the first line.
668 When "off" points after the start of a line, possibly on the
669 NUL at the end of a line, the first line of text is appended
670 to this line. Further lines come below it.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000671 Possible replies:
672 123 no problem
673 123 !message failed
674 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000675 Also sets the current buffer, if necessary.
Bram Moolenaar0fd92892006-03-09 22:27:48 +0000676 Does not move the cursor to the changed text.
677 Resets undo information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000678
679remove off length
680 Delete "length" bytes of text at position "off". Both
681 arguments are numbers.
682 Possible replies:
683 123 no problem
684 123 !message failed
685 Note that the message in the reply is not quoted.
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000686 Also sets the current buffer, if necessary.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000687
688saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
689 If there are no changed files or the user does not cancel the
690 operation Vim exits and no result is sent back. The IDE can
691 consider closing the connection as a successful result.
692 If the user cancels the operation the number of modified
693 buffers that remains is returned and Vim does not exit.
694 New in version 2.1.
695
696
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00006976.5 Events *nb-events*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000698
699balloonEval off len type
700 The mouse pointer rests on text for a short while. When "len"
701 is zero, there is no selection and the pointer is at position
702 "off". When "len" is non-zero the text from position "off" to
703 "off" + "len" is selected.
704 Only sent after "enableBalloonEval" was used for this buffer.
705 "type" is not yet defined.
706 Not implemented yet.
707
708balloonText text
709 Used when 'ballooneval' is set and the mouse pointer rests on
710 some text for a moment. "text" is a string, the text under
711 the mouse pointer.
Bram Moolenaar67c53842010-05-22 18:28:27 +0200712 Only when Vim is run with a GUI.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000713 New in version 2.1.
714
715buttonRelease button lnum col
716 Report which button was pressed and the location of the cursor
717 at the time of the release. Only for buffers that are owned
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000718 by the Vim Controller. This event is not sent if the button
719 was released while the mouse was in the status line or in a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000720 separator line. If col is less than 1 the button release was
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721 in the sign area.
722 New in version 2.2.
723
Bram Moolenaar009b2592004-10-24 19:18:58 +0000724disconnect
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000725 Tell the Vim Controller that Vim is exiting and not to try and
726 read or write more commands.
Bram Moolenaar009b2592004-10-24 19:18:58 +0000727 New in version 2.3.
728
Bram Moolenaar071d4272004-06-13 20:20:40 +0000729fileClosed Not implemented.
730
731fileModified Not implemented.
732
733fileOpened pathname open modified
734 A file was opened by the user.
735 Arguments:
736 pathname string name of the file
737 open boolean always "T"
738 modified boolean always "F"
739
740geometry cols rows x y
741 Report the size and position of the editor window.
742 Arguments:
743 cols number number of text columns
744 rows number number of text rows
745 x number pixel position on screen
746 y number pixel position on screen
747 Only works for Motif.
748
749insert off text
750 Text "text" has been inserted in Vim at position "off".
751 Only fired when enabled, see "startDocumentListen".
752
753invokeAction Not implemented.
754
755keyCommand keyName
756 Reports a special key being pressed with name "keyName", which
757 is a string.
758 Supported key names:
759 F1 function key 1
760 F2 function key 2
761 ...
762 F12 function key 12
763
764 ' ' space (without the quotes)
765 ! exclamation mark
766 ... any other ASCII printable character
767 ~ tilde
768
769 X any unrecognized key
770
771 The key may be prepended by "C", "S" and/or "M" for Control,
772 Shift and Meta (Alt) modifiers. If there is a modifier a dash
773 is used to separate it from the key name. For example:
774 "C-F2".
775 ASCII characters are new in version 2.1.
776
777keyAtPos keyName lnum/col
778 Like "keyCommand" and also report the line number and column
779 of the cursor.
780 New in version 2.1.
781
Bram Moolenaard7f8f5c2009-01-06 15:14:30 +0000782killed A file was deleted or wiped out by the user and the buffer
783 annotations have been removed. The bufID number for this
784 buffer has become invalid. Only for files that have been
785 assigned a bufID number by the IDE.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000786
787newDotAndMark off off
788 Reports the position of the cursor being at "off" bytes into
789 the buffer. Only sent just before a "keyCommand" event.
790
791quit Not implemented.
792
793remove off len
794 Text was deleted in Vim at position "off" with byte length
795 "len".
796 Only fired when enabled, see "startDocumentListen".
797
798revert Not implemented.
799
800save The buffer has been saved and is now unmodified.
801 Only fired when enabled, see "startDocumentListen".
802
803startupDone The editor has finished its startup work and is ready for
804 editing files.
805 New in version 2.1.
806
807unmodified The buffer is now unmodified.
808 Only fired when enabled, see "startDocumentListen".
809
810version vers Report the version of the interface implementation. Vim
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000811 reports "2.4" (including the quotes).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000812
813
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008146.6 Special messages *nb-special*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000815
816These messages do not follow the style of the messages above. They are
817terminated by a newline character.
818
819ACCEPT Not used.
820
821AUTH password editor -> IDE: First message that the editor sends to the IDE.
822 Must contain the password for the socket server, as specified
823 with the |-nb| argument. No quotes are used!
824
825DISCONNECT IDE -> editor: break the connection. The editor will exit.
826 The IDE must only send this message when there are no unsaved
827 changes!
828
829DETACH IDE -> editor: break the connection without exiting the
830 editor. Used when the IDE exits without bringing down the
831 editor as well.
832 New in version 2.1.
833
834REJECT Not used.
835
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000836
8376.7 Protocol errors *nb-protocol_errors*
838
839These errors occur when a message violates the protocol:
Bram Moolenaar5e9b2fa2016-02-01 22:37:05 +0100840*E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000841*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +0200842*E647* *E648* *E649* *E650* *E651* *E652*
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000843
844
Bram Moolenaar071d4272004-06-13 20:20:40 +0000845==============================================================================
Bram Moolenaarb26e6322010-05-22 21:34:09 +02008467. NetBeans commands *netbeans-commands*
847
Bram Moolenaar4a748032010-09-30 21:47:56 +0200848 *:nbstart* *E511* *E838*
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200849:nbs[tart] {connection} Start a new Netbeans session with {connection} as the
850 socket connection parameters. The format of
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200851 {connection} is described in |netbeans-parameters|.
Bram Moolenaarb26e6322010-05-22 21:34:09 +0200852 At any time, one may check if the netbeans socket is
853 connected by running the command:
854 ':echo has("netbeans_enabled")'
855
856 *:nbclose*
857:nbc[lose] Close the current NetBeans session. Remove all placed
858 signs.
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000859
860 *:nbkey*
Bram Moolenaare3cc6d42011-10-20 21:58:34 +0200861:nb[key] {key} Pass the {key} to the Vim Controller for processing.
862 When a hot-key has been installed with the specialKeys
863 command, this command can be used to generate a hotkey
864 message to the Vim Controller.
865 This command can also be used to pass any text to the
866 Vim Controller. It is used by Pyclewn, for example,
867 to build the complete set of gdb commands as Vim user
868 commands.
869 The events newDotAndMark, keyCommand and keyAtPos are
870 generated (in this order).
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000871
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000872
873==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00008748. Known problems *netbeans-problems*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875
876NUL bytes are not possible. For editor -> IDE they will appear as NL
877characters. For IDE -> editor they cannot be inserted.
878
Bram Moolenaar67c53842010-05-22 18:28:27 +0200879A NetBeans session may be initiated with Vim running in a terminal, and
Bram Moolenaar9855d6b2010-07-18 14:34:51 +0200880continued later in a GUI environment after running the |:gui| command. In this
Bram Moolenaar67c53842010-05-22 18:28:27 +0200881case, the highlighting defined for the NetBeans annotations may be cleared
882when the ":gui" command sources .gvimrc and this file loads a colorscheme
883that runs the command ":highlight clear".
884New in version 2.5.
885
Bram Moolenaar071d4272004-06-13 20:20:40 +0000886
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000887==============================================================================
8889. Debugging NetBeans protocol *netbeans-debugging*
889
890To debug the Vim protocol, you must first compile Vim with debugging support
891and NetBeans debugging support. See |netbeans-configure| for instructions
892about Vim compiling and how to enable debug support.
893
894When running Vim, set the following environment variables:
895
896 export SPRO_GVIM_DEBUG=netbeans.log
897 export SPRO_GVIM_DLEVEL=0xffffffff
898
899Vim will then log all the incoming and outgoing messages of the NetBeans
900protocol to the file netbeans.log .
901
902The content of netbeans.log after a session looks like this:
903Tue May 20 17:19:27 2008
904EVT: 0:startupDone=0
905CMD 1: (1) create
906CMD 2: (1) setTitle "testfile1.txt"
907CMD 3: (1) setFullName "testfile1.txt"
908EVT(suppressed): 1:remove=3 0 -1
909EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F
910CMD 4: (1) initDone
911FUN 5: (0) getCursor
912REP 5: 1 1 0 0
913CMD 6: (2) create
914CMD 7: (2) setTitle "testfile2.txt"
915CMD 8: (2) setFullName "testfile2.txt"
916EVT(suppressed): 2:remove=8 0 -1
917EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F
918CMD 9: (2) initDone
919
920
921==============================================================================
92210. NetBeans External Editor
923
924NOTE: This information is obsolete! Only relevant if you are using an old
925version of NetBeans.
926
927
92810.1. Downloading NetBeans *netbeans-download*
929
930The NetBeans IDE is available for download from netbeans.org. You can download
931a released version, download sources, or use CVS to download the current
932source tree. If you choose to download sources, follow directions from
933netbeans.org on building NetBeans.
934
935Depending on the version of NetBeans you download, you may need to do further
936work to get the required External Editor module. This is the module which lets
937NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
938for details on downloading this module if your NetBeans release does not have
939it.
940
941For C, C++, and Fortran support you will also need the cpp module. See
942http://cpp.netbeans.org for information regarding this module.
943
944You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
945free trial. See http://www.sun.com for further details.
946
947
94810.2. NetBeans Key Bindings *netbeans-keybindings*
949
950Vim understands a number of key bindings that execute NetBeans commands.
951These are typically all the Function key combinations. To execute a NetBeans
952command, the user must press the Pause key followed by a NetBeans key binding.
953For example, in order to compile a Java file, the NetBeans key binding is
954"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a
955breakpoint at the current line, press "Pause Shift F8".
956
957The Pause key is Function key 21. If you don't have a working Pause key and
958want to use F8 instead, use: >
959
960 :map <F8> <F21>
961
962The External Editor module dynamically reads the NetBeans key bindings so vim
963should always have the latest key bindings, even when NetBeans changes them.
964
965
96610.3. Preparing NetBeans for Vim *netbeans-preparation*
967
968In order for NetBeans to work with vim, the NetBeans External Editor module
969must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
970then this module should be loaded and enabled. If you have a NetBeans release
971you may need to find another way of obtaining this open source module.
972
973You can check if you have this module by opening the Tools->Options dialog
974and drilling down to the "Modules" list (IDE Configuration->System->Modules).
975If your Modules list has an entry for "External Editor" you must make sure
976it is enabled (the "Enabled" property should have the value "True"). If your
977Modules list has no External Editor see the next section on |obtaining-exted|.
978
979
98010.4. Obtaining the External Editor Module *obtaining-exted*
981
982There are 2 ways of obtaining the External Editor module. The easiest way
983is to use the NetBeans Update Center to download and install the module.
984Unfortunately, some versions do not have this module in their update
985center. If you cannot download via the update center you will need to
986download sources and build the module. I will try and get the module
987available from the NetBeans Update Center so building will be unnecessary.
988Also check http://externaleditor.netbeans.org for other availability options.
989
990To download the External Editor sources via CVS and build your own module,
991see http://externaleditor.netbeans.org and http://www.netbeans.org.
992Unfortunately, this is not a trivial procedure.
993
994
99510.5. Setting up NetBeans to run with Vim *netbeans-setup*
996
997Assuming you have loaded and enabled the NetBeans External Editor module
998as described in |netbeans-preparation| all you need to do is verify that
999the gvim command line is properly configured for your environment.
1000
1001Open the Tools->Options dialog and open the Editing category. Select the
1002External Editor. The right hand pane should contain a Properties tab and
1003an Expert tab. In the Properties tab make sure the "Editor Type" is set
1004to "Vim". In the Expert tab make sure the "Vim Command" is correct.
1005
1006You should be careful if you change the "Vim Command". There are command
1007line options there which must be there for the connection to be properly
1008set up. You can change the command name but that's about it. If your gvim
Bram Moolenaar6aa8cea2017-06-05 14:44:35 +02001009can be found by your $PATH then the Vim Command can start with "gvim". If
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001010you don't want gvim searched from your $PATH then hard code in the full
1011Unix path name. At this point you should get a gvim for any source file
1012you open in NetBeans.
1013
1014If some files come up in gvim and others (with different file suffixes) come
1015up in the default NetBeans editor you should verify the MIME type in the
1016Expert tab MIME Type property. NetBeans is MIME oriented and the External
1017Editor will only open MIME types specified in this property.
1018
1019
Bram Moolenaar91f84f62018-07-29 15:07:52 +02001020 vim:tw=78:ts=8:noet:ft=help:norl: