title: Customizing the cursor's position in zsh
body: <p>I am using <a href="https://github.com/willghatch/zsh-snippets" rel="nofollow noreferrer">this</a> snippet plugin in <strong>zsh</strong> shell and wanted to customize it.
  How I can customize the cursor's position to a specific place after expanding the snippet (like the editors usually do with the completion).</p>
  <p>I write <code>l</code> and press Ctrl-d to expand it so it becomes <code>$(line )</code> but the cursor goes after the entire snippet, I want it to be inside the snippet so I can write a number after the <code>line</code> and before the character <code>)</code></p>
  <p>This is the function responsible for the snippet expanding ( I still didn't edit anything from the source code, it is still the same as the repository ):</p>
  <pre class="lang-sh prettyprint-override"><code>snippet-expand () {
      emulate -L zsh
      setopt extendedglob
      local MATCH
      LBUFFER=${LBUFFER%%(#m)[.\-+:|_a-zA-Z0-9]#} 
      LBUFFER+=${snippets[$MATCH]:-$MATCH} 
  }
  </code></pre>