diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-17 16:40:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-17 16:40:06 +0200 |
commit | d620aa9be4d574627c020dedd39313f8482ab216 (patch) | |
tree | 624b63e85141e01e5ac4c3b200a842f4719e6d6e /runtime | |
parent | cfef5ff23ea09b17203d9f466f6f3526c76a8b99 (diff) | |
download | vim-git-d620aa9be4d574627c020dedd39313f8482ab216.tar.gz |
updated for version 7.3.966v7.3.966
Problem: There is ":py3do" but no ":pydo".
Solution: Add the ":pydo" command. (Lilydjwg)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/if_pyth.txt | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 051dfacaf..a2c949e34 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -57,6 +57,22 @@ Example: > Note: Python is very sensitive to the indenting. Make sure the "class" line and "EOF" do not have any indent. + *:pydo* +:[range]pydo {body} Execute Python function "def _vim_pydo(line, linenr): + {body}" for each line in the [range], with the + function arguments being set to the text of each line + in turn, without a trailing <EOL>, and the current + line number. The function should return a string or + None. If a string is returned, it becomes the text of + the line in the current turn. The default for [range] + is the whole file: "1,$". + {not in Vi} + +Examples: +> + :pydo return "%s\t%d" % (line[::-1], len(line)) + :pydo if line: return "%4d: %s" % (linenr, line) +< *:pyfile* *:pyf* :[range]pyf[ile] {file} Execute the Python script in {file}. The whole @@ -485,27 +501,14 @@ sure edit "gvim.exe" and search for "python\d*.dll\c". 8. Python 3 *python3* *:py3* *:python3* -The |:py3| and |:python3| commands work similar to |:python|. A simple check +The `:py3` and `:python3` commands work similar to `:python`. A simple check if the `:py3` command is working: > :py3 print("Hello") < *:py3file* -The |:py3file| command works similar to |:pyfile|. - +The `:py3file` command works similar to `:pyfile`. *:py3do* *E863* -:[range]py3do {body} Execute Python function "def _vim_pydo(line, linenr): - {body}" for each line in the [range], with the - function arguments being set to the text of each line - in turn, without a trailing <EOL>, and the current - line number. The function should return a string or - None. If a string is returned, it becomes the text of - the line in the current turn. The default for [range] - is the whole file: "1,$". - {not in Vi} +The `:py3do` command works similar to `:pydo`. -Examples: -> - :py3do return "%s\t%d" % (line[::-1], len(line)) - :py3do if line: return "%4d: %s" % (linenr, line) Vim can be built in four ways (:version output): 1. No Python support (-python, -python3) |