/
usr
/
share
/
vim
/
vim82
/
doc
/
/usr/share/vim/vim82/doc
mkdir
upload
Name
Size
Mode
Actions
arabic.txt
12204
0644
edit
dl
rm
autocmd.txt
74314
0644
edit
dl
rm
builtin.txt
389075
0644
edit
dl
rm
change.txt
79214
0644
edit
dl
rm
channel.txt
50387
0644
edit
dl
rm
cmdline.txt
50130
0644
edit
dl
rm
debug.txt
6896
0644
edit
dl
rm
debugger.txt
5443
0644
edit
dl
rm
develop.txt
22861
0644
edit
dl
rm
diff.txt
17515
0644
edit
dl
rm
digraph.txt
62082
0644
edit
dl
rm
editing.txt
75319
0644
edit
dl
rm
eval.txt
178282
0644
edit
dl
rm
farsi.txt
523
0644
edit
dl
rm
filetype.txt
27998
0644
edit
dl
rm
fold.txt
24139
0644
edit
dl
rm
ft_ada.txt
18246
0644
edit
dl
rm
ft_ps1.txt
2187
0644
edit
dl
rm
ft_raku.txt
4183
0644
edit
dl
rm
ft_rust.txt
9596
0644
edit
dl
rm
ft_sql.txt
30697
0644
edit
dl
rm
gui.txt
53076
0644
edit
dl
rm
gui_w32.txt
19117
0644
edit
dl
rm
gui_x11.txt
29906
0644
edit
dl
rm
hangulin.txt
598
0644
edit
dl
rm
hebrew.txt
5666
0644
edit
dl
rm
help.txt
9098
0644
edit
dl
rm
help.txt.vim-tiny
1431
0644
edit
dl
rm
helphelp.txt
15933
0644
edit
dl
rm
howto.txt
2916
0644
edit
dl
rm
if_cscop.txt
19325
0644
edit
dl
rm
if_lua.txt
18546
0644
edit
dl
rm
if_mzsch.txt
11941
0644
edit
dl
rm
if_ole.txt
7361
0644
edit
dl
rm
if_perl.txt
11281
0644
edit
dl
rm
if_pyth.txt
38644
0644
edit
dl
rm
if_ruby.txt
8516
0644
edit
dl
rm
if_sniff.txt
271
0644
edit
dl
rm
if_tcl.txt
22941
0644
edit
dl
rm
indent.txt
41902
0644
edit
dl
rm
index.txt
81125
0644
edit
dl
rm
insert.txt
87568
0644
edit
dl
rm
intro.txt
38934
0644
edit
dl
rm
map.txt
74464
0644
edit
dl
rm
mbyte.txt
59640
0644
edit
dl
rm
message.txt
31671
0644
edit
dl
rm
mlang.txt
8187
0644
edit
dl
rm
motion.txt
51891
0644
edit
dl
rm
netbeans.txt
37982
0644
edit
dl
rm
options.txt
401254
0644
edit
dl
rm
os_390.txt
4749
0644
edit
dl
rm
os_amiga.txt
5466
0644
edit
dl
rm
os_beos.txt
293
0644
edit
dl
rm
os_dos.txt
15496
0644
edit
dl
rm
os_haiku.txt
8496
0644
edit
dl
rm
os_mac.txt
6856
0644
edit
dl
rm
os_mint.txt
391
0644
edit
dl
rm
os_msdos.txt
523
0644
edit
dl
rm
os_os2.txt
299
0644
edit
dl
rm
os_qnx.txt
4071
0644
edit
dl
rm
os_risc.txt
328
0644
edit
dl
rm
os_unix.txt
2603
0644
edit
dl
rm
os_vms.txt
32903
0644
edit
dl
rm
os_win32.txt
14404
0644
edit
dl
rm
pattern.txt
62949
0644
edit
dl
rm
pi_getscript.txt
21082
0644
edit
dl
rm
pi_gzip.txt
1294
0644
edit
dl
rm
pi_logipat.txt
4196
0644
edit
dl
rm
pi_netrw.txt
181824
0644
edit
dl
rm
pi_paren.txt
2274
0644
edit
dl
rm
pi_spec.txt
4127
0644
edit
dl
rm
pi_tar.txt
7247
0644
edit
dl
rm
pi_vimball.txt
11859
0644
edit
dl
rm
pi_zip.txt
7491
0644
edit
dl
rm
popup.txt
39689
0644
edit
dl
rm
print.txt
31209
0644
edit
dl
rm
quickfix.txt
83331
0644
edit
dl
rm
quickref.txt
72492
0644
edit
dl
rm
quotes.txt
12748
0644
edit
dl
rm
README.Debian
324
0644
edit
dl
rm
recover.txt
10720
0644
edit
dl
rm
remote.txt
8420
0644
edit
dl
rm
repeat.txt
43565
0644
edit
dl
rm
rileft.txt
4938
0644
edit
dl
rm
russian.txt
3024
0644
edit
dl
rm
scroll.txt
13781
0644
edit
dl
rm
sign.txt
26870
0644
edit
dl
rm
spell.txt
64095
0644
edit
dl
rm
sponsor.txt
6803
0644
edit
dl
rm
starting.txt
73599
0644
edit
dl
rm
syntax.txt
229795
0644
edit
dl
rm
tabpage.txt
17248
0644
edit
dl
rm
tags
362670
0644
edit
dl
rm
tags.vim-tiny
30
0644
edit
dl
rm
tagsrch.txt
40278
0644
edit
dl
rm
term.txt
49822
0644
edit
dl
rm
terminal.txt
57098
0644
edit
dl
rm
testing.txt
16678
0644
edit
dl
rm
textprop.txt
16395
0644
edit
dl
rm
tips.txt
21089
0644
edit
dl
rm
todo.txt
307147
0644
edit
dl
rm
uganda.txt
14028
0644
edit
dl
rm
undo.txt
16584
0644
edit
dl
rm
usr_01.txt
7081
0644
edit
dl
rm
usr_02.txt
24229
0644
edit
dl
rm
usr_03.txt
23872
0644
edit
dl
rm
usr_04.txt
19131
0644
edit
dl
rm
usr_05.txt
27023
0644
edit
dl
rm
usr_06.txt
10638
0644
edit
dl
rm
usr_07.txt
15995
0644
edit
dl
rm
usr_08.txt
19379
0644
edit
dl
rm
usr_09.txt
11502
0644
edit
dl
rm
usr_10.txt
29200
0644
edit
dl
rm
usr_11.txt
13025
0644
edit
dl
rm
usr_12.txt
13433
0644
edit
dl
rm
usr_20.txt
13733
0644
edit
dl
rm
usr_21.txt
18456
0644
edit
dl
rm
usr_22.txt
14999
0644
edit
dl
rm
usr_23.txt
12744
0644
edit
dl
rm
usr_24.txt
20827
0644
edit
dl
rm
usr_25.txt
19176
0644
edit
dl
rm
usr_26.txt
8259
0644
edit
dl
rm
usr_27.txt
17709
0644
edit
dl
rm
usr_28.txt
16020
0644
edit
dl
rm
usr_29.txt
20121
0644
edit
dl
rm
usr_30.txt
22658
0644
edit
dl
rm
usr_31.txt
10399
0644
edit
dl
rm
usr_32.txt
5378
0644
edit
dl
rm
usr_40.txt
23195
0644
edit
dl
rm
usr_41.txt
95626
0644
edit
dl
rm
usr_42.txt
13853
0644
edit
dl
rm
usr_43.txt
7409
0644
edit
dl
rm
usr_44.txt
28948
0644
edit
dl
rm
usr_45.txt
17688
0644
edit
dl
rm
usr_46.txt
7096
0644
edit
dl
rm
usr_90.txt
16836
0644
edit
dl
rm
usr_toc.txt
9505
0644
edit
dl
rm
various.txt
31483
0644
edit
dl
rm
version4.txt
13911
0644
edit
dl
rm
version5.txt
308533
0644
edit
dl
rm
version6.txt
576942
0644
edit
dl
rm
version7.txt
674703
0644
edit
dl
rm
version8.txt
1940466
0644
edit
dl
rm
vim9.txt
68612
0644
edit
dl
rm
visual.txt
21846
0644
edit
dl
rm
vi_diff.txt
57428
0644
edit
dl
rm
windows.txt
55898
0644
edit
dl
rm
workshop.txt
371
0644
edit
dl
rm
Edit:
/usr/share/vim/vim82/doc/textprop.txt
(16395B)
*textprop.txt* For Vim version 8.2. Last change: 2021 Nov 23 VIM REFERENCE MANUAL by Bram Moolenaar Displaying text with properties attached. *textprop* *text-properties* 1. Introduction |text-prop-intro| 2. Functions |text-prop-functions| 3. When text changes |text-prop-changes| {not able to use text properties when the |+textprop| feature was disabled at compile time} ============================================================================== 1. Introduction *text-prop-intro* Text properties can be attached to text in a buffer. They will move with the text: If lines are deleted or inserted the properties move with the text they are attached to. Also when inserting/deleting text in the line before the text property. And when inserting/deleting text inside the text property, it will increase/decrease in size. The main use for text properties is to highlight text. This can be seen as a replacement for syntax highlighting. Instead of defining patterns to match the text, the highlighting is set by a script, possibly using the output of an external parser. This only needs to be done once, not every time when redrawing the screen, thus can be much faster, after the initial cost of attaching the text properties. Text properties can also be used for other purposes to identify text. For example, add a text property on a function name, so that a search can be defined to jump to the next/previous function. A text property is attached at a specific line and column, and has a specified length. The property can span multiple lines. A text property has these fields: "id" a number to be used as desired "type" the name of a property type Property Types ~ *E971* A text property normally has the name of a property type, which defines how to highlight the text. The property type can have these entries: "highlight" name of the highlight group to use "combine" when omitted or TRUE the text property highlighting is combined with any syntax highlighting; when FALSE the text property highlighting replaces the syntax highlighting "priority" when properties overlap, the one with the highest priority will be used. "start_incl" when TRUE inserts at the start position will be included in the text property "end_incl" when TRUE inserts at the end position will be included in the text property Example ~ Suppose line 11 in a buffer has this text (excluding the indent): The number 123 is smaller than 4567. To highlight the numbers in this text: > call prop_type_add('number', {'highlight': 'Constant'}) call prop_add(11, 12, {'length': 3, 'type': 'number'}) call prop_add(11, 32, {'length': 4, 'type': 'number'}) Try inserting or deleting lines above the text, you will see that the text properties stick to the text, thus the line number is adjusted as needed. Setting "start_incl" and "end_incl" is useful when white space surrounds the text, e.g. for a function name. Using false is useful when the text starts and/or ends with a specific character, such as the quote surrounding a string. func FuncName(arg) ~ ^^^^^^^^ property with start_incl and end_incl set var = "text"; ~ ^^^^^^ property with start_incl and end_incl not set Nevertheless, when text is inserted or deleted the text may need to be parsed and the text properties updated. But this can be done asynchronously. Internal error *E967* If you see E967, please report the bug. You can do this at Github: https://github.com/vim/vim/issues/new ============================================================================== 2. Functions *text-prop-functions* Manipulating text property types: prop_type_add({name}, {props}) define a new property type prop_type_change({name}, {props}) change an existing property type prop_type_delete({name} [, {props}]) delete a property type prop_type_get({name} [, {props}]) get property type values prop_type_list([{props}]) get list of property types Manipulating text properties: prop_add({lnum}, {col}, {props}) add a text property prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) add a text property at multiple positions. prop_clear({lnum} [, {lnum-end} [, {bufnr}]]) remove all text properties prop_find({props} [, {direction}]) search for a text property prop_list({lnum} [, {props}]) text properties in {lnum} prop_remove({props} [, {lnum} [, {lnum-end}]]) remove a text property *prop_add()* *E965* prop_add({lnum}, {col}, {props}) Attach a text property at position {lnum}, {col}. {col} is counted in bytes, use one for the first column. If {lnum} is invalid an error is given. *E966* If {col} is invalid an error is given. *E964* {props} is a dictionary with these fields: length length of text in bytes, can only be used for a property that does not continue in another line; can be zero end_lnum line number for the end of text (inclusive) end_col column just after the text; not used when "length" is present; when {col} and "end_col" are equal, and "end_lnum" is omitted or equal to {lnum}, this is a zero-width text property bufnr buffer to add the property to; when omitted the current buffer is used id user defined ID for the property; must be a number; when omitted zero is used type name of the text property type All fields except "type" are optional. It is an error when both "length" and "end_lnum" or "end_col" are given. Either use "length" or "end_col" for a property within one line, or use "end_lnum" and "end_col" for a property that spans more than one line. When neither "length" nor "end_col" are given the property will be zero-width. That means it will move with the text, as a kind of mark. One character will be highlighted, if the type specifies highlighting. The property can end exactly at the last character of the text, or just after it. In the last case, if text is appended to the line, the text property size will increase, also when the property type does not have "end_incl" set. "type" will first be looked up in the buffer the property is added to. When not found, the global property types are used. If not found an error is given. Can also be used as a |method|: > GetLnum()->prop_add(col, props) < *prop_add_list()* prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) Similar to prop_add(), but attaches a text property at multiple positions in a buffer. {props} is a dictionary with these fields: bufnr buffer to add the property to; when omitted the current buffer is used id user defined ID for the property; must be a number; when omitted zero is used type name of the text property type All fields except "type" are optional. The second argument is a List of Lists where each list specifies the starting and ending position of the text. The first two items {lnum} and {col} specify the starting position of the text where the property will be attached and the last two items {end-lnum} and {end-col} specify the position just after the text. Example: call prop_add_list(#{type: 'MyProp', id: 2}, \ [[1, 4, 1, 7], \ [1, 15, 1, 20], \ [2, 30, 3, 30]] Can also be used as a |method|: > GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]]) prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()* Remove all text properties from line {lnum}. When {lnum-end} is given, remove all text properties from line {lnum} to {lnum-end} (inclusive). When {props} contains a "bufnr" item use this buffer, otherwise use the current buffer. Can also be used as a |method|: > GetLnum()->prop_clear() < *prop_find()* prop_find({props} [, {direction}]) Search for a text property as specified with {props}: id property with this ID type property with this type name both "id" and "type" must both match bufnr buffer to search in; when present a start position with "lnum" and "col" must be given; when omitted the current buffer is used lnum start in this line (when omitted start at the cursor) col start at this column (when omitted and "lnum" is given: use column 1, otherwise start at the cursor) skipstart do not look for a match at the start position A property matches when either "id" or "type" matches. {direction} can be "f" for forward and "b" for backward. When omitted forward search is performed. If a match is found then a Dict is returned with the entries as with prop_list(), and additionally an "lnum" entry. If no match is found then an empty Dict is returned. prop_list({lnum} [, {props}]) *prop_list()* Returns a List with all the text properties in line {lnum}. The following optional items are supported in {props}: bufnr use this buffer instead of the current buffer end_lnum return text properties in all the lines between {lnum} and {end_lnum} (inclusive). A negative value is used as an offset from the last buffer line; -1 refers to the last buffer line. types List of property type names. Return only text properties that match one of the type names. ids List of property identifiers. Return only text properties with one of these identifiers. The properties are ordered by starting column and priority. Each property is a Dict with these entries: lnum starting line number. Present only when returning text properties between {lnum} and {end_lnum}. col starting column length length in bytes, one more if line break is included id property ID type name of the property type, omitted if the type was deleted type_bufnr buffer number for which this type was defined; 0 if the type is global start when TRUE property starts in this line end when TRUE property ends in this line When "start" is zero the property started in a previous line, the current one is a continuation. When "end" is zero the property continues in the next line. The line break after this line is included. Returns an empty list on error. Examples: " get text properties placed in line 5 echo prop_list(5) " get text properties placed in line 20 in buffer 4 echo prop_list(20, {'bufnr': 4}) " get all the text properties between line 1 and 20 echo prop_list(1, {'end_lnum': 20}) " get all the text properties of type 'myprop' echo prop_list(1, {'types': ['myprop'], \ 'end_lnum': -1}) " get all the text properties of type 'prop1' or 'prop2' echo prop_list(1, {'types': ['prop1', 'prop2'], \ 'end_lnum': -1}) " get all the text properties with ID 8 echo prop_list(1, {'ids': [8], 'end_lnum': line('$')}) " get all the text properties with ID 10 and 20 echo prop_list(1, {'ids': [10, 20], 'end_lnum': -1}) " get text properties with type 'myprop' and ID 100 " in buffer 4. echo prop_list(1, {'bufnr': 4, 'types': ['myprop'], \ 'ids': [100], 'end_lnum': -1}) Can also be used as a |method|: > GetLnum()->prop_list() < *prop_remove()* *E968* *E860* prop_remove({props} [, {lnum} [, {lnum-end}]]) Remove a matching text property from line {lnum}. When {lnum-end} is given, remove matching text properties from line {lnum} to {lnum-end} (inclusive). When {lnum} is omitted remove matching text properties from all lines (this requires going over all lines, thus will be a bit slow for a buffer with many lines). {props} is a dictionary with these fields: id remove text properties with this ID type remove text properties with this type name both "id" and "type" must both match bufnr use this buffer instead of the current one all when TRUE remove all matching text properties, not just the first one A property matches when either "id" or "type" matches. If buffer "bufnr" does not exist you get an error message. If buffer "bufnr" is not loaded then nothing happens. Returns the number of properties that were removed. Can also be used as a |method|: > GetProps()->prop_remove() prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970* Add a text property type {name}. If a property type with this name already exists an error is given. Nothing is returned. {props} is a dictionary with these optional fields: bufnr define the property only for this buffer; this avoids name collisions and automatically clears the property types when the buffer is deleted. highlight name of highlight group to use priority when a character has multiple text properties the one with the highest priority will be used; negative values can be used, the default priority is zero combine when omitted or TRUE combine the highlight with any syntax highlight; when FALSE syntax highlight will not be used start_incl when TRUE inserts at the start position will be included in the text property end_incl when TRUE inserts at the end position will be included in the text property Can also be used as a |method|: > GetPropName()->prop_type_add(props) prop_type_change({name}, {props}) *prop_type_change()* Change properties of an existing text property type. If a property with this name does not exist an error is given. The {props} argument is just like |prop_type_add()|. Can also be used as a |method|: > GetPropName()->prop_type_change(props) prop_type_delete({name} [, {props}]) *prop_type_delete()* Remove the text property type {name}. When text properties using the type {name} are still in place, they will not have an effect and can no longer be removed by name. {props} can contain a "bufnr" item. When it is given, delete a property type from this buffer instead of from the global property types. When text property type {name} is not found there is no error. Can also be used as a |method|: > GetPropName()->prop_type_delete() prop_type_get({name} [, {props}]) *prop_type_get()* Returns the properties of property type {name}. This is a dictionary with the same fields as was given to prop_type_add(). When the property type {name} does not exist, an empty dictionary is returned. {props} can contain a "bufnr" item. When it is given, use this buffer instead of the global property types. Can also be used as a |method|: > GetPropName()->prop_type_get() prop_type_list([{props}]) *prop_type_list()* Returns a list with all property type names. {props} can contain a "bufnr" item. When it is given, use this buffer instead of the global property types. ============================================================================== 3. When text changes *text-prop-changes* Vim will do its best to keep the text properties on the text where it was attached. When inserting or deleting text the properties after the change will move accordingly. When text is deleted and a text property no longer includes any text, it is deleted. However, a text property that was defined as zero-width will remain, unless the whole line is deleted. *E275* When a buffer is unloaded, all the text properties are gone. There is no way to store the properties in a file. You can only re-create them. When a buffer is hidden the text is preserved and so are the text properties. It is not possible to add text properties to an unloaded buffer. When using replace mode, the text properties stay on the same character positions, even though the characters themselves change. To update text properties after the text was changed, install a callback with `listener_add()`. E.g, if your plugin does spell checking, you can have the callback update spelling mistakes in the changed text. Vim will move the properties below the changed text, so that they still highlight the same text, thus you don't need to update these. Text property columns are not updated or copied: ~ - When setting the line with |setline()| or through an interface, such as Lua, Tcl or Python. Vim does not know what text got inserted or deleted. - With a command like `:move`, which takes a line of text out of context. vim:tw=78:ts=8:noet:ft=help:norl:
Save
cmd:
run