summaryrefslogtreecommitdiff
path: root/runtime/doc/if_pyth.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-02 21:07:30 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-02 21:07:30 +0200
commit20aac6c1126988339611576d425965a25a777658 (patch)
tree7954ca9025cbef1081a0ea9ad231e5692c6238b0 /runtime/doc/if_pyth.txt
parentacca8df9d475bbfbafc71691ebc3b857ecd2777e (diff)
downloadvim-git-20aac6c1126988339611576d425965a25a777658.tar.gz
Update runtime files.
Diffstat (limited to 'runtime/doc/if_pyth.txt')
-rw-r--r--runtime/doc/if_pyth.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index d21de4b46..a93f3cbb4 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -82,6 +82,18 @@ Examples:
:pydo return "%s\t%d" % (line[::-1], len(line))
:pydo if line: return "%4d: %s" % (linenr, line)
<
+One can use `:pydo` in possible conjunction with `:py` to filter a range using
+python. For example: >
+
+ :py3 << EOF
+ needle = vim.eval('@a')
+ replacement = vim.eval('@b')
+
+ def py_vim_string_replace(str):
+ return str.replace(needle, replacement)
+ EOF
+ :'<,'>py3do return py_vim_string_replace(line)
+<
*:pyfile* *:pyf*
:[range]pyf[ile] {file}
Execute the Python script in {file}. The whole