|
1 |
| -*eval.txt* For Vim version 7.4. Last change: 2016 Jan 21 |
| 1 | +*eval.txt* For Vim version 7.4. Last change: 2016 Jan 23 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -1409,6 +1409,10 @@ v:exception The value of the exception most recently caught and not
|
1409 | 1409 | :endtry
|
1410 | 1410 | < Output: "caught oops".
|
1411 | 1411 |
|
| 1412 | + *v:false* *false-variable* |
| 1413 | +v:false A Number with value zero. Used to put "false" in JSON. See |
| 1414 | + |jsonencode()|. |
| 1415 | + |
1412 | 1416 | *v:fcs_reason* *fcs_reason-variable*
|
1413 | 1417 | v:fcs_reason The reason why the |FileChangedShell| event was triggered.
|
1414 | 1418 | Can be used in an autocommand to decide what to do and/or what
|
@@ -1542,6 +1546,14 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
|
1542 | 1546 | This is the screen column number, like with |virtcol()|. The
|
1543 | 1547 | value is zero when there was no mouse button click.
|
1544 | 1548 |
|
| 1549 | + *v:none* *none-variable* |
| 1550 | +v:none An empty String. Used to put an empty item in JSON. See |
| 1551 | + |jsonencode()|. |
| 1552 | + |
| 1553 | + *v:null* *null-variable* |
| 1554 | +v:null An empty String. Used to put "null" in JSON. See |
| 1555 | + |jsonencode()|. |
| 1556 | + |
1545 | 1557 | *v:oldfiles* *oldfiles-variable*
|
1546 | 1558 | v:oldfiles List of file names that is loaded from the |viminfo| file on
|
1547 | 1559 | startup. These are the files that Vim remembers marks for.
|
@@ -1707,6 +1719,10 @@ v:throwpoint The point where the exception most recently caught and not
|
1707 | 1719 | :endtry
|
1708 | 1720 | < Output: "Exception from test.vim, line 2"
|
1709 | 1721 |
|
| 1722 | + *v:true* *true-variable* |
| 1723 | +v:true A Number with value one. Used to put "true" in JSON. See |
| 1724 | + |jsonencode()|. |
| 1725 | + |
1710 | 1726 | *v:val* *val-variable*
|
1711 | 1727 | v:val Value of the current item of a |List| or |Dictionary|. Only
|
1712 | 1728 | valid while evaluating the expression used with |map()| and
|
@@ -1913,6 +1929,8 @@ isdirectory( {directory}) Number TRUE if {directory} is a directory
|
1913 | 1929 | islocked( {expr}) Number TRUE if {expr} is locked
|
1914 | 1930 | items( {dict}) List key-value pairs in {dict}
|
1915 | 1931 | join( {list} [, {sep}]) String join {list} items into one String
|
| 1932 | +jsondecode( {string}) any decode JSON |
| 1933 | +jsonencode( {expr}) String encode JSON |
1916 | 1934 | keys( {dict}) List keys in {dict}
|
1917 | 1935 | len( {expr}) Number the length of {expr}
|
1918 | 1936 | libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
|
@@ -4215,6 +4233,27 @@ join({list} [, {sep}]) *join()*
|
4215 | 4233 | converted into a string like with |string()|.
|
4216 | 4234 | The opposite function is |split()|.
|
4217 | 4235 |
|
| 4236 | +jsondecode({string}) *jsondecode()* |
| 4237 | + TODO |
| 4238 | + |
| 4239 | +jsonencode({expr}) *jsonencode()* |
| 4240 | + Encodode {expr} as JSON and return this as a string. |
| 4241 | + The encoding is specified in: |
| 4242 | + http://www.ietf.org/rfc/rfc4627.txt |
| 4243 | + Vim values are converted as follows: |
| 4244 | + Number decimal number |
| 4245 | + Float floating point number |
| 4246 | + String in double quotes (possibly null) |
| 4247 | + Funcref nothing |
| 4248 | + List as an array (possibly null); when |
| 4249 | + used recursively: [] |
| 4250 | + Dict as an object (possibly null); when |
| 4251 | + used recursively: {} |
| 4252 | + v:false "false" |
| 4253 | + v:true "true" |
| 4254 | + v:none nothing |
| 4255 | + v:null "null" |
| 4256 | + |
4218 | 4257 | keys({dict}) *keys()*
|
4219 | 4258 | Return a |List| with all the keys of {dict}. The |List| is in
|
4220 | 4259 | arbitrary order.
|
|
0 commit comments