Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 1 | *netbeans.txt* For Vim version 7.0aa. Last change: 2005 Jan 31 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Gordon Prieur |
| 5 | |
| 6 | |
| 7 | NetBeans ExternalEditor Integration Features *netbeans* |
| 8 | *netbeans-support* |
| 9 | 1. Introduction |netbeans-intro| |
| 10 | 2. NetBeans Key Bindings |netbeans-keybindings| |
| 11 | 3. Configuring Vim for NetBeans |netbeans-configure| |
| 12 | 4. Downloading NetBeans |netbeans-download| |
| 13 | 5. Preparing NetBeans for Vim |netbeans-preparation| |
| 14 | 6. Obtaining the External Editor Module |obtaining-exted| |
| 15 | 7. Setting up NetBeans to run with Vim |netbeans-setup| |
| 16 | 8. Messages |netbeans-messages| |
| 17 | 9. Running Vim from NetBeans |netbeans-run| |
| 18 | 10. NetBeans protocol |netbeans-protocol| |
Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 19 | 11. NetBeans commands |netbeans-commands| |
| 20 | 12. Known problems |netbeans-problems| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 21 | |
| 22 | {Vi does not have any of these features} |
| 23 | {only available when compiled with the |+netbeans_intg| feature} |
| 24 | |
| 25 | ============================================================================== |
| 26 | 1. Introduction *netbeans-intro* |
| 27 | |
| 28 | NetBeans is an open source Integrated Development Environment developed |
| 29 | jointly by Sun Microsystems, Inc. and the netbeans.org developer community. |
| 30 | Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added |
| 31 | in recent releases. |
| 32 | |
| 33 | For more information visit the main NetBeans web site http://www.netbeans.org |
| 34 | or the NetBeans External Editor site at http://externaleditor.netbeans.org. |
| 35 | |
| 36 | Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio. |
| 37 | Visit http://www.sun.com for more information regarding the Sun ONE Studio |
| 38 | product line. |
| 39 | |
| 40 | Current releases of NetBeans provide full support for Java and limited support |
| 41 | for C, C++, and Fortran. Current releases of Sun ONE Studio provide full |
| 42 | support for Java, C, C++, and Fortran. |
| 43 | |
| 44 | The interface to NetBeans is also supported by Agide, the A-A-P GUI IDE. |
| 45 | Agide is very different from NetBeans: |
| 46 | - Based on Python instead of Java, much smaller footprint and fast startup. |
| 47 | - Agide is a framework in which many different tools can work together. |
| 48 | See the A-A-P website for information: http://www.A-A-P.org. |
| 49 | |
| 50 | ============================================================================== |
| 51 | 2. NetBeans Key Bindings *netbeans-keybindings* |
| 52 | |
| 53 | Vim understands a number of key bindings that execute NetBeans commands. These |
| 54 | are typically all the Function key combinations. To execute a NetBeans command, |
| 55 | the user must press the Pause key followed by a NetBeans key binding. For |
| 56 | example, in order to compile a Java file, the NetBeans key binding is "F9". So, |
| 57 | while in vim, press "Pause F9" to compile a java file. To toggle a breakpoint |
| 58 | at the current line, press "Pause Shift F8". |
| 59 | |
| 60 | The Pause key is Function key 21. If you don't have a working Pause key and |
| 61 | want to use F8 instead, use: > |
| 62 | |
| 63 | :map <F8> <F21> |
| 64 | |
| 65 | The External Editor module dynamically reads the NetBeans key bindings so vim |
| 66 | should always have the latest key bindings, even when NetBeans changes them. |
| 67 | |
| 68 | ============================================================================== |
| 69 | 3. Configuring Vim for NetBeans *netbeans-configure* |
| 70 | |
| 71 | For more help installing vim, please read |usr_90.txt| in the Vim User Manual. |
| 72 | |
| 73 | |
| 74 | On Unix |
| 75 | |
| 76 | When running configure without arguments the NetBeans interface should be |
| 77 | included. That is, if the configure check to find out if your system supports |
| 78 | the required features succeeds. |
| 79 | |
| 80 | In case you do not want the NetBeans interface you can disable it by |
| 81 | uncommenting a line with "--disable-netbeans" in the Makefile. |
| 82 | |
| 83 | Currently, only gvim is supported in this integration as NetBeans does not |
| 84 | have means to supply a terminal emulator for the vim command. Furthermore, |
| 85 | there is only GUI support for GTK, GNOME, and Motif. |
| 86 | |
| 87 | If Motif support is required the user must supply XPM libraries. See |
| 88 | |workshop-xpm| for details on obtaining the latest version of XPM. |
| 89 | |
| 90 | |
| 91 | On MS-Windows |
| 92 | |
| 93 | The Win32 support is now in beta stage. |
| 94 | |
| 95 | To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile |
| 96 | XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/ |
| 97 | (for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW). |
| 98 | |
| 99 | ============================================================================== |
| 100 | 4. Downloading NetBeans *netbeans-download* |
| 101 | |
| 102 | The NetBeans IDE is available for download from netbeans.org. You can download |
| 103 | a released version, download sources, or use CVS to download the current |
| 104 | source tree. If you choose to download sources, follow directions from |
| 105 | netbeans.org on building NetBeans. |
| 106 | |
| 107 | Depending on the version of NetBeans you download, you may need to do further |
| 108 | work to get the required External Editor module. This is the module which lets |
| 109 | NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org |
| 110 | for details on downloading this module if your NetBeans release does not have |
| 111 | it. |
| 112 | |
| 113 | For C, C++, and Fortran support you will also need the cpp module. See |
| 114 | http://cpp.netbeans.org for information regarding this module. |
| 115 | |
| 116 | You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day |
| 117 | free trial. See http://www.sun.com for further details. |
| 118 | |
| 119 | ============================================================================== |
| 120 | 5. Preparing NetBeans for Vim *netbeans-preparation* |
| 121 | |
| 122 | In order for NetBeans to work with vim, the NetBeans External Editor module |
| 123 | must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition |
| 124 | then this module should be loaded and enabled. If you have a NetBeans release |
| 125 | you may need to find another way of obtaining this open source module. |
| 126 | |
| 127 | You can check if you have this module by opening the Tools->Options dialog |
| 128 | and drilling down to the "Modules" list (IDE Configuration->System->Modules). |
| 129 | If your Modules list has an entry for "External Editor" you must make sure |
| 130 | it is enabled (the "Enabled" property should have the value "True"). If your |
| 131 | Modules list has no External Editor see the next section on |obtaining-exted|. |
| 132 | |
| 133 | ============================================================================== |
| 134 | 6. Obtaining the External Editor Module *obtaining-exted* |
| 135 | |
| 136 | There are 2 ways of obtaining the External Editor module. The easiest way |
| 137 | is to use the NetBeans Update Center to download and install the module. |
| 138 | Unfortunately, some versions do not have this module in their update |
| 139 | center. If you cannot download via the update center you will need to |
| 140 | download sources and build the module. I will try and get the module |
| 141 | available from the NetBeans Update Center so building will be unnecessary. |
| 142 | Also check http://externaleditor.netbeans.org for other availability options. |
| 143 | |
| 144 | To download the External Editor sources via CVS and build your own module, |
| 145 | see http://externaleditor.netbeans.org and http://www.netbeans.org. |
| 146 | Unfortunately, this is not a trivial procedure. |
| 147 | |
| 148 | ============================================================================== |
| 149 | 7. Setting up NetBeans to run with Vim *netbeans-setup* |
| 150 | |
| 151 | Assuming you have loaded and enabled the NetBeans External Editor module |
| 152 | as described in |netbeans-preparation| all you need to do is verify that |
| 153 | the gvim command line is properly configured for your environment. |
| 154 | |
| 155 | Open the Tools->Options dialog and open the Editing category. Select the |
| 156 | External Editor. The right hand pane should contain a Properties tab and |
| 157 | an Expert tab. In the Properties tab make sure the "Editor Type" is set |
| 158 | to "Vim". In the Expert tab make sure the "Vim Command" is correct. |
| 159 | |
| 160 | You should be careful if you change the "Vim Command". There are command |
| 161 | line options there which must be there for the connection to be properly |
| 162 | set up. You can change the command name but thats about it. If your gvim |
| 163 | can be found by your $PATH then the VIM Command can start with "gvim". If |
| 164 | you don't want gvim searched from your $PATH then hard code in the full |
| 165 | Unix path name. At this point you should get a gvim for any source file |
| 166 | you open in NetBeans. |
| 167 | |
| 168 | If some files come up in gvim and others (with different file suffixes) come |
| 169 | up in the default NetBeans editor you should verify the MIME type in the |
| 170 | Expert tab MIME Type property. NetBeans is MIME oriented and the External |
| 171 | Editor will only open MIME types specified in this property. |
| 172 | |
| 173 | ============================================================================== |
| 174 | 8. Messages *netbeans-messages* |
| 175 | |
| 176 | These messages are specific for NetBeans: |
| 177 | |
| 178 | *E463* |
| 179 | Region is guarded, cannot modify |
| 180 | NetBeans defines guarded areas in the text, which you cannot |
| 181 | change. |
| 182 | |
| 183 | *E656* |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 184 | NetBeans disallows writes of unmodified buffers |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 185 | NetBeans does not support writes of unmodified buffers that |
| 186 | were opened from NetBeans. |
| 187 | |
| 188 | *E657* |
| 189 | Partial writes disallowed for NetBeans buffers |
| 190 | NetBeans does not support partial writes for buffers that were |
| 191 | opened from NetBeans. |
| 192 | |
| 193 | *E658* |
| 194 | NetBeans connection lost for this buffer |
| 195 | NetBeans has become confused about the state of this file. |
| 196 | Rather than risc data corruption, NetBeans has severed the |
| 197 | connection for this file. Vim will take over responsibility |
| 198 | for saving changes to this file and NetBeans will no longer |
| 199 | know of these changes. |
| 200 | |
Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 201 | *E744* |
| 202 | NetBeans does not allow changes in read-only files |
| 203 | Vim normally allows changes to a read-only file and only |
| 204 | enforces the read-only rule if you try to write the file. |
| 205 | However, NetBeans does not let you make changes to a file |
| 206 | which is read-only and becomes confused if vim does this. |
| 207 | So vim does not allow modifications to files when run with |
| 208 | NetBeans. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 209 | ============================================================================== |
| 210 | 9. Running Vim from NetBeans *netbeans-run* |
| 211 | |
| 212 | NetBeans starts Vim with the |-nb| argument. Three forms can be used, that |
| 213 | differ in the way the information for the connection is specified: |
| 214 | |
| 215 | -nb={fname} from a file |
| 216 | -nb:{hostname}:{addr}:{password} directly |
| 217 | -nb from a file or environment |
| 218 | |
| 219 | *E660* *E668* |
| 220 | For security reasons, the best method is to write the information in a file |
| 221 | readable only by the user. The name of the file can be passed with the |
| 222 | "-nb={fname}" argument or, when "-nb" is used without a parameter, the |
| 223 | environment variable "__NETBEANS_CONINFO". The file must contain these three |
| 224 | lines, in any order: |
| 225 | |
| 226 | host={hostname} |
| 227 | port={addr} |
| 228 | auth={password} |
| 229 | |
| 230 | Other lines are ignored. The caller of Vim is responsible for deleting the |
| 231 | file afterwards. |
| 232 | |
| 233 | {hostname} is the name of the machine where NetBeans is running. When omitted |
| 234 | the environment variable "__NETBEANS_HOST" is used or the default "localhost". |
| 235 | |
| 236 | {addr} is the port number for NetBeans. When omitted the environment variable |
| 237 | "__NETBEANS_SOCKET" is used or the default 3219. |
| 238 | |
| 239 | {password} is the password for connecting to NetBeans. When omitted the |
| 240 | environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme". |
| 241 | |
| 242 | ============================================================================== |
| 243 | 10. NetBeans protocol *netbeans-protocol* |
| 244 | |
| 245 | The communication between NetBeans and Vim uses plain text messages. This |
| 246 | protocol was first designed to work with the external editor module of |
| 247 | NetBeans (see http://externaleditor.netbeans.org). Later it was extended to |
| 248 | work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org). The extensions are |
| 249 | marked with "version 2.1". |
| 250 | |
| 251 | Version 2.2 of the protocol has several minor changes which should only |
| 252 | affect NetBeans users (ie, not Agide users). However, a bug was fixed which |
| 253 | could cause confusion. The netbeans_saved() function sent a "save" protocol |
| 254 | command. In protocol version 2.1 and earlier this was incorrectly interpreted |
| 255 | as a notification that a write had taken place. In reality, it told NetBeans |
| 256 | to save the file so multiple writes were being done. This caused various |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 257 | problems and has been fixed in 2.2. To decrease the likelihood of this |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 258 | confusion happening again, netbeans_saved() has been renamed to |
| 259 | netbeans_save_buffer(). |
| 260 | |
| 261 | The messages are currently sent over a socket. Since the messages are in |
| 262 | plain UTF-8 text this protocol could also be used with any other communication |
| 263 | mechanism. |
| 264 | |
| 265 | 10.1 Kinds of messages |nb-messages| |
| 266 | 10.2 Terms |nb-terms| |
| 267 | 10.3 Commands |nb-commands| |
| 268 | 10.4 Functions and Replies |nb-functions| |
| 269 | 10.5 Events |nb-events| |
| 270 | 10.6 Special messages |nb-special| |
| 271 | |
| 272 | *E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636* |
| 273 | *E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646* |
| 274 | *E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654* |
| 275 | These errors occur when a message violates the protocol. |
| 276 | |
| 277 | |
| 278 | 10.1 Kinds of messages *nb-messages* |
| 279 | |
| 280 | There are four kinds of messages: |
| 281 | |
| 282 | kind direction comment ~ |
| 283 | Command IDE -> editor no reply necessary |
| 284 | Function IDE -> editor editor must send back a reply |
| 285 | Reply editor -> IDE only in response to a Function |
| 286 | Event editor -> IDE no reply necessary |
| 287 | |
| 288 | The messages are sent as a single line with a terminating newline character. |
| 289 | Arguments are separated by a single space. The first item of the message |
| 290 | depends on the kind of message: |
| 291 | |
| 292 | kind first item example ~ |
| 293 | Command bufID:name!seqno 11:showBalloon!123 "text" |
| 294 | Function bufID:name/seqno 11:getLength/123 |
| 295 | Reply seqno 123 5000 |
| 296 | Event bufID:name=123 11:keyCommand=123 "S-F2" |
| 297 | |
| 298 | |
| 299 | 10.2 Terms *nb-terms* |
| 300 | |
| 301 | bufID Buffer number. A message may be either for a specific buffer |
| 302 | or generic. Generic messages use a bufID of zero. NOTE: this |
| 303 | buffer ID is assigned by the IDE, it is not Vim's buffer |
| 304 | number. The bufID must be a sequentially rising number, |
| 305 | starting at one. |
| 306 | |
| 307 | seqno The IDE uses a sequence number for Commands and Functions. A |
| 308 | Reply must use the sequence number of the Function that it is |
| 309 | associated with. A zero sequence number can be used for |
| 310 | Events (the seqno of the last received Command or Function can |
| 311 | also be used). |
| 312 | |
| 313 | string Argument in double quotes. Text is in UTF-8 encoding. This |
| 314 | means ASCII is passed as-is. Special characters are |
| 315 | represented with a backslash: |
| 316 | \" double quote |
| 317 | \n newline |
| 318 | \r carriage-return |
| 319 | \t tab (optional, also works literally) |
| 320 | \\ backslash |
| 321 | NUL bytes are not allowed! |
| 322 | |
| 323 | boolean Argument with two possible values: |
| 324 | T true |
| 325 | F false |
| 326 | |
| 327 | number Argument with a decimal number. |
| 328 | |
| 329 | optnum Argument with either a decimal number or "none" (without the |
| 330 | quotes). |
| 331 | |
| 332 | offset A number argument that indicates a byte position in a buffer. |
| 333 | The first byte has offset zero. Line breaks are counted for |
| 334 | how they appear in the file (CR/LF counts for two bytes). |
| 335 | Note that a multi-byte character is counted for the number of |
| 336 | bytes it takes. |
| 337 | |
| 338 | lnum/col Argument with a line number and column number position. The |
| 339 | line number starts with one, the column is the byte position, |
| 340 | starting with zero. Note that a multi-byte character counts |
| 341 | for several columns. |
| 342 | |
| 343 | pathname String argument: file name with full path. |
| 344 | |
| 345 | |
| 346 | 10.3 Commands *nb-commands* |
| 347 | |
| 348 | actionMenuItem Not implemented. |
| 349 | |
| 350 | actionSensitivity |
| 351 | Not implemented. |
| 352 | |
| 353 | addAnno serNum typeNum off len |
| 354 | Place an annotation in this buffer. |
| 355 | Arguments: |
| 356 | serNum number serial number of this placed |
| 357 | annotation, used to be able to remove |
| 358 | it |
| 359 | typeNum number sequence number of the annotation |
| 360 | defined with defineAnnoType for this |
| 361 | buffer |
| 362 | off number offset where annotation is to be placed |
| 363 | len number not used |
| 364 | In version 2.1 "lnum/col" can be used instead of "off". |
| 365 | |
| 366 | balloonResult text |
| 367 | Not implemented. |
| 368 | |
| 369 | close Close the buffer. This leaves us without current buffer, very |
| 370 | dangerous to use! |
| 371 | |
| 372 | create Creates a buffer without a name. Replaces the current buffer |
| 373 | (it's hidden when it was changed). |
| 374 | NetBeans uses this as the first command for a file that is |
| 375 | being opened. The sequence of commands could be: |
| 376 | create |
| 377 | setCaretListener (ignored) |
| 378 | setModified (no effect) |
| 379 | setContentType (ignored) |
| 380 | startDocumentListen |
| 381 | setTitle |
| 382 | setFullName |
| 383 | |
| 384 | defineAnnoType typeNum typeName tooltip glyphFile fg bg |
| 385 | Define a type of annotation for this buffer. |
| 386 | Arguments: |
| 387 | typeNum number sequence number (not really used) |
| 388 | typeName string name that identifies this annotation |
| 389 | tooltip string not used |
| 390 | glyphFile string name of icon file |
| 391 | fg optnum foreground color for line highlighting |
| 392 | bg optnum background color for line highlighting |
| 393 | Vim will define a sign for the annotation. |
| 394 | When both "fg" and "bg" are "none" no line highlighting is |
| 395 | used (new in version 2.1). |
| 396 | When "glyphFile" is empty, no text sign is used (new in |
| 397 | version 2.1). |
| 398 | When "glyphFile" is one or two characters long, a text sign is |
| 399 | defined (new in version 2.1). |
| 400 | Note: the annotations will be defined in sequence, and the |
| 401 | sequence number is later used with addAnno. |
| 402 | |
| 403 | editFile pathname |
| 404 | Set the name for the buffer and edit the file "pathname", a |
| 405 | string argument. |
| 406 | Normal way for the IDE to tell the editor to edit a file. If |
| 407 | the IDE is going to pass the file text to the editor use these |
| 408 | commands instead: |
| 409 | setFullName |
| 410 | insert |
| 411 | initDone |
| 412 | New in version 2.1. |
| 413 | |
| 414 | enableBalloonEval |
| 415 | Not implemented. |
| 416 | |
| 417 | endAtomic End an atomic operation. The changes between "startAtomic" |
| 418 | and "endAtomic" can be undone as one operation. But it's not |
| 419 | implemented yet. Redraw when necessary. |
| 420 | |
| 421 | guard off len |
| 422 | Mark an area in the buffer as guarded. This means it cannot |
| 423 | be edited. "off" and "len" are numbers and specify the text |
| 424 | to be guarded. |
| 425 | |
| 426 | initDone Mark the buffer as ready for use. Implicitly makes the buffer |
| 427 | the current buffer. Fires the BufReadPost autocommand event. |
| 428 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 429 | insertDone |
| 430 | Sent by NetBeans to tell vim an initial file insert is done. |
| 431 | This triggers a read message being printed. Prior to version |
| 432 | 2.3, no read messages were displayed after opening a file. |
| 433 | New in version 2.3. |
| 434 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 435 | moveAnnoToFront serNum |
| 436 | Not implemented. |
| 437 | |
| 438 | netbeansBuffer isNetbeansBuffer |
| 439 | If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by |
| 440 | NetBeans. |
| 441 | New in version 2.2. |
| 442 | |
| 443 | putBufferNumber pathname |
| 444 | Associate a buffer number with the Vim buffer by the name |
| 445 | "pathname", a string argument. To be used when the editor |
| 446 | reported editing another file to the IDE and the IDE needs to |
| 447 | tell the editor what buffer number it will use for this file. |
| 448 | Also marks the buffer as initialized. |
| 449 | New in version 2.1. |
| 450 | |
| 451 | raise Bring the editor to the foreground. |
| 452 | New in version 2.1. |
| 453 | |
| 454 | removeAnno serNum |
| 455 | Remove a previously place annotation for this buffer. |
| 456 | "serNum" is the same number used in addAnno. |
| 457 | |
| 458 | save Save the buffer when it was modified. The other side of the |
| 459 | interface is expected to write the buffer and invoke |
| 460 | "setModified" to reset the "changed" flag of the buffer. |
| 461 | The writing is skipped when one of these conditions is true: |
| 462 | - 'write' is not set |
| 463 | - the buffer is read-only |
| 464 | - the buffer does not have a file name |
| 465 | - 'buftype' disallows writing |
| 466 | New in version 2.2. |
| 467 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 468 | saveDone |
| 469 | Sent by NetBeans to tell vim a save is done. This triggers |
| 470 | a save message being printed. Prior to version 2.3, no save |
| 471 | messages were displayed after a save. |
| 472 | New in version 2.3. |
| 473 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 474 | setAsUser Not implemented. |
| 475 | |
| 476 | setBufferNumber pathname |
| 477 | Associate a buffer number with Vim buffer by the name |
| 478 | "pathname". To be used when the editor reported editing |
| 479 | another file to the IDE and the IDE needs to tell the editor |
| 480 | what buffer number it will use for this file. |
| 481 | Has the side effect of making the buffer the current buffer. |
| 482 | See "putBufferNumber" for a more useful command. |
| 483 | |
| 484 | setContentType |
| 485 | Not implemented. |
| 486 | |
| 487 | setDot off Make the buffer the current buffer and set the cursor at the |
| 488 | specified position. If there are folds they are opened to |
| 489 | make the cursor line visible. |
| 490 | In version 2.1 "lnum/col" can be used instead of "off". |
| 491 | |
| 492 | setExitDelay seconds |
| 493 | Set the delay for exiting to "seconds", a number. |
| 494 | This delay is used to give the IDE a chance to handle things |
| 495 | before really exiting. The default delay is two seconds. |
| 496 | New in version 2.1. |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 497 | Obsolete in version 2.3. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 498 | |
| 499 | setFullName pathname |
| 500 | Set the file name to be used for a buffer to "pathname", a |
| 501 | string argument. |
| 502 | Used when the IDE wants to edit a file under control of the |
| 503 | IDE. This makes the buffer the current buffer, but does not |
| 504 | read the file. "insert" commands will be used next to set the |
| 505 | contents. |
| 506 | |
| 507 | setLocAndSize Not implemented. |
| 508 | |
| 509 | setMark Not implemented. |
| 510 | |
| 511 | setModified modified |
| 512 | When the boolean argument "modified" is "T" mark the buffer as |
| 513 | modified, when it is "F" mark it as unmodified. |
| 514 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 515 | setModtime time |
| 516 | Update a buffers modification time after NetBeans saves the |
| 517 | file. |
| 518 | New in version 2.3. |
| 519 | |
| 520 | setReadOnly |
| 521 | Passed by NetBeans to tell vim a file is readonly. |
| 522 | Implemented in verion 2.3. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 523 | |
| 524 | setStyle Not implemented. |
| 525 | |
| 526 | setTitle name |
| 527 | Set the title for the buffer to "name", a string argument. |
| 528 | The title is only used for NetBeans functions, not by Vim. |
| 529 | |
| 530 | setVisible visible |
| 531 | When the boolean argument "visible" is "T", goto the buffer. |
| 532 | The "F" argument does nothing. |
| 533 | |
| 534 | showBalloon text |
| 535 | Show a balloon (popup window) at the mouse pointer position, |
| 536 | containing "text", a string argument. The balloon should |
| 537 | disappear when the mouse is moved more than a few pixels. |
| 538 | New in version 2.1. |
| 539 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 540 | specialKeys |
| 541 | Map a set of keys (mostly function keys) to be passed back |
| 542 | to NetBeans for processing. This lets NetBeans hotkeys be |
| 543 | used from vim. |
| 544 | Implemented in version 2.3. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 545 | |
| 546 | startAtomic Begin an atomic operation. The screen will not be updated |
| 547 | until "endAtomic" is given. |
| 548 | |
| 549 | startCaretListen |
| 550 | Not implemented. |
| 551 | |
| 552 | startDocumentListen |
| 553 | Mark the buffer to report changes to the IDE with the |
| 554 | "insert" and "remove" events. The default is to report |
| 555 | changes. |
| 556 | |
| 557 | stopCaretListen |
| 558 | Not implemented. |
| 559 | |
| 560 | stopDocumentListen |
| 561 | Mark the buffer to stop reporting changes to the IDE. |
| 562 | Opposite of startDocumentListen. |
Bram Moolenaar | 748bf03 | 2005-02-02 23:04:36 +0000 | [diff] [blame] | 563 | NOTE: if "netbeansBuffer" was used to mark this buffer as a |
| 564 | NetBeans buffer, then the buffer is deleted in Vim. This is |
| 565 | for compatibility with Sun Studio 10. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 566 | |
| 567 | unguard off len |
| 568 | Opposite of "guard", remove guarding for a text area. |
| 569 | |
| 570 | version Not implemented. |
| 571 | |
| 572 | |
| 573 | 10.4 Functions and Replies *nb-functions* |
| 574 | |
| 575 | getDot Not implemented. |
| 576 | |
| 577 | getCursor Return the current buffer and cursor position. |
| 578 | The reply is: |
| 579 | seqno bufID lnum col off |
| 580 | seqno = sequence number of the function |
| 581 | bufID = buffer ID of the current buffer (if this is unknown -1 |
| 582 | is used) |
| 583 | lnum = line number of the cursor (first line is one) |
| 584 | col = column number of the cursor (in bytes, zero based) |
| 585 | off = offset of the cursor in the buffer (in bytes) |
| 586 | New in version 2.1. |
| 587 | |
| 588 | getLength Return the length of the buffer in bytes. |
| 589 | Reply example for a buffer with 5000 bytes: |
| 590 | 123 5000 |
| 591 | TODO: explain use of partial line. |
| 592 | |
| 593 | getMark Not implemented. |
| 594 | |
| 595 | getModified When a buffer is specified: Return zero if the buffer does not |
| 596 | have changes, one if it does have changes. |
| 597 | When no buffer is specified (buffer number zero): Return the |
| 598 | number of buffers with changes. When the result is zero it's |
| 599 | safe to tell Vim to exit. |
| 600 | New in version 2.1. |
| 601 | |
| 602 | getText Return the contents of the buffer as a string. |
| 603 | Reply example for a buffer with two lines |
| 604 | 123 "first line\nsecond line\n" |
| 605 | NOTE: docs indicate an offset and length argument, but this is |
| 606 | not implemented. |
| 607 | |
| 608 | insert off text |
| 609 | Insert "text" before position "off". "text" is a string |
| 610 | argument, "off" a number. |
| 611 | Possible replies: |
| 612 | 123 no problem |
| 613 | 123 !message failed |
| 614 | Note that the message in the reply is not quoted. |
| 615 | |
| 616 | remove off length |
| 617 | Delete "length" bytes of text at position "off". Both |
| 618 | arguments are numbers. |
| 619 | Possible replies: |
| 620 | 123 no problem |
| 621 | 123 !message failed |
| 622 | Note that the message in the reply is not quoted. |
| 623 | |
| 624 | saveAndExit Perform the equivalent of closing Vim: ":confirm qall". |
| 625 | If there are no changed files or the user does not cancel the |
| 626 | operation Vim exits and no result is sent back. The IDE can |
| 627 | consider closing the connection as a successful result. |
| 628 | If the user cancels the operation the number of modified |
| 629 | buffers that remains is returned and Vim does not exit. |
| 630 | New in version 2.1. |
| 631 | |
| 632 | |
| 633 | 10.5 Events *nb-events* |
| 634 | |
| 635 | balloonEval off len type |
| 636 | The mouse pointer rests on text for a short while. When "len" |
| 637 | is zero, there is no selection and the pointer is at position |
| 638 | "off". When "len" is non-zero the text from position "off" to |
| 639 | "off" + "len" is selected. |
| 640 | Only sent after "enableBalloonEval" was used for this buffer. |
| 641 | "type" is not yet defined. |
| 642 | Not implemented yet. |
| 643 | |
| 644 | balloonText text |
| 645 | Used when 'ballooneval' is set and the mouse pointer rests on |
| 646 | some text for a moment. "text" is a string, the text under |
| 647 | the mouse pointer. |
| 648 | New in version 2.1. |
| 649 | |
| 650 | buttonRelease button lnum col |
| 651 | Report which button was pressed and the location of the cursor |
| 652 | at the time of the release. Only for buffers that are owned |
| 653 | by NetBeans. This event is not sent if the button was |
| 654 | released while the mouse was in the status line or in a |
| 655 | separator line. If col is less than 1 the button release was |
| 656 | in the sign area. |
| 657 | New in version 2.2. |
| 658 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 659 | disconnect |
| 660 | Tell NetBeans that vim is exiting and not to try and read or |
| 661 | write more commands. |
| 662 | New in version 2.3. |
| 663 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 664 | fileClosed Not implemented. |
| 665 | |
| 666 | fileModified Not implemented. |
| 667 | |
| 668 | fileOpened pathname open modified |
| 669 | A file was opened by the user. |
| 670 | Arguments: |
| 671 | pathname string name of the file |
| 672 | open boolean always "T" |
| 673 | modified boolean always "F" |
| 674 | |
| 675 | geometry cols rows x y |
| 676 | Report the size and position of the editor window. |
| 677 | Arguments: |
| 678 | cols number number of text columns |
| 679 | rows number number of text rows |
| 680 | x number pixel position on screen |
| 681 | y number pixel position on screen |
| 682 | Only works for Motif. |
| 683 | |
| 684 | insert off text |
| 685 | Text "text" has been inserted in Vim at position "off". |
| 686 | Only fired when enabled, see "startDocumentListen". |
| 687 | |
| 688 | invokeAction Not implemented. |
| 689 | |
| 690 | keyCommand keyName |
| 691 | Reports a special key being pressed with name "keyName", which |
| 692 | is a string. |
| 693 | Supported key names: |
| 694 | F1 function key 1 |
| 695 | F2 function key 2 |
| 696 | ... |
| 697 | F12 function key 12 |
| 698 | |
| 699 | ' ' space (without the quotes) |
| 700 | ! exclamation mark |
| 701 | ... any other ASCII printable character |
| 702 | ~ tilde |
| 703 | |
| 704 | X any unrecognized key |
| 705 | |
| 706 | The key may be prepended by "C", "S" and/or "M" for Control, |
| 707 | Shift and Meta (Alt) modifiers. If there is a modifier a dash |
| 708 | is used to separate it from the key name. For example: |
| 709 | "C-F2". |
| 710 | ASCII characters are new in version 2.1. |
| 711 | |
| 712 | keyAtPos keyName lnum/col |
| 713 | Like "keyCommand" and also report the line number and column |
| 714 | of the cursor. |
| 715 | New in version 2.1. |
| 716 | |
| 717 | killed A file was closed by the user. Only for files that have been |
| 718 | assigned a number by the IDE. |
| 719 | |
| 720 | newDotAndMark off off |
| 721 | Reports the position of the cursor being at "off" bytes into |
| 722 | the buffer. Only sent just before a "keyCommand" event. |
| 723 | |
| 724 | quit Not implemented. |
| 725 | |
| 726 | remove off len |
| 727 | Text was deleted in Vim at position "off" with byte length |
| 728 | "len". |
| 729 | Only fired when enabled, see "startDocumentListen". |
| 730 | |
| 731 | revert Not implemented. |
| 732 | |
| 733 | save The buffer has been saved and is now unmodified. |
| 734 | Only fired when enabled, see "startDocumentListen". |
| 735 | |
| 736 | startupDone The editor has finished its startup work and is ready for |
| 737 | editing files. |
| 738 | New in version 2.1. |
| 739 | |
| 740 | unmodified The buffer is now unmodified. |
| 741 | Only fired when enabled, see "startDocumentListen". |
| 742 | |
| 743 | version vers Report the version of the interface implementation. Vim |
| 744 | reports "2.2" (including the quotes). |
| 745 | |
| 746 | |
| 747 | 10.6 Special messages *nb-special* |
| 748 | |
| 749 | These messages do not follow the style of the messages above. They are |
| 750 | terminated by a newline character. |
| 751 | |
| 752 | ACCEPT Not used. |
| 753 | |
| 754 | AUTH password editor -> IDE: First message that the editor sends to the IDE. |
| 755 | Must contain the password for the socket server, as specified |
| 756 | with the |-nb| argument. No quotes are used! |
| 757 | |
| 758 | DISCONNECT IDE -> editor: break the connection. The editor will exit. |
| 759 | The IDE must only send this message when there are no unsaved |
| 760 | changes! |
| 761 | |
| 762 | DETACH IDE -> editor: break the connection without exiting the |
| 763 | editor. Used when the IDE exits without bringing down the |
| 764 | editor as well. |
| 765 | New in version 2.1. |
| 766 | |
| 767 | REJECT Not used. |
| 768 | |
| 769 | ============================================================================== |
Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 770 | 11. NetBeans Commands *netbeans-commands* |
| 771 | |
| 772 | *:nbkey* |
| 773 | :nbkey key Pass the key to NetBeans for processing |
| 774 | |
| 775 | Pass the key to NetBeans for hot-key processing. You should not need to use |
| 776 | this command directly. However, NetBeans passes a list of hot-keys to Vim at |
| 777 | startup and when one of these keys is pressed, this command is generated to |
| 778 | send the key press back to NetBeans. |
| 779 | |
| 780 | ============================================================================== |
| 781 | 12. Known problems *netbeans-problems* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 782 | |
| 783 | NUL bytes are not possible. For editor -> IDE they will appear as NL |
| 784 | characters. For IDE -> editor they cannot be inserted. |
| 785 | |
| 786 | |
| 787 | vim:tw=78:ts=8:ft=help:norl: |