<blockquote>
<p><a href="https://github.com/techee" class="user-mention">@techee</a> can't you make the scripting plugin a proxy and the scripts sub-plugins? IIUC <a href="https://github.com/kugel-" class="user-mention">@kugel-</a> made it possible for proxies to manipulate keybindings.</p>
</blockquote>
<p>Ah, no, the plugin does something different. The main feature is that the scripts can be written in ANY language and don't require ANY knowledge of GTK or Geany API. They only behave as filters so they do the following transformation:</p>
<pre><code>input -> script -> output
</code></pre>
<p>where <code>input</code> becomes stdin of the script and the script writes <code>output</code> to stdout. Now both <code>input</code> and <code>output</code> will be configurable so for instance, <code>input</code> can be configured in a separate config file to be:</p>
<ul>
<li>current document</li>
<li>selection in current document</li>
<li>none (no input at all)</li>
</ul>
<p>and output to:</p>
<ul>
<li>replace current document</li>
<li>insert at cursor position</li>
<li>replace selection</li>
<li>opened in a new document</li>
<li>written to the messages window</li>
</ul>
<p>Also before the script is run, some values will be exported through environment variables so the script can e.g. use $CURRENT_DOCUMENT to get the name of current document.</p>
<p>So for instance a shell script containing only</p>
<pre><code>git blame $CURRENT_DOCUMENT
</code></pre>
<p>and configuration</p>
<p>input: none<br>
output: new document</p>
<p>will open a new document with <code>git blame</code> of current document (you can easily imagine how one could re-create GeanyVC with single-line scripts like this).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1430#issuecomment-300600211">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ955NB-uMsr3SjVgqkDXAXm1Z_KXks5r4ht3gaJpZM4MegRN">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJwk5tjlIA8xR5jzKnBw6tGjKt_SSks5r4ht3gaJpZM4MegRN.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1430#issuecomment-300600211"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@techee in #1430: \u003e @techee can't you make the scripting plugin a proxy and the scripts sub-plugins? IIUC @kugel- made it possible for proxies to manipulate keybindings.\r\n\r\nAh, no, the plugin does something different. The main feature is that the scripts can be written in ANY language and don't require ANY knowledge of GTK or Geany API. They only behave as filters so they do the following transformation:\r\n\r\n```\r\ninput -\u003e script -\u003e output\r\n```\r\n\r\nwhere `input` becomes stdin of the script and the script writes `output` to stdout. Now both `input` and `output` will be configurable so for instance, `input` can be configured in a separate config file to be:\r\n\r\n- current document\r\n- selection in current document\r\n- none (no input at all)\r\n\r\nand output to:\r\n\r\n- replace current document\r\n- insert at cursor position\r\n- replace selection\r\n- opened in a new document\r\n- written to the messages window\r\n\r\nAlso before the script is run, some values will be exported through environment variables so the script can e.g. use $CURRENT_DOCUMENT to get the name of current document.\r\n\r\nSo for instance a shell script containing only\r\n\r\n```\r\ngit blame $CURRENT_DOCUMENT\r\n```\r\n\r\nand configuration\r\n\r\ninput: none\r\noutput: new document\r\n\r\nwill open a new document with `git blame` of current document (you can easily imagine how one could re-create GeanyVC with single-line scripts like this)."}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1430#issuecomment-300600211"}}}</script>