Mercurial > vim
comparison runtime/doc/eval.txt @ 20:4ac1dce8dd5e v7.0012
updated for version 7.0012
author | vimboss |
---|---|
date | Mon, 26 Jul 2004 12:53:41 +0000 |
parents | a81bc802c17c |
children | cc049b00ee70 |
comparison
equal
deleted
inserted
replaced
19:a81bc802c17c | 20:4ac1dce8dd5e |
---|---|
1 *eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 19 | 1 *eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 25 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
844 getcharmod( ) Number modifiers for the last typed character | 844 getcharmod( ) Number modifiers for the last typed character |
845 getbufvar( {expr}, {varname}) variable {varname} in buffer {expr} | 845 getbufvar( {expr}, {varname}) variable {varname} in buffer {expr} |
846 getcmdline() String return the current command-line | 846 getcmdline() String return the current command-line |
847 getcmdpos() Number return cursor position in command-line | 847 getcmdpos() Number return cursor position in command-line |
848 getcwd() String the current working directory | 848 getcwd() String the current working directory |
849 getfsize( {fname}) Number size in bytes of file | 849 getfperm( {fname}) String file permissions of file {fname} |
850 getfsize( {fname}) Number size in bytes of file {fname} | |
850 getftime( {fname}) Number last modification time of file | 851 getftime( {fname}) Number last modification time of file |
852 getftype( {fname}) String description of type of file {fname} | |
851 getline( {lnum}) String line {lnum} from current buffer | 853 getline( {lnum}) String line {lnum} from current buffer |
852 getreg( [{regname}]) String contents of register | 854 getreg( [{regname}]) String contents of register |
853 getregtype( [{regname}]) String type of register | 855 getregtype( [{regname}]) String type of register |
854 getwinposx() Number X coord in pixels of GUI Vim window | 856 getwinposx() Number X coord in pixels of GUI Vim window |
855 getwinposy() Number Y coord in pixels of GUI Vim window | 857 getwinposy() Number Y coord in pixels of GUI Vim window |
1578 The result is a Number, which is the size in bytes of the | 1580 The result is a Number, which is the size in bytes of the |
1579 given file {fname}. | 1581 given file {fname}. |
1580 If {fname} is a directory, 0 is returned. | 1582 If {fname} is a directory, 0 is returned. |
1581 If the file {fname} can't be found, -1 is returned. | 1583 If the file {fname} can't be found, -1 is returned. |
1582 | 1584 |
1585 getfperm({fname}) *getfperm()* | |
1586 The result is a String, which is the read, write, and execute | |
1587 permissions of the given file {fname}. | |
1588 If {fname} does not exist or its directory cannot be read, an | |
1589 empty string is returned. | |
1590 The result is of the form "rwxrwxrwx", where each group of | |
1591 "rwx" flags represent, in turn, the permissions of the owner | |
1592 of the file, the group the file belongs to, and other users. | |
1593 If a user does not have a given permission the flag for this | |
1594 is replaced with the string "-". Example: > | |
1595 :echo getfperm("/etc/passwd") | |
1596 < This will hopefully (from a security point of view) display | |
1597 the string "rw-r--r--" or even "rw-------". | |
1598 | |
1583 getftime({fname}) *getftime()* | 1599 getftime({fname}) *getftime()* |
1584 The result is a Number, which is the last modification time of | 1600 The result is a Number, which is the last modification time of |
1585 the given file {fname}. The value is measured as seconds | 1601 the given file {fname}. The value is measured as seconds |
1586 since 1st Jan 1970, and may be passed to strftime(). See also | 1602 since 1st Jan 1970, and may be passed to strftime(). See also |
1587 |localtime()| and |strftime()|. | 1603 |localtime()| and |strftime()|. |
1588 If the file {fname} can't be found -1 is returned. | 1604 If the file {fname} can't be found -1 is returned. |
1605 | |
1606 getftype({fname}) *getftype()* | |
1607 The result is a String, which is a description of the kind of | |
1608 file of the given file {fname}. | |
1609 If {fname} does not exist an empty string is returned. | |
1610 Here is a table over different kinds of files and their | |
1611 results: | |
1612 Normal file "file" | |
1613 Directory "dir" | |
1614 Symbolic link "link" | |
1615 Block device "bdev" | |
1616 Character device "cdev" | |
1617 Socket "socket" | |
1618 FIFO "fifo" | |
1619 All other "other" | |
1620 Example: > | |
1621 getftype("/home") | |
1622 < Note that a type such as "link" will only be returned on | |
1623 systems that support it. On some systems only "dir" and | |
1624 "file" are returned. | |
1589 | 1625 |
1590 *getline()* | 1626 *getline()* |
1591 getline({lnum}) The result is a String, which is line {lnum} from the current | 1627 getline({lnum}) The result is a String, which is line {lnum} from the current |
1592 buffer. Example: > | 1628 buffer. Example: > |
1593 getline(1) | 1629 getline(1) |
2244 search({pattern} [, {flags}]) *search()* | 2280 search({pattern} [, {flags}]) *search()* |
2245 Search for regexp pattern {pattern}. The search starts at the | 2281 Search for regexp pattern {pattern}. The search starts at the |
2246 cursor position. | 2282 cursor position. |
2247 {flags} is a String, which can contain these character flags: | 2283 {flags} is a String, which can contain these character flags: |
2248 'b' search backward instead of forward | 2284 'b' search backward instead of forward |
2285 'n' do Not move the cursor | |
2249 'w' wrap around the end of the file | 2286 'w' wrap around the end of the file |
2250 'W' don't wrap around the end of the file | 2287 'W' don't wrap around the end of the file |
2251 If neither 'w' or 'W' is given, the 'wrapscan' option applies. | 2288 If neither 'w' or 'W' is given, the 'wrapscan' option applies. |
2252 | 2289 |
2253 When a match has been found its line number is returned, and | 2290 When a match has been found its line number is returned. |
2254 the cursor will be positioned at the match. If there is no | 2291 The cursor will be positioned at the match, unless the 'n' |
2255 match a 0 is returned and the cursor doesn't move. No error | 2292 flag is used). |
2256 message is given. | 2293 If there is no match a 0 is returned and the cursor doesn't |
2294 move. No error message is given. | |
2257 | 2295 |
2258 Example (goes over all files in the argument list): > | 2296 Example (goes over all files in the argument list): > |
2259 :let n = 1 | 2297 :let n = 1 |
2260 :while n <= argc() " loop over all files in arglist | 2298 :while n <= argc() " loop over all files in arglist |
2261 : exe "argument " . n | 2299 : exe "argument " . n |
2745 winline() The result is a Number, which is the screen line of the cursor | 2783 winline() The result is a Number, which is the screen line of the cursor |
2746 in the window. This is counting screen lines from the top of | 2784 in the window. This is counting screen lines from the top of |
2747 the window. The first line is one. | 2785 the window. The first line is one. |
2748 | 2786 |
2749 *winnr()* | 2787 *winnr()* |
2750 winnr() The result is a Number, which is the number of the current | 2788 winnr([{arg}]) The result is a Number, which is the number of the current |
2751 window. The top window has number 1. The number can be used | 2789 window. The top window has number 1. |
2752 with |CTRL-W_w| and ":wincmd w" |:wincmd|. | 2790 When the optional argument is "$", the number of the |
2791 last window is returnd (the window count). | |
2792 When the optional argument is "#", the number of the last | |
2793 accessed window is returned (where |CTRL-W_p| goes to). | |
2794 If there is no previous window 0 is returned. | |
2795 The number can be used with |CTRL-W_w| and ":wincmd w" | |
2796 |:wincmd|. | |
2753 | 2797 |
2754 *winrestcmd()* | 2798 *winrestcmd()* |
2755 winrestcmd() Returns a sequence of |:resize| commands that should restore | 2799 winrestcmd() Returns a sequence of |:resize| commands that should restore |
2756 the current window sizes. Only works properly when no windows | 2800 the current window sizes. Only works properly when no windows |
2757 are opened or closed and the current window is unchanged. | 2801 are opened or closed and the current window is unchanged. |