title: How to duplicate selection with Sublime Text snippet
body: <h2>The quest</h2>
  
  <p>Turn this (with <code>currHour</code> being the current selection):</p>
  
  <pre><code>var currHour = now.getHours();
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>var currHour = now.getHours();
  console.log('currHour=' + currHour);
  </code></pre>
  
  <p>Should work also for these cases:</p>
  
  <pre><code>currHour = now.getHours();
  </code></pre>
  
  <p>--></p>
  
  <pre><code>currHour = now.getHours();
  console.log('currHour=' + currHour);
  </code></pre>
  
  <p>and (where <code>b</code> is selected):</p>
  
  <pre><code>a = b;
  </code></pre>
  
  <p>--></p>
  
  <pre><code>a = b;
  console.log('b=' + b);
  </code></pre>
  
  <p>etc.</p>
  
  <hr>
  
  <h2>The Situation</h2>
  
  <p>Now, by following <a href="https://stackoverflow.com/a/12165583/451962">this answer</a> I was able to produce the second line, with this:</p>
  
  <pre><code>&lt;snippet&gt;
    &lt;content&gt;
      &lt;![CDATA[console.log('$SELECTION=' + $SELECTION);]]&gt; &lt;/content&gt;
    &lt;description&gt;Print selection to console.log&lt;/description&gt;
  &lt;/snippet&gt;
  </code></pre>
  
  <p><em>NB: my snippet code ommits <code>&lt;scope&gt;</code> because the scope is implied by the location of the snippet file (under language-specific dir -- JavaScript).</em></p>
  
  <p><em>NB2: the <code>&lt;tabTrigger&gt;</code> setting in the snippet was ommited intentionally, because I will use a keyboard shortcut:</em></p>
  
  <pre><code>{ "keys": ["ctrl+shift+o"], "command": "insert_snippet", "args": { "name": "Packages/User/JavaScript/console-log-selection.sublime-snippet" } },
  </code></pre>
  
  <p>OK, that brings me half way there...</p>
  
  <hr>
  
  <h2>The problem</h2>
  
  <p>The current "solution" requires of me to <strong>manually duplicate</strong> the selection before I can invoke the snippet. That is an inconvenient step I'd like to skip if I can.
  So, are there ways to <strong>make snippet duplicate the selection into new line</strong>?</p>