Mercurial > vim
comparison runtime/doc/insert.txt @ 3082:3502a7f991fc
Updated runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 14 Sep 2011 17:55:08 +0200 |
parents | 840c3cadb842 |
children | b7811ab264bf |
comparison
equal
deleted
inserted
replaced
3081:1e50bdaa24f8 | 3082:3502a7f991fc |
---|---|
1 *insert.txt* For Vim version 7.3. Last change: 2010 Nov 10 | 1 *insert.txt* For Vim version 7.3. Last change: 2011 Sep 14 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1018 located in the first call (can be empty) | 1018 located in the first call (can be empty) |
1019 | 1019 |
1020 The function must return a List with the matching words. These matches | 1020 The function must return a List with the matching words. These matches |
1021 usually include the "a:base" text. When there are no matches return an empty | 1021 usually include the "a:base" text. When there are no matches return an empty |
1022 List. | 1022 List. |
1023 | |
1024 In order to return more information than the matching words, return a Dict | |
1025 that contains the List. The Dict can have these items: | |
1026 words The List of matching words (mandatory). | |
1027 refresh A string to control re-invocation of the function | |
1028 (optional). | |
1029 The only value currently recognized is "always", the | |
1030 effect is that the function is called whenever the | |
1031 leading text is changed. | |
1032 Other items are ignored. | |
1033 | |
1034 For example, the function can contain this: > | |
1035 let matches = ... list of words ... | |
1036 return {'words': matches, 'refresh': 'always'} | |
1037 < | |
1023 *complete-items* | 1038 *complete-items* |
1024 Each list item can either be a string or a Dictionary. When it is a string it | 1039 Each list item can either be a string or a Dictionary. When it is a string it |
1025 is used as the completion. When it is a Dictionary it can contain these | 1040 is used as the completion. When it is a Dictionary it can contain these |
1026 items: | 1041 items: |
1027 word the text that will be inserted, mandatory | 1042 word the text that will be inserted, mandatory |
1038 dup when non-zero this match will be added even when an | 1053 dup when non-zero this match will be added even when an |
1039 item with the same word is already present. | 1054 item with the same word is already present. |
1040 empty when non-zero this match will be added even when it is | 1055 empty when non-zero this match will be added even when it is |
1041 an empty string | 1056 an empty string |
1042 | 1057 |
1043 All of these except 'icase' must be a string. If an item does not meet these | 1058 All of these except 'icase', 'dup' and 'empty' must be a string. If an item |
1044 requirements then an error message is given and further items in the list are | 1059 does not meet these requirements then an error message is given and further |
1045 not used. You can mix string and Dictionary items in the returned list. | 1060 items in the list are not used. You can mix string and Dictionary items in |
1061 the returned list. | |
1046 | 1062 |
1047 The "menu" item is used in the popup menu and may be truncated, thus it should | 1063 The "menu" item is used in the popup menu and may be truncated, thus it should |
1048 be relatively short. The "info" item can be longer, it will be displayed in | 1064 be relatively short. The "info" item can be longer, it will be displayed in |
1049 the preview window when "preview" appears in 'completeopt'. The "info" item | 1065 the preview window when "preview" appears in 'completeopt'. The "info" item |
1050 will also remain displayed after the popup menu has been removed. This is | 1066 will also remain displayed after the popup menu has been removed. This is |