代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>sign - 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>
/ sign<br />
<a name="top"></a><h1>sign - 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="sign.html" name="sign.txt">sign.txt</a> For <span class="Identifier">Vim version 8.0.</span> Last change: 2016 Aug 17<br>
<br>
<br>
<span class="Identifier">VIM REFERENCE MANUAL by Gordon Prieur</span><br>
and Bram Moolenaar<br>
<br>
<br>
Sign Support Features <a class="Constant" href="sign.html#sign-support" name="sign-support">sign-support</a><br>
<br>
1. Introduction <a class="Identifier" href="sign.html#sign-intro">sign-intro</a><br>
2. Commands <a class="Identifier" href="sign.html#sign-commands">sign-commands</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#+signs">+signs</a><span class="Special"> feature}</span><br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Introduction <a class="Constant" href="sign.html#sign-intro" name="sign-intro">sign-intro</a> <a class="Constant" href="sign.html#signs" name="signs">signs</a><br>
<br>
When a debugger or other IDE tool is driving an editor it needs to be able<br>
to give specific highlights which quickly tell the user useful information<br>
about the file. One example of this would be a debugger which had an icon<br>
in the left-hand column denoting a breakpoint. Another example might be an<br>
arrow representing the Program Counter (PC). The sign features allow both<br>
placement of a sign, or icon, in the left-hand side of the window and<br>
definition of a highlight which will be applied to that line. Displaying the<br>
sign as an image is most likely only feasible in gvim (although Sun<br>
Microsystem's dtterm does support this it's the only terminal emulator I know<br>
of which does). A text sign and the highlight should be feasible in any color<br>
terminal emulator.<br>
<br>
Signs and highlights are not useful just for debuggers. Sun's Visual<br>
WorkShop uses signs and highlights to mark build errors and SourceBrowser<br>
hits. Additionally, the debugger supports 8 to 10 different signs and<br>
highlight colors. <a class="Identifier" href="workshop.html#workshop">workshop</a> Same for Netbeans <a class="Identifier" href="netbeans.html#netbeans">netbeans</a>.<br>
<br>
There are two steps in using signs:<br>
<br>
1. Define the sign. This specifies the image, text and highlighting. For<br>
example, you can define a "break" sign with an image of a stop roadsign and<br>
text "!!".<br>
<br>
2. Place the sign. This specifies the file and line number where the sign is<br>
displayed. A defined sign can be placed several times in different lines<br>
and files.<br>
<br>
When signs are defined for a file, Vim will automatically add a column of two<br>
characters to display them in. When the last sign is unplaced the column<br>
disappears again. This behavior can be changed with the <a class="Type" href="options.html#'signcolumn'">'signcolumn'</a> option.<br>
<br>
The color of the column is set with the SignColumn group <a class="Identifier" href="syntax.html#hl-SignColumn">hl-SignColumn</a>.<br>
Example to set the color:<br>
<br>
<div class="helpExample"> :highlight SignColumn guibg=darkgrey</div>
<br>
<span class="PreProc">==============================================================================</span><br>
2. Commands <a class="Constant" href="sign.html#sign-commands" name="sign-commands">sign-commands</a> <a class="Constant" href="sign.html#:sig" name=":sig">:sig</a> <a class="Constant" href="sign.html#:sign" name=":sign">:sign</a><br>
<br>
Here is an example that places a sign "piet", displayed with the text ">>", in<br>
line 23 of the current file:<br>
<div class="helpExample"> :sign define piet text=>> texthl=Search<br>
:exe ":sign place 2 line=23 name=piet file=" . expand("%:p")</div>
<br>
And here is the command to delete it again:<br>
<div class="helpExample"> :sign unplace 2</div>
<br>
<span class="Todo">Note</span> that the ":sign" command cannot be followed by another command or a<br>
comment. If you do need that, use the <a class="Identifier" href="eval.html#:execute">:execute</a> command.<br>
<br>
<br>
<span class="Statement">DEFINING A SIGN. </span><a class="Constant" href="sign.html#:sign-define" name=":sign-define">:sign-define</a> <a class="Constant" href="sign.html#E255" name="E255">E255</a> <a class="Constant" href="sign.html#E160" name="E160">E160</a> <a class="Constant" href="sign.html#E612" name="E612">E612</a><br>
<br>
:sign define <span class="Special">{name}</span> <span class="Special">{argument}</span>...<br>
Define a new sign or set attributes for an existing sign.<br>
The <span class="Special">{name}</span> can either be a number (all digits) or a name<br>
starting with a non-digit. Leading digits are ignored, thus<br>
"0012", "012" and "12" are considered the same name.<br>
About 120 different signs can be defined.<br>
<br>
Accepted arguments:<br>
<br>
icon=<span class="Special">{bitmap}</span><br>
Define the file name where the bitmap can be found. Should be<br>
a full path. The bitmap should fit in the place of two<br>
characters. This is not checked. If the bitmap is too big it<br>
will cause redraw problems. Only GTK 2 can scale the bitmap<br>
to fit the space available.<br>
<span class="PreProc">toolkit supports</span><br>
GTK 1 pixmap (.xpm)<br>
GTK 2 many<br>
Motif pixmap (.xpm)<br>
Win32 .bmp, .ico, .cur<br>
pixmap (.xpm) <a class="Identifier" href="various.html#+xpm_w32">+xpm_w32</a><br>
<br>
linehl=<span class="Special">{group}</span><br>
Highlighting group used for the whole line the sign is placed<br>
in. Most useful is defining a background color.<br>
<br>
text=<span class="Special">{text}</span> <a class="Constant" href="sign.html#E239" name="E239">E239</a><br>
Define the text that is displayed when there is no icon or the<br>
GUI is not being used. Only printable characters are allowed<br>
and they must occupy one or two display cells.<br>
<br>
texthl=<span class="Special">{group}</span><br>
Highlighting group used for the text item.<br>
<br>
<br>
<span class="Statement">DELETING A SIGN </span><a class="Constant" href="sign.html#:sign-undefine" name=":sign-undefine">:sign-undefine</a> <a class="Constant" href="sign.html#E155" name="E155">E155</a><br>
<br>
:sign undefine <span class="Special">{name}</span><br>
Deletes a previously defined sign. If signs with this <span class="Special">{name}</span><br>
are still placed this will cause trouble.<br>
<br>
<br>
<span class="Statement">LISTING SIGNS </span><a class="Constant" href="sign.html#:sign-list" name=":sign-list">:sign-list</a> <a class="Constant" href="sign.html#E156" name="E156">E156</a><br>
<br>
:sign list Lists all defined signs and their attributes.<br>
<br>
:sign list <span class="Special">{name}</span><br>
Lists one defined sign and its attributes.<br>
<br>
<br>
<span class="Statement">PLACING SIGNS </span><a class="Constant" href="sign.html#:sign-place" name=":sign-place">:sign-place</a> <a class="Constant" href="sign.html#E158" name="E158">E158</a><br>
<br>
:sign place <span class="Special">{id}</span> line=<span class="Special">{lnum}</span> name=<span class="Special">{name}</span> file=<span class="Special">{fname}</span><br>
Place sign defined as <span class="Special">{name}</span> at line <span class="Special">{lnum}</span> in file <span class="Special">{fname}</span>.<br>
<a class="Constant" href="sign.html#:sign-fname" name=":sign-fname">:sign-fname</a><br>
The file <span class="Special">{fname}</span> must already be loaded in a buffer. The<br>
exact file name must be used, wildcards, $ENV and ~ are not<br>
expanded, white space must not be escaped. Trailing white<br>
space is ignored.<br>
<br>
The sign is remembered under <span class="Special">{id}</span>, this can be used for<br>
further manipulation. <span class="Special">{id}</span> must be a number.<br>
It's up to the user to make sure the <span class="Special">{id}</span> is used only once in<br>
each file (if it's used several times unplacing will also have<br>
to be done several times and making changes may not work as<br>
expected).<br>
<br>
:sign place <span class="Special">{id}</span> line=<span class="Special">{lnum}</span> name=<span class="Special">{name}</span> buffer=<span class="Special">{nr}</span><br>
Same, but use buffer <span class="Special">{nr}</span>.<br>
<br>
<a class="Constant" href="sign.html#E885" name="E885">E885</a><br>
:sign place <span class="Special">{id}</span> name=<span class="Special">{name}</span> file=<span class="Special">{fname}</span><br>
Change the placed sign <span class="Special">{id}</span> in file <span class="Special">{fname}</span> to use the defined<br>
sign <span class="Special">{name}</span>. See remark above about <span class="Special">{fname}</span> <a class="Identifier" href="sign.html#:sign-fname">:sign-fname</a>.<br>
This can be used to change the displayed sign without moving<br>
it (e.g., when the debugger has stopped at a breakpoint).<br>
<br>
:sign place <span class="Special">{id}</span> name=<span class="Special">{name}</span> buffer=<span class="Special">{nr}</span><br>
Same, but use buffer <span class="Special">{nr}</span>.<br>
<br>
<br>
<span class="Statement">REMOVING SIGNS </span><a class="Constant" href="sign.html#:sign-unplace" name=":sign-unplace">:sign-unplace</a> <a class="Constant" href="sign.html#E159" name="E159">E159</a><br>
<br>
:sign unplace <span class="Special">{id}</span> file=<span class="Special">{fname}</span><br>
Remove the previously placed sign <span class="Special">{id}</span> from file <span class="Special">{fname}</span>.<br>
See remark above about <span class="Special">{fname}</span> <a class="Identifier" href="sign.html#:sign-fname">:sign-fname</a>.<br>
<br>
:sign unplace * file=<span class="Special">{fname}</span><br>
Remove all placed signs in file <span class="Special">{fname}</span>.<br>
<br>
:sign unplace <span class="Special">{id}</span> buffer=<span class="Special">{nr}</span><br>
Remove the previously placed sign <span class="Special">{id}</span> from buffer <span class="Special">{nr}</span>.<br>
<br>
:sign unplace * buffer=<span class="Special">{nr}</span><br>
Remove all placed signs in buffer <span class="Special">{nr}</span>.<br>
<br>
:sign unplace <span class="Special">{id}</span><br>
Remove the previously placed sign <span class="Special">{id}</span> from all files it<br>
appears in.<br>
<br>
:sign unplace *<br>
Remove all placed signs.<br>
<br>
:sign unplace<br>
Remove the placed sign at the cursor position.<br>
<br>
<br>
<span class="Statement">LISTING PLACED SIGNS </span><a class="Constant" href="sign.html#:sign-place-list" name=":sign-place-list">:sign-place-list</a><br>
<br>
:sign place file=<span class="Special">{fname}</span><br>
List signs placed in file <span class="Special">{fname}</span>.<br>
See remark above about <span class="Special">{fname}</span> <a class="Identifier" href="sign.html#:sign-fname">:sign-fname</a>.<br>
<br>
:sign place buffer=<span class="Special">{nr}</span><br>
List signs placed in buffer <span class="Special">{nr}</span>.<br>
<br>
:sign place List placed signs in all files.<br>
<br>
<br>
<span class="Statement">JUMPING TO A SIGN </span><a class="Constant" href="sign.html#:sign-jump" name=":sign-jump">:sign-jump</a> <a class="Constant" href="sign.html#E157" name="E157">E157</a><br>
<br>
:sign jump <span class="Special">{id}</span> file=<span class="Special">{fname}</span><br>
Open the file <span class="Special">{fname}</span> or jump to the window that contains<br>
<span class="Special">{fname}</span> and position the cursor at sign <span class="Special">{id}</span>.<br>
See remark above about <span class="Special">{fname}</span> <a class="Identifier" href="sign.html#:sign-fname">:sign-fname</a>.<br>
If the file isn't displayed in window and the current file can<br>
not be <a class="Identifier" href="editing.html#abandon">abandon</a>ed this fails.<br>
<br>
:sign jump <span class="Special">{id}</span> buffer=<span class="Special">{nr}</span> <a class="Constant" href="sign.html#E934" name="E934">E934</a><br>
Same, but use buffer <span class="Special">{nr}</span>. This fails if buffer <span class="Special">{nr}</span> does not<br>
have a name.<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: -->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。