comparison runtime/doc/eval.txt @ 8148:f5da459c5698

commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 20 15:47:01 2016 +0100 Updated runtime files.
author Christian Brabandt <cb@256bit.org>
date Sat, 20 Feb 2016 16:00:06 +0100
parents 18a3f0f05244
children e77efd7a7dad
comparison
equal deleted inserted replaced
8147:da6300d5a13b 8148:f5da459c5698
1 *eval.txt* For Vim version 7.4. Last change: 2016 Feb 16 1 *eval.txt* For Vim version 7.4. Last change: 2016 Feb 19
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
1791 argc() Number number of files in the argument list 1791 argc() Number number of files in the argument list
1792 argidx() Number current index in the argument list 1792 argidx() Number current index in the argument list
1793 arglistid( [{winnr} [, {tabnr}]]) 1793 arglistid( [{winnr} [, {tabnr}]])
1794 Number argument list id 1794 Number argument list id
1795 argv( {nr}) String {nr} entry of the argument list 1795 argv( {nr}) String {nr} entry of the argument list
1796 argv( ) List the argument list 1796 argv() List the argument list
1797 assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act} 1797 assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act}
1798 assert_exception({error} [, {msg}]) none assert {error} is in v:exception 1798 assert_exception( {error} [, {msg}]) none assert {error} is in v:exception
1799 assert_fails( {cmd} [, {error}]) none assert {cmd} fails 1799 assert_fails( {cmd} [, {error}]) none assert {cmd} fails
1800 assert_false( {actual} [, {msg}]) none assert {actual} is false 1800 assert_false( {actual} [, {msg}]) none assert {actual} is false
1801 assert_true( {actual} [, {msg}]) none assert {actual} is true 1801 assert_true( {actual} [, {msg}]) none assert {actual} is true
1802 asin( {expr}) Float arc sine of {expr} 1802 asin( {expr}) Float arc sine of {expr}
1803 atan( {expr}) Float arc tangent of {expr} 1803 atan( {expr}) Float arc tangent of {expr}
1816 byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr} 1816 byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
1817 call( {func}, {arglist} [, {dict}]) 1817 call( {func}, {arglist} [, {dict}])
1818 any call {func} with arguments {arglist} 1818 any call {func} with arguments {arglist}
1819 ceil( {expr}) Float round {expr} up 1819 ceil( {expr}) Float round {expr} up
1820 ch_close( {handle}) none close a channel 1820 ch_close( {handle}) none close a channel
1821 ch_log( {msg} [, {channel}]) none write {msg} in the channel log file
1821 ch_logfile( {fname} [, {mode}]) none start logging channel activity 1822 ch_logfile( {fname} [, {mode}]) none start logging channel activity
1822 ch_open( {address} [, {argdict})] Number open a channel to {address} 1823 ch_open( {address} [, {options}]) Channel open a channel to {address}
1823 ch_readraw( {handle}) String read from channel {handle} 1824 ch_readraw( {handle}) String read from channel {handle}
1824 ch_sendexpr( {handle}, {expr} [, {options}]) 1825 ch_sendexpr( {handle}, {expr} [, {options}])
1825 any send {expr} over JSON channel {handle} 1826 any send {expr} over JSON channel {handle}
1826 ch_sendraw( {handle}, {string} [, {options}]) 1827 ch_sendraw( {handle}, {string} [, {options}])
1827 any send {string} over raw channel {handle} 1828 any send {string} over raw channel {handle}
1829 ch_setoptions( {handle}, {options}) none set options for channel {handle}
1828 ch_status( {handle}) String status of channel {handle} 1830 ch_status( {handle}) String status of channel {handle}
1829 changenr() Number current change number 1831 changenr() Number current change number
1830 char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} 1832 char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
1831 cindent( {lnum}) Number C indent for line {lnum} 1833 cindent( {lnum}) Number C indent for line {lnum}
1832 clearmatches() none clear all matches 1834 clearmatches() none clear all matches
1849 deepcopy( {expr} [, {noref}]) any make a full copy of {expr} 1851 deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
1850 delete( {fname} [, {flags}]) Number delete the file or directory {fname} 1852 delete( {fname} [, {flags}]) Number delete the file or directory {fname}
1851 did_filetype() Number TRUE if FileType autocommand event used 1853 did_filetype() Number TRUE if FileType autocommand event used
1852 diff_filler( {lnum}) Number diff filler lines about {lnum} 1854 diff_filler( {lnum}) Number diff filler lines about {lnum}
1853 diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} 1855 diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
1854 disable_char_avail_for_testing({expr}) none test without typeahead 1856 disable_char_avail_for_testing( {expr}) none test without typeahead
1855 empty( {expr}) Number TRUE if {expr} is empty 1857 empty( {expr}) Number TRUE if {expr} is empty
1856 escape( {string}, {chars}) String escape {chars} in {string} with '\' 1858 escape( {string}, {chars}) String escape {chars} in {string} with '\'
1857 eval( {string}) any evaluate {string} into its value 1859 eval( {string}) any evaluate {string} into its value
1858 eventhandler( ) Number TRUE if inside an event handler 1860 eventhandler() Number TRUE if inside an event handler
1859 executable( {expr}) Number 1 if executable {expr} exists 1861 executable( {expr}) Number 1 if executable {expr} exists
1860 exepath( {expr}) String full path of the command {expr} 1862 exepath( {expr}) String full path of the command {expr}
1861 exists( {expr}) Number TRUE if {expr} exists 1863 exists( {expr}) Number TRUE if {expr} exists
1862 extend( {expr1}, {expr2} [, {expr3}]) 1864 extend( {expr1}, {expr2} [, {expr3}])
1863 List/Dict insert items of {expr2} into {expr1} 1865 List/Dict insert items of {expr2} into {expr1}
1879 fnameescape( {fname}) String escape special characters in {fname} 1881 fnameescape( {fname}) String escape special characters in {fname}
1880 fnamemodify( {fname}, {mods}) String modify file name 1882 fnamemodify( {fname}, {mods}) String modify file name
1881 foldclosed( {lnum}) Number first line of fold at {lnum} if closed 1883 foldclosed( {lnum}) Number first line of fold at {lnum} if closed
1882 foldclosedend( {lnum}) Number last line of fold at {lnum} if closed 1884 foldclosedend( {lnum}) Number last line of fold at {lnum} if closed
1883 foldlevel( {lnum}) Number fold level at {lnum} 1885 foldlevel( {lnum}) Number fold level at {lnum}
1884 foldtext( ) String line displayed for closed fold 1886 foldtext() String line displayed for closed fold
1885 foldtextresult( {lnum}) String text for closed fold at {lnum} 1887 foldtextresult( {lnum}) String text for closed fold at {lnum}
1886 foreground( ) Number bring the Vim window to the foreground 1888 foreground() Number bring the Vim window to the foreground
1887 function( {name}) Funcref reference to function {name} 1889 function( {name}) Funcref reference to function {name}
1888 garbagecollect( [{atexit}]) none free memory, breaking cyclic references 1890 garbagecollect( [{atexit}]) none free memory, breaking cyclic references
1889 get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def} 1891 get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
1890 get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def} 1892 get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
1891 getbufline( {expr}, {lnum} [, {end}]) 1893 getbufline( {expr}, {lnum} [, {end}])
1892 List lines {lnum} to {end} of buffer {expr} 1894 List lines {lnum} to {end} of buffer {expr}
1893 getbufvar( {expr}, {varname} [, {def}]) 1895 getbufvar( {expr}, {varname} [, {def}])
1894 any variable {varname} in buffer {expr} 1896 any variable {varname} in buffer {expr}
1895 getchar( [expr]) Number get one character from the user 1897 getchar( [expr]) Number get one character from the user
1896 getcharmod( ) Number modifiers for the last typed character 1898 getcharmod() Number modifiers for the last typed character
1897 getcharsearch() Dict last character search 1899 getcharsearch() Dict last character search
1898 getcmdline() String return the current command-line 1900 getcmdline() String return the current command-line
1899 getcmdpos() Number return cursor position in command-line 1901 getcmdpos() Number return cursor position in command-line
1900 getcmdtype() String return current command-line type 1902 getcmdtype() String return current command-line type
1901 getcmdwintype() String return current command-line window type 1903 getcmdwintype() String return current command-line window type
1933 has_key( {dict}, {key}) Number TRUE if {dict} has entry {key} 1935 has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
1934 haslocaldir( [{winnr} [, {tabnr}]]) 1936 haslocaldir( [{winnr} [, {tabnr}]])
1935 Number TRUE if the window executed |:lcd| 1937 Number TRUE if the window executed |:lcd|
1936 hasmapto( {what} [, {mode} [, {abbr}]]) 1938 hasmapto( {what} [, {mode} [, {abbr}]])
1937 Number TRUE if mapping to {what} exists 1939 Number TRUE if mapping to {what} exists
1938 histadd( {history},{item}) String add an item to a history 1940 histadd( {history}, {item}) String add an item to a history
1939 histdel( {history} [, {item}]) String remove an item from a history 1941 histdel( {history} [, {item}]) String remove an item from a history
1940 histget( {history} [, {index}]) String get the item {index} from a history 1942 histget( {history} [, {index}]) String get the item {index} from a history
1941 histnr( {history}) Number highest index of a history 1943 histnr( {history}) Number highest index of a history
1942 hlexists( {name}) Number TRUE if highlight group {name} exists 1944 hlexists( {name}) Number TRUE if highlight group {name} exists
1943 hlID( {name}) Number syntax ID of highlight group {name} 1945 hlID( {name}) Number syntax ID of highlight group {name}
2218 *argidx()* 2220 *argidx()*
2219 argidx() The result is the current index in the argument list. 0 is 2221 argidx() The result is the current index in the argument list. 0 is
2220 the first file. argc() - 1 is the last one. See |arglist|. 2222 the first file. argc() - 1 is the last one. See |arglist|.
2221 2223
2222 *arglistid()* 2224 *arglistid()*
2223 arglistid([{winnr}, [ {tabnr} ]]) 2225 arglistid([{winnr} [, {tabnr}]])
2224 Return the argument list ID. This is a number which 2226 Return the argument list ID. This is a number which
2225 identifies the argument list being used. Zero is used for the 2227 identifies the argument list being used. Zero is used for the
2226 global argument list. See |arglist|. 2228 global argument list. See |arglist|.
2227 Return -1 if the arguments are invalid. 2229 Return -1 if the arguments are invalid.
2228 2230
2684 2686
2685 ch_close({handle}) *ch_close()* 2687 ch_close({handle}) *ch_close()*
2686 Close channel {handle}. See |channel|. 2688 Close channel {handle}. See |channel|.
2687 {only available when compiled with the |+channel| feature} 2689 {only available when compiled with the |+channel| feature}
2688 2690
2689 ch_logfile( {fname} [, {mode}]) *ch_logfile()* 2691 ch_log({msg} [, {channel}]) *ch_log()*
2692 Write {msg} in the channel log file, if it was opened with
2693 |ch_logfile()|.
2694 When {channel} is passed the channel number is used for the
2695 message. {channel} must be an open channel.
2696
2697 ch_logfile({fname} [, {mode}]) *ch_logfile()*
2690 Start logging channel activity to {fname}. 2698 Start logging channel activity to {fname}.
2691 When {fname} is an empty string: stop logging. 2699 When {fname} is an empty string: stop logging.
2692 2700
2693 When {mode} is omitted or "a" append to the file. 2701 When {mode} is omitted or "a" append to the file.
2694 When {mode} is "w" start with an empty file. 2702 When {mode} is "w" start with an empty file.
2695 2703
2696 The file is flushed after every message, on Unix you can use 2704 The file is flushed after every message, on Unix you can use
2697 "tail -f" to see what is going on in real time. 2705 "tail -f" to see what is going on in real time.
2698 2706
2699 ch_open({address} [, {argdict}]) *ch_open()* 2707 ch_open({address} [, {options}]) *ch_open()*
2700 Open a channel to {address}. See |channel|. 2708 Open a channel to {address}. See |channel|.
2701 Returns the channel handle on success. Returns a negative 2709 Returns the channel handle on success. Returns a negative
2702 number for failure. 2710 number for failure.
2703 2711
2704 {address} has the form "hostname:port", e.g., 2712 {address} has the form "hostname:port", e.g.,
2705 "localhost:8765". 2713 "localhost:8765".
2706 2714
2707 If {argdict} is given it must be a |Dictionary|. The optional 2715 If {options} is given it must be a |Dictionary|. The optional
2708 items are: 2716 items are:
2709 mode "raw", "js" or "json". 2717 mode "raw", "js" or "json".
2710 Default "json". 2718 Default "json".
2711 callback function to call for requests with a zero 2719 callback function to call for requests with a zero
2712 sequence number. See |channel-callback|. 2720 sequence number. See |channel-callback|.
2751 in NL mode, the caller must do that. The NL in the response 2759 in NL mode, the caller must do that. The NL in the response
2752 is removed. 2760 is removed.
2753 See |channel-use|. 2761 See |channel-use|.
2754 2762
2755 {only available when compiled with the |+channel| feature} 2763 {only available when compiled with the |+channel| feature}
2764
2765 ch_setoptions({handle}, {options}) *ch_setoptions()*
2766 Set options on channel {handle}:
2767 "callback" the channel callback
2768 "timeout" default read timeout in msec
2769 See |ch_open()| for more explanation.
2770
2771 These options cannot be changed:
2772 "mode" cannot be changed once channel is open
2773 "waittime" only applies to "ch_open()|
2756 2774
2757 ch_status({handle}) *ch_status()* 2775 ch_status({handle}) *ch_status()*
2758 Return the status of channel {handle}: 2776 Return the status of channel {handle}:
2759 "fail" failed to open the channel 2777 "fail" failed to open the channel
2760 "open" channel can be used 2778 "open" channel can be used
6003 independent of the 'errorformat' setting. Use a command like 6021 independent of the 'errorformat' setting. Use a command like
6004 ":cc 1" to jump to the first position. 6022 ":cc 1" to jump to the first position.
6005 6023
6006 6024
6007 *setreg()* 6025 *setreg()*
6008 setreg({regname}, {value} [,{options}]) 6026 setreg({regname}, {value} [, {options}])
6009 Set the register {regname} to {value}. 6027 Set the register {regname} to {value}.
6010 {value} may be any value returned by |getreg()|, including 6028 {value} may be any value returned by |getreg()|, including
6011 a |List|. 6029 a |List|.
6012 If {options} contains "a" or {regname} is upper case, 6030 If {options} contains "a" or {regname} is upper case,
6013 then the value is appended. 6031 then the value is appended.