Mercurial > vim
comparison runtime/doc/eval.txt @ 7659:07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 17 22:26:33 2016 +0100
Update help files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jan 2016 22:30:06 +0100 |
parents | d4370fef0175 |
children | 39251e981d1f |
comparison
equal
deleted
inserted
replaced
7658:fc6d585a9726 | 7659:07f11de5efca |
---|---|
871 text column numbers start with one! Example, to get the byte under the | 871 text column numbers start with one! Example, to get the byte under the |
872 cursor: > | 872 cursor: > |
873 :let c = getline(".")[col(".") - 1] | 873 :let c = getline(".")[col(".") - 1] |
874 | 874 |
875 If the length of the String is less than the index, the result is an empty | 875 If the length of the String is less than the index, the result is an empty |
876 String. A negative index always results in an empty string (reason: backwards | 876 String. A negative index always results in an empty string (reason: backward |
877 compatibility). Use [-1:] to get the last byte. | 877 compatibility). Use [-1:] to get the last byte. |
878 | 878 |
879 If expr8 is a |List| then it results the item at index expr1. See |list-index| | 879 If expr8 is a |List| then it results the item at index expr1. See |list-index| |
880 for possible index values. If the index is out of range this results in an | 880 for possible index values. If the index is out of range this results in an |
881 error. Example: > | 881 error. Example: > |
4561 is specified as a positive integer (zero excluded). IDs 1, 2 | 4561 is specified as a positive integer (zero excluded). IDs 1, 2 |
4562 and 3 are reserved for |:match|, |:2match| and |:3match|, | 4562 and 3 are reserved for |:match|, |:2match| and |:3match|, |
4563 respectively. If the {id} argument is not specified or -1, | 4563 respectively. If the {id} argument is not specified or -1, |
4564 |matchadd()| automatically chooses a free ID. | 4564 |matchadd()| automatically chooses a free ID. |
4565 | 4565 |
4566 The optional {dict} argmument allows for further custom | 4566 The optional {dict} argument allows for further custom |
4567 values. Currently this is used to specify a match specifc | 4567 values. Currently this is used to specify a match specific |
4568 conceal character that will be shown for |hl-Conceal| | 4568 conceal character that will be shown for |hl-Conceal| |
4569 highlighted matches. The dict can have the following members: | 4569 highlighted matches. The dict can have the following members: |
4570 | 4570 |
4571 conceal Special character to show instead of the | 4571 conceal Special character to show instead of the |
4572 match (only for |hl-Conceal| highlighed | 4572 match (only for |hl-Conceal| highlighed |
4795 It doesn't matter if the path exists or not. | 4795 It doesn't matter if the path exists or not. |
4796 | 4796 |
4797 perleval({expr}) *perleval()* | 4797 perleval({expr}) *perleval()* |
4798 Evaluate Perl expression {expr} in scalar context and return | 4798 Evaluate Perl expression {expr} in scalar context and return |
4799 its result converted to Vim data structures. If value can't be | 4799 its result converted to Vim data structures. If value can't be |
4800 converted, it returned as string Perl representation. | 4800 converted, it is returned as a string Perl representation. |
4801 Note: If you want a array or hash, {expr} must returns an | 4801 Note: If you want an array or hash, {expr} must return a |
4802 reference of it. | 4802 reference to it. |
4803 Example: > | 4803 Example: > |
4804 :echo perleval('[1 .. 4]') | 4804 :echo perleval('[1 .. 4]') |
4805 < [1, 2, 3, 4] | 4805 < [1, 2, 3, 4] |
4806 {only available when compiled with the |+perl| feature} | 4806 {only available when compiled with the |+perl| feature} |
4807 | 4807 |
5317 cursor is moved. The 's' flag cannot be combined with the 'n' | 5317 cursor is moved. The 's' flag cannot be combined with the 'n' |
5318 flag. | 5318 flag. |
5319 | 5319 |
5320 'ignorecase', 'smartcase' and 'magic' are used. | 5320 'ignorecase', 'smartcase' and 'magic' are used. |
5321 | 5321 |
5322 When the 'z' flag is not given seaching always starts in | 5322 When the 'z' flag is not given, searching always starts in |
5323 column zero and then matches before the cursor are skipped. | 5323 column zero and then matches before the cursor are skipped. |
5324 When the 'c' flag is present in 'cpo' the next search starts | 5324 When the 'c' flag is present in 'cpo' the next search starts |
5325 after the match. Without the 'c' flag the next search starts | 5325 after the match. Without the 'c' flag the next search starts |
5326 one column further. | 5326 one column further. |
5327 | 5327 |
7679 or ":endif" if {expr1} evaluates to non-zero. | 7679 or ":endif" if {expr1} evaluates to non-zero. |
7680 | 7680 |
7681 From Vim version 4.5 until 5.0, every Ex command in | 7681 From Vim version 4.5 until 5.0, every Ex command in |
7682 between the ":if" and ":endif" is ignored. These two | 7682 between the ":if" and ":endif" is ignored. These two |
7683 commands were just to allow for future expansions in a | 7683 commands were just to allow for future expansions in a |
7684 backwards compatible way. Nesting was allowed. Note | 7684 backward compatible way. Nesting was allowed. Note |
7685 that any ":else" or ":elseif" was ignored, the "else" | 7685 that any ":else" or ":elseif" was ignored, the "else" |
7686 part was not executed either. | 7686 part was not executed either. |
7687 | 7687 |
7688 You can use this to remain compatible with older | 7688 You can use this to remain compatible with older |
7689 versions: > | 7689 versions: > |