aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/space_vlaze')
-rw-r--r--autoload/space_vlaze/random.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/autoload/space_vlaze/random.vim b/autoload/space_vlaze/random.vim
new file mode 100644
index 0000000..b3b151e
--- /dev/null
+++ b/autoload/space_vlaze/random.vim
@@ -0,0 +1,7 @@
+" Generate a random integer between 0 and `max`
+"
+" From:
+" http://vi.stackexchange.com/questions/807/how-to-generate-random-numbers/812#812
+function! space_vlaze#random#Random(max)
+ return system('python -c "import random; print(random.randint(0, ' . a:max . '))"')
+endfunction