1
0
Fork 0
mirror of synced 2024-12-27 00:53:20 -05:00
ultimate-vim/sources_non_forked/vim-autoformat/plugin/utils.vim

21 lines
438 B
VimL
Raw Normal View History

2022-05-20 05:05:00 -04:00
" Simple python-based random number generator
function! g:RandomInt()
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