代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>netbeans - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="header">
<a href="http://vim-jp.org/">vim-jp</a>
/ <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
/ netbeans<br />
<a name="top"></a><h1>netbeans - Vim Documentation</h1>
<a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
</div>
</header>
<nav>
<dl>
<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>
<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>
<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>
<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>
<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>
<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>
<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>
<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>
<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>
<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>
<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>
<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>
<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>
<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>
<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>
<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>
<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>
</dl>
</nav>
<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="netbeans.html" name="netbeans.txt">netbeans.txt</a> For <span class="Identifier">Vim version 8.0.</span> Last change: 2016 Jul 15<br>
<br>
<br>
<span class="Identifier">VIM REFERENCE MANUAL by Gordon Prieur et al.</span><br>
<br>
<br>
<a class="Constant" href="netbeans.html#netbeans" name="netbeans">netbeans</a> <a class="Constant" href="netbeans.html#netbeans-support" name="netbeans-support">netbeans-support</a><br>
<br>
Vim NetBeans Protocol: a socket interface for Vim integration into an IDE.<br>
<br>
1. Introduction <a class="Identifier" href="netbeans.html#netbeans-intro">netbeans-intro</a><br>
2. Integration features <a class="Identifier" href="netbeans.html#netbeans-integration">netbeans-integration</a><br>
3. Configuring Vim for NetBeans <a class="Identifier" href="netbeans.html#netbeans-configure">netbeans-configure</a><br>
4. Error Messages <a class="Identifier" href="netbeans.html#netbeans-messages">netbeans-messages</a><br>
5. Running Vim in NetBeans mode <a class="Identifier" href="netbeans.html#netbeans-run">netbeans-run</a><br>
6. NetBeans protocol <a class="Identifier" href="netbeans.html#netbeans-protocol">netbeans-protocol</a><br>
7. NetBeans commands <a class="Identifier" href="netbeans.html#netbeans-commands">netbeans-commands</a><br>
8. Known problems <a class="Identifier" href="netbeans.html#netbeans-problems">netbeans-problems</a><br>
9. Debugging NetBeans protocol <a class="Identifier" href="netbeans.html#netbeans-debugging">netbeans-debugging</a><br>
10. NetBeans External Editor<br>
10.1. Downloading NetBeans <a class="Identifier" href="netbeans.html#netbeans-download">netbeans-download</a><br>
10.2. NetBeans Key Bindings <a class="Identifier" href="netbeans.html#netbeans-keybindings">netbeans-keybindings</a><br>
10.3. Preparing NetBeans for Vim <a class="Identifier" href="netbeans.html#netbeans-preparation">netbeans-preparation</a><br>
10.4. Obtaining the External Editor Module <a class="Identifier" href="netbeans.html#obtaining-exted">obtaining-exted</a><br>
10.5. Setting up NetBeans to run with Vim <a class="Identifier" href="netbeans.html#netbeans-setup">netbeans-setup</a><br>
<br>
<span class="Special">{Vi does not have any of these features}</span><br>
<span class="Special">{only available when compiled with the </span><a class="Identifier" href="various.html#+netbeans_intg">+netbeans_intg</a><span class="Special"> feature}</span><br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Introduction <a class="Constant" href="netbeans.html#netbeans-intro" name="netbeans-intro">netbeans-intro</a><br>
<br>
The NetBeans interface was initially developed to integrate Vim into the<br>
NetBeans Java IDE, using the external editor plugin. This NetBeans plugin no<br>
longer exists for recent versions of NetBeans but the protocol was developed<br>
in such a way that any IDE can use it to integrate Vim.<br>
<br>
The NetBeans protocol of Vim is a text based communication protocol, over a<br>
classical TCP socket. There is no dependency on Java or NetBeans. Any language<br>
or environment providing a socket interface can control Vim using this<br>
protocol. There are existing implementations in C, C++, Python and Java. The<br>
name NetBeans is kept today for historical reasons.<br>
<br>
Current projects using the NetBeans protocol of Vim are:<br>
- VimIntegration, description of various projects doing Vim Integration:<br>
<span class="Constant"><a href="http://www.freehackers.org/VimIntegration">http://www.freehackers.org/VimIntegration</a></span><br>
- Agide, an IDE for the AAP project, written in Python:<br>
<span class="Constant"><a href="http://www.a-a-p.org">http://www.a-a-p.org</a></span><br>
- Clewn, a gdb integration into Vim, written in C:<br>
<span class="Constant"><a href="http://clewn.sourceforge.net/">http://clewn.sourceforge.net/</a></span><br>
- Pyclewn, a gdb integration into Vim, written in Python:<br>
<span class="Constant"><a href="http://pyclewn.sourceforge.net/">http://pyclewn.sourceforge.net/</a></span><br>
- VimPlugin, integration of Vim inside Eclipse:<br>
<span class="Constant"><a href="http://vimplugin.sourceforge.net/wiki/pmwiki.php">http://vimplugin.sourceforge.net/wiki/pmwiki.php</a></span><br>
- PIDA, IDE written in Python integrating Vim:<br>
<span class="Constant"><a href="http://pida.co.uk/">http://pida.co.uk/</a></span><br>
- VimWrapper, library to easy Vim integration into IDE:<br>
<span class="Constant"><a href="http://www.freehackers.org/VimWrapper">http://www.freehackers.org/VimWrapper</a></span><br>
<br>
Check the specific project pages to see how to use Vim with these projects.<br>
<br>
An alternative is to use a channel, see <a class="Identifier" href="channel.html#channel">channel</a>.<br>
<br>
In the rest of this help page, we will use the term "Vim Controller" to<br>
describe the program controlling Vim through the NetBeans socket interface.<br>
<br>
<br>
<span class="PreProc">About the NetBeans IDE</span><br>
<br>
NetBeans is an open source Integrated Development Environment developed<br>
jointly by Sun Microsystems, Inc. and the netbeans.org developer community.<br>
Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added<br>
in recent releases.<br>
<br>
For more information visit the main NetBeans web site <span class="Constant"><a href="http://www.netbeans.org">http://www.netbeans.org</a></span>.<br>
The External Editor is now, unfortunately, declared obsolete. See<br>
<span class="Constant"><a href="http://externaleditor.netbeans.org">http://externaleditor.netbeans.org</a></span>.<br>
<br>
Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.<br>
Visit <span class="Constant"><a href="http://www.sun.com">http://www.sun.com</a></span> for more information regarding the Sun ONE Studio<br>
product line.<br>
<br>
Current releases of NetBeans provide full support for Java and limited support<br>
for C, C++, and Fortran. Current releases of Sun ONE Studio provide full<br>
support for Java, C, C++, and Fortran.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
2. Integration features <a class="Constant" href="netbeans.html#netbeans-integration" name="netbeans-integration">netbeans-integration</a><br>
<br>
The NetBeans socket interface of Vim allows to get information from Vim or to<br>
ask Vim to perform specific actions:<br>
- get information about buffer: buffer name, cursor position, buffer content,<br>
etc.<br>
- be notified when buffers are open or closed<br>
- be notified of how the buffer content is modified<br>
- load and save files<br>
- modify the buffer content<br>
- installing special key bindings<br>
- raise the window, control the window geometry<br>
<br>
For sending key strokes to Vim or for evaluating functions in Vim, you must<br>
use the <a class="Identifier" href="remote.html#clientserver">clientserver</a> interface.<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
3. Configuring Vim for NetBeans <a class="Constant" href="netbeans.html#netbeans-configure" name="netbeans-configure">netbeans-configure</a><br>
<br>
For more help about installing Vim, please read <a class="Identifier" href="usr_90.html">usr_90.txt</a> in the Vim User<br>
Manual.<br>
<br>
<br>
On Unix:<br>
<span class="PreProc">--------</span><br>
<br>
When running configure without arguments the NetBeans interface should be<br>
included. That is, if the configure check to find out if your system supports<br>
the required features succeeds.<br>
<br>
In case you do not want the NetBeans interface you can disable it by<br>
uncommenting a line with "--disable-netbeans" in the Makefile.<br>
<br>
Currently the NetBeans interface is supported by Vim running in a terminal and<br>
by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,<br>
Athena and Motif.<br>
<br>
If Motif support is required the user must supply XPM libraries. See<br>
<a class="Identifier" href="workshop.html#workshop-xpm">workshop-xpm</a> for details on obtaining the latest version of XPM.<br>
<br>
<br>
On MS-Windows:<br>
<span class="PreProc">--------------</span><br>
<br>
The Win32 support is now in beta stage.<br>
<br>
To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile<br>
XPM by yourself or use precompiled libraries from <span class="Constant"><a href="http://iamphet.nm.ru/misc/">http://iamphet.nm.ru/misc/</a></span><br>
(for MS Visual C++) or <span class="Constant"><a href="http://gnuwin32.sourceforge.net">http://gnuwin32.sourceforge.net</a></span> (for MinGW).<br>
<br>
Enable debugging:<br>
<span class="PreProc">-----------------</span><br>
<br>
To enable debugging of Vim and of the NetBeans protocol, the "NBDEBUG" macro<br>
needs to be defined. Search in the Makefile of the platform you are using for<br>
"NBDEBUG" to see what line needs to be uncommented. This effectively adds<br>
"-DNBDEBUG" to the compile command. Also see <a class="Identifier" href="netbeans.html#netbeans-debugging">netbeans-debugging</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
4. Error Messages <a class="Constant" href="netbeans.html#netbeans-messages" name="netbeans-messages">netbeans-messages</a><br>
<br>
These error messages are specific to NetBeans socket protocol:<br>
<br>
<a class="Constant" href="netbeans.html#E463" name="E463">E463</a><br>
Region is guarded, cannot modify<br>
The Vim Controller has defined guarded areas in the text,<br>
which you cannot change. Also sets the current buffer, if<br>
necessary.<br>
<br>
<a class="Constant" href="netbeans.html#E532" name="E532">E532</a><br>
The defineAnnoType highlighting color name is too long<br>
The maximum length of the "fg" or "bg" color argument in the<br>
defineAnnoType command is 32 characters.<br>
New in version 2.5.<br>
<br>
<a class="Constant" href="netbeans.html#E656" name="E656">E656</a><br>
Writes of unmodified buffers forbidden<br>
Writes of unmodified buffers that were opened from the<br>
Vim Controller are not possible.<br>
<br>
<a class="Constant" href="netbeans.html#E657" name="E657">E657</a><br>
Partial writes disallowed<br>
Partial writes for buffers that were opened from the<br>
Vim Controller are not allowed.<br>
<br>
<a class="Constant" href="netbeans.html#E658" name="E658">E658</a><br>
Connection lost for this buffer<br>
The Vim Controller has become confused about the state of<br>
this file. Rather than risk data corruption, it has severed<br>
the connection for this file. Vim will take over<br>
responsibility for saving changes to this file and the<br>
Vim Controller will no longer know of these changes.<br>
<br>
<a class="Constant" href="netbeans.html#E744" name="E744">E744</a><br>
Read-only file<br>
Vim normally allows changes to a read-only file and only<br>
enforces the read-only rule if you try to write the file.<br>
However, NetBeans does not let you make changes to a file<br>
which is read-only and becomes confused if Vim does this.<br>
So Vim does not allow modifications to files when run<br>
in NetBeans mode.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
5. Running Vim in NetBeans mode <a class="Constant" href="netbeans.html#netbeans-run" name="netbeans-run">netbeans-run</a><br>
<br>
There are two different ways to run Vim in NetBeans mode:<br>
<br>
+ an IDE may start Vim with the <a class="Identifier" href="starting.html#-nb">-nb</a> command line argument<br>
+ NetBeans can be started from within Vim with the <a class="Identifier" href="netbeans.html#:nbstart">:nbstart</a> command<br>
<br>
Vim uses a 3 second timeout on trying to make the connection.<br>
<br>
<a class="Constant" href="netbeans.html#netbeans-parameters" name="netbeans-parameters">netbeans-parameters</a><br>
Three forms can be used to setup the NetBeans connection parameters.<br>
When started from the command line, the <a class="Identifier" href="starting.html#-nb">-nb</a> command line argument may be:<br>
<br>
-nb=<span class="Special">{fname}</span> from a file<br>
-nb:<span class="Special">{hostname}</span>:<span class="Special">{addr}</span>:<span class="Special">{password}</span> directly<br>
-nb from a file or environment<br>
<br>
When started from within Vim, the <a class="Identifier" href="netbeans.html#:nbstart">:nbstart</a> optional argument may be:<br>
<br>
=<span class="Special">{fname}</span> from a file<br>
:<span class="Special">{hostname}</span>:<span class="Special">{addr}</span>:<span class="Special">{password}</span> directly<br>
<MISSING ARGUMENT> from a file or environment<br>
<br>
<a class="Constant" href="netbeans.html#E660" name="E660">E660</a> <a class="Constant" href="netbeans.html#E668" name="E668">E668</a><br>
When NetBeans is started from the command line, for security reasons, the best<br>
method is to write the information in a file readable only by the user. The<br>
name of the file can be passed with the "-nb=<span class="Special">{fname}</span>" argument or, when "-nb"<br>
is used without a parameter, the environment variable "__NETBEANS_CONINFO".<br>
The file must contain these three lines, in any order:<br>
<br>
host=<span class="Special">{hostname}</span><br>
port=<span class="Special">{addr}</span><br>
auth=<span class="Special">{password}</span><br>
<br>
Other lines are ignored. The Vim Controller is responsible for deleting the<br>
file afterwards.<br>
<br>
<span class="Special">{hostname}</span> is the name of the machine where Vim Controller is running. When<br>
omitted the environment variable "__NETBEANS_HOST" is used or the default<br>
"localhost".<br>
<br>
<span class="Special">{addr}</span> is the port number for the NetBeans interface. When omitted the<br>
environment variable "__NETBEANS_SOCKET" is used or the default 3219.<br>
<br>
<span class="Special">{password}</span> is the password for connecting to NetBeans. When omitted the<br>
environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".<br>
<br>
Vim will initiate a socket connection (client side) to the specified host and<br>
port upon startup. The password will be sent with the AUTH event when the<br>
connection has been established.<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
6. NetBeans protocol <a class="Constant" href="netbeans.html#netbeans-protocol" name="netbeans-protocol">netbeans-protocol</a><br>
<br>
The communication between the Vim Controller and Vim uses plain text<br>
messages. This protocol was first designed to work with the external editor<br>
module of NetBeans. Later it was extended to work with Agide (A-A-P GUI IDE,<br>
see <span class="Constant"><a href="http://www.a-a-p.org">http://www.a-a-p.org</a></span>) and then with other IDE. The extensions are marked<br>
with "version 2.1".<br>
<br>
Version 2.2 of the protocol has several minor changes which should only affect<br>
NetBeans users (ie, not Agide users). However, a bug was fixed which could<br>
cause confusion. The netbeans_saved() function sent a "save" protocol<br>
command. In protocol version 2.1 and earlier this was incorrectly interpreted<br>
as a notification that a write had taken place. In reality, it told NetBeans<br>
to save the file so multiple writes were being done. This caused various<br>
problems and has been fixed in 2.2. To decrease the likelihood of this<br>
confusion happening again, netbeans_saved() has been renamed to<br>
netbeans_save_buffer().<br>
<br>
We are now at version 2.5. For the differences between 2.4 and 2.5 search for<br>
"2.5" below.<br>
<br>
The messages are currently sent over a socket. Since the messages are in<br>
plain UTF-8 text this protocol could also be used with any other communication<br>
mechanism.<br>
<br>
Netbeans messages are processed when Vim is idle, waiting for user input.<br>
When Vim is run in non-interactive mode, for example when running an automated<br>
test case that sources a Vim script, the idle loop may not be called often<br>
enough. In that case, insert <a class="Identifier" href="various.html#:sleep">:sleep</a> commands in the Vim script. The <a class="Identifier" href="various.html#:sleep">:sleep</a><br>
command does invoke Netbeans messages processing.<br>
<br>
6.1 Kinds of messages <a class="Identifier" href="netbeans.html#nb-messages">nb-messages</a><br>
6.2 Terms <a class="Identifier" href="netbeans.html#nb-terms">nb-terms</a><br>
6.3 Commands <a class="Identifier" href="netbeans.html#nb-commands">nb-commands</a><br>
6.4 Functions and Replies <a class="Identifier" href="netbeans.html#nb-functions">nb-functions</a><br>
6.5 Events <a class="Identifier" href="netbeans.html#nb-events">nb-events</a><br>
6.6 Special messages <a class="Identifier" href="netbeans.html#nb-special">nb-special</a><br>
6.7 Protocol errors <a class="Identifier" href="netbeans.html#nb-protocol_errors">nb-protocol_errors</a><br>
<br>
<br>
6.1 Kinds of messages <a class="Constant" href="netbeans.html#nb-messages" name="nb-messages">nb-messages</a><br>
<br>
There are four kinds of messages:<br>
<br>
<span class="PreProc">kind direction comment</span><br>
Command IDE -> editor no reply necessary<br>
Function IDE -> editor editor must send back a reply<br>
Reply editor -> IDE only in response to a Function<br>
Event editor -> IDE no reply necessary<br>
<br>
The messages are sent as a single line with a terminating newline character.<br>
Arguments are separated by a single space. The first item of the message<br>
depends on the kind of message:<br>
<br>
<span class="PreProc">kind first item example</span><br>
Command bufID:name!seqno 11:showBalloon!123 "text"<br>
Function bufID:name/seqno 11:getLength/123<br>
Reply seqno 123 5000<br>
Event bufID:name=seqno 11:keyCommand=123 "S-F2"<br>
<br>
<br>
<br>
6.2 Terms <a class="Constant" href="netbeans.html#nb-terms" name="nb-terms">nb-terms</a><br>
<br>
bufID Buffer number. A message may be either for a specific buffer<br>
or generic. Generic messages use a bufID of zero. <span class="Todo">NOTE</span>: this<br>
buffer ID is assigned by the IDE, it is not Vim's buffer<br>
number. The bufID must be a sequentially rising number,<br>
starting at one. When the <a class="Type" href="options.html#'switchbuf'">'switchbuf'</a> option is set to<br>
"usetab" and the "bufID" buffer is not found in the current<br>
tab page, the netbeans commands and functions that set this<br>
buffer as the current buffer will jump to the first open<br>
window that contains this buffer in other tab pages instead of<br>
replacing the buffer in the current window.<br>
<br>
seqno The IDE uses a sequence number for Commands and Functions. A<br>
Reply must use the sequence number of the Function that it is<br>
associated with. A zero sequence number can be used for<br>
Events (the seqno of the last received Command or Function can<br>
also be used).<br>
<br>
string Argument in double quotes. Text is in UTF-8 encoding. This<br>
means ASCII is passed as-is. Special characters are<br>
represented with a backslash:<br>
\" double quote<br>
\n newline<br>
\r carriage-return<br>
\t tab (optional, also works literally)<br>
\\ backslash<br>
NUL bytes are not allowed!<br>
<br>
boolean Argument with two possible values:<br>
T true<br>
F false<br>
<br>
number Argument with a decimal number.<br>
<br>
color Argument with either a decimal number, "none" (without the<br>
quotes) or the name of a color (without the quotes) defined<br>
both in the color list in <a class="Identifier" href="syntax.html#highlight-ctermfg">highlight-ctermfg</a> and in the color<br>
list in <a class="Identifier" href="syntax.html#gui-colors">gui-colors</a>.<br>
New in version 2.5.<br>
<br>
offset A number argument that indicates a byte position in a buffer.<br>
The first byte has offset zero. Line breaks are counted for<br>
how they appear in the file (CR/LF counts for two bytes).<br>
<span class="Todo">Note</span> that a multi-byte character is counted for the number of<br>
bytes it takes.<br>
<br>
lnum/col Argument with a line number and column number position. The<br>
line number starts with one, the column is the byte position,<br>
starting with zero. <span class="Todo">Note</span> that a multi-byte character counts<br>
for several columns.<br>
<br>
pathname String argument: file name with full path.<br>
<br>
<br>
6.3 Commands <a class="Constant" href="netbeans.html#nb-commands" name="nb-commands">nb-commands</a><br>
<br>
actionMenuItem Not implemented.<br>
<br>
actionSensitivity<br>
Not implemented.<br>
<br>
addAnno serNum typeNum off len<br>
Place an annotation in this buffer.<br>
Arguments:<br>
serNum number serial number of this placed<br>
annotation, used to be able to remove<br>
it<br>
typeNum number sequence number of the annotation<br>
defined with defineAnnoType for this<br>
buffer<br>
off number offset where annotation is to be placed<br>
len number not used<br>
In version 2.1 "lnum/col" can be used instead of "off".<br>
<br>
balloonResult text<br>
Not implemented.<br>
<br>
close Close the buffer. This leaves us without current buffer, very<br>
dangerous to use!<br>
<br>
create Creates a buffer without a name. Replaces the current buffer<br>
(it's hidden when it was changed).<br>
The Vim Controller should use this as the first command for a<br>
file that is being opened. The sequence of commands could be:<br>
create<br>
setCaretListener (ignored)<br>
setModified (no effect)<br>
setContentType (ignored)<br>
startDocumentListen<br>
setTitle<br>
setFullName<br>
<br>
defineAnnoType typeNum typeName tooltip glyphFile fg bg<br>
Define a type of annotation for this buffer.<br>
Arguments:<br>
typeNum number sequence number (not really used)<br>
typeName string name that identifies this annotation<br>
tooltip string not used<br>
glyphFile string name of icon file<br>
fg color foreground color for line highlighting<br>
bg color background color for line highlighting<br>
Vim will define a sign for the annotation.<br>
When color is a number, this is the "#rrggbb" Red, Green and<br>
Blue values of the color (see <a class="Identifier" href="syntax.html#gui-colors">gui-colors</a>) and the<br>
highlighting is only defined for GVim.<br>
When color is a name, this color is defined both for Vim<br>
running in a color terminal and for GVim.<br>
When both "fg" and "bg" are "none" no line highlighting is<br>
used (new in version 2.1).<br>
When "glyphFile" is empty, no text sign is used (new in<br>
version 2.1).<br>
When "glyphFile" is one or two characters long, a text sign is<br>
defined (new in version 2.1).<br>
<span class="Todo">Note</span>: the annotations will be defined in sequence, and the<br>
sequence number is later used with addAnno.<br>
<br>
editFile pathname<br>
Set the name for the buffer and edit the file "pathname", a<br>
string argument.<br>
Normal way for the IDE to tell the editor to edit a file.<br>
<br>
You must set a bufId different of 0 with this command to<br>
assign a bufId to the buffer. It will trigger an event<br>
fileOpened with a bufId of 0 but the buffer has been assigned.<br>
<br>
If the IDE is going to pass the file text to the editor use<br>
these commands instead:<br>
setFullName<br>
insert<br>
initDone<br>
New in version 2.1.<br>
<br>
enableBalloonEval<br>
Not implemented.<br>
<br>
endAtomic End an atomic operation. The changes between "startAtomic"<br>
and "endAtomic" can be undone as one operation. But it's not<br>
implemented yet. Redraw when necessary.<br>
<br>
guard off len<br>
Mark an area in the buffer as guarded. This means it cannot<br>
be edited. "off" and "len" are numbers and specify the text<br>
to be guarded.<br>
<br>
initDone Mark the buffer as ready for use. Implicitly makes the buffer<br>
the current buffer. Fires the BufReadPost autocommand event.<br>
<br>
insertDone<br>
Sent by Vim Controller to tell Vim an initial file insert is<br>
done. This triggers a read message being printed. Prior to<br>
version 2.3, no read messages were displayed after opening a<br>
file. New in version 2.3.<br>
<br>
moveAnnoToFront serNum<br>
Not implemented.<br>
<br>
netbeansBuffer isNetbeansBuffer<br>
If "isNetbeansBuffer" is "T" then this buffer is "owned" by<br>
NetBeans.<br>
New in version 2.2.<br>
<br>
putBufferNumber pathname<br>
Associate a buffer number with the Vim buffer by the name<br>
"pathname", a string argument. To be used when the editor<br>
reported editing another file to the IDE and the IDE needs to<br>
tell the editor what buffer number it will use for this file.<br>
Also marks the buffer as initialized.<br>
New in version 2.1.<br>
<br>
raise Bring the editor to the foreground.<br>
Only when Vim is run with a GUI.<br>
New in version 2.1.<br>
<br>
removeAnno serNum<br>
Remove a previously placed annotation for this buffer.<br>
"serNum" is the same number used in addAnno.<br>
<br>
save Save the buffer when it was modified. The other side of the<br>
interface is expected to write the buffer and invoke<br>
"setModified" to reset the "changed" flag of the buffer.<br>
The writing is skipped when one of these conditions is true:<br>
- <a class="Type" href="options.html#'write'">'write'</a> is not set<br>
- the buffer is read-only<br>
- the buffer does not have a file name<br>
- <a class="Type" href="options.html#'buftype'">'buftype'</a> disallows writing<br>
New in version 2.2.<br>
<br>
saveDone<br>
Sent by Vim Controller to tell Vim a save is done. This<br>
triggers a save message being printed. Prior to version 2.3,<br>
no save messages were displayed after a save.<br>
New in version 2.3.<br>
<br>
setAsUser Not implemented.<br>
<br>
setBufferNumber pathname<br>
Associate a buffer number with Vim buffer by the name<br>
"pathname". To be used when the editor reported editing<br>
another file to the IDE and the IDE needs to tell the editor<br>
what buffer number it will use for this file.<br>
Has the side effect of making the buffer the current buffer.<br>
See "putBufferNumber" for a more useful command.<br>
<br>
setContentType<br>
Not implemented.<br>
<br>
setDot off Make the buffer the current buffer and set the cursor at the<br>
specified position. If the buffer is open in another window<br>
than make that window the current window.<br>
If there are folds they are opened to make the cursor line<br>
visible.<br>
In version 2.1 "lnum/col" can be used instead of "off".<br>
<br>
setExitDelay seconds<br>
Set the delay for exiting to "seconds", a number.<br>
This delay is used to give the IDE a chance to handle things<br>
before really exiting. The default delay is two seconds.<br>
New in version 2.1.<br>
Obsolete in version 2.3.<br>
<br>
setFullName pathname<br>
Set the file name to be used for a buffer to "pathname", a<br>
string argument.<br>
Used when the IDE wants to edit a file under control of the<br>
IDE. This makes the buffer the current buffer, but does not<br>
read the file. "insert" commands will be used next to set the<br>
contents.<br>
<br>
setLocAndSize Not implemented.<br>
<br>
setMark Not implemented.<br>
<br>
setModified modified<br>
When the boolean argument "modified" is "T" mark the buffer as<br>
modified, when it is "F" mark it as unmodified.<br>
<br>
setModtime time<br>
Update a buffers modification time after the file has been<br>
saved directly by the Vim Controller.<br>
New in version 2.3.<br>
<br>
setReadOnly<br>
Set a file as readonly<br>
Implemented in version 2.3.<br>
<br>
setStyle Not implemented.<br>
<br>
setTitle name<br>
Set the title for the buffer to "name", a string argument.<br>
The title is only used for the Vim Controller functions, not<br>
by Vim.<br>
<br>
setVisible visible<br>
When the boolean argument "visible" is "T", goto the buffer.<br>
The "F" argument does nothing.<br>
<br>
showBalloon text<br>
Show a balloon (popup window) at the mouse pointer position,<br>
containing "text", a string argument. The balloon should<br>
disappear when the mouse is moved more than a few pixels.<br>
Only when Vim is run with a GUI.<br>
New in version 2.1.<br>
<br>
specialKeys<br>
Map a set of keys (mostly function keys) to be passed back<br>
to the Vim Controller for processing. This lets regular IDE<br>
hotkeys be used from Vim.<br>
Implemented in version 2.3.<br>
<br>
startAtomic Begin an atomic operation. The screen will not be updated<br>
until "endAtomic" is given.<br>
<br>
startCaretListen<br>
Not implemented.<br>
<br>
startDocumentListen<br>
Mark the buffer to report changes to the IDE with the<br>
"insert" and "remove" events. The default is to report<br>
changes.<br>
<br>
stopCaretListen<br>
Not implemented.<br>
<br>
stopDocumentListen<br>
Mark the buffer to stop reporting changes to the IDE.<br>
Opposite of startDocumentListen.<br>
<span class="Todo">NOTE</span>: if "netbeansBuffer" was used to mark this buffer as a<br>
NetBeans buffer, then the buffer is deleted in Vim. This is<br>
for compatibility with Sun Studio 10.<br>
<br>
unguard off len<br>
Opposite of "guard", remove guarding for a text area.<br>
Also sets the current buffer, if necessary.<br>
<br>
version Not implemented.<br>
<br>
<br>
6.4 Functions and Replies <a class="Constant" href="netbeans.html#nb-functions" name="nb-functions">nb-functions</a><br>
<br>
getDot Not implemented.<br>
<br>
getCursor Return the current buffer and cursor position.<br>
The reply is:<br>
seqno bufID lnum col off<br>
seqno = sequence number of the function<br>
bufID = buffer ID of the current buffer (if this is unknown -1<br>
is used)<br>
lnum = line number of the cursor (first line is one)<br>
col = column number of the cursor (in bytes, zero based)<br>
off = offset of the cursor in the buffer (in bytes)<br>
New in version 2.1.<br>
<br>
getLength Return the length of the buffer in bytes.<br>
Reply example for a buffer with 5000 bytes:<br>
123 5000<br>
TODO: explain use of partial line.<br>
<br>
getMark Not implemented.<br>
<br>
getAnno serNum<br>
Return the line number of the annotation in the buffer.<br>
Argument:<br>
serNum serial number of this placed annotation<br>
The reply is:<br>
123 lnum line number of the annotation<br>
123 0 invalid annotation serial number<br>
New in version 2.4.<br>
<br>
getModified When a buffer is specified: Return zero if the buffer does not<br>
have changes, one if it does have changes.<br>
When no buffer is specified (buffer number zero): Return the<br>
number of buffers with changes. When the result is zero it's<br>
safe to tell Vim to exit.<br>
New in version 2.1.<br>
<br>
getText Return the contents of the buffer as a string.<br>
Reply example for a buffer with two lines<br>
123 "first line\nsecond line\n"<br>
<span class="Todo">NOTE</span>: docs indicate an offset and length argument, but this is<br>
not implemented.<br>
<br>
insert off text<br>
Insert "text" before position "off". "text" is a string<br>
argument, "off" a number.<br>
"text" should have a "\n" (newline) at the end of each line.<br>
Or "\r\n" when <a class="Type" href="options.html#'fileformat'">'fileformat'</a> is "dos". When using "insert" in<br>
an empty buffer Vim will set <a class="Type" href="options.html#'fileformat'">'fileformat'</a> accordingly.<br>
When "off" points to the start of a line the text is inserted<br>
above this line. Thus when "off" is zero lines are inserted<br>
before the first line.<br>
When "off" points after the start of a line, possibly on the<br>
NUL at the end of a line, the first line of text is appended<br>
to this line. Further lines come below it.<br>
Possible replies:<br>
123 no problem<br>
123 !message failed<br>
<span class="Todo">Note</span> that the message in the reply is not quoted.<br>
Also sets the current buffer, if necessary.<br>
Does not move the cursor to the changed text.<br>
Resets undo information.<br>
<br>
remove off length<br>
Delete "length" bytes of text at position "off". Both<br>
arguments are numbers.<br>
Possible replies:<br>
123 no problem<br>
123 !message failed<br>
<span class="Todo">Note</span> that the message in the reply is not quoted.<br>
Also sets the current buffer, if necessary.<br>
<br>
saveAndExit Perform the equivalent of closing Vim: ":confirm qall".<br>
If there are no changed files or the user does not cancel the<br>
operation Vim exits and no result is sent back. The IDE can<br>
consider closing the connection as a successful result.<br>
If the user cancels the operation the number of modified<br>
buffers that remains is returned and Vim does not exit.<br>
New in version 2.1.<br>
<br>
<br>
6.5 Events <a class="Constant" href="netbeans.html#nb-events" name="nb-events">nb-events</a><br>
<br>
balloonEval off len type<br>
The mouse pointer rests on text for a short while. When "len"<br>
is zero, there is no selection and the pointer is at position<br>
"off". When "len" is non-zero the text from position "off" to<br>
"off" + "len" is selected.<br>
Only sent after "enableBalloonEval" was used for this buffer.<br>
"type" is not yet defined.<br>
Not implemented yet.<br>
<br>
balloonText text<br>
Used when <a class="Type" href="options.html#'ballooneval'">'ballooneval'</a> is set and the mouse pointer rests on<br>
some text for a moment. "text" is a string, the text under<br>
the mouse pointer.<br>
Only when Vim is run with a GUI.<br>
New in version 2.1.<br>
<br>
buttonRelease button lnum col<br>
Report which button was pressed and the location of the cursor<br>
at the time of the release. Only for buffers that are owned<br>
by the Vim Controller. This event is not sent if the button<br>
was released while the mouse was in the status line or in a<br>
separator line. If col is less than 1 the button release was<br>
in the sign area.<br>
New in version 2.2.<br>
<br>
disconnect<br>
Tell the Vim Controller that Vim is exiting and not to try and<br>
read or write more commands.<br>
New in version 2.3.<br>
<br>
fileClosed Not implemented.<br>
<br>
fileModified Not implemented.<br>
<br>
fileOpened pathname open modified<br>
A file was opened by the user.<br>
Arguments:<br>
pathname string name of the file<br>
open boolean always "T"<br>
modified boolean always "F"<br>
<br>
geometry cols rows x y<br>
Report the size and position of the editor window.<br>
Arguments:<br>
cols number number of text columns<br>
rows number number of text rows<br>
x number pixel position on screen<br>
y number pixel position on screen<br>
Only works for Motif.<br>
<br>
insert off text<br>
Text "text" has been inserted in Vim at position "off".<br>
Only fired when enabled, see "startDocumentListen".<br>
<br>
invokeAction Not implemented.<br>
<br>
keyCommand keyName<br>
Reports a special key being pressed with name "keyName", which<br>
is a string.<br>
Supported key names:<br>
F1 function key 1<br>
F2 function key 2<br>
...<br>
F12 function key 12<br>
<br>
' ' space (without the quotes)<br>
! exclamation mark<br>
... any other ASCII printable character<br>
~ tilde<br>
<br>
X any unrecognized key<br>
<br>
The key may be prepended by "C", "S" and/or "M" for Control,<br>
Shift and Meta (Alt) modifiers. If there is a modifier a dash<br>
is used to separate it from the key name. For example:<br>
"C-F2".<br>
ASCII characters are new in version 2.1.<br>
<br>
keyAtPos keyName lnum/col<br>
Like "keyCommand" and also report the line number and column<br>
of the cursor.<br>
New in version 2.1.<br>
<br>
killed A file was deleted or wiped out by the user and the buffer<br>
annotations have been removed. The bufID number for this<br>
buffer has become invalid. Only for files that have been<br>
assigned a bufID number by the IDE.<br>
<br>
newDotAndMark off off<br>
Reports the position of the cursor being at "off" bytes into<br>
the buffer. Only sent just before a "keyCommand" event.<br>
<br>
quit Not implemented.<br>
<br>
remove off len<br>
Text was deleted in Vim at position "off" with byte length<br>
"len".<br>
Only fired when enabled, see "startDocumentListen".<br>
<br>
revert Not implemented.<br>
<br>
save The buffer has been saved and is now unmodified.<br>
Only fired when enabled, see "startDocumentListen".<br>
<br>
startupDone The editor has finished its startup work and is ready for<br>
editing files.<br>
New in version 2.1.<br>
<br>
unmodified The buffer is now unmodified.<br>
Only fired when enabled, see "startDocumentListen".<br>
<br>
version vers Report the version of the interface implementation. Vim<br>
reports "2.4" (including the quotes).<br>
<br>
<br>
6.6 Special messages <a class="Constant" href="netbeans.html#nb-special" name="nb-special">nb-special</a><br>
<br>
These messages do not follow the style of the messages above. They are<br>
terminated by a newline character.<br>
<br>
ACCEPT Not used.<br>
<br>
AUTH password editor -> IDE: First message that the editor sends to the IDE.<br>
Must contain the password for the socket server, as specified<br>
with the <a class="Identifier" href="starting.html#-nb">-nb</a> argument. No quotes are used!<br>
<br>
DISCONNECT IDE -> editor: break the connection. The editor will exit.<br>
The IDE must only send this message when there are no unsaved<br>
changes!<br>
<br>
DETACH IDE -> editor: break the connection without exiting the<br>
editor. Used when the IDE exits without bringing down the<br>
editor as well.<br>
New in version 2.1.<br>
<br>
REJECT Not used.<br>
<br>
<br>
6.7 Protocol errors <a class="Constant" href="netbeans.html#nb-protocol_errors" name="nb-protocol_errors">nb-protocol_errors</a><br>
<br>
These errors occur when a message violates the protocol:<br>
<a class="Constant" href="netbeans.html#E627" name="E627">E627</a> <a class="Constant" href="netbeans.html#E628" name="E628">E628</a> <a class="Constant" href="netbeans.html#E629" name="E629">E629</a> <a class="Constant" href="netbeans.html#E632" name="E632">E632</a> <a class="Constant" href="netbeans.html#E633" name="E633">E633</a> <a class="Constant" href="netbeans.html#E634" name="E634">E634</a> <a class="Constant" href="netbeans.html#E635" name="E635">E635</a> <a class="Constant" href="netbeans.html#E636" name="E636">E636</a><br>
<a class="Constant" href="netbeans.html#E637" name="E637">E637</a> <a class="Constant" href="netbeans.html#E638" name="E638">E638</a> <a class="Constant" href="netbeans.html#E639" name="E639">E639</a> <a class="Constant" href="netbeans.html#E640" name="E640">E640</a> <a class="Constant" href="netbeans.html#E641" name="E641">E641</a> <a class="Constant" href="netbeans.html#E642" name="E642">E642</a> <a class="Constant" href="netbeans.html#E643" name="E643">E643</a> <a class="Constant" href="netbeans.html#E644" name="E644">E644</a> <a class="Constant" href="netbeans.html#E645" name="E645">E645</a> <a class="Constant" href="netbeans.html#E646" name="E646">E646</a><br>
<a class="Constant" href="netbeans.html#E647" name="E647">E647</a> <a class="Constant" href="netbeans.html#E648" name="E648">E648</a> <a class="Constant" href="netbeans.html#E649" name="E649">E649</a> <a class="Constant" href="netbeans.html#E650" name="E650">E650</a> <a class="Constant" href="netbeans.html#E651" name="E651">E651</a> <a class="Constant" href="netbeans.html#E652" name="E652">E652</a><br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
7. NetBeans commands <a class="Constant" href="netbeans.html#netbeans-commands" name="netbeans-commands">netbeans-commands</a><br>
<br>
<a class="Constant" href="netbeans.html#:nbstart" name=":nbstart">:nbstart</a> <a class="Constant" href="netbeans.html#E511" name="E511">E511</a> <a class="Constant" href="netbeans.html#E838" name="E838">E838</a><br>
:nbs[tart] <span class="Special">{connection}</span> Start a new Netbeans session with <span class="Special">{connection}</span> as the<br>
socket connection parameters. The format of<br>
<span class="Special">{connection}</span> is described in <a class="Identifier" href="netbeans.html#netbeans-parameters">netbeans-parameters</a>.<br>
At any time, one may check if the netbeans socket is<br>
connected by running the command:<br>
':echo has("netbeans_enabled")'<br>
<br>
<a class="Constant" href="netbeans.html#:nbclose" name=":nbclose">:nbclose</a><br>
:nbc[lose] Close the current NetBeans session. Remove all placed<br>
signs.<br>
<br>
<a class="Constant" href="netbeans.html#:nbkey" name=":nbkey">:nbkey</a><br>
:nb[key] <span class="Special">{key}</span> Pass the <span class="Special">{key}</span> to the Vim Controller for processing.<br>
When a hot-key has been installed with the specialKeys<br>
command, this command can be used to generate a hotkey<br>
message to the Vim Controller.<br>
This command can also be used to pass any text to the<br>
Vim Controller. It is used by Pyclewn, for example,<br>
to build the complete set of gdb commands as Vim user<br>
commands.<br>
The events newDotAndMark, keyCommand and keyAtPos are<br>
generated (in this order).<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
8. Known problems <a class="Constant" href="netbeans.html#netbeans-problems" name="netbeans-problems">netbeans-problems</a><br>
<br>
NUL bytes are not possible. For editor -> IDE they will appear as NL<br>
characters. For IDE -> editor they cannot be inserted.<br>
<br>
A NetBeans session may be initiated with Vim running in a terminal, and<br>
continued later in a GUI environment after running the <a class="Identifier" href="gui_x11.html#:gui">:gui</a> command. In this<br>
case, the highlighting defined for the NetBeans annotations may be cleared<br>
when the ":gui" command sources .gvimrc and this file loads a colorscheme<br>
that runs the command ":highlight clear".<br>
New in version 2.5.<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
9. Debugging NetBeans protocol <a class="Constant" href="netbeans.html#netbeans-debugging" name="netbeans-debugging">netbeans-debugging</a><br>
<br>
To debug the Vim protocol, you must first compile Vim with debugging support<br>
and NetBeans debugging support. See <a class="Identifier" href="netbeans.html#netbeans-configure">netbeans-configure</a> for instructions<br>
about Vim compiling and how to enable debug support.<br>
<br>
When running Vim, set the following environment variables:<br>
<br>
export SPRO_GVIM_DEBUG=netbeans.log<br>
export SPRO_GVIM_DLEVEL=0xffffffff<br>
<br>
Vim will then log all the incoming and outgoing messages of the NetBeans<br>
protocol to the file netbeans.log .<br>
<br>
The content of netbeans.log after a session looks like this:<br>
Tue May 20 17:19:27 2008<br>
EVT: 0:startupDone=0<br>
CMD 1: (1) create<br>
CMD 2: (1) setTitle "testfile1.txt"<br>
CMD 3: (1) setFullName "testfile1.txt"<br>
EVT(suppressed): 1:remove=3 0 -1<br>
EVT: 1:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile1.txt" T F<br>
CMD 4: (1) initDone<br>
FUN 5: (0) getCursor<br>
REP 5: 1 1 0 0<br>
CMD 6: (2) create<br>
CMD 7: (2) setTitle "testfile2.txt"<br>
CMD 8: (2) setFullName "testfile2.txt"<br>
EVT(suppressed): 2:remove=8 0 -1<br>
EVT: 2:fileOpened=0 "d:\\work\\vimWrapper\\vimWrapper2\\pyvimwrapper\\tests\\testfile2.txt" T F<br>
CMD 9: (2) initDone<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
10. NetBeans External Editor<br>
<br>
<span class="Todo">NOTE</span>: This information is obsolete! Only relevant if you are using an old<br>
version of NetBeans.<br>
<br>
<br>
10.1. Downloading NetBeans <a class="Constant" href="netbeans.html#netbeans-download" name="netbeans-download">netbeans-download</a><br>
<br>
The NetBeans IDE is available for download from netbeans.org. You can download<br>
a released version, download sources, or use CVS to download the current<br>
source tree. If you choose to download sources, follow directions from<br>
netbeans.org on building NetBeans.<br>
<br>
Depending on the version of NetBeans you download, you may need to do further<br>
work to get the required External Editor module. This is the module which lets<br>
NetBeans work with gvim (or xemacs :-). See <span class="Constant"><a href="http://externaleditor.netbeans.org">http://externaleditor.netbeans.org</a></span><br>
for details on downloading this module if your NetBeans release does not have<br>
it.<br>
<br>
For C, C++, and Fortran support you will also need the cpp module. See<br>
<span class="Constant"><a href="http://cpp.netbeans.org">http://cpp.netbeans.org</a></span> for information regarding this module.<br>
<br>
You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day<br>
free trial. See <span class="Constant"><a href="http://www.sun.com">http://www.sun.com</a></span> for further details.<br>
<br>
<br>
10.2. NetBeans Key Bindings <a class="Constant" href="netbeans.html#netbeans-keybindings" name="netbeans-keybindings">netbeans-keybindings</a><br>
<br>
Vim understands a number of key bindings that execute NetBeans commands.<br>
These are typically all the Function key combinations. To execute a NetBeans<br>
command, the user must press the Pause key followed by a NetBeans key binding.<br>
For example, in order to compile a Java file, the NetBeans key binding is<br>
"F9". So, while in vim, press "Pause F9" to compile a java file. To toggle a<br>
breakpoint at the current line, press "Pause Shift F8".<br>
<br>
The Pause key is Function key 21. If you don't have a working Pause key and<br>
want to use F8 instead, use:<br>
<br>
<div class="helpExample"> :map <F8> <F21></div>
<br>
The External Editor module dynamically reads the NetBeans key bindings so vim<br>
should always have the latest key bindings, even when NetBeans changes them.<br>
<br>
<br>
10.3. Preparing NetBeans for Vim <a class="Constant" href="netbeans.html#netbeans-preparation" name="netbeans-preparation">netbeans-preparation</a><br>
<br>
In order for NetBeans to work with vim, the NetBeans External Editor module<br>
must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition<br>
then this module should be loaded and enabled. If you have a NetBeans release<br>
you may need to find another way of obtaining this open source module.<br>
<br>
You can check if you have this module by opening the Tools->Options dialog<br>
and drilling down to the "Modules" list (IDE Configuration->System->Modules).<br>
If your Modules list has an entry for "External Editor" you must make sure<br>
it is enabled (the "Enabled" property should have the value "True"). If your<br>
Modules list has no External Editor see the next section on <a class="Identifier" href="netbeans.html#obtaining-exted">obtaining-exted</a>.<br>
<br>
<br>
10.4. Obtaining the External Editor Module <a class="Constant" href="netbeans.html#obtaining-exted" name="obtaining-exted">obtaining-exted</a><br>
<br>
There are 2 ways of obtaining the External Editor module. The easiest way<br>
is to use the NetBeans Update Center to download and install the module.<br>
Unfortunately, some versions do not have this module in their update<br>
center. If you cannot download via the update center you will need to<br>
download sources and build the module. I will try and get the module<br>
available from the NetBeans Update Center so building will be unnecessary.<br>
Also check <span class="Constant"><a href="http://externaleditor.netbeans.org">http://externaleditor.netbeans.org</a></span> for other availability options.<br>
<br>
To download the External Editor sources via CVS and build your own module,<br>
see <span class="Constant"><a href="http://externaleditor.netbeans.org">http://externaleditor.netbeans.org</a></span> and <span class="Constant"><a href="http://www.netbeans.org">http://www.netbeans.org</a></span>.<br>
Unfortunately, this is not a trivial procedure.<br>
<br>
<br>
10.5. Setting up NetBeans to run with Vim <a class="Constant" href="netbeans.html#netbeans-setup" name="netbeans-setup">netbeans-setup</a><br>
<br>
Assuming you have loaded and enabled the NetBeans External Editor module<br>
as described in <a class="Identifier" href="netbeans.html#netbeans-preparation">netbeans-preparation</a> all you need to do is verify that<br>
the gvim command line is properly configured for your environment.<br>
<br>
Open the Tools->Options dialog and open the Editing category. Select the<br>
External Editor. The right hand pane should contain a Properties tab and<br>
an Expert tab. In the Properties tab make sure the "Editor Type" is set<br>
to "Vim". In the Expert tab make sure the "Vim Command" is correct.<br>
<br>
You should be careful if you change the "Vim Command". There are command<br>
line options there which must be there for the connection to be properly<br>
set up. You can change the command name but that's about it. If your gvim<br>
can be found by your $PATH then the Vim Command can start with "gvim". If<br>
you don't want gvim searched from your $PATH then hard code in the full<br>
Unix path name. At this point you should get a gvim for any source file<br>
you open in NetBeans.<br>
<br>
If some files come up in gvim and others (with different file suffixes) come<br>
up in the default NetBeans editor you should verify the MIME type in the<br>
Expert tab MIME Type property. NetBeans is MIME oriented and the External<br>
Editor will only open MIME types specified in this property.<br>
<br>
<br>
vim:tw=78:ts=8:ft=help:norl:<br>
</div>
</article>
<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>
<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->
</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。