rndm


Ⅰ. 插件描述

Random number generation for vim

Ⅱ. 基本信息

创建日期:  2014-04-07
使用用户:  1
Github星:  1
插件作者:  Eduardo San Martin Morote

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Rndm.vim

Author: Charles E. Campbell, Jr.

Date: Aug 12, 2008

Version: 4f ASTRO-ONLY

Discussion: algorithm developed at MIT

Rndm.vim uses three pseudo-random seed variables

g:rndm_m1 g:rndm_m2 g:rndm_m3

Each should be on the interval 0 - 100,000,000

  • RndmInit(s1,s2,s3): takes three arguments to set the three seeds (optional)
  • Rndm() : generates a pseudo-random variate on [0,100000000)
  • Urndm(a,b) : generates a uniformly distributed pseudo-random variate on the interval [a,b]
  • Dice(qty,sides) : emulates a variate from sum of "qty" user-specified dice, each of which can take on values [1,sides]
  • SetDeck(N) : returns a pseudo-random "deck" of integers from 1..N (actually, a list of pseudo-randomly distributed integers)

添加新评论