Mercurial > vim
annotate runtime/doc/netbeans.txt @ 34387:e6defaa1e46a v9.1.0120
patch 9.1.0120: hard to get visual region using Vim script
Commit: https://github.com/vim/vim/commit/3f905ab3c4f66562f4a224bf00f49d98a0b0da91
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Wed Feb 21 00:02:45 2024 +0100
patch 9.1.0120: hard to get visual region using Vim script
Problem: hard to get visual region using Vim script
Solution: Add getregion() Vim script function
(Shougo Matsushita, Jakub ?uczy?ski)
closes: #13998
closes: #11579
Co-authored-by: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= <doubleloop@o2.pl>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 21 Feb 2024 00:15:02 +0100 |
parents | 4635e43f2c6f |
children | 7191ebc28df2 |
rev | line source |
---|---|
34057
4635e43f2c6f
patch 9.1.0000: Vim 9.1 release
Christian Brabandt <cb@256bit.org>
parents:
33840
diff
changeset
|
1 *netbeans.txt* For Vim version 9.1. Last change: 2023 Nov 26 |
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 | |
20087
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
43 Active project using the NetBeans protocol of Vim: |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
44 - Eclim, http://eclim.org/ |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
45 |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
46 VimIntegration, description of various projects doing Vim Integration: |
1620 | 47 http://www.freehackers.org/VimIntegration |
20087
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
48 |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
49 Projects using the NetBeans protocol of Vim are or were: |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
50 - Agide, an IDE for the AAP project, written in Python (now replaced by |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
51 |:Termdebug|): http://www.a-a-p.org |
1620 | 52 - Clewn, a gdb integration into Vim, written in C: |
53 http://clewn.sourceforge.net/ | |
2210 | 54 - Pyclewn, a gdb integration into Vim, written in Python: |
55 http://pyclewn.sourceforge.net/ | |
20087
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
56 - VimWrapper, library to easy Vim integration into IDE: |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
57 http://www.freehackers.org/VimWrapper |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
58 Outdated projects (links don't work): |
1620 | 59 - VimPlugin, integration of Vim inside Eclipse: |
60 http://vimplugin.sourceforge.net/wiki/pmwiki.php | |
61 - PIDA, IDE written in Python integrating Vim: | |
62 http://pida.co.uk/ | |
63 | |
64 Check the specific project pages to see how to use Vim with these projects. | |
65 | |
9533
9f921133ee90
commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents:
8951
diff
changeset
|
66 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
|
67 |
1620 | 68 In the rest of this help page, we will use the term "Vim Controller" to |
69 describe the program controlling Vim through the NetBeans socket interface. | |
70 | |
71 | |
72 About the NetBeans IDE ~ | |
73 | |
7 | 74 NetBeans is an open source Integrated Development Environment developed |
75 jointly by Sun Microsystems, Inc. and the netbeans.org developer community. | |
76 Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added | |
77 in recent releases. | |
78 | |
1620 | 79 For more information visit the main NetBeans web site http://www.netbeans.org. |
1668 | 80 The External Editor is now, unfortunately, declared obsolete. See |
1620 | 81 http://externaleditor.netbeans.org. |
7 | 82 |
83 Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio. | |
84 Visit http://www.sun.com for more information regarding the Sun ONE Studio | |
85 product line. | |
86 | |
87 Current releases of NetBeans provide full support for Java and limited support | |
236 | 88 for C, C++, and Fortran. Current releases of Sun ONE Studio provide full |
7 | 89 support for Java, C, C++, and Fortran. |
90 | |
91 ============================================================================== | |
1620 | 92 2. Integration features *netbeans-integration* |
7 | 93 |
1620 | 94 The NetBeans socket interface of Vim allows to get information from Vim or to |
95 ask Vim to perform specific actions: | |
96 - get information about buffer: buffer name, cursor position, buffer content, | |
97 etc. | |
98 - be notified when buffers are open or closed | |
99 - be notified of how the buffer content is modified | |
100 - load and save files | |
101 - modify the buffer content | |
102 - installing special key bindings | |
103 - raise the window, control the window geometry | |
7 | 104 |
1620 | 105 For sending key strokes to Vim or for evaluating functions in Vim, you must |
106 use the |clientserver| interface. | |
7 | 107 |
108 | |
109 ============================================================================== | |
110 3. Configuring Vim for NetBeans *netbeans-configure* | |
111 | |
2207
b17bbfa96fa0
Add the settabvar() and gettabvar() functions.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
112 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
|
113 Manual. |
7 | 114 |
115 | |
1620 | 116 On Unix: |
117 -------- | |
7 | 118 |
119 When running configure without arguments the NetBeans interface should be | |
120 included. That is, if the configure check to find out if your system supports | |
121 the required features succeeds. | |
122 | |
123 In case you do not want the NetBeans interface you can disable it by | |
124 uncommenting a line with "--disable-netbeans" in the Makefile. | |
125 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
126 Currently the NetBeans interface is supported by Vim running in a terminal and |
28379 | 127 by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows |
128 and Motif. | |
7 | 129 |
15510
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
130 *netbeans-xpm* |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
131 If Motif support is required the user must supply XPM libraries. |
28379 | 132 The XPM library is required to show images within Vim with Motif. |
15510
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
133 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
|
134 |
41fbbcea0f1b
patch 8.1.0763: nobody is using the Sun Workshop support
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
135 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
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 xpm directory you will need to change the XPM_DIR in src/Makefile. |
7 | 142 |
143 | |
1620 | 144 On MS-Windows: |
145 -------------- | |
7 | 146 |
147 The Win32 support is now in beta stage. | |
148 | |
149 To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile | |
150 XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/ | |
151 (for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW). | |
152 | |
1620 | 153 Enable debugging: |
154 ----------------- | |
7 | 155 |
1620 | 156 To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro |
157 needs to be defined. Search in the Makefile of the platform you are using for | |
158 "NBDEBUG" to see what line needs to be uncommented. This effectively adds | |
159 "-DNBDEBUG" to the compile command. Also see |netbeans-debugging| | |
7 | 160 |
161 ============================================================================== | |
1620 | 162 4. Error Messages *netbeans-messages* |
7 | 163 |
1620 | 164 These error messages are specific to NetBeans socket protocol: |
7 | 165 |
166 *E463* | |
167 Region is guarded, cannot modify | |
1620 | 168 The Vim Controller has defined guarded areas in the text, |
169 which you cannot change. Also sets the current buffer, if | |
170 necessary. | |
7 | 171 |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
172 *E532* |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
173 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
|
174 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
|
175 defineAnnoType command is 32 characters. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
176 New in version 2.5. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
177 |
7 | 178 *E656* |
1620 | 179 Writes of unmodified buffers forbidden |
180 Writes of unmodified buffers that were opened from the | |
181 Vim Controller are not possible. | |
7 | 182 |
183 *E657* | |
1620 | 184 Partial writes disallowed |
185 Partial writes for buffers that were opened from the | |
186 Vim Controller are not allowed. | |
7 | 187 |
188 *E658* | |
1620 | 189 Connection lost for this buffer |
190 The Vim Controller has become confused about the state of | |
191 this file. Rather than risk data corruption, it has severed | |
192 the connection for this file. Vim will take over | |
193 responsibility for saving changes to this file and the | |
194 Vim Controller will no longer know of these changes. | |
7 | 195 |
146 | 196 *E744* |
1620 | 197 Read-only file |
146 | 198 Vim normally allows changes to a read-only file and only |
199 enforces the read-only rule if you try to write the file. | |
200 However, NetBeans does not let you make changes to a file | |
1620 | 201 which is read-only and becomes confused if Vim does this. |
202 So Vim does not allow modifications to files when run | |
203 in NetBeans mode. | |
204 | |
7 | 205 ============================================================================== |
1620 | 206 5. Running Vim in NetBeans mode *netbeans-run* |
7 | 207 |
2210 | 208 There are two different ways to run Vim in NetBeans mode: |
209 | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
210 + 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
|
211 + NetBeans can be started from within Vim with the |:nbstart| command |
2210 | 212 |
8148
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
7876
diff
changeset
|
213 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
|
214 |
2210 | 215 *netbeans-parameters* |
216 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
|
217 When started from the command line, the |-nb| command line argument may be: |
7 | 218 |
219 -nb={fname} from a file | |
220 -nb:{hostname}:{addr}:{password} directly | |
221 -nb from a file or environment | |
222 | |
2337
a0f87fc19d1d
Better conceal in help. (partly by Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2210
diff
changeset
|
223 When started from within Vim, the |:nbstart| optional argument may be: |
2210 | 224 |
225 ={fname} from a file | |
226 :{hostname}:{addr}:{password} directly | |
227 <MISSING ARGUMENT> from a file or environment | |
228 | |
7 | 229 *E660* *E668* |
2210 | 230 When NetBeans is started from the command line, for security reasons, the best |
231 method is to write the information in a file readable only by the user. The | |
232 name of the file can be passed with the "-nb={fname}" argument or, when "-nb" | |
233 is used without a parameter, the environment variable "__NETBEANS_CONINFO". | |
234 The file must contain these three lines, in any order: | |
7 | 235 |
236 host={hostname} | |
237 port={addr} | |
238 auth={password} | |
239 | |
2210 | 240 Other lines are ignored. The Vim Controller is responsible for deleting the |
7 | 241 file afterwards. |
242 | |
1620 | 243 {hostname} is the name of the machine where Vim Controller is running. When |
244 omitted the environment variable "__NETBEANS_HOST" is used or the default | |
245 "localhost". | |
7 | 246 |
1620 | 247 {addr} is the port number for the NetBeans interface. When omitted the |
248 environment variable "__NETBEANS_SOCKET" is used or the default 3219. | |
7 | 249 |
250 {password} is the password for connecting to NetBeans. When omitted the | |
251 environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme". | |
252 | |
1620 | 253 Vim will initiate a socket connection (client side) to the specified host and |
254 port upon startup. The password will be sent with the AUTH event when the | |
255 connection has been established. | |
256 | |
7 | 257 |
1620 | 258 ============================================================================== |
259 6. NetBeans protocol *netbeans-protocol* | |
260 | |
261 The communication between the Vim Controller and Vim uses plain text | |
262 messages. This protocol was first designed to work with the external editor | |
263 module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE, | |
264 see http://www.a-a-p.org) and then with other IDE. The extensions are marked | |
265 with "version 2.1". | |
7 | 266 |
236 | 267 Version 2.2 of the protocol has several minor changes which should only affect |
268 NetBeans users (ie, not Agide users). However, a bug was fixed which could | |
269 cause confusion. The netbeans_saved() function sent a "save" protocol | |
270 command. In protocol version 2.1 and earlier this was incorrectly interpreted | |
271 as a notification that a write had taken place. In reality, it told NetBeans | |
272 to save the file so multiple writes were being done. This caused various | |
273 problems and has been fixed in 2.2. To decrease the likelihood of this | |
7 | 274 confusion happening again, netbeans_saved() has been renamed to |
275 netbeans_save_buffer(). | |
276 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
277 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
|
278 "2.5" below. |
718 | 279 |
7 | 280 The messages are currently sent over a socket. Since the messages are in |
281 plain UTF-8 text this protocol could also be used with any other communication | |
282 mechanism. | |
283 | |
3151 | 284 Netbeans messages are processed when Vim is idle, waiting for user input. |
285 When Vim is run in non-interactive mode, for example when running an automated | |
286 test case that sources a Vim script, the idle loop may not be called often | |
3312 | 287 enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep| |
3151 | 288 command does invoke Netbeans messages processing. |
289 | |
1620 | 290 6.1 Kinds of messages |nb-messages| |
291 6.2 Terms |nb-terms| | |
292 6.3 Commands |nb-commands| | |
293 6.4 Functions and Replies |nb-functions| | |
294 6.5 Events |nb-events| | |
295 6.6 Special messages |nb-special| | |
296 6.7 Protocol errors |nb-protocol_errors| | |
718 | 297 |
298 | |
1620 | 299 6.1 Kinds of messages *nb-messages* |
7 | 300 |
301 There are four kinds of messages: | |
302 | |
303 kind direction comment ~ | |
304 Command IDE -> editor no reply necessary | |
305 Function IDE -> editor editor must send back a reply | |
306 Reply editor -> IDE only in response to a Function | |
307 Event editor -> IDE no reply necessary | |
308 | |
309 The messages are sent as a single line with a terminating newline character. | |
310 Arguments are separated by a single space. The first item of the message | |
311 depends on the kind of message: | |
312 | |
313 kind first item example ~ | |
314 Command bufID:name!seqno 11:showBalloon!123 "text" | |
315 Function bufID:name/seqno 11:getLength/123 | |
316 Reply seqno 123 5000 | |
1620 | 317 Event bufID:name=seqno 11:keyCommand=123 "S-F2" |
7 | 318 |
319 | |
1620 | 320 |
321 6.2 Terms *nb-terms* | |
7 | 322 |
323 bufID Buffer number. A message may be either for a specific buffer | |
324 or generic. Generic messages use a bufID of zero. NOTE: this | |
325 buffer ID is assigned by the IDE, it is not Vim's buffer | |
326 number. The bufID must be a sequentially rising number, | |
6697 | 327 starting at one. When the 'switchbuf' option is set to |
328 "usetab" and the "bufID" buffer is not found in the current | |
329 tab page, the netbeans commands and functions that set this | |
330 buffer as the current buffer will jump to the first open | |
331 window that contains this buffer in other tab pages instead of | |
332 replacing the buffer in the current window. | |
7 | 333 |
334 seqno The IDE uses a sequence number for Commands and Functions. A | |
335 Reply must use the sequence number of the Function that it is | |
336 associated with. A zero sequence number can be used for | |
337 Events (the seqno of the last received Command or Function can | |
338 also be used). | |
339 | |
340 string Argument in double quotes. Text is in UTF-8 encoding. This | |
341 means ASCII is passed as-is. Special characters are | |
342 represented with a backslash: | |
343 \" double quote | |
344 \n newline | |
345 \r carriage-return | |
346 \t tab (optional, also works literally) | |
347 \\ backslash | |
348 NUL bytes are not allowed! | |
349 | |
350 boolean Argument with two possible values: | |
351 T true | |
352 F false | |
353 | |
354 number Argument with a decimal number. | |
355 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
356 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
|
357 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
|
358 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
|
359 list in |gui-colors|. |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
360 New in version 2.5. |
7 | 361 |
362 offset A number argument that indicates a byte position in a buffer. | |
363 The first byte has offset zero. Line breaks are counted for | |
364 how they appear in the file (CR/LF counts for two bytes). | |
21991 | 365 Note that a multibyte character is counted for the number of |
7 | 366 bytes it takes. |
367 | |
368 lnum/col Argument with a line number and column number position. The | |
369 line number starts with one, the column is the byte position, | |
21991 | 370 starting with zero. Note that a multibyte character counts |
7 | 371 for several columns. |
372 | |
373 pathname String argument: file name with full path. | |
374 | |
375 | |
1620 | 376 6.3 Commands *nb-commands* |
7 | 377 |
378 actionMenuItem Not implemented. | |
379 | |
380 actionSensitivity | |
381 Not implemented. | |
382 | |
383 addAnno serNum typeNum off len | |
384 Place an annotation in this buffer. | |
385 Arguments: | |
386 serNum number serial number of this placed | |
387 annotation, used to be able to remove | |
388 it | |
389 typeNum number sequence number of the annotation | |
390 defined with defineAnnoType for this | |
391 buffer | |
392 off number offset where annotation is to be placed | |
393 len number not used | |
394 In version 2.1 "lnum/col" can be used instead of "off". | |
395 | |
396 balloonResult text | |
397 Not implemented. | |
398 | |
399 close Close the buffer. This leaves us without current buffer, very | |
400 dangerous to use! | |
401 | |
402 create Creates a buffer without a name. Replaces the current buffer | |
403 (it's hidden when it was changed). | |
1620 | 404 The Vim Controller should use this as the first command for a |
405 file that is being opened. The sequence of commands could be: | |
7 | 406 create |
407 setCaretListener (ignored) | |
408 setModified (no effect) | |
409 setContentType (ignored) | |
410 startDocumentListen | |
411 setTitle | |
412 setFullName | |
413 | |
414 defineAnnoType typeNum typeName tooltip glyphFile fg bg | |
415 Define a type of annotation for this buffer. | |
416 Arguments: | |
417 typeNum number sequence number (not really used) | |
418 typeName string name that identifies this annotation | |
419 tooltip string not used | |
420 glyphFile string name of icon file | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
421 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
|
422 bg color background color for line highlighting |
7 | 423 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
|
424 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
|
425 Blue values of the color (see |gui-colors|) and the |
14347 | 426 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
|
427 When color is a name, this color is defined both for Vim |
14347 | 428 running in a color terminal and for gVim. |
7 | 429 When both "fg" and "bg" are "none" no line highlighting is |
430 used (new in version 2.1). | |
431 When "glyphFile" is empty, no text sign is used (new in | |
432 version 2.1). | |
433 When "glyphFile" is one or two characters long, a text sign is | |
434 defined (new in version 2.1). | |
435 Note: the annotations will be defined in sequence, and the | |
436 sequence number is later used with addAnno. | |
437 | |
438 editFile pathname | |
439 Set the name for the buffer and edit the file "pathname", a | |
440 string argument. | |
1620 | 441 Normal way for the IDE to tell the editor to edit a file. |
442 | |
443 You must set a bufId different of 0 with this command to | |
444 assign a bufId to the buffer. It will trigger an event | |
445 fileOpened with a bufId of 0 but the buffer has been assigned. | |
446 | |
447 If the IDE is going to pass the file text to the editor use | |
448 these commands instead: | |
7 | 449 setFullName |
450 insert | |
451 initDone | |
452 New in version 2.1. | |
453 | |
454 enableBalloonEval | |
455 Not implemented. | |
456 | |
457 endAtomic End an atomic operation. The changes between "startAtomic" | |
458 and "endAtomic" can be undone as one operation. But it's not | |
459 implemented yet. Redraw when necessary. | |
460 | |
461 guard off len | |
462 Mark an area in the buffer as guarded. This means it cannot | |
463 be edited. "off" and "len" are numbers and specify the text | |
464 to be guarded. | |
465 | |
466 initDone Mark the buffer as ready for use. Implicitly makes the buffer | |
467 the current buffer. Fires the BufReadPost autocommand event. | |
468 | |
20087
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
469 insertDone starteol readonly |
1620 | 470 Sent by Vim Controller to tell Vim an initial file insert is |
20087
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
471 done. This triggers a read message being printed. If |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
472 "starteol" is "F" then the last line doesn't have a EOL. If |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
473 "readonly" is "T" then the file is marked as readonly. Prior |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
474 to version 2.3, no read messages were displayed after opening |
b378f860d4ab
patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
475 a file. New in version 2.3. |
33 | 476 |
7 | 477 moveAnnoToFront serNum |
478 Not implemented. | |
479 | |
480 netbeansBuffer isNetbeansBuffer | |
1668 | 481 If "isNetbeansBuffer" is "T" then this buffer is "owned" by |
7 | 482 NetBeans. |
483 New in version 2.2. | |
484 | |
485 putBufferNumber pathname | |
486 Associate a buffer number with the Vim buffer by the name | |
487 "pathname", a string argument. To be used when the editor | |
488 reported editing another file to the IDE and the IDE needs to | |
489 tell the editor what buffer number it will use for this file. | |
490 Also marks the buffer as initialized. | |
491 New in version 2.1. | |
492 | |
493 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
|
494 Only when Vim is run with a GUI. |
7 | 495 New in version 2.1. |
496 | |
497 removeAnno serNum | |
6259 | 498 Remove a previously placed annotation for this buffer. |
7 | 499 "serNum" is the same number used in addAnno. |
500 | |
501 save Save the buffer when it was modified. The other side of the | |
502 interface is expected to write the buffer and invoke | |
503 "setModified" to reset the "changed" flag of the buffer. | |
504 The writing is skipped when one of these conditions is true: | |
505 - 'write' is not set | |
506 - the buffer is read-only | |
507 - the buffer does not have a file name | |
508 - 'buftype' disallows writing | |
509 New in version 2.2. | |
510 | |
33 | 511 saveDone |
1620 | 512 Sent by Vim Controller to tell Vim a save is done. This |
513 triggers a save message being printed. Prior to version 2.3, | |
514 no save messages were displayed after a save. | |
33 | 515 New in version 2.3. |
516 | |
7 | 517 setAsUser Not implemented. |
518 | |
519 setBufferNumber pathname | |
520 Associate a buffer number with Vim buffer by the name | |
521 "pathname". To be used when the editor reported editing | |
522 another file to the IDE and the IDE needs to tell the editor | |
523 what buffer number it will use for this file. | |
524 Has the side effect of making the buffer the current buffer. | |
525 See "putBufferNumber" for a more useful command. | |
526 | |
527 setContentType | |
528 Not implemented. | |
529 | |
530 setDot off Make the buffer the current buffer and set the cursor at the | |
659 | 531 specified position. If the buffer is open in another window |
532 than make that window the current window. | |
533 If there are folds they are opened to make the cursor line | |
534 visible. | |
7 | 535 In version 2.1 "lnum/col" can be used instead of "off". |
536 | |
537 setExitDelay seconds | |
538 Set the delay for exiting to "seconds", a number. | |
539 This delay is used to give the IDE a chance to handle things | |
540 before really exiting. The default delay is two seconds. | |
541 New in version 2.1. | |
33 | 542 Obsolete in version 2.3. |
7 | 543 |
544 setFullName pathname | |
545 Set the file name to be used for a buffer to "pathname", a | |
546 string argument. | |
547 Used when the IDE wants to edit a file under control of the | |
548 IDE. This makes the buffer the current buffer, but does not | |
549 read the file. "insert" commands will be used next to set the | |
550 contents. | |
551 | |
552 setLocAndSize Not implemented. | |
553 | |
554 setMark Not implemented. | |
555 | |
556 setModified modified | |
557 When the boolean argument "modified" is "T" mark the buffer as | |
558 modified, when it is "F" mark it as unmodified. | |
559 | |
33 | 560 setModtime time |
1620 | 561 Update a buffers modification time after the file has been |
562 saved directly by the Vim Controller. | |
33 | 563 New in version 2.3. |
564 | |
22788
c8a4ad051d23
patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
565 setReadOnly readonly |
c8a4ad051d23
patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
566 When the boolean argument "readonly" is "T" for True, mark the |
c8a4ad051d23
patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
567 buffer as readonly, when it is "F" for False, mark it as not |
c8a4ad051d23
patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents:
21991
diff
changeset
|
568 readonly. Implemented in version 2.3. |
7 | 569 |
570 setStyle Not implemented. | |
571 | |
572 setTitle name | |
573 Set the title for the buffer to "name", a string argument. | |
1620 | 574 The title is only used for the Vim Controller functions, not |
575 by Vim. | |
7 | 576 |
577 setVisible visible | |
578 When the boolean argument "visible" is "T", goto the buffer. | |
579 The "F" argument does nothing. | |
580 | |
581 showBalloon text | |
582 Show a balloon (popup window) at the mouse pointer position, | |
583 containing "text", a string argument. The balloon should | |
584 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
|
585 Only when Vim is run with a GUI. |
7 | 586 New in version 2.1. |
587 | |
33 | 588 specialKeys |
589 Map a set of keys (mostly function keys) to be passed back | |
1620 | 590 to the Vim Controller for processing. This lets regular IDE |
591 hotkeys be used from Vim. | |
33 | 592 Implemented in version 2.3. |
7 | 593 |
594 startAtomic Begin an atomic operation. The screen will not be updated | |
595 until "endAtomic" is given. | |
596 | |
597 startCaretListen | |
598 Not implemented. | |
599 | |
600 startDocumentListen | |
601 Mark the buffer to report changes to the IDE with the | |
602 "insert" and "remove" events. The default is to report | |
603 changes. | |
604 | |
605 stopCaretListen | |
606 Not implemented. | |
607 | |
608 stopDocumentListen | |
609 Mark the buffer to stop reporting changes to the IDE. | |
610 Opposite of startDocumentListen. | |
153 | 611 NOTE: if "netbeansBuffer" was used to mark this buffer as a |
612 NetBeans buffer, then the buffer is deleted in Vim. This is | |
613 for compatibility with Sun Studio 10. | |
7 | 614 |
615 unguard off len | |
616 Opposite of "guard", remove guarding for a text area. | |
659 | 617 Also sets the current buffer, if necessary. |
7 | 618 |
619 version Not implemented. | |
620 | |
621 | |
1620 | 622 6.4 Functions and Replies *nb-functions* |
7 | 623 |
624 getDot Not implemented. | |
625 | |
626 getCursor Return the current buffer and cursor position. | |
627 The reply is: | |
628 seqno bufID lnum col off | |
629 seqno = sequence number of the function | |
630 bufID = buffer ID of the current buffer (if this is unknown -1 | |
631 is used) | |
632 lnum = line number of the cursor (first line is one) | |
633 col = column number of the cursor (in bytes, zero based) | |
634 off = offset of the cursor in the buffer (in bytes) | |
635 New in version 2.1. | |
636 | |
637 getLength Return the length of the buffer in bytes. | |
638 Reply example for a buffer with 5000 bytes: | |
639 123 5000 | |
640 TODO: explain use of partial line. | |
641 | |
642 getMark Not implemented. | |
643 | |
1037 | 644 getAnno serNum |
645 Return the line number of the annotation in the buffer. | |
646 Argument: | |
647 serNum serial number of this placed annotation | |
648 The reply is: | |
649 123 lnum line number of the annotation | |
650 123 0 invalid annotation serial number | |
651 New in version 2.4. | |
652 | |
7 | 653 getModified When a buffer is specified: Return zero if the buffer does not |
654 have changes, one if it does have changes. | |
655 When no buffer is specified (buffer number zero): Return the | |
656 number of buffers with changes. When the result is zero it's | |
657 safe to tell Vim to exit. | |
658 New in version 2.1. | |
659 | |
660 getText Return the contents of the buffer as a string. | |
661 Reply example for a buffer with two lines | |
662 123 "first line\nsecond line\n" | |
663 NOTE: docs indicate an offset and length argument, but this is | |
664 not implemented. | |
665 | |
666 insert off text | |
667 Insert "text" before position "off". "text" is a string | |
668 argument, "off" a number. | |
1620 | 669 "text" should have a "\n" (newline) at the end of each line. |
718 | 670 Or "\r\n" when 'fileformat' is "dos". When using "insert" in |
671 an empty buffer Vim will set 'fileformat' accordingly. | |
672 When "off" points to the start of a line the text is inserted | |
673 above this line. Thus when "off" is zero lines are inserted | |
674 before the first line. | |
675 When "off" points after the start of a line, possibly on the | |
676 NUL at the end of a line, the first line of text is appended | |
677 to this line. Further lines come below it. | |
7 | 678 Possible replies: |
679 123 no problem | |
680 123 !message failed | |
681 Note that the message in the reply is not quoted. | |
659 | 682 Also sets the current buffer, if necessary. |
718 | 683 Does not move the cursor to the changed text. |
684 Resets undo information. | |
7 | 685 |
686 remove off length | |
687 Delete "length" bytes of text at position "off". Both | |
688 arguments are numbers. | |
689 Possible replies: | |
690 123 no problem | |
691 123 !message failed | |
692 Note that the message in the reply is not quoted. | |
659 | 693 Also sets the current buffer, if necessary. |
7 | 694 |
695 saveAndExit Perform the equivalent of closing Vim: ":confirm qall". | |
696 If there are no changed files or the user does not cancel the | |
697 operation Vim exits and no result is sent back. The IDE can | |
698 consider closing the connection as a successful result. | |
699 If the user cancels the operation the number of modified | |
700 buffers that remains is returned and Vim does not exit. | |
701 New in version 2.1. | |
702 | |
703 | |
1620 | 704 6.5 Events *nb-events* |
7 | 705 |
706 balloonEval off len type | |
707 The mouse pointer rests on text for a short while. When "len" | |
708 is zero, there is no selection and the pointer is at position | |
709 "off". When "len" is non-zero the text from position "off" to | |
710 "off" + "len" is selected. | |
711 Only sent after "enableBalloonEval" was used for this buffer. | |
712 "type" is not yet defined. | |
713 Not implemented yet. | |
714 | |
715 balloonText text | |
716 Used when 'ballooneval' is set and the mouse pointer rests on | |
717 some text for a moment. "text" is a string, the text under | |
718 the mouse pointer. | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
719 Only when Vim is run with a GUI. |
7 | 720 New in version 2.1. |
721 | |
722 buttonRelease button lnum col | |
723 Report which button was pressed and the location of the cursor | |
724 at the time of the release. Only for buffers that are owned | |
1620 | 725 by the Vim Controller. This event is not sent if the button |
726 was released while the mouse was in the status line or in a | |
236 | 727 separator line. If col is less than 1 the button release was |
7 | 728 in the sign area. |
729 New in version 2.2. | |
730 | |
33 | 731 disconnect |
1620 | 732 Tell the Vim Controller that Vim is exiting and not to try and |
733 read or write more commands. | |
33 | 734 New in version 2.3. |
735 | |
7 | 736 fileClosed Not implemented. |
737 | |
738 fileModified Not implemented. | |
739 | |
740 fileOpened pathname open modified | |
741 A file was opened by the user. | |
742 Arguments: | |
743 pathname string name of the file | |
744 open boolean always "T" | |
745 modified boolean always "F" | |
746 | |
747 geometry cols rows x y | |
748 Report the size and position of the editor window. | |
749 Arguments: | |
750 cols number number of text columns | |
751 rows number number of text rows | |
752 x number pixel position on screen | |
753 y number pixel position on screen | |
754 Only works for Motif. | |
755 | |
756 insert off text | |
757 Text "text" has been inserted in Vim at position "off". | |
758 Only fired when enabled, see "startDocumentListen". | |
759 | |
760 invokeAction Not implemented. | |
761 | |
762 keyCommand keyName | |
763 Reports a special key being pressed with name "keyName", which | |
764 is a string. | |
765 Supported key names: | |
766 F1 function key 1 | |
767 F2 function key 2 | |
768 ... | |
769 F12 function key 12 | |
770 | |
771 ' ' space (without the quotes) | |
772 ! exclamation mark | |
773 ... any other ASCII printable character | |
774 ~ tilde | |
775 | |
776 X any unrecognized key | |
777 | |
778 The key may be prepended by "C", "S" and/or "M" for Control, | |
779 Shift and Meta (Alt) modifiers. If there is a modifier a dash | |
780 is used to separate it from the key name. For example: | |
781 "C-F2". | |
782 ASCII characters are new in version 2.1. | |
783 | |
784 keyAtPos keyName lnum/col | |
785 Like "keyCommand" and also report the line number and column | |
786 of the cursor. | |
787 New in version 2.1. | |
788 | |
1781 | 789 killed A file was deleted or wiped out by the user and the buffer |
790 annotations have been removed. The bufID number for this | |
791 buffer has become invalid. Only for files that have been | |
792 assigned a bufID number by the IDE. | |
7 | 793 |
794 newDotAndMark off off | |
795 Reports the position of the cursor being at "off" bytes into | |
796 the buffer. Only sent just before a "keyCommand" event. | |
797 | |
798 quit Not implemented. | |
799 | |
800 remove off len | |
801 Text was deleted in Vim at position "off" with byte length | |
802 "len". | |
803 Only fired when enabled, see "startDocumentListen". | |
804 | |
805 revert Not implemented. | |
806 | |
807 save The buffer has been saved and is now unmodified. | |
808 Only fired when enabled, see "startDocumentListen". | |
809 | |
810 startupDone The editor has finished its startup work and is ready for | |
811 editing files. | |
812 New in version 2.1. | |
813 | |
814 unmodified The buffer is now unmodified. | |
815 Only fired when enabled, see "startDocumentListen". | |
816 | |
817 version vers Report the version of the interface implementation. Vim | |
1620 | 818 reports "2.4" (including the quotes). |
7 | 819 |
820 | |
1620 | 821 6.6 Special messages *nb-special* |
7 | 822 |
823 These messages do not follow the style of the messages above. They are | |
824 terminated by a newline character. | |
825 | |
826 ACCEPT Not used. | |
827 | |
828 AUTH password editor -> IDE: First message that the editor sends to the IDE. | |
829 Must contain the password for the socket server, as specified | |
830 with the |-nb| argument. No quotes are used! | |
831 | |
832 DISCONNECT IDE -> editor: break the connection. The editor will exit. | |
833 The IDE must only send this message when there are no unsaved | |
834 changes! | |
835 | |
836 DETACH IDE -> editor: break the connection without exiting the | |
837 editor. Used when the IDE exits without bringing down the | |
838 editor as well. | |
839 New in version 2.1. | |
840 | |
841 REJECT Not used. | |
842 | |
1620 | 843 |
844 6.7 Protocol errors *nb-protocol_errors* | |
845 | |
846 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
|
847 *E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636* |
1620 | 848 *E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646* |
33840
f1a17857b9b0
patch 9.0.2132: Duplicate Netbeans Error Message
Christian Brabandt <cb@256bit.org>
parents:
29314
diff
changeset
|
849 *E647* *E648* *E650* *E651* *E652* |
1620 | 850 |
851 | |
7 | 852 ============================================================================== |
2210 | 853 7. NetBeans commands *netbeans-commands* |
854 | |
2596 | 855 *:nbstart* *E511* *E838* |
2210 | 856 :nbs[tart] {connection} Start a new Netbeans session with {connection} as the |
857 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
|
858 {connection} is described in |netbeans-parameters|. |
2210 | 859 At any time, one may check if the netbeans socket is |
860 connected by running the command: | |
861 ':echo has("netbeans_enabled")' | |
862 | |
863 *:nbclose* | |
864 :nbc[lose] Close the current NetBeans session. Remove all placed | |
865 signs. | |
146 | 866 |
867 *:nbkey* | |
3151 | 868 :nb[key] {key} Pass the {key} to the Vim Controller for processing. |
869 When a hot-key has been installed with the specialKeys | |
870 command, this command can be used to generate a hotkey | |
871 message to the Vim Controller. | |
872 This command can also be used to pass any text to the | |
873 Vim Controller. It is used by Pyclewn, for example, | |
874 to build the complete set of gdb commands as Vim user | |
875 commands. | |
876 The events newDotAndMark, keyCommand and keyAtPos are | |
877 generated (in this order). | |
1620 | 878 |
146 | 879 |
880 ============================================================================== | |
1620 | 881 8. Known problems *netbeans-problems* |
7 | 882 |
883 NUL bytes are not possible. For editor -> IDE they will appear as NL | |
884 characters. For IDE -> editor they cannot be inserted. | |
885 | |
2209
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
886 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
|
887 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
|
888 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
|
889 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
|
890 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
|
891 New in version 2.5. |
d0ddf7ba1630
Included the patch to support netbeans in a terminal.
Bram Moolenaar <bram@vim.org>
parents:
2207
diff
changeset
|
892 |
7 | 893 |
1620 | 894 ============================================================================== |
895 9. Debugging NetBeans protocol *netbeans-debugging* | |
896 | |
897 To debug the Vim protocol, you must first compile Vim with debugging support | |
898 and NetBeans debugging support. See |netbeans-configure| for instructions | |
899 about Vim compiling and how to enable debug support. | |
900 | |
901 When running Vim, set the following environment variables: | |
902 | |
903 export SPRO_GVIM_DEBUG=netbeans.log | |
904 export SPRO_GVIM_DLEVEL=0xffffffff | |
905 | |
906 Vim will then log all the incoming and outgoing messages of the NetBeans | |
907 protocol to the file netbeans.log . | |
908 | |
909 The content of netbeans.log after a session looks like this: | |
910 Tue May 20 17:19:27 2008 | |
911 EVT: 0:startupDone=0 | |
912 CMD 1: (1) create | |
913 CMD 2: (1) setTitle "testfile1.txt" | |
914 CMD 3: (1) setFullName "testfile1.txt" | |
915 EVT(suppressed): 1:remove=3 0 -1 | |
916 EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F | |
917 CMD 4: (1) initDone | |
918 FUN 5: (0) getCursor | |
919 REP 5: 1 1 0 0 | |
920 CMD 6: (2) create | |
921 CMD 7: (2) setTitle "testfile2.txt" | |
922 CMD 8: (2) setFullName "testfile2.txt" | |
923 EVT(suppressed): 2:remove=8 0 -1 | |
924 EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F | |
925 CMD 9: (2) initDone | |
926 | |
927 | |
928 ============================================================================== | |
929 10. NetBeans External Editor | |
930 | |
931 NOTE: This information is obsolete! Only relevant if you are using an old | |
932 version of NetBeans. | |
933 | |
934 | |
935 10.1. Downloading NetBeans *netbeans-download* | |
936 | |
937 The NetBeans IDE is available for download from netbeans.org. You can download | |
938 a released version, download sources, or use CVS to download the current | |
939 source tree. If you choose to download sources, follow directions from | |
940 netbeans.org on building NetBeans. | |
941 | |
942 Depending on the version of NetBeans you download, you may need to do further | |
943 work to get the required External Editor module. This is the module which lets | |
944 NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org | |
945 for details on downloading this module if your NetBeans release does not have | |
946 it. | |
947 | |
948 For C, C++, and Fortran support you will also need the cpp module. See | |
949 http://cpp.netbeans.org for information regarding this module. | |
950 | |
951 You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day | |
952 free trial. See http://www.sun.com for further details. | |
953 | |
954 | |
955 10.2. NetBeans Key Bindings *netbeans-keybindings* | |
956 | |
957 Vim understands a number of key bindings that execute NetBeans commands. | |
958 These are typically all the Function key combinations. To execute a NetBeans | |
959 command, the user must press the Pause key followed by a NetBeans key binding. | |
960 For example, in order to compile a Java file, the NetBeans key binding is | |
961 "F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a | |
962 breakpoint at the current line, press "Pause Shift F8". | |
963 | |
964 The Pause key is Function key 21. If you don't have a working Pause key and | |
965 want to use F8 instead, use: > | |
966 | |
967 :map <F8> <F21> | |
968 | |
969 The External Editor module dynamically reads the NetBeans key bindings so vim | |
970 should always have the latest key bindings, even when NetBeans changes them. | |
971 | |
972 | |
973 10.3. Preparing NetBeans for Vim *netbeans-preparation* | |
974 | |
975 In order for NetBeans to work with vim, the NetBeans External Editor module | |
976 must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition | |
977 then this module should be loaded and enabled. If you have a NetBeans release | |
978 you may need to find another way of obtaining this open source module. | |
979 | |
980 You can check if you have this module by opening the Tools->Options dialog | |
981 and drilling down to the "Modules" list (IDE Configuration->System->Modules). | |
982 If your Modules list has an entry for "External Editor" you must make sure | |
983 it is enabled (the "Enabled" property should have the value "True"). If your | |
984 Modules list has no External Editor see the next section on |obtaining-exted|. | |
985 | |
986 | |
987 10.4. Obtaining the External Editor Module *obtaining-exted* | |
988 | |
989 There are 2 ways of obtaining the External Editor module. The easiest way | |
990 is to use the NetBeans Update Center to download and install the module. | |
991 Unfortunately, some versions do not have this module in their update | |
992 center. If you cannot download via the update center you will need to | |
993 download sources and build the module. I will try and get the module | |
994 available from the NetBeans Update Center so building will be unnecessary. | |
995 Also check http://externaleditor.netbeans.org for other availability options. | |
996 | |
997 To download the External Editor sources via CVS and build your own module, | |
998 see http://externaleditor.netbeans.org and http://www.netbeans.org. | |
999 Unfortunately, this is not a trivial procedure. | |
1000 | |
1001 | |
1002 10.5. Setting up NetBeans to run with Vim *netbeans-setup* | |
1003 | |
1004 Assuming you have loaded and enabled the NetBeans External Editor module | |
1005 as described in |netbeans-preparation| all you need to do is verify that | |
1006 the gvim command line is properly configured for your environment. | |
1007 | |
1008 Open the Tools->Options dialog and open the Editing category. Select the | |
1009 External Editor. The right hand pane should contain a Properties tab and | |
1010 an Expert tab. In the Properties tab make sure the "Editor Type" is set | |
1011 to "Vim". In the Expert tab make sure the "Vim Command" is correct. | |
1012 | |
1013 You should be careful if you change the "Vim Command". There are command | |
1014 line options there which must be there for the connection to be properly | |
1015 set up. You can change the command name but that's about it. If your gvim | |
11473 | 1016 can be found by your $PATH then the Vim Command can start with "gvim". If |
1620 | 1017 you don't want gvim searched from your $PATH then hard code in the full |
1018 Unix path name. At this point you should get a gvim for any source file | |
1019 you open in NetBeans. | |
1020 | |
1021 If some files come up in gvim and others (with different file suffixes) come | |
1022 up in the default NetBeans editor you should verify the MIME type in the | |
1023 Expert tab MIME Type property. NetBeans is MIME oriented and the External | |
1024 Editor will only open MIME types specified in this property. | |
1025 | |
1026 | |
14421 | 1027 vim:tw=78:ts=8:noet:ft=help:norl: |