title: Vim: Create custom command that takes a movement
body: <p>I often transform lines of texts to arrays. For example, this:</p>
  
  <pre><code>Monday
  Tuesday
  Wednesday
  </code></pre>
  
  <p>Becomes:</p>
  
  <pre><code>[
    'Monday',
    'Tuesday',
    'Wednesday',
  ]
  </code></pre>
  
  <p>I can make a map that changes one of the lines (e.g. <code>Monday</code> to <code>'Monday',</code>) like so:</p>
  
  <p><code>:nnoremap gsa ^i'&lt;Esc&gt;A,</code></p>
  
  <p>What I'd like to do is have that command take a movement or a text object so that I can execute it like <code>gsaip</code> or <code>gsip3j</code>.</p>
  
  <p>How can I accomplish this?</p>