Mercurial > vim
comparison runtime/doc/eval.txt @ 3224:8b8ef1fed009
Update runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 14 Dec 2011 21:17:39 +0100 |
parents | cd145cc2f2c9 |
children | 91e53bcb7946 |
comparison
equal
deleted
inserted
replaced
3223:576648218cb5 | 3224:8b8ef1fed009 |
---|---|
1 *eval.txt* For Vim version 7.3. Last change: 2011 Sep 30 | 1 *eval.txt* For Vim version 7.3. Last change: 2011 Dec 14 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
612 expr7 % expr7 .. number modulo | 612 expr7 % expr7 .. number modulo |
613 | 613 |
614 |expr7| ! expr7 logical NOT | 614 |expr7| ! expr7 logical NOT |
615 - expr7 unary minus | 615 - expr7 unary minus |
616 + expr7 unary plus | 616 + expr7 unary plus |
617 | |
618 | 617 |
619 |expr8| expr8[expr1] byte of a String or item of a |List| | 618 |expr8| expr8[expr1] byte of a String or item of a |List| |
620 expr8[expr1 : expr1] substring of a String or sublist of a |List| | 619 expr8[expr1 : expr1] substring of a String or sublist of a |List| |
621 expr8.name entry in a |Dictionary| | 620 expr8.name entry in a |Dictionary| |
622 expr8(expr1, ...) function call with |Funcref| variable | 621 expr8(expr1, ...) function call with |Funcref| variable |
944 | 943 |
945 | 944 |
946 *expr9* | 945 *expr9* |
947 number | 946 number |
948 ------ | 947 ------ |
949 number number constant *expr-number* | 948 number number constant *expr-number* |
949 *hex-number* *octal-number* | |
950 | 950 |
951 Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). | 951 Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). |
952 | 952 |
953 *floating-point-format* | 953 *floating-point-format* |
954 Floating point numbers can be written in two forms: | 954 Floating point numbers can be written in two forms: |
1766 foldlevel( {lnum}) Number fold level at {lnum} | 1766 foldlevel( {lnum}) Number fold level at {lnum} |
1767 foldtext( ) String line displayed for closed fold | 1767 foldtext( ) String line displayed for closed fold |
1768 foldtextresult( {lnum}) String text for closed fold at {lnum} | 1768 foldtextresult( {lnum}) String text for closed fold at {lnum} |
1769 foreground( ) Number bring the Vim window to the foreground | 1769 foreground( ) Number bring the Vim window to the foreground |
1770 function( {name}) Funcref reference to function {name} | 1770 function( {name}) Funcref reference to function {name} |
1771 garbagecollect( [at_exit]) none free memory, breaking cyclic references | 1771 garbagecollect( [{atexit}]) none free memory, breaking cyclic references |
1772 get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def} | 1772 get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def} |
1773 get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def} | 1773 get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def} |
1774 getbufline( {expr}, {lnum} [, {end}]) | 1774 getbufline( {expr}, {lnum} [, {end}]) |
1775 List lines {lnum} to {end} of buffer {expr} | 1775 List lines {lnum} to {end} of buffer {expr} |
1776 getbufvar( {expr}, {varname}) any variable {varname} in buffer {expr} | 1776 getbufvar( {expr}, {varname}) any variable {varname} in buffer {expr} |
1842 localtime() Number current time | 1842 localtime() Number current time |
1843 log( {expr}) Float natural logarithm (base e) of {expr} | 1843 log( {expr}) Float natural logarithm (base e) of {expr} |
1844 log10( {expr}) Float logarithm of Float {expr} to base 10 | 1844 log10( {expr}) Float logarithm of Float {expr} to base 10 |
1845 map( {expr}, {string}) List/Dict change each item in {expr} to {expr} | 1845 map( {expr}, {string}) List/Dict change each item in {expr} to {expr} |
1846 maparg( {name}[, {mode} [, {abbr} [, {dict}]]]) | 1846 maparg( {name}[, {mode} [, {abbr} [, {dict}]]]) |
1847 String rhs of mapping {name} in mode {mode} | 1847 String or Dict |
1848 rhs of mapping {name} in mode {mode} | |
1848 mapcheck( {name}[, {mode} [, {abbr}]]) | 1849 mapcheck( {name}[, {mode} [, {abbr}]]) |
1849 String check for mappings matching {name} | 1850 String check for mappings matching {name} |
1850 match( {expr}, {pat}[, {start}[, {count}]]) | 1851 match( {expr}, {pat}[, {start}[, {count}]]) |
1851 Number position where {pat} matches in {expr} | 1852 Number position where {pat} matches in {expr} |
1852 matchadd( {group}, {pattern}[, {priority}[, {id}]]) | 1853 matchadd( {group}, {pattern}[, {priority}[, {id}]]) |
3075 function({name}) *function()* *E700* | 3076 function({name}) *function()* *E700* |
3076 Return a |Funcref| variable that refers to function {name}. | 3077 Return a |Funcref| variable that refers to function {name}. |
3077 {name} can be a user defined function or an internal function. | 3078 {name} can be a user defined function or an internal function. |
3078 | 3079 |
3079 | 3080 |
3080 garbagecollect([at_exit]) *garbagecollect()* | 3081 garbagecollect([{atexit}]) *garbagecollect()* |
3081 Cleanup unused |Lists| and |Dictionaries| that have circular | 3082 Cleanup unused |Lists| and |Dictionaries| that have circular |
3082 references. There is hardly ever a need to invoke this | 3083 references. There is hardly ever a need to invoke this |
3083 function, as it is automatically done when Vim runs out of | 3084 function, as it is automatically done when Vim runs out of |
3084 memory or is waiting for the user to press a key after | 3085 memory or is waiting for the user to press a key after |
3085 'updatetime'. Items without circular references are always | 3086 'updatetime'. Items without circular references are always |
3086 freed when they become unused. | 3087 freed when they become unused. |
3087 This is useful if you have deleted a very big |List| and/or | 3088 This is useful if you have deleted a very big |List| and/or |
3088 |Dictionary| with circular references in a script that runs | 3089 |Dictionary| with circular references in a script that runs |
3089 for a long time. | 3090 for a long time. |
3090 When the optional "at_exit" argument is one, garbage | 3091 When the optional {atexit} argument is one, garbage |
3091 collection will also be done when exiting Vim, if it wasn't | 3092 collection will also be done when exiting Vim, if it wasn't |
3092 done before. This is useful when checking for memory leaks. | 3093 done before. This is useful when checking for memory leaks. |
3093 | 3094 |
3094 get({list}, {idx} [, {default}]) *get()* | 3095 get({list}, {idx} [, {default}]) *get()* |
3095 Get item {idx} from |List| {list}. When this item is not | 3096 Get item {idx} from |List| {list}. When this item is not |
3160 not included in the character. | 3161 not included in the character. |
3161 | 3162 |
3162 When {expr} is 1 only the first byte is returned. For a | 3163 When {expr} is 1 only the first byte is returned. For a |
3163 one-byte character it is the character itself as a number. | 3164 one-byte character it is the character itself as a number. |
3164 Use nr2char() to convert it to a String. | 3165 Use nr2char() to convert it to a String. |
3166 | |
3167 Use getcharmod() to obtain any additional modifiers. | |
3165 | 3168 |
3166 When the user clicks a mouse button, the mouse event will be | 3169 When the user clicks a mouse button, the mouse event will be |
3167 returned. The position can then be found in |v:mouse_col|, | 3170 returned. The position can then be found in |v:mouse_col|, |
3168 |v:mouse_lnum| and |v:mouse_win|. This example positions the | 3171 |v:mouse_lnum| and |v:mouse_win|. This example positions the |
3169 mouse as it would normally happen: > | 3172 mouse as it would normally happen: > |
3199 the last obtained character with getchar() or in another way. | 3202 the last obtained character with getchar() or in another way. |
3200 These values are added together: | 3203 These values are added together: |
3201 2 shift | 3204 2 shift |
3202 4 control | 3205 4 control |
3203 8 alt (meta) | 3206 8 alt (meta) |
3204 16 mouse double click | 3207 16 meta (when it's different from ALT) |
3205 32 mouse triple click | 3208 32 mouse double click |
3206 64 mouse quadruple click | 3209 64 mouse triple click |
3207 128 Macintosh only: command | 3210 96 mouse quadruple click (== 32 + 64) |
3211 128 command (Macintosh only) | |
3208 Only the modifiers that have not been included in the | 3212 Only the modifiers that have not been included in the |
3209 character itself are obtained. Thus Shift-a results in "A" | 3213 character itself are obtained. Thus Shift-a results in "A" |
3210 without a modifier. | 3214 without a modifier. |
3211 | 3215 |
3212 getcmdline() *getcmdline()* | 3216 getcmdline() *getcmdline()* |
6256 mouse_dec Compiled with support for Dec terminal mouse. | 6260 mouse_dec Compiled with support for Dec terminal mouse. |
6257 mouse_gpm Compiled with support for gpm (Linux console mouse) | 6261 mouse_gpm Compiled with support for gpm (Linux console mouse) |
6258 mouse_netterm Compiled with support for netterm mouse. | 6262 mouse_netterm Compiled with support for netterm mouse. |
6259 mouse_pterm Compiled with support for qnx pterm mouse. | 6263 mouse_pterm Compiled with support for qnx pterm mouse. |
6260 mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse) | 6264 mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse) |
6265 mouse_urxvt Compiled with support for urxvt mouse. | |
6261 mouse_xterm Compiled with support for xterm mouse. | 6266 mouse_xterm Compiled with support for xterm mouse. |
6262 mouseshape Compiled with support for 'mouseshape'. | 6267 mouseshape Compiled with support for 'mouseshape'. |
6263 multi_byte Compiled with support for 'encoding' | 6268 multi_byte Compiled with support for 'encoding' |
6264 multi_byte_encoding 'encoding' is set to a multi-byte encoding. | 6269 multi_byte_encoding 'encoding' is set to a multi-byte encoding. |
6265 multi_byte_ime Compiled with support for IME input method. | 6270 multi_byte_ime Compiled with support for IME input method. |