pythondo


Ⅰ. 插件描述

Add

Ⅱ. 基本信息

创建日期:  2010-07-23
使用用户:  1
Github星:  3
插件作者:  lubin yin

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/pythondo'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/pythondo'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/pythondo'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/pythondo

Ⅳ. 文档说明

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()

添加新评论