Mercurial > vim
comparison runtime/doc/if_pyth.txt @ 14637:0ecb909e3249
Update runtime files.
commit https://github.com/vim/vim/commit/fc65cabb15d0236bce001ad78e12a40511caf941
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 28 22:58:02 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 28 Aug 2018 23:00:08 +0200 |
parents | 2f7e67dd088c |
children | 34fd018452ed |
comparison
equal
deleted
inserted
replaced
14636:91eef21ff090 | 14637:0ecb909e3249 |
---|---|
166 - a string if the Vim expression evaluates to a string or number | 166 - a string if the Vim expression evaluates to a string or number |
167 - a list if the Vim expression evaluates to a Vim list | 167 - a list if the Vim expression evaluates to a Vim list |
168 - a dictionary if the Vim expression evaluates to a Vim dictionary | 168 - a dictionary if the Vim expression evaluates to a Vim dictionary |
169 Dictionaries and lists are recursively expanded. | 169 Dictionaries and lists are recursively expanded. |
170 Examples: > | 170 Examples: > |
171 :" value of the 'textwidth' option | |
171 :py text_width = vim.eval("&tw") | 172 :py text_width = vim.eval("&tw") |
172 :py str = vim.eval("12+12") # NB result is a string! Use | 173 : |
173 # string.atoi() to convert to | 174 :" contents of the 'a' register |
174 # a number. | 175 :py a_reg = vim.eval("@a") |
175 | 176 : |
177 :" Result is a string! Use string.atoi() to convert to a number. | |
178 :py str = vim.eval("12+12") | |
179 : | |
176 :py tagList = vim.eval('taglist("eval_expr")') | 180 :py tagList = vim.eval('taglist("eval_expr")') |
177 < The latter will return a python list of python dicts, for instance: | 181 < The latter will return a python list of python dicts, for instance: |
178 [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ | 182 [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ |
179 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~ | 183 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~ |
180 | 184 |