comparison runtime/doc/eval.txt @ 724:a35dce0cabc5

updated for version 7.0220
author vimboss
date Fri, 10 Mar 2006 21:42:59 +0000
parents 8ae24f338cab
children f664cc974a7a
comparison
equal deleted inserted replaced
723:587ea89ab80c 724:a35dce0cabc5
1 *eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 07 1 *eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 10
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
1511 call( {func}, {arglist} [, {dict}]) 1511 call( {func}, {arglist} [, {dict}])
1512 any call {func} with arguments {arglist} 1512 any call {func} with arguments {arglist}
1513 char2nr( {expr}) Number ASCII value of first char in {expr} 1513 char2nr( {expr}) Number ASCII value of first char in {expr}
1514 cindent( {lnum}) Number C indent for line {lnum} 1514 cindent( {lnum}) Number C indent for line {lnum}
1515 col( {expr}) Number column nr of cursor or mark 1515 col( {expr}) Number column nr of cursor or mark
1516 complete({startcol}, {matches}) String set Insert mode completion
1516 complete_add( {expr}) Number add completion match 1517 complete_add( {expr}) Number add completion match
1517 complete_check() Number check for key typed during completion 1518 complete_check() Number check for key typed during completion
1518 confirm( {msg} [, {choices} [, {default} [, {type}]]]) 1519 confirm( {msg} [, {choices} [, {default} [, {type}]]])
1519 Number number of choice picked by user 1520 Number number of choice picked by user
1520 copy( {expr}) any make a shallow copy of {expr} 1521 copy( {expr}) any make a shallow copy of {expr}
1956 \<C-O>:set ve=all<CR> 1957 \<C-O>:set ve=all<CR>
1957 \<C-O>:echo col(".") . "\n" <Bar> 1958 \<C-O>:echo col(".") . "\n" <Bar>
1958 \let &ve = save_ve<CR> 1959 \let &ve = save_ve<CR>
1959 < 1960 <
1960 1961
1962 complete({startcol}, {matches}) *complete()* *E785*
1963 Set the matches for Insert mode completion.
1964 Can only be used in Insert mode. You need to use a mapping
1965 with an expression argument |:map-<expr>| or CTRL-R =
1966 |i_CTRL-R|. It does not work after CTRL-O.
1967 {startcol} is the byte offset in the line where the completed
1968 text start. The text up to the cursor is the original text
1969 that will be replaced by the matches. Use col('.') for an
1970 empty string. "col('.') - 1" will replace one character by a
1971 match.
1972 {matches} must be a |List|. Each |List| item is one match.
1973 See |complete-items| for the kind of items that are possible.
1974 Note that the after calling this function you need to avoid
1975 inserting anything that would completion to stop.
1976 The match can be selected with CTRL-N and CTRL-P as usual with
1977 Insert mode completion. The popup menu will appear if
1978 specified, see |ins-completion-menu|.
1979 Example: >
1980 inoremap <expr> <F5> ListMonths()
1981
1982 func! ListMonths()
1983 call complete(col('.'), ['January', 'February', 'March',
1984 \ 'April', 'May', 'June', 'July', 'August', 'September',
1985 \ 'October', 'November', 'December'])
1986 return ''
1987 endfunc
1988 < This isn't very useful, but it shows how it works. Note that
1989 an empty string is returned to avoid a zero being inserted.
1990
1961 complete_add({expr}) *complete_add()* 1991 complete_add({expr}) *complete_add()*
1962 Add {expr} to the list of matches. Only to be used by the 1992 Add {expr} to the list of matches. Only to be used by the
1963 function specified with the 'completefunc' option. 1993 function specified with the 'completefunc' option.
1964 Returns 0 for failure (empty string or out of memory), 1994 Returns 0 for failure (empty string or out of memory),
1965 1 when the match was added, 2 when the match was already in 1995 1 when the match was added, 2 when the match was already in