GoSublime 9o multiple commands in build_command?

agolangf · · 1293 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m trying to use multiple commands in my build_command setting, but it doesn&#39;t appear to be working:</p> <pre><code>&#34;build_command&#34;: [&#34;reset &amp;&amp; go run $_fn&#34;], &#34;build_command&#34;: [&#34;reset&#34; &#34;go run $_fn&#34;], </code></pre> <p>Has anybody else tried this?</p> <hr/>**评论:**<br/><br/>hi_im_nate: <pre><p>I&#39;m not sure how sublime does its execution, but you may need to have a shell open to run multiple things like that. Try adding the commands into a script and running that script as your build command. </p></pre>prohulaelk: <pre><p>from the default settings&#39; comments, it looks like you&#39;d need to quote-and-comma separate each arg; something more like <code>[&#34;reset&#34;, &#34;&amp;&amp;&#34;, &#34;go&#34;, &#34;run&#34;, &#34;$_fn&#34;]</code>:</p> <pre><code>// what 9o command to run when (super or )ctrl+dot,ctrl+b us pressed // e.g. [&#34;go&#34;, &#34;build&#34;] // the 9o command ^1 recalls the last command you ran manually // see 9o help(ctrl+9 &#34;help&#34;) for more details about what commands are supported &#34;build_command&#34;: [&#34;^1&#34;], </code></pre> <p>9o.md doesn&#39;t list anything about supporting <code>&amp;&amp;</code> or <code>reset</code> though, so not sure if even that&#39;ll work.</p> <p>You might need to make your own build system, eg. mine is:</p> <pre><code>{ &#34;cmd&#34;: &#34;go run $file&#34;, &#34;file_regex&#34;: &#34;^[ ]*File \&#34;(...*?)\&#34;, line ([0-9]*)&#34;, &#34;selector&#34;: &#34;source.go&#34;, &#34;shell&#34;: &#34;true&#34;, &#34;variants&#34;: [ {&#34;name&#34;: &#34;Go Test&#34;, &#34;cmd&#34;: &#34;go test $file&#34;}, {&#34;name&#34;: &#34;Go Build&#34;, &#34;cmd&#34;: &#34;go build $file&#34;} ] } </code></pre> <p>the cmd arguments there should support anything your OS&#39; default shell does.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1293 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传