Mercurial > vim
comparison runtime/doc/if_pyth.txt @ 856:8cd729851562 v7.0g
updated for version 7.0g
author | vimboss |
---|---|
date | Sun, 30 Apr 2006 18:54:39 +0000 |
parents | a209672376fd |
children | 4bac29d27e2f |
comparison
equal
deleted
inserted
replaced
855:d2a4f08396fe | 856:8cd729851562 |
---|---|
1 *if_pyth.txt* For Vim version 7.0f. Last change: 2006 Jan 20 | 1 *if_pyth.txt* For Vim version 7.0g. Last change: 2006 Apr 30 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Paul Moore | 4 VIM REFERENCE MANUAL by Paul Moore |
5 | 5 |
6 | 6 |
132 vim.eval(str) *python-eval* | 132 vim.eval(str) *python-eval* |
133 Evaluates the expression str using the vim internal expression | 133 Evaluates the expression str using the vim internal expression |
134 evaluator (see |expression|). Returns the expression result as: | 134 evaluator (see |expression|). Returns the expression result as: |
135 - a string if the Vim expression evaluates to a string or number | 135 - a string if the Vim expression evaluates to a string or number |
136 - a list if the Vim expression evaluates to a Vim list | 136 - a list if the Vim expression evaluates to a Vim list |
137 - a dictionary if the Vim expression evaluates to a Vim dictionary | 137 - a dictionary if the Vim expression evaluates to a Vim dictionary |
138 Dictionaries and lists are recursively expanded. | 138 Dictionaries and lists are recursively expanded. |
139 Examples: > | 139 Examples: > |
140 :py text_width = vim.eval("&tw") | 140 :py text_width = vim.eval("&tw") |
141 :py str = vim.eval("12+12") # NB result is a string! Use | 141 :py str = vim.eval("12+12") # NB result is a string! Use |
142 # string.atoi() to convert to | 142 # string.atoi() to convert to |
143 # a number. | 143 # a number. |
144 | 144 |
145 :py tagList = vim.eval('taglist("eval_expr")') | 145 :py tagList = vim.eval('taglist("eval_expr")') |
146 < The latter will return a python list of python dicts, for instance: | 146 < The latter will return a python list of python dicts, for instance: |
147 [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': | 147 [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': |
148 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] | 148 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] |
149 | 149 |
150 | 150 |