title: How to shuffle a list in vim?
body: <p>What is the best way to shuffle a list in Vim?</p>
  
  <p>I'm trying to randomly sort lines in vim (using vimscript).
  I created for this a list with all line numbers (in my selection).</p>
  
  <p>p.e. if I select from line 10 to 20 my list will be:</p>
  
  <pre><code>mylist = ['10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
  </code></pre>
  
  <p>I would like to sort the lines randomly and with a for loop put them back in the same selection in the new sequence.
  In order to realize this I would like to shuffle the list many times but don't know how to shuffle the list.</p>
  
  <p>Another solution would be to pick an index from my last randomly.</p>
  
  <p>Can't find out what is the best way.</p>
  
  <p>I know I can sort lines using python, ruby or with other languages but I don't want to install them.
  I would like to realize above using vimscript.</p>