sign.txt 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. *sign.txt* For Vim version 9.0. Last change: 2021 Dec 05
  2. VIM REFERENCE MANUAL by Gordon Prieur
  3. and Bram Moolenaar
  4. Sign Support Features *sign-support*
  5. 1. Introduction |sign-intro|
  6. 2. Commands |sign-commands|
  7. 3. Functions |sign-functions-details|
  8. {only available when compiled with the |+signs| feature}
  9. ==============================================================================
  10. 1. Introduction *sign-intro* *signs*
  11. When a debugger or other IDE tool is driving an editor it needs to be able
  12. to give specific highlights which quickly tell the user useful information
  13. about the file. One example of this would be a debugger which had an icon
  14. in the left-hand column denoting a breakpoint. Another example might be an
  15. arrow representing the Program Counter (PC). The sign features allow both
  16. placement of a sign, or icon, in the left-hand side of the window and
  17. definition of a highlight which will be applied to that line. Displaying the
  18. sign as an image is most likely only feasible in gvim (although Sun
  19. Microsystem's dtterm does support this it's the only terminal emulator I know
  20. of which does). A text sign and the highlight should be feasible in any color
  21. terminal emulator.
  22. Signs and highlights are not useful just for debuggers. Sun's Visual
  23. WorkShop uses signs and highlights to mark build errors and SourceBrowser
  24. hits. Additionally, the debugger supports 8 to 10 different signs and
  25. highlight colors, see |NetBeans|.
  26. There are two steps in using signs:
  27. 1. Define the sign. This specifies the image, text and highlighting. For
  28. example, you can define a "break" sign with an image of a stop roadsign and
  29. text "!!".
  30. 2. Place the sign. This specifies the file and line number where the sign is
  31. displayed. A defined sign can be placed several times in different lines
  32. and files.
  33. *sign-column*
  34. When signs are defined for a file, Vim will automatically add a column of two
  35. characters to display them in. When the last sign is unplaced the column
  36. disappears again. This behavior can be changed with the 'signcolumn' option.
  37. The color of the column is set with the SignColumn highlight group
  38. |hl-SignColumn|. Example to set the color: >
  39. :highlight SignColumn guibg=darkgrey
  40. <
  41. If 'cursorline' is enabled, then the CursorLineSign highlight group is used
  42. |hl-CursorLineSign|.
  43. *sign-identifier*
  44. Each placed sign is identified by a number called the sign identifier. This
  45. identifier is used to jump to the sign or to remove the sign. The identifier
  46. is assigned when placing the sign using the |:sign-place| command or the
  47. |sign_place()| function. Each sign identifier should be a unique number. If
  48. multiple placed signs use the same identifier, then jumping to or removing a
  49. sign becomes unpredictable. To avoid overlapping identifiers, sign groups can
  50. be used. The |sign_place()| function can be called with a zero sign identifier
  51. to allocate the next available identifier.
  52. *sign-group*
  53. Each placed sign can be assigned to either the global group or a named group.
  54. When placing a sign, if a group name is not supplied, or an empty string is
  55. used, then the sign is placed in the global group. Otherwise the sign is
  56. placed in the named group. The sign identifier is unique within a group. The
  57. sign group allows Vim plugins to use unique signs without interfering with
  58. other plugins using signs.
  59. To place a sign in a popup window the group name must start with "PopUp".
  60. Other signs will not show in a popup window. The group name "PopUpMenu" is
  61. used by popup windows where 'cursorline' is set.
  62. *sign-priority*
  63. Each placed sign is assigned a priority value. When multiple signs are placed
  64. on the same line, the attributes of the sign with the highest priority is used
  65. independently of the sign group. The default priority for a sign is 10. The
  66. priority is assigned at the time of placing a sign.
  67. When two signs with the same priority are present, and one has an icon or text
  68. in the signcolumn while the other has line highlighting, then both are
  69. displayed.
  70. When the line on which the sign is placed is deleted, the sign is moved to the
  71. next line (or the last line of the buffer, if there is no next line). When
  72. the delete is undone the sign does not move back.
  73. When a sign with line highlighting and 'cursorline' highlighting are both
  74. present, if the priority is 100 or more then the sign highlighting takes
  75. precedence, otherwise the 'cursorline' highlighting.
  76. ==============================================================================
  77. 2. Commands *sign-commands* *:sig* *:sign*
  78. Here is an example that places a sign "piet", displayed with the text ">>", in
  79. line 23 of the current file: >
  80. :sign define piet text=>> texthl=Search
  81. :exe ":sign place 2 line=23 name=piet file=" .. expand("%:p")
  82. And here is the command to delete it again: >
  83. :sign unplace 2
  84. Note that the ":sign" command cannot be followed by another command or a
  85. comment. If you do need that, use the |:execute| command.
  86. DEFINING A SIGN. *:sign-define* *E255* *E160* *E612*
  87. See |sign_define()| for the equivalent Vim script function.
  88. :sign define {name} {argument}...
  89. Define a new sign or set attributes for an existing sign.
  90. The {name} can either be a number (all digits) or a name
  91. starting with a non-digit. Leading zeros are ignored, thus
  92. "0012", "012" and "12" are considered the same name.
  93. About 120 different signs can be defined.
  94. Accepted arguments:
  95. icon={bitmap}
  96. Define the file name where the bitmap can be found. Should be
  97. a full path. The bitmap should fit in the place of two
  98. characters. This is not checked. If the bitmap is too big it
  99. will cause redraw problems. Only GTK 2 can scale the bitmap
  100. to fit the space available.
  101. toolkit supports ~
  102. GTK 1 pixmap (.xpm)
  103. GTK 2 many
  104. Motif pixmap (.xpm)
  105. Win32 .bmp, .ico, .cur
  106. pixmap (.xpm) |+xpm_w32|
  107. linehl={group}
  108. Highlighting group used for the whole line the sign is placed
  109. in. Most useful is defining a background color.
  110. numhl={group}
  111. Highlighting group used for the line number on the line where
  112. the sign is placed. Overrides |hl-LineNr|, |hl-LineNrAbove|,
  113. |hl-LineNrBelow|, and |hl-CursorLineNr|.
  114. text={text} *E239*
  115. Define the text that is displayed when there is no icon or the
  116. GUI is not being used. Only printable characters are allowed
  117. and they must occupy one or two display cells.
  118. texthl={group}
  119. Highlighting group used for the text item.
  120. culhl={group}
  121. Highlighting group used for the text item when the cursor is
  122. on the same line as the sign and 'cursorline' is enabled.
  123. Example: >
  124. :sign define MySign text=>> texthl=Search linehl=DiffText
  125. <
  126. DELETING A SIGN *:sign-undefine* *E155*
  127. See |sign_undefine()| for the equivalent Vim script function.
  128. :sign undefine {name}
  129. Deletes a previously defined sign. If signs with this {name}
  130. are still placed this will cause trouble.
  131. Example: >
  132. :sign undefine MySign
  133. <
  134. LISTING SIGNS *:sign-list* *E156*
  135. See |sign_getdefined()| for the equivalent Vim script function.
  136. :sign list Lists all defined signs and their attributes.
  137. :sign list {name}
  138. Lists one defined sign and its attributes.
  139. PLACING SIGNS *:sign-place* *E158*
  140. See |sign_place()| for the equivalent Vim script function.
  141. :sign place {id} line={lnum} name={name} file={fname}
  142. Place sign defined as {name} at line {lnum} in file {fname}.
  143. *:sign-fname*
  144. The file {fname} must already be loaded in a buffer. The
  145. exact file name must be used, wildcards, $ENV and ~ are not
  146. expanded, white space must not be escaped. Trailing white
  147. space is ignored.
  148. The sign is remembered under {id}, this can be used for
  149. further manipulation. {id} must be a number.
  150. It's up to the user to make sure the {id} is used only once in
  151. each file (if it's used several times unplacing will also have
  152. to be done several times and making changes may not work as
  153. expected).
  154. The following optional sign attributes can be specified before
  155. "file=":
  156. group={group} Place sign in sign group {group}
  157. priority={prio} Assign priority {prio} to sign
  158. By default, the sign is placed in the global sign group.
  159. By default, the sign is assigned a default priority of 10. To
  160. assign a different priority value, use "priority={prio}" to
  161. specify a value. The priority is used to determine the sign
  162. that is displayed when multiple signs are placed on the same
  163. line.
  164. Examples: >
  165. :sign place 5 line=3 name=sign1 file=a.py
  166. :sign place 6 group=g2 line=2 name=sign2 file=x.py
  167. :sign place 9 group=g2 priority=50 line=5
  168. \ name=sign1 file=a.py
  169. <
  170. :sign place {id} line={lnum} name={name} [buffer={nr}]
  171. Same, but use buffer {nr}. If the buffer argument is not
  172. given, place the sign in the current buffer.
  173. Example: >
  174. :sign place 10 line=99 name=sign3
  175. :sign place 10 line=99 name=sign3 buffer=3
  176. <
  177. *E885*
  178. :sign place {id} name={name} file={fname}
  179. Change the placed sign {id} in file {fname} to use the defined
  180. sign {name}. See remark above about {fname} |:sign-fname|.
  181. This can be used to change the displayed sign without moving
  182. it (e.g., when the debugger has stopped at a breakpoint).
  183. The optional "group={group}" attribute can be used before
  184. "file=" to select a sign in a particular group. The optional
  185. "priority={prio}" attribute can be used to change the priority
  186. of an existing sign.
  187. Example: >
  188. :sign place 23 name=sign1 file=/path/to/edit.py
  189. <
  190. :sign place {id} name={name} [buffer={nr}]
  191. Same, but use buffer {nr}. If the buffer argument is not
  192. given, use the current buffer.
  193. Example: >
  194. :sign place 23 name=sign1
  195. :sign place 23 name=sign1 buffer=7
  196. <
  197. REMOVING SIGNS *:sign-unplace* *E159*
  198. See |sign_unplace()| for the equivalent Vim script function.
  199. :sign unplace {id} file={fname}
  200. Remove the previously placed sign {id} from file {fname}.
  201. See remark above about {fname} |:sign-fname|.
  202. :sign unplace {id} group={group} file={fname}
  203. Same but remove the sign {id} in sign group {group}.
  204. :sign unplace {id} group=* file={fname}
  205. Same but remove the sign {id} from all the sign groups.
  206. :sign unplace * file={fname}
  207. Remove all placed signs in file {fname}.
  208. :sign unplace * group={group} file={fname}
  209. Remove all placed signs in group {group} from file {fname}.
  210. :sign unplace * group=* file={fname}
  211. Remove all placed signs in all the groups from file {fname}.
  212. :sign unplace {id} buffer={nr}
  213. Remove the previously placed sign {id} from buffer {nr}.
  214. :sign unplace {id} group={group} buffer={nr}
  215. Remove the previously placed sign {id} in group {group} from
  216. buffer {nr}.
  217. :sign unplace {id} group=* buffer={nr}
  218. Remove the previously placed sign {id} in all the groups from
  219. buffer {nr}.
  220. :sign unplace * buffer={nr}
  221. Remove all placed signs in buffer {nr}.
  222. :sign unplace * group={group} buffer={nr}
  223. Remove all placed signs in group {group} from buffer {nr}.
  224. :sign unplace * group=* buffer={nr}
  225. Remove all placed signs in all the groups from buffer {nr}.
  226. :sign unplace {id}
  227. Remove the previously placed sign {id} from all files it
  228. appears in.
  229. :sign unplace {id} group={group}
  230. Remove the previously placed sign {id} in group {group} from
  231. all files it appears in.
  232. :sign unplace {id} group=*
  233. Remove the previously placed sign {id} in all the groups from
  234. all the files it appears in.
  235. :sign unplace *
  236. Remove all placed signs in the global group from all the files.
  237. :sign unplace * group={group}
  238. Remove all placed signs in group {group} from all the files.
  239. :sign unplace * group=*
  240. Remove all placed signs in all the groups from all the files.
  241. :sign unplace
  242. Remove a placed sign at the cursor position. If multiple signs
  243. are placed in the line, then only one is removed.
  244. :sign unplace group={group}
  245. Remove a placed sign in group {group} at the cursor
  246. position.
  247. :sign unplace group=*
  248. Remove a placed sign in any group at the cursor position.
  249. LISTING PLACED SIGNS *:sign-place-list*
  250. See |sign_getplaced()| for the equivalent Vim script function.
  251. :sign place file={fname}
  252. List signs placed in file {fname}.
  253. See remark above about {fname} |:sign-fname|.
  254. :sign place group={group} file={fname}
  255. List signs in group {group} placed in file {fname}.
  256. :sign place group=* file={fname}
  257. List signs in all the groups placed in file {fname}.
  258. :sign place buffer={nr}
  259. List signs placed in buffer {nr}.
  260. :sign place group={group} buffer={nr}
  261. List signs in group {group} placed in buffer {nr}.
  262. :sign place group=* buffer={nr}
  263. List signs in all the groups placed in buffer {nr}.
  264. :sign place List placed signs in the global group in all files.
  265. :sign place group={group}
  266. List placed signs with sign group {group} in all files.
  267. :sign place group=*
  268. List placed signs in all sign groups in all files.
  269. JUMPING TO A SIGN *:sign-jump* *E157*
  270. See |sign_jump()| for the equivalent Vim script function.
  271. :sign jump {id} file={fname}
  272. Open the file {fname} or jump to the window that contains
  273. {fname} and position the cursor at sign {id}.
  274. See remark above about {fname} |:sign-fname|.
  275. If the file isn't displayed in window and the current file can
  276. not be |abandon|ed this fails.
  277. :sign jump {id} group={group} file={fname}
  278. Same but jump to the sign in group {group}
  279. :sign jump {id} [buffer={nr}] *E934*
  280. Same, but use buffer {nr}. This fails if buffer {nr} does not
  281. have a name. If the buffer argument is not given, use the
  282. current buffer.
  283. :sign jump {id} group={group} [buffer={nr}]
  284. Same but jump to the sign in group {group}
  285. ==============================================================================
  286. 3. Functions *sign-functions-details*
  287. sign_define({name} [, {dict}]) *sign_define()*
  288. sign_define({list})
  289. Define a new sign named {name} or modify the attributes of an
  290. existing sign. This is similar to the |:sign-define| command.
  291. Prefix {name} with a unique text to avoid name collisions.
  292. There is no {group} like with placing signs.
  293. The {name} can be a String or a Number. The optional {dict}
  294. argument specifies the sign attributes. The following values
  295. are supported:
  296. icon full path to the bitmap file for the sign.
  297. linehl highlight group used for the whole line the
  298. sign is placed in.
  299. numhl highlight group used for the line number where
  300. the sign is placed.
  301. text text that is displayed when there is no icon
  302. or the GUI is not being used.
  303. texthl highlight group used for the text item
  304. culhl highlight group used for the text item when
  305. the cursor is on the same line as the sign and
  306. 'cursorline' is enabled.
  307. If the sign named {name} already exists, then the attributes
  308. of the sign are updated.
  309. The one argument {list} can be used to define a list of signs.
  310. Each list item is a dictionary with the above items in {dict}
  311. and a "name" item for the sign name.
  312. Returns 0 on success and -1 on failure. When the one argument
  313. {list} is used, then returns a List of values one for each
  314. defined sign.
  315. Examples: >
  316. call sign_define("mySign", {
  317. \ "text" : "=>",
  318. \ "texthl" : "Error",
  319. \ "linehl" : "Search"})
  320. call sign_define([
  321. \ {'name' : 'sign1',
  322. \ 'text' : '=>'},
  323. \ {'name' : 'sign2',
  324. \ 'text' : '!!'}
  325. \ ])
  326. <
  327. Can also be used as a |method|: >
  328. GetSignList()->sign_define()
  329. sign_getdefined([{name}]) *sign_getdefined()*
  330. Get a list of defined signs and their attributes.
  331. This is similar to the |:sign-list| command.
  332. If the {name} is not supplied, then a list of all the defined
  333. signs is returned. Otherwise the attribute of the specified
  334. sign is returned.
  335. Each list item in the returned value is a dictionary with the
  336. following entries:
  337. icon full path to the bitmap file of the sign
  338. linehl highlight group used for the whole line the
  339. sign is placed in; not present if not set
  340. name name of the sign
  341. numhl highlight group used for the line number where
  342. the sign is placed; not present if not set
  343. text text that is displayed when there is no icon
  344. or the GUI is not being used.
  345. texthl highlight group used for the text item; not
  346. present if not set
  347. culhl highlight group used for the text item when
  348. the cursor is on the same line as the sign and
  349. 'cursorline' is enabled; not present if not
  350. set
  351. Returns an empty List if there are no signs and when {name} is
  352. not found.
  353. Examples: >
  354. " Get a list of all the defined signs
  355. echo sign_getdefined()
  356. " Get the attribute of the sign named mySign
  357. echo sign_getdefined("mySign")
  358. <
  359. Can also be used as a |method|: >
  360. GetSignList()->sign_getdefined()
  361. sign_getplaced([{buf} [, {dict}]]) *sign_getplaced()*
  362. Return a list of signs placed in a buffer or all the buffers.
  363. This is similar to the |:sign-place-list| command.
  364. If the optional buffer name {buf} is specified, then only the
  365. list of signs placed in that buffer is returned. For the use
  366. of {buf}, see |bufname()|. The optional {dict} can contain
  367. the following entries:
  368. group select only signs in this group
  369. id select sign with this identifier
  370. lnum select signs placed in this line. For the use
  371. of {lnum}, see |line()|.
  372. If {group} is '*', then signs in all the groups including the
  373. global group are returned. If {group} is not supplied or is an
  374. empty string, then only signs in the global group are
  375. returned. If no arguments are supplied, then signs in the
  376. global group placed in all the buffers are returned.
  377. See |sign-group|.
  378. Each list item in the returned value is a dictionary with the
  379. following entries:
  380. bufnr number of the buffer with the sign
  381. signs list of signs placed in {bufnr}. Each list
  382. item is a dictionary with the below listed
  383. entries
  384. The dictionary for each sign contains the following entries:
  385. group sign group. Set to '' for the global group.
  386. id identifier of the sign
  387. lnum line number where the sign is placed
  388. name name of the defined sign
  389. priority sign priority
  390. The returned signs in a buffer are ordered by their line
  391. number and priority.
  392. Returns an empty list on failure or if there are no placed
  393. signs.
  394. Examples: >
  395. " Get a List of signs placed in eval.c in the
  396. " global group
  397. echo sign_getplaced("eval.c")
  398. " Get a List of signs in group 'g1' placed in eval.c
  399. echo sign_getplaced("eval.c", {'group' : 'g1'})
  400. " Get a List of signs placed at line 10 in eval.c
  401. echo sign_getplaced("eval.c", {'lnum' : 10})
  402. " Get sign with identifier 10 placed in a.py
  403. echo sign_getplaced("a.py", {'id' : 10})
  404. " Get sign with id 20 in group 'g1' placed in a.py
  405. echo sign_getplaced("a.py", {'group' : 'g1',
  406. \ 'id' : 20})
  407. " Get a List of all the placed signs
  408. echo sign_getplaced()
  409. <
  410. Can also be used as a |method|: >
  411. GetBufname()->sign_getplaced()
  412. <
  413. *sign_jump()*
  414. sign_jump({id}, {group}, {buf})
  415. Open the buffer {buf} or jump to the window that contains
  416. {buf} and position the cursor at sign {id} in group {group}.
  417. This is similar to the |:sign-jump| command.
  418. If {group} is an empty string, then the global group is used.
  419. For the use of {buf}, see |bufname()|.
  420. Returns the line number of the sign. Returns -1 if the
  421. arguments are invalid.
  422. Example: >
  423. " Jump to sign 10 in the current buffer
  424. call sign_jump(10, '', '')
  425. <
  426. Can also be used as a |method|: >
  427. GetSignid()->sign_jump()
  428. <
  429. *sign_place()*
  430. sign_place({id}, {group}, {name}, {buf} [, {dict}])
  431. Place the sign defined as {name} at line {lnum} in file or
  432. buffer {buf} and assign {id} and {group} to sign. This is
  433. similar to the |:sign-place| command.
  434. If the sign identifier {id} is zero, then a new identifier is
  435. allocated. Otherwise the specified number is used. {group} is
  436. the sign group name. To use the global sign group, use an
  437. empty string. {group} functions as a namespace for {id}, thus
  438. two groups can use the same IDs. Refer to |sign-identifier|
  439. and |sign-group| for more information.
  440. {name} refers to a defined sign.
  441. {buf} refers to a buffer name or number. For the accepted
  442. values, see |bufname()|.
  443. The optional {dict} argument supports the following entries:
  444. lnum line number in the file or buffer
  445. {buf} where the sign is to be placed.
  446. For the accepted values, see |line()|.
  447. priority priority of the sign. See
  448. |sign-priority| for more information.
  449. If the optional {dict} is not specified, then it modifies the
  450. placed sign {id} in group {group} to use the defined sign
  451. {name}.
  452. Returns the sign identifier on success and -1 on failure.
  453. Examples: >
  454. " Place a sign named sign1 with id 5 at line 20 in
  455. " buffer json.c
  456. call sign_place(5, '', 'sign1', 'json.c',
  457. \ {'lnum' : 20})
  458. " Updates sign 5 in buffer json.c to use sign2
  459. call sign_place(5, '', 'sign2', 'json.c')
  460. " Place a sign named sign3 at line 30 in
  461. " buffer json.c with a new identifier
  462. let id = sign_place(0, '', 'sign3', 'json.c',
  463. \ {'lnum' : 30})
  464. " Place a sign named sign4 with id 10 in group 'g3'
  465. " at line 40 in buffer json.c with priority 90
  466. call sign_place(10, 'g3', 'sign4', 'json.c',
  467. \ {'lnum' : 40, 'priority' : 90})
  468. <
  469. Can also be used as a |method|: >
  470. GetSignid()->sign_place(group, name, expr)
  471. <
  472. *sign_placelist()*
  473. sign_placelist({list})
  474. Place one or more signs. This is similar to the
  475. |sign_place()| function. The {list} argument specifies the
  476. List of signs to place. Each list item is a dict with the
  477. following sign attributes:
  478. buffer buffer name or number. For the accepted
  479. values, see |bufname()|.
  480. group sign group. {group} functions as a namespace
  481. for {id}, thus two groups can use the same
  482. IDs. If not specified or set to an empty
  483. string, then the global group is used. See
  484. |sign-group| for more information.
  485. id sign identifier. If not specified or zero,
  486. then a new unique identifier is allocated.
  487. Otherwise the specified number is used. See
  488. |sign-identifier| for more information.
  489. lnum line number in the buffer {expr} where the
  490. sign is to be placed. For the accepted values,
  491. see |line()|.
  492. name name of the sign to place. See |sign_define()|
  493. for more information.
  494. priority priority of the sign. When multiple signs are
  495. placed on a line, the sign with the highest
  496. priority is used. If not specified, the
  497. default value of 10 is used. See
  498. |sign-priority| for more information.
  499. If {id} refers to an existing sign, then the existing sign is
  500. modified to use the specified {name} and/or {priority}.
  501. Returns a List of sign identifiers. If failed to place a
  502. sign, the corresponding list item is set to -1.
  503. Examples: >
  504. " Place sign s1 with id 5 at line 20 and id 10 at line
  505. " 30 in buffer a.c
  506. let [n1, n2] = sign_placelist([
  507. \ {'id' : 5,
  508. \ 'name' : 's1',
  509. \ 'buffer' : 'a.c',
  510. \ 'lnum' : 20},
  511. \ {'id' : 10,
  512. \ 'name' : 's1',
  513. \ 'buffer' : 'a.c',
  514. \ 'lnum' : 30}
  515. \ ])
  516. " Place sign s1 in buffer a.c at line 40 and 50
  517. " with auto-generated identifiers
  518. let [n1, n2] = sign_placelist([
  519. \ {'name' : 's1',
  520. \ 'buffer' : 'a.c',
  521. \ 'lnum' : 40},
  522. \ {'name' : 's1',
  523. \ 'buffer' : 'a.c',
  524. \ 'lnum' : 50}
  525. \ ])
  526. <
  527. Can also be used as a |method|: >
  528. GetSignlist()->sign_placelist()
  529. sign_undefine([{name}]) *sign_undefine()*
  530. sign_undefine({list})
  531. Deletes a previously defined sign {name}. This is similar to
  532. the |:sign-undefine| command. If {name} is not supplied, then
  533. deletes all the defined signs.
  534. The one argument {list} can be used to undefine a list of
  535. signs. Each list item is the name of a sign.
  536. Returns 0 on success and -1 on failure. For the one argument
  537. {list} call, returns a list of values one for each undefined
  538. sign.
  539. Examples: >
  540. " Delete a sign named mySign
  541. call sign_undefine("mySign")
  542. " Delete signs 'sign1' and 'sign2'
  543. call sign_undefine(["sign1", "sign2"])
  544. " Delete all the signs
  545. call sign_undefine()
  546. <
  547. Can also be used as a |method|: >
  548. GetSignlist()->sign_undefine()
  549. sign_unplace({group} [, {dict}]) *sign_unplace()*
  550. Remove a previously placed sign in one or more buffers. This
  551. is similar to the |:sign-unplace| command.
  552. {group} is the sign group name. To use the global sign group,
  553. use an empty string. If {group} is set to '*', then all the
  554. groups including the global group are used.
  555. The signs in {group} are selected based on the entries in
  556. {dict}. The following optional entries in {dict} are
  557. supported:
  558. buffer buffer name or number. See |bufname()|.
  559. id sign identifier
  560. If {dict} is not supplied, then all the signs in {group} are
  561. removed.
  562. Returns 0 on success and -1 on failure.
  563. Examples: >
  564. " Remove sign 10 from buffer a.vim
  565. call sign_unplace('', {'buffer' : "a.vim", 'id' : 10})
  566. " Remove sign 20 in group 'g1' from buffer 3
  567. call sign_unplace('g1', {'buffer' : 3, 'id' : 20})
  568. " Remove all the signs in group 'g2' from buffer 10
  569. call sign_unplace('g2', {'buffer' : 10})
  570. " Remove sign 30 in group 'g3' from all the buffers
  571. call sign_unplace('g3', {'id' : 30})
  572. " Remove all the signs placed in buffer 5
  573. call sign_unplace('*', {'buffer' : 5})
  574. " Remove the signs in group 'g4' from all the buffers
  575. call sign_unplace('g4')
  576. " Remove sign 40 from all the buffers
  577. call sign_unplace('*', {'id' : 40})
  578. " Remove all the placed signs from all the buffers
  579. call sign_unplace('*')
  580. < Can also be used as a |method|: >
  581. GetSigngroup()->sign_unplace()
  582. <
  583. sign_unplacelist({list}) *sign_unplacelist()*
  584. Remove previously placed signs from one or more buffers. This
  585. is similar to the |sign_unplace()| function.
  586. The {list} argument specifies the List of signs to remove.
  587. Each list item is a dict with the following sign attributes:
  588. buffer buffer name or number. For the accepted
  589. values, see |bufname()|. If not specified,
  590. then the specified sign is removed from all
  591. the buffers.
  592. group sign group name. If not specified or set to an
  593. empty string, then the global sign group is
  594. used. If set to '*', then all the groups
  595. including the global group are used.
  596. id sign identifier. If not specified, then all
  597. the signs in the specified group are removed.
  598. Returns a List where an entry is set to 0 if the corresponding
  599. sign was successfully removed or -1 on failure.
  600. Example: >
  601. " Remove sign with id 10 from buffer a.vim and sign
  602. " with id 20 from buffer b.vim
  603. call sign_unplacelist([
  604. \ {'id' : 10, 'buffer' : "a.vim"},
  605. \ {'id' : 20, 'buffer' : 'b.vim'},
  606. \ ])
  607. <
  608. Can also be used as a |method|: >
  609. GetSignlist()->sign_unplacelist()
  610. <
  611. vim:tw=78:ts=8:noet:ft=help:norl: