sponsor Vim development Vim logo Vim Book Ad

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.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
pythondo.zip 0.1 2010-07-27 6.0 lubin yin Add help file.
pythondo.vim 0.1 2010-07-23 6.0 lubin yin Initial upload
ip used for rating: 18.118.32.213

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github