21 lines
438 B
VimL
Raw Normal View History

2017-08-30 15:14:56 +02:00
" Simple python-based random number generator
2017-10-05 11:17:03 +02:00
function! g:RandomInt()
2017-08-30 15:14:56 +02:00
if has("python3")
python3 << EOF
import random
result = random.randrange(1, 1000000)
vim.command('return ' + str(result))
EOF
else
python << EOF
import random
result = random.randrange(1, 1000000)
vim.command('return ' + str(result))
EOF
endif
endfunction
" Put the uncopyable messages text into the buffer
command! PutMessages redir @" | messages | redir END | put