vim-paint


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2011-02-17
使用用户:  1
Github星:  8
插件作者:  Yukihiro Nakadaira

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Example:
  let canvas = paint#canvas#new(128, 128)
  call canvas.draw_line([0, 0], [63, 63], [0, 0, 0], 1)
  call canvas.draw_line([0, 63], [63, 0], [0, 0, 0], 2)
  call canvas.draw_rect([0, 64], [63, 127], [255, 0, 0], -1)
  call canvas.draw_rect([32, 64], [63, 95], [0, 255, 0], 1)
  call canvas.draw_ellipse([64, 0], [127, 63], [0, 0, 255], -1)
  call canvas.draw_ellipse([64, 32], [95, 63], [255, 255, 0], 2)
  for x in range(64)
    for y in range(64)
      call canvas.set_pixel(x + 64, y + 64, [x 256 / 64, y 256 / 64, 0])
    endfor
  endfor
  let font = paint#bdf#loadfile(globpath(&rtp, 'font/mplus/mplus_f12r.bdf'))
  call canvas.draw_text("Hello, Vim", [64, 76], font, [255, 255, 255])
  call canvas.save('example.bmp')

  result: http://ynkdir.github.com/vim-paint/example.bmp

添加新评论