How to generate random numbers in the buffer?

vi, vim

Solution

is this ok for you?

:r! echo $RANDOM

then

9@:

if you have certain programming language env available on your OS, you can eval those statement too.

Problem

I want to generate 10 random numbers in the buffer. In Emacs I would do: `<start macro>(random limit) <eval lisp><newline><end macro>` to define the macro, and `9 <execute macro>` to generate it 10 times. Is there a way I can do this in vim?

Original source

Related problems