pythondo : Add
script karma |
Rating 5/2,
Downloaded by 635 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
lubin yin |
|
script type |
utility |
|
description |
This plugin adds a command ":Pythondo", which is rather like ":perldo" or" ":rubydo".
:[range]Pythondo {cmd}
:[range]Pyd {cmd}
Execute Python command {cmd} for each line in the
[range], with variable "s" being set to the text of each line in
turn, and variable "n" being the corresponding line number.
Setting variable "s" will change the text, but note that it
is not possible to add or delete lines using this command.
The default for [range] is the whole file: "1,$".
Setting variable "n" will set the text to line of number n, not
the current line. It's better not to set variable "n".
Here are some things you can try: >
:Pythondo s = str(n+1) + ' ' + s # Add line number to each line
:py import time
:.Pythondo s = time.ctime()
|
|
install details |
Copy the file pythondo.vim to plugin folder,
and place pythondo.txt in doc folder.
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.118.32.213
|