Diff to HTML by rtfpessoa

Files changed (5) hide show
  1. runtime/doc/builtin.txt +46 -1
  2. runtime/doc/options.txt +14 -1
  3. runtime/doc/todo.txt +2 -12
  4. runtime/doc/usr_41.txt +3 -1
  5. runtime/doc/version9.txt +3 -1
runtime/doc/builtin.txt CHANGED
@@ -1,4 +1,4 @@
1
- *builtin.txt* For Vim version 9.1. Last change: 2025 Apr 23
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
@@ -136,6 +136,7 @@ complete({startcol}, {matches}) none set Insert mode completion
136
  complete_add({expr}) Number add completion match
137
  complete_check() Number check for key typed during completion
138
  complete_info([{what}]) Dict get current completion information
 
139
  confirm({msg} [, {choices} [, {default} [, {type}]]])
140
  Number number of choice picked by user
141
  copy({expr}) any make a shallow copy of {expr}
@@ -2032,6 +2033,50 @@ complete_info([{what}]) *complete_info()*
2032
  <
2033
  Return type: dict<any>
2034
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2035
  *confirm()*
2036
  confirm({msg} [, {choices} [, {default} [, {type}]]])
2037
  confirm() offers the user a dialog, from which a choice can be
1
+ *builtin.txt* For Vim version 9.1. Last change: 2025 Apr 24
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
136
  complete_add({expr}) Number add completion match
137
  complete_check() Number check for key typed during completion
138
  complete_info([{what}]) Dict get current completion information
139
+ complete_match([{lnum}, {col}]) List get completion column and trigger text
140
  confirm({msg} [, {choices} [, {default} [, {type}]]])
141
  Number number of choice picked by user
142
  copy({expr}) any make a shallow copy of {expr}
2033
  <
2034
  Return type: dict<any>
2035
 
2036
+ complete_match([{lnum}, {col}]) *complete_match()*
2037
+ Returns a List of matches found according to the 'isexpand'
2038
+ option. Each match is represented as a List containing
2039
+ [startcol, trigger_text] where:
2040
+ - startcol: column position where completion should start,
2041
+ or -1 if no trigger position is found. For multi-character
2042
+ triggers, returns the column of the first character.
2043
+ - trigger_text: the matching trigger string from 'isexpand',
2044
+ or empty string if no match was found or when using the
2045
+ default 'iskeyword' pattern.
2046
+
2047
+ When 'isexpand' is empty, uses the 'iskeyword' pattern
2048
+ "\k\+$" to find the start of the current keyword.
2049
+
2050
+ When no arguments are provided, uses the current cursor
2051
+ position.
2052
+
2053
+ Examples: >
2054
+ set isexpand=.,->,/,/*,abc
2055
+ func CustomComplete()
2056
+ let res = complete_match()
2057
+ if res->len() == 0 | return | endif
2058
+ let [col, trigger] = res[0]
2059
+ let items = []
2060
+ if trigger == '/*'
2061
+ let items = ['/** */']
2062
+ elseif trigger == '/'
2063
+ let items = ['/*! */', '// TODO:', '// fixme:']
2064
+ elseif trigger == '.'
2065
+ let items = ['length()']
2066
+ elseif trigger =~ '^\->'
2067
+ let items = ['map()', 'reduce()']
2068
+ elseif trigger =~ '^\abc'
2069
+ let items = ['def', 'ghk']
2070
+ endif
2071
+ if items->len() > 0
2072
+ let startcol = trigger =~ '^/' ? col : col + len(trigger)
2073
+ call complete(startcol, items)
2074
+ endif
2075
+ endfunc
2076
+ inoremap <Tab> <Cmd>call CustomComplete()<CR>
2077
+ <
2078
+ Return type: list<list<any>>
2079
+
2080
  *confirm()*
2081
  confirm({msg} [, {choices} [, {default} [, {type}]]])
2082
  confirm() offers the user a dialog, from which a choice can be
runtime/doc/options.txt CHANGED
@@ -1,4 +1,4 @@
1
- *options.txt* For Vim version 9.1. Last change: 2025 Apr 19
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4983,6 +4983,19 @@ A jump table for the options with a short description can be found at |Q_op|.
4983
  and there is a letter before it, the completed part is made uppercase.
4984
  With 'noinfercase' the match is used as-is.
4985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4986
  *'insertmode'* *'im'* *'noinsertmode'* *'noim'*
4987
  'insertmode' 'im' boolean (default off)
4988
  global
1
+ *options.txt* For Vim version 9.1. Last change: 2025 Apr 24
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
4983
  and there is a letter before it, the completed part is made uppercase.
4984
  With 'noinfercase' the match is used as-is.
4985
 
4986
+ *'isexpand'* *'ise'*
4987
+ 'isexpand' 'ise' string (default: "")
4988
+ local to buffer
4989
+ Defines characters and patterns for completion in insert mode. Used by
4990
+ the |complete_match()| function to determine the starting position for
4991
+ completion. This is a comma-separated list of triggers. Each trigger
4992
+ can be:
4993
+ - A single character like "." or "/"
4994
+ - A sequence of characters like "->", "/*", or "/**"
4995
+
4996
+ Note: Use "\\," to add a literal comma as trigger character, see
4997
+ |option-backslash|.
4998
+
4999
  *'insertmode'* *'im'* *'noinsertmode'* *'noim'*
5000
  'insertmode' 'im' boolean (default off)
5001
  global
runtime/doc/todo.txt CHANGED
@@ -1,4 +1,4 @@
1
- *todo.txt* For Vim version 9.1. Last change: 2025 Mar 27
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4749,20 +4749,10 @@ Insert mode completion/expansion:
4749
  7 When expanding file names with an environment variable, add the match with
4750
  the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and
4751
  "$HOME/tmp"
4752
- 8 When there is no word before the cursor but something like "sys." complete
4753
- with "sys.". Works well for C and similar languages.
4754
  9 ^X^L completion doesn't repeat correctly. It uses the first match with
4755
  the last added line, instead of continuing where the last match ended.
4756
  (Webb)
4757
- 8 Add option to set different behavior for Insert mode completion:
4758
- - ignore/match case
4759
- - different characters than 'iskeyword'
4760
- 8 Add option 'isexpand', containing characters when doing expansion (so that
4761
- "." and "\" can be included, without changing 'iskeyword'). (Goldfarb)
4762
- Also: 'istagword': characters used for CTRL-].
4763
- When 'isexpand' or 'istagword' are empty, use 'iskeyword'.
4764
- Alternative: Use a pattern so that start and end of a keyword can be
4765
- defined, only allow dash in the middle, etc.
4766
  8 Add a command to undo the completion, go back to the original text.
4767
  7 Completion of an abbreviation: Can leave letters out, like what Instant
4768
  text does: www.textware.com
1
+ *todo.txt* For Vim version 9.1. Last change: 2025 Apr 24
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
4749
  7 When expanding file names with an environment variable, add the match with
4750
  the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and
4751
  "$HOME/tmp"
 
 
4752
  9 ^X^L completion doesn't repeat correctly. It uses the first match with
4753
  the last added line, instead of continuing where the last match ended.
4754
  (Webb)
4755
+ 8 Add option 'istagword': characters used for CTRL-]. like 'isexpand'
 
 
 
 
 
 
 
 
4756
  8 Add a command to undo the completion, go back to the original text.
4757
  7 Completion of an abbreviation: Can leave letters out, like what Instant
4758
  text does: www.textware.com
runtime/doc/usr_41.txt CHANGED
@@ -1,4 +1,4 @@
1
- *usr_41.txt* For Vim version 9.1. Last change: 2025 Apr 21
2
 
3
  VIM USER MANUAL - by Bram Moolenaar
4
 
@@ -1124,6 +1124,8 @@ Insert mode completion: *completion-functions*
1124
  complete_add() add to found matches
1125
  complete_check() check if completion should be aborted
1126
  complete_info() get current completion information
 
 
1127
  pumvisible() check if the popup menu is displayed
1128
  pum_getpos() position and size of popup menu if visible
1129
 
1
+ *usr_41.txt* For Vim version 9.1. Last change: 2025 Apr 24
2
 
3
  VIM USER MANUAL - by Bram Moolenaar
4
 
1124
  complete_add() add to found matches
1125
  complete_check() check if completion should be aborted
1126
  complete_info() get current completion information
1127
+ complete_match() get insert completion start match col and
1128
+ trigger text
1129
  pumvisible() check if the popup menu is displayed
1130
  pum_getpos() position and size of popup menu if visible
1131
 
runtime/doc/version9.txt CHANGED
@@ -1,4 +1,4 @@
1
- *version9.txt* For Vim version 9.1. Last change: 2025 Apr 23
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41688,6 +41688,7 @@ Functions: ~
41688
  |blob2str()| convert a blob into a List of strings
41689
  |bindtextdomain()| set message lookup translation base path
41690
  |cmdcomplete_info()| get current cmdline completion info
 
41691
  |diff()| diff two Lists of strings
41692
  |filecopy()| copy a file {from} to {to}
41693
  |foreach()| apply function to List items
@@ -41750,6 +41751,7 @@ Options: ~
41750
  'eventignorewin' autocommand events that are ignored in a window
41751
  'findfunc' Vim function to obtain the results for a |:find|
41752
  command
 
41753
  'lhistory' Size of the location list stack |quickfix-stack|.
41754
  'messagesopt' configure |:messages| and |hit-enter| prompt
41755
  'pummaxwidth' maximum width for the completion popup menu
1
+ *version9.txt* For Vim version 9.1. Last change: 2025 Apr 24
2
 
3
 
4
  VIM REFERENCE MANUAL by Bram Moolenaar
41688
  |blob2str()| convert a blob into a List of strings
41689
  |bindtextdomain()| set message lookup translation base path
41690
  |cmdcomplete_info()| get current cmdline completion info
41691
+ |complete_match()| get completion and trigger info
41692
  |diff()| diff two Lists of strings
41693
  |filecopy()| copy a file {from} to {to}
41694
  |foreach()| apply function to List items
41751
  'eventignorewin' autocommand events that are ignored in a window
41752
  'findfunc' Vim function to obtain the results for a |:find|
41753
  command
41754
+ 'isexpand' defines triggers for completion
41755
  'lhistory' Size of the location list stack |quickfix-stack|.
41756
  'messagesopt' configure |:messages| and |hit-enter| prompt
41757
  'pummaxwidth' maximum width for the completion popup menu