title: How can I pass the current line to a Vimscript function?
body: <p>I am trying to create a Vim mapping that will operate on the current line, taking a string like this:</p>
  
  <pre><code>[boiled cabbage, mad donkey, elephant, very dark fudge]
  </code></pre>
  
  <p>And quoting all the list elements to end up with this:</p>
  
  <pre><code>["boiled cabbage", "mad donkey", "elephant", "very dark fudge"]
  </code></pre>
  
  <p>I tried with vim regexes, but figured it would be easier to write a function that takes the current line as an argument and returns the transformed line.  I have no problem performing the transformation in vimscript.  But how can I pass the current line to the function, and how do I replace the line with the transformed line?</p>