Mercurial > vim
diff runtime/doc/if_pyth.txt @ 14668:34fd018452ed
Update runtime files.
commit https://github.com/vim/vim/commit/20aac6c1126988339611576d425965a25a777658
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 2 21:07:30 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 02 Sep 2018 21:15:05 +0200 |
parents | 0ecb909e3249 |
children | 40ef13331e02 |
line wrap: on
line diff
--- 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