Mercurial > vim
annotate runtime/doc/netbeans.txt @ 17706:431d52b7f7d3 v8.1.1850
patch 8.1.1850: focus may remain in popup window
commit https://github.com/vim/vim/commit/5dd143e22333a1c320fcf330f6c5061269bd1a17
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 15 21:34:34 2019 +0200
patch 8.1.1850: focus may remain in popup window
Problem: Focus may remain in popup window.
Solution: Change focus if needed.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Aug 2019 21:45:04 +0200 |
parents | 0e473e9e70c2 |
children | af69c9335223 |
rev | line source |
---|---|
16553
0e473e9e70c2
patch 8.1.1280: remarks about functionality not in Vi clutters the help
Bram Moolenaar <Bram@vim.org>
parents:
15510
diff
changeset
|
1 *netbeans.txt* For Vim version 8.1. Last change: 2019 May 05 |
7 | 2 |
3 | |
1620 | 4 VIM REFERENCE MANUAL by Gordon Prieur et al. |
7 | 5 |
6 | |
15510
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
7 *netbeans* *NetBeans* *netbeans-support* |
1620 | 8 |
9 Vim NetBeans Protocol: a socket interface for Vim integration into an IDE. | |
10 | |
7 | 11 1. Introduction |netbeans-intro| |
1620 | 12 2. Integration features |netbeans-integration| |
7 | 13 3. Configuring Vim for NetBeans |netbeans-configure| |
1620 | 14 4. Error Messages |netbeans-messages| |
15 5. Running Vim in NetBeans mode |netbeans-run| | |
16 6. NetBeans protocol |netbeans-protocol| | |
2210 | 17 7. NetBeans commands |netbeans-commands| |
1620 | 18 8. Known problems |netbeans-problems| |
19 9. Debugging NetBeans protocol |netbeans-debugging| | |
20 10. 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| | |
7 | 26 |
27 {only available when compiled with the |+netbeans_intg| feature} | |
28 | |
29 ============================================================================== | |
30 1. Introduction *netbeans-intro* | |
31 | |
1620 | 32 The NetBeans interface was initially developed to integrate Vim into the |
33 NetBeans Java IDE, using the external editor plugin. This NetBeans plugin no | |
34 longer exists for recent versions of NetBeans but the protocol was developed | |
35 in such a way that any IDE can use it to integrate Vim. | |
36 | |
37 The NetBeans protocol of Vim is a text based communication protocol, over a | |
38 classical TCP socket. There is no dependency on Java or NetBeans. Any language | |
39 or environment providing a socket interface can control Vim using this | |
40 protocol. There are existing implementations in C, C++, Python and Java. The | |
41 name NetBeans is kept today for historical reasons. | |
42 | |
43 Current 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/ | |
2210 | 50 - Pyclewn, a gdb integration into Vim, written in Python: |
51 http://pyclewn.sourceforge.net/ | |
1620 | 52 - 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 | |
59 Check the specific project pages to see how to use Vim with these projects. | |
60 | |
9533
9f921133ee90
commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents:
8951
diff
changeset
|
61 An alternative is to use a channel, see |channel|. |
9f921133ee90
commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents:
8951
diff
changeset
|
62 |
1620 | 63 In the rest of this help page, we will use the term "Vim Controller" to |
64 describe the program controlling Vim through the NetBeans socket interface. | |
65 | |
66 | |
67 About the NetBeans IDE ~ | |
68 | |
7 | 69 NetBeans is an open source Integrated Development Environment developed |
70 jointly by Sun Microsystems, Inc. and the netbeans.org developer community. | |
71 Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added | |
72 in recent releases. | |
73 | |
1620 | 74 For more information visit the main NetBeans web site http://www.netbeans.org. |
1668 | 75 The External Editor is now, unfortunately, declared obsolete. See |
1620 | 76 http://externaleditor.netbeans.org. |
7 | 77 |
78 Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio. | |
79 Visit http://www.sun.com for more information regarding the Sun ONE Studio | |
80 product line. | |
81 | |
82 Current releases of NetBeans provide full support for Java and limited support | |
236 | 83 for C, C++, and Fortran. Current releases of Sun ONE Studio provide full |
7 | 84 support for Java, C, C++, and Fortran. |
85 | |
86 ============================================================================== | |
1620 | 87 2. Integration features *netbeans-integration* |
7 | 88 |
1620 | 89 The NetBeans socket interface of Vim allows to get information from Vim or to |
90 ask 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 | |
7 | 99 |
1620 | 100 For sending key strokes to Vim or for evaluating functions in Vim, you must |
101 use the |clientserver| interface. | |
7 | 102 |
103 | |
104 ============================================================================== | |
105 3. Configuring Vim for NetBeans *netbeans-configure* | |
106 | |
2207
b17bbfa96fa0
Add the settabvar() and gettabvar() functions.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
107 For more help about installing Vim, please read |usr_90.txt| in the Vim User |
b17bbfa96fa0
Add the settabvar() and gettabvar() functions.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
108 Manual. |
7 | 109 |
110 | |
1620 | 111 On Unix: |
112 -------- | |
7 | 113 |
114 When running configure without arguments the NetBeans interface should be | |
115 included. That is, if the configure check to find out if your system supports | |
116 the required features succeeds. | |
117 | |
118 In case you do not want the NetBeans interface you can disable it by | |
119 uncommenting a line with "--disable-netbeans" in the Makefile. | |
120 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
121 Currently the NetBeans interface is supported by Vim running in a terminal and |
11473 | 122 by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows, |
2592 | 123 Athena and Motif. |
7 | 124 |
15510
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
125 *netbeans-xpm* |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
126 If Motif support is required the user must supply XPM libraries. |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
127 The XPM library is required to show images within Vim with Motif or Athena. |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
128 Without it the toolbar and signs will be disabled. |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
129 |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
130 The XPM library is provided by Arnaud Le Hors of the French National Institute |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
131 for Research in Computer Science and Control. It can be downloaded from |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
132 http://cgit.freedesktop.org/xorg/lib/libXpm. The current release, as of this |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
133 writing, is xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
134 the directory /usr/local/xpm and untar the file there you can use the |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
135 uncommented lines in the Makefile without changing them. If you use another |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
136 xpm directory you will need to change the XPM_DIR in src/Makefile. |
7 | 137 |
138 | |
1620 | 139 On MS-Windows: |
140 -------------- | |
7 | 141 |
142 The Win32 support is now in beta stage. | |
143 | |
144 To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile | |
145 XPM 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 | |
1620 | 148 Enable debugging: |
149 ----------------- | |
7 | 150 |
1620 | 151 To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro |
152 needs 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| | |
7 | 155 |
156 ============================================================================== | |
1620 | 157 4. Error Messages *netbeans-messages* |
7 | 158 |
1620 | 159 These error messages are specific to NetBeans socket protocol: |
7 | 160 |
161 *E463* | |
162 Region is guarded, cannot modify | |
1620 | 163 The Vim Controller has defined guarded areas in the text, |
164 which you cannot change. Also sets the current buffer, if | |
165 necessary. | |
7 | 166 |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
167 *E532* |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
168 The defineAnnoType highlighting color name is too long |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
169 The maximum length of the "fg" or "bg" color argument in the |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
170 defineAnnoType command is 32 characters. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
171 New in version 2.5. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
172 |
7 | 173 *E656* |
1620 | 174 Writes of unmodified buffers forbidden |
175 Writes of unmodified buffers that were opened from the | |
176 Vim Controller are not possible. | |
7 | 177 |
178 *E657* | |
1620 | 179 Partial writes disallowed |
180 Partial writes for buffers that were opened from the | |
181 Vim Controller are not allowed. | |
7 | 182 |
183 *E658* | |
1620 | 184 Connection 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. | |
7 | 190 |
146 | 191 *E744* |
1620 | 192 Read-only file |
146 | 193 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 | |
1620 | 196 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. | |
199 | |
7 | 200 ============================================================================== |
1620 | 201 5. Running Vim in NetBeans mode *netbeans-run* |
7 | 202 |
2210 | 203 There are two different ways to run Vim in NetBeans mode: |
204 | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
205 + an IDE may start Vim with the |-nb| command line argument |
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
206 + NetBeans can be started from within Vim with the |:nbstart| command |
2210 | 207 |
8148
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
7876
diff
changeset
|
208 Vim uses a 3 second timeout on trying to make the connection. |
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
7876
diff
changeset
|
209 |
2210 | 210 *netbeans-parameters* |
211 Three forms can be used to setup the NetBeans connection parameters. | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
212 When started from the command line, the |-nb| command line argument may be: |
7 | 213 |
214 -nb={fname} from a file | |
215 -nb:{hostname}:{addr}:{password} directly | |
216 -nb from a file or environment | |
217 | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
218 When started from within Vim, the |:nbstart| optional argument may be: |
2210 | 219 |
220 ={fname} from a file | |
221 :{hostname}:{addr}:{password} directly | |
222 <MISSING ARGUMENT> from a file or environment | |
223 | |
7 | 224 *E660* *E668* |
2210 | 225 When NetBeans is started from the command line, for security reasons, the best |
226 method is to write the information in a file readable only by the user. The | |
227 name of the file can be passed with the "-nb={fname}" argument or, when "-nb" | |
228 is used without a parameter, the environment variable "__NETBEANS_CONINFO". | |
229 The file must contain these three lines, in any order: | |
7 | 230 |
231 host={hostname} | |
232 port={addr} | |
233 auth={password} | |
234 | |
2210 | 235 Other lines are ignored. The Vim Controller is responsible for deleting the |
7 | 236 file afterwards. |
237 | |
1620 | 238 {hostname} is the name of the machine where Vim Controller is running. When |
239 omitted the environment variable "__NETBEANS_HOST" is used or the default | |
240 "localhost". | |
7 | 241 |
1620 | 242 {addr} is the port number for the NetBeans interface. When omitted the |
243 environment variable "__NETBEANS_SOCKET" is used or the default 3219. | |
7 | 244 |
245 {password} is the password for connecting to NetBeans. When omitted the | |
246 environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme". | |
247 | |
1620 | 248 Vim will initiate a socket connection (client side) to the specified host and |
249 port upon startup. The password will be sent with the AUTH event when the | |
250 connection has been established. | |
251 | |
7 | 252 |
1620 | 253 ============================================================================== |
254 6. NetBeans protocol *netbeans-protocol* | |
255 | |
256 The communication between the Vim Controller and Vim uses plain text | |
257 messages. This protocol was first designed to work with the external editor | |
258 module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE, | |
259 see http://www.a-a-p.org) and then with other IDE. The extensions are marked | |
260 with "version 2.1". | |
7 | 261 |
236 | 262 Version 2.2 of the protocol has several minor changes which should only affect |
263 NetBeans users (ie, not Agide users). However, a bug was fixed which could | |
264 cause confusion. The netbeans_saved() function sent a "save" protocol | |
265 command. In protocol version 2.1 and earlier this was incorrectly interpreted | |
266 as a notification that a write had taken place. In reality, it told NetBeans | |
267 to save the file so multiple writes were being done. This caused various | |
268 problems and has been fixed in 2.2. To decrease the likelihood of this | |
7 | 269 confusion happening again, netbeans_saved() has been renamed to |
270 netbeans_save_buffer(). | |
271 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
272 We are now at version 2.5. For the differences between 2.4 and 2.5 search for |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
273 "2.5" below. |
718 | 274 |
7 | 275 The messages are currently sent over a socket. Since the messages are in |
276 plain UTF-8 text this protocol could also be used with any other communication | |
277 mechanism. | |
278 | |
3151 | 279 Netbeans messages are processed when Vim is idle, waiting for user input. |
280 When Vim is run in non-interactive mode, for example when running an automated | |
281 test case that sources a Vim script, the idle loop may not be called often | |
3312 | 282 enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep| |
3151 | 283 command does invoke Netbeans messages processing. |
284 | |
1620 | 285 6.1 Kinds of messages |nb-messages| |
286 6.2 Terms |nb-terms| | |
287 6.3 Commands |nb-commands| | |
288 6.4 Functions and Replies |nb-functions| | |
289 6.5 Events |nb-events| | |
290 6.6 Special messages |nb-special| | |
291 6.7 Protocol errors |nb-protocol_errors| | |
718 | 292 |
293 | |
1620 | 294 6.1 Kinds of messages *nb-messages* |
7 | 295 |
296 There are four kinds of messages: | |
297 | |
298 kind direction comment ~ | |
299 Command IDE -> editor no reply necessary | |
300 Function IDE -> editor editor must send back a reply | |
301 Reply editor -> IDE only in response to a Function | |
302 Event editor -> IDE no reply necessary | |
303 | |
304 The messages are sent as a single line with a terminating newline character. | |
305 Arguments are separated by a single space. The first item of the message | |
306 depends on the kind of message: | |
307 | |
308 kind first item example ~ | |
309 Command bufID:name!seqno 11:showBalloon!123 "text" | |
310 Function bufID:name/seqno 11:getLength/123 | |
311 Reply seqno 123 5000 | |
1620 | 312 Event bufID:name=seqno 11:keyCommand=123 "S-F2" |
7 | 313 |
314 | |
1620 | 315 |
316 6.2 Terms *nb-terms* | |
7 | 317 |
318 bufID 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, | |
6697 | 322 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. | |
7 | 328 |
329 seqno 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 | |
335 string 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 | |
345 boolean Argument with two possible values: | |
346 T true | |
347 F false | |
348 | |
349 number Argument with a decimal number. | |
350 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
351 color Argument with either a decimal number, "none" (without the |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
352 quotes) or the name of a color (without the quotes) defined |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
353 both in the color list in |highlight-ctermfg| and in the color |
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
354 list in |gui-colors|. |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
355 New in version 2.5. |
7 | 356 |
357 offset 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 | |
363 lnum/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 | |
368 pathname String argument: file name with full path. | |
369 | |
370 | |
1620 | 371 6.3 Commands *nb-commands* |
7 | 372 |
373 actionMenuItem Not implemented. | |
374 | |
375 actionSensitivity | |
376 Not implemented. | |
377 | |
378 addAnno 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 | |
391 balloonResult text | |
392 Not implemented. | |
393 | |
394 close Close the buffer. This leaves us without current buffer, very | |
395 dangerous to use! | |
396 | |
397 create Creates a buffer without a name. Replaces the current buffer | |
398 (it's hidden when it was changed). | |
1620 | 399 The Vim Controller should use this as the first command for a |
400 file that is being opened. The sequence of commands could be: | |
7 | 401 create |
402 setCaretListener (ignored) | |
403 setModified (no effect) | |
404 setContentType (ignored) | |
405 startDocumentListen | |
406 setTitle | |
407 setFullName | |
408 | |
409 defineAnnoType 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 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
416 fg color foreground color for line highlighting |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
417 bg color background color for line highlighting |
7 | 418 Vim will define a sign for the annotation. |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
419 When color is a number, this is the "#rrggbb" Red, Green and |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
420 Blue values of the color (see |gui-colors|) and the |
14347 | 421 highlighting is only defined for gVim. |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
422 When color is a name, this color is defined both for Vim |
14347 | 423 running in a color terminal and for gVim. |
7 | 424 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 | |
433 editFile pathname | |
434 Set the name for the buffer and edit the file "pathname", a | |
435 string argument. | |
1620 | 436 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: | |
7 | 444 setFullName |
445 insert | |
446 initDone | |
447 New in version 2.1. | |
448 | |
449 enableBalloonEval | |
450 Not implemented. | |
451 | |
452 endAtomic 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 | |
456 guard 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 | |
461 initDone Mark the buffer as ready for use. Implicitly makes the buffer | |
462 the current buffer. Fires the BufReadPost autocommand event. | |
463 | |
33 | 464 insertDone |
1620 | 465 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. | |
33 | 469 |
7 | 470 moveAnnoToFront serNum |
471 Not implemented. | |
472 | |
473 netbeansBuffer isNetbeansBuffer | |
1668 | 474 If "isNetbeansBuffer" is "T" then this buffer is "owned" by |
7 | 475 NetBeans. |
476 New in version 2.2. | |
477 | |
478 putBufferNumber 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 | |
486 raise Bring the editor to the foreground. | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
487 Only when Vim is run with a GUI. |
7 | 488 New in version 2.1. |
489 | |
490 removeAnno serNum | |
6259 | 491 Remove a previously placed annotation for this buffer. |
7 | 492 "serNum" is the same number used in addAnno. |
493 | |
494 save 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 | |
33 | 504 saveDone |
1620 | 505 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. | |
33 | 508 New in version 2.3. |
509 | |
7 | 510 setAsUser Not implemented. |
511 | |
512 setBufferNumber 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 | |
520 setContentType | |
521 Not implemented. | |
522 | |
523 setDot off Make the buffer the current buffer and set the cursor at the | |
659 | 524 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. | |
7 | 528 In version 2.1 "lnum/col" can be used instead of "off". |
529 | |
530 setExitDelay 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. | |
33 | 535 Obsolete in version 2.3. |
7 | 536 |
537 setFullName 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 | |
545 setLocAndSize Not implemented. | |
546 | |
547 setMark Not implemented. | |
548 | |
549 setModified modified | |
550 When the boolean argument "modified" is "T" mark the buffer as | |
551 modified, when it is "F" mark it as unmodified. | |
552 | |
33 | 553 setModtime time |
1620 | 554 Update a buffers modification time after the file has been |
555 saved directly by the Vim Controller. | |
33 | 556 New in version 2.3. |
557 | |
558 setReadOnly | |
1620 | 559 Set a file as readonly |
560 Implemented in version 2.3. | |
7 | 561 |
562 setStyle Not implemented. | |
563 | |
564 setTitle name | |
565 Set the title for the buffer to "name", a string argument. | |
1620 | 566 The title is only used for the Vim Controller functions, not |
567 by Vim. | |
7 | 568 |
569 setVisible visible | |
570 When the boolean argument "visible" is "T", goto the buffer. | |
571 The "F" argument does nothing. | |
572 | |
573 showBalloon 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. | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
577 Only when Vim is run with a GUI. |
7 | 578 New in version 2.1. |
579 | |
33 | 580 specialKeys |
581 Map a set of keys (mostly function keys) to be passed back | |
1620 | 582 to the Vim Controller for processing. This lets regular IDE |
583 hotkeys be used from Vim. | |
33 | 584 Implemented in version 2.3. |
7 | 585 |
586 startAtomic Begin an atomic operation. The screen will not be updated | |
587 until "endAtomic" is given. | |
588 | |
589 startCaretListen | |
590 Not implemented. | |
591 | |
592 startDocumentListen | |
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 | |
597 stopCaretListen | |
598 Not implemented. | |
599 | |
600 stopDocumentListen | |
601 Mark the buffer to stop reporting changes to the IDE. | |
602 Opposite of startDocumentListen. | |
153 | 603 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. | |
7 | 606 |
607 unguard off len | |
608 Opposite of "guard", remove guarding for a text area. | |
659 | 609 Also sets the current buffer, if necessary. |
7 | 610 |
611 version Not implemented. | |
612 | |
613 | |
1620 | 614 6.4 Functions and Replies *nb-functions* |
7 | 615 |
616 getDot Not implemented. | |
617 | |
618 getCursor 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 | |
629 getLength 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 | |
634 getMark Not implemented. | |
635 | |
1037 | 636 getAnno 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 | |
7 | 645 getModified 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 | |
652 getText 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 | |
658 insert off text | |
659 Insert "text" before position "off". "text" is a string | |
660 argument, "off" a number. | |
1620 | 661 "text" should have a "\n" (newline) at the end of each line. |
718 | 662 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. | |
7 | 670 Possible replies: |
671 123 no problem | |
672 123 !message failed | |
673 Note that the message in the reply is not quoted. | |
659 | 674 Also sets the current buffer, if necessary. |
718 | 675 Does not move the cursor to the changed text. |
676 Resets undo information. | |
7 | 677 |
678 remove 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. | |
659 | 685 Also sets the current buffer, if necessary. |
7 | 686 |
687 saveAndExit 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 | |
1620 | 696 6.5 Events *nb-events* |
7 | 697 |
698 balloonEval 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 | |
707 balloonText 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. | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
711 Only when Vim is run with a GUI. |
7 | 712 New in version 2.1. |
713 | |
714 buttonRelease 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 | |
1620 | 717 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 | |
236 | 719 separator line. If col is less than 1 the button release was |
7 | 720 in the sign area. |
721 New in version 2.2. | |
722 | |
33 | 723 disconnect |
1620 | 724 Tell the Vim Controller that Vim is exiting and not to try and |
725 read or write more commands. | |
33 | 726 New in version 2.3. |
727 | |
7 | 728 fileClosed Not implemented. |
729 | |
730 fileModified Not implemented. | |
731 | |
732 fileOpened 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 | |
739 geometry 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 | |
748 insert off text | |
749 Text "text" has been inserted in Vim at position "off". | |
750 Only fired when enabled, see "startDocumentListen". | |
751 | |
752 invokeAction Not implemented. | |
753 | |
754 keyCommand 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 | |
776 keyAtPos 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 | |
1781 | 781 killed 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. | |
7 | 785 |
786 newDotAndMark 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 | |
790 quit Not implemented. | |
791 | |
792 remove off len | |
793 Text was deleted in Vim at position "off" with byte length | |
794 "len". | |
795 Only fired when enabled, see "startDocumentListen". | |
796 | |
797 revert Not implemented. | |
798 | |
799 save The buffer has been saved and is now unmodified. | |
800 Only fired when enabled, see "startDocumentListen". | |
801 | |
802 startupDone The editor has finished its startup work and is ready for | |
803 editing files. | |
804 New in version 2.1. | |
805 | |
806 unmodified The buffer is now unmodified. | |
807 Only fired when enabled, see "startDocumentListen". | |
808 | |
809 version vers Report the version of the interface implementation. Vim | |
1620 | 810 reports "2.4" (including the quotes). |
7 | 811 |
812 | |
1620 | 813 6.6 Special messages *nb-special* |
7 | 814 |
815 These messages do not follow the style of the messages above. They are | |
816 terminated by a newline character. | |
817 | |
818 ACCEPT Not used. | |
819 | |
820 AUTH 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 | |
824 DISCONNECT 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 | |
828 DETACH 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 | |
833 REJECT Not used. | |
834 | |
1620 | 835 |
836 6.7 Protocol errors *nb-protocol_errors* | |
837 | |
838 These errors occur when a message violates the protocol: | |
7876
93f747af7b58
commit https://github.com/vim/vim/commit/5e9b2fa9bb0e6061cf18457c173cd141a5dc9c92
Christian Brabandt <cb@256bit.org>
parents:
7790
diff
changeset
|
839 *E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636* |
1620 | 840 *E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646* |
8951
0bdeaf7092bc
commit https://github.com/vim/vim/commit/aa3b15dbebf333282503d6031e2f9ba6ee4398ed
Christian Brabandt <cb@256bit.org>
parents:
8148
diff
changeset
|
841 *E647* *E648* *E649* *E650* *E651* *E652* |
1620 | 842 |
843 | |
7 | 844 ============================================================================== |
2210 | 845 7. NetBeans commands *netbeans-commands* |
846 | |
2596 | 847 *:nbstart* *E511* *E838* |
2210 | 848 :nbs[tart] {connection} Start a new Netbeans session with {connection} as the |
849 socket connection parameters. The format of | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
850 {connection} is described in |netbeans-parameters|. |
2210 | 851 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. | |
146 | 858 |
859 *:nbkey* | |
3151 | 860 :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). | |
1620 | 870 |
146 | 871 |
872 ============================================================================== | |
1620 | 873 8. Known problems *netbeans-problems* |
7 | 874 |
875 NUL bytes are not possible. For editor -> IDE they will appear as NL | |
876 characters. For IDE -> editor they cannot be inserted. | |
877 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
878 A NetBeans session may be initiated with Vim running in a terminal, and |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
879 continued later in a GUI environment after running the |:gui| command. In this |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
880 case, the highlighting defined for the NetBeans annotations may be cleared |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
881 when the ":gui" command sources .gvimrc and this file loads a colorscheme |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
882 that runs the command ":highlight clear". |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
883 New in version 2.5. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
884 |
7 | 885 |
1620 | 886 ============================================================================== |
887 9. Debugging NetBeans protocol *netbeans-debugging* | |
888 | |
889 To debug the Vim protocol, you must first compile Vim with debugging support | |
890 and NetBeans debugging support. See |netbeans-configure| for instructions | |
891 about Vim compiling and how to enable debug support. | |
892 | |
893 When running Vim, set the following environment variables: | |
894 | |
895 export SPRO_GVIM_DEBUG=netbeans.log | |
896 export SPRO_GVIM_DLEVEL=0xffffffff | |
897 | |
898 Vim will then log all the incoming and outgoing messages of the NetBeans | |
899 protocol to the file netbeans.log . | |
900 | |
901 The content of netbeans.log after a session looks like this: | |
902 Tue May 20 17:19:27 2008 | |
903 EVT: 0:startupDone=0 | |
904 CMD 1: (1) create | |
905 CMD 2: (1) setTitle "testfile1.txt" | |
906 CMD 3: (1) setFullName "testfile1.txt" | |
907 EVT(suppressed): 1:remove=3 0 -1 | |
908 EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F | |
909 CMD 4: (1) initDone | |
910 FUN 5: (0) getCursor | |
911 REP 5: 1 1 0 0 | |
912 CMD 6: (2) create | |
913 CMD 7: (2) setTitle "testfile2.txt" | |
914 CMD 8: (2) setFullName "testfile2.txt" | |
915 EVT(suppressed): 2:remove=8 0 -1 | |
916 EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F | |
917 CMD 9: (2) initDone | |
918 | |
919 | |
920 ============================================================================== | |
921 10. NetBeans External Editor | |
922 | |
923 NOTE: This information is obsolete! Only relevant if you are using an old | |
924 version of NetBeans. | |
925 | |
926 | |
927 10.1. Downloading NetBeans *netbeans-download* | |
928 | |
929 The NetBeans IDE is available for download from netbeans.org. You can download | |
930 a released version, download sources, or use CVS to download the current | |
931 source tree. If you choose to download sources, follow directions from | |
932 netbeans.org on building NetBeans. | |
933 | |
934 Depending on the version of NetBeans you download, you may need to do further | |
935 work to get the required External Editor module. This is the module which lets | |
936 NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org | |
937 for details on downloading this module if your NetBeans release does not have | |
938 it. | |
939 | |
940 For C, C++, and Fortran support you will also need the cpp module. See | |
941 http://cpp.netbeans.org for information regarding this module. | |
942 | |
943 You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day | |
944 free trial. See http://www.sun.com for further details. | |
945 | |
946 | |
947 10.2. NetBeans Key Bindings *netbeans-keybindings* | |
948 | |
949 Vim understands a number of key bindings that execute NetBeans commands. | |
950 These are typically all the Function key combinations. To execute a NetBeans | |
951 command, the user must press the Pause key followed by a NetBeans key binding. | |
952 For 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 | |
954 breakpoint at the current line, press "Pause Shift F8". | |
955 | |
956 The Pause key is Function key 21. If you don't have a working Pause key and | |
957 want to use F8 instead, use: > | |
958 | |
959 :map <F8> <F21> | |
960 | |
961 The External Editor module dynamically reads the NetBeans key bindings so vim | |
962 should always have the latest key bindings, even when NetBeans changes them. | |
963 | |
964 | |
965 10.3. Preparing NetBeans for Vim *netbeans-preparation* | |
966 | |
967 In order for NetBeans to work with vim, the NetBeans External Editor module | |
968 must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition | |
969 then this module should be loaded and enabled. If you have a NetBeans release | |
970 you may need to find another way of obtaining this open source module. | |
971 | |
972 You can check if you have this module by opening the Tools->Options dialog | |
973 and drilling down to the "Modules" list (IDE Configuration->System->Modules). | |
974 If your Modules list has an entry for "External Editor" you must make sure | |
975 it is enabled (the "Enabled" property should have the value "True"). If your | |
976 Modules list has no External Editor see the next section on |obtaining-exted|. | |
977 | |
978 | |
979 10.4. Obtaining the External Editor Module *obtaining-exted* | |
980 | |
981 There are 2 ways of obtaining the External Editor module. The easiest way | |
982 is to use the NetBeans Update Center to download and install the module. | |
983 Unfortunately, some versions do not have this module in their update | |
984 center. If you cannot download via the update center you will need to | |
985 download sources and build the module. I will try and get the module | |
986 available from the NetBeans Update Center so building will be unnecessary. | |
987 Also check http://externaleditor.netbeans.org for other availability options. | |
988 | |
989 To download the External Editor sources via CVS and build your own module, | |
990 see http://externaleditor.netbeans.org and http://www.netbeans.org. | |
991 Unfortunately, this is not a trivial procedure. | |
992 | |
993 | |
994 10.5. Setting up NetBeans to run with Vim *netbeans-setup* | |
995 | |
996 Assuming you have loaded and enabled the NetBeans External Editor module | |
997 as described in |netbeans-preparation| all you need to do is verify that | |
998 the gvim command line is properly configured for your environment. | |
999 | |
1000 Open the Tools->Options dialog and open the Editing category. Select the | |
1001 External Editor. The right hand pane should contain a Properties tab and | |
1002 an Expert tab. In the Properties tab make sure the "Editor Type" is set | |
1003 to "Vim". In the Expert tab make sure the "Vim Command" is correct. | |
1004 | |
1005 You should be careful if you change the "Vim Command". There are command | |
1006 line options there which must be there for the connection to be properly | |
1007 set up. You can change the command name but that's about it. If your gvim | |
11473 | 1008 can be found by your $PATH then the Vim Command can start with "gvim". If |
1620 | 1009 you don't want gvim searched from your $PATH then hard code in the full |
1010 Unix path name. At this point you should get a gvim for any source file | |
1011 you open in NetBeans. | |
1012 | |
1013 If some files come up in gvim and others (with different file suffixes) come | |
1014 up in the default NetBeans editor you should verify the MIME type in the | |
1015 Expert tab MIME Type property. NetBeans is MIME oriented and the External | |
1016 Editor will only open MIME types specified in this property. | |
1017 | |
1018 | |
14421 | 1019 vim:tw=78:ts=8:noet:ft=help:norl: |