2009-08-31 47 views
170

Eclipse有没有什么像样的bash插件?我唯一的要求是语法高亮。我已经搜索了一下,但没有看到任何看起来像“the”bash插件的东西。Eclipse的Bash脚本插件?

+0

什么是您的操作系统?你是否试图在Windows上运行这个shell模拟器?有点像Cygwin – amphibient

+0

另请参阅:http://stackoverflow.com/questions/5324471/problem-installing-shelled-plugin-in-eclipse-helios –

回答

137

ShellEd看起来很有希望,做语法高亮显示,并具有积极的评价,虽然我还没有尝试过自己。 Redhat的发行版包含approved。 Eclipse网站上的ShellEd plugin page有更多信息,而他们的wiki上有installation instructions

需要注意的是,如果你不运行Eclipse的了最新版本(撰写本文时,朱诺),你需要使用一个旧版本,例如2.0.1与靛蓝兼容。

+1

我使用这个插件,它是非常有用的。 – romaintaz

+0

@romaintaz你是如何安装它的?你可以请看看http://stackoverflow.com/questions/5064250/question-on-installing-eclipse-plugin – London

+0

这个插件是伟大的!一个问题:有谁知道如何获得语法高亮来支持bash的HEREDOC语法? 例如: 猫> /tmp/somefile.out <<“EOF” 这段文本应该加亮后AS一HEREDOC 此$变量和报价不可在加亮后,因为我们使用一个带引号的“EOF” EOF – TrinitronX

36

编辑(2013年8月3日):使用http://sourceforge.net/projects/shelled/files/shelled/update/为最新版本

编辑(2013年2月25日):非必要基于Eclipse 4.2炮轰2.0.2安装Linux的工具。 1。另外,不需要下载zip文件。这里的炮轰2.0.2的更新站点:http://sourceforge.net/projects/shelled/files/shelled/ShellEd%202.0.2/update/

旧文章:

我喜欢带壳为好。如果您现在安装它,则需要下载zip文件并在Eclipse的安装新软件向导中指向它。您还需要从

http://download.eclipse.org/technology/linuxtools/update 
+0

直接链接到zip文件:http://ppl.ug/tvjARs_cKQE/dl –

+0

炮轰网站:http://sourceforge.net/projects/shelled/ –

+0

+1这是今天最有价值的信息。我希望在使用Juno SR2之前一小时之前安装好了... –

11

安装手册插件只要按照从ShellEd's InstallGuide

+0

没有为我工作:放在更新网站,它发现只有炮击,它立即拒绝安装,因为它想要一个用户界面模块。 – Rob

+3

正如其文档中所述(http://sourceforge.net/apps/trac/shelled/wiki/Documentation/InstallGuide),您必须将此http://download.eclipse.org/technology/linuxtools/update添加到可用的软件站点。之后,事情应该工作得很好! – pedromanoel

+0

2014年7月:shelled不再可通过linuxtools URL/repo for eclipse获得。 – woohoo

13

调试器的Bash 3版官方说明(伯恩再次壳)。
Eclipse插件。只能使用shell脚本编辑器ShellEd。 basheclipse

7

自由EclipseColorer Editor可以做语法高亮显示的bash脚本。

但是,它不使用Eclipse的“大纲视图”,即它不与的功能定义列表填充它。 语法突出显示有时会停在脚本的中间。然后重新打开脚本会有所帮助。

+1

我使用了ShellEd一段时间,但它陷入了大文件,我发现它的autoindent选择令人沮丧。 EclipseColorer编辑器适合我的目的。拥有这个插件的其他文件类型的大列表也很好。 – Demyn

+1

我也使用了ShellEd两年,但它不断弄乱缩进,有一个非常烦人的习惯,最初折叠所有评论(不可配置),并且非常缓慢。刚切换到EclipseColorer,似乎工作正常。 –

0

我试过炮轰,但也不会承认我的任何shell脚本,甚至当我重新启动蚀。我添加了ksh解释器并将其设置为默认值,但它没有任何差别。

最后,我关闭了,这是开放的,显示KSH文件选项卡,然后重新打开它。这使它正常工作。使用一段时间后,我也可以推荐它。

4

炮轰之下如何安装炮轰

解决方案不为我工作。很多依赖关系的错误。找到适合我的解决方案。

系统:

Linux的Lubuntu 12。04

IDE:

Eclipse的开普勒

在Eclipse中,进入帮助>安装新软件

单击Add ...

添加下面的位置,http://download.eclipse.org/releases/kepler,并命名为“Eclipse开普勒”。

单击确定。

选择新创建的Eclipse Kepler站点。

展开底部的Web,XML,Java EE和OSGi企业开发部分。 选择WST服务器适配器。

点击下一步,并像往常一样安装。

重启Eclipse

然后同样添加炮轰回购上面列出: http://sourceforge.net/projects/shelled/files/shelled/update/

并安装它。

重新启动Eclipse。

在Eclipse靛蓝还担任过这里说: http://docs.wraithmonster.com/install-shelled

享受:)

+0

不知道为什么,但是这样也解决了我之后以及之前安装2次不成功的问题;我在Mac OS X上的Eclipse Kepler上 –

2

我会在这里重现一个很好的教程,因为我失去了这篇文章,需要一些时间来重新找到它!

添加语法高亮新的语言与Colorer库的Eclipse

假设你有一个包含一些编程语言的语法和词法结构Eclipse不支持(例如d/iptables的或任何一个HRC文件其他脚本语言)。

使用EclipseColorer插件,您可以轻松地为其添加支持。

去帮助 - >安装新软件,然后单击添加.. 在名称字段写入Colorer并在位置字段写入http://colorer.sf.net/eclipsecolorer/

选择你刚刚与工作添加的条目:组合框,等待组件列表来填充,然后点击全选

点击下一步,然后按照说明

一旦安装了该插件后,关闭Eclipse。

您的HRC文件复制到 [EclipseFolder] \插件\ net.sf.colorer_0.9.9 \ colorer \ HRC \汽车\类型

[EclipseFolder] = /家庭/名为myUsername /。日食

使用您喜欢的文本编辑器打开

[EclipseFolder] \插件\ net.sf.colorer_0.9.9 \ colorer \ HRC \汽车\ empty.hrc

添加相应的原型元。例如,如果您的HRC文件d.hrc,empty.hrc看起来就像这样:

<?xml version="1.0" encoding='Windows-1251'?> 
<!DOCTYPE hrc PUBLIC 
"-//Cail Lomecb//DTD Colorer HRC take5//EN" 
"http://colorer.sf.net/2003/hrc.dtd" 
> 
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd" 
><annotation><documentation> 
'auto' is a place for include 
to colorer your own HRCs 
</documentation></annotation> 
    <prototype name="d" group="main" description="D"> 
     <location link="types/d.hrc"/> 
     <filename>/\.(d)$/i</filename> 
</prototype> 
</hrc> 

保存更改并关闭文本编辑器

打开Eclipse和去窗口 - >首选项 - >常规 - >编辑 - >文件关联

在文件类型部分,单击Add ...,并在相应的文件类型填写(例如.D)

单击确定,然后单击列表中的

新添加的条目

在关联的编辑器部分中,单击添加..,选择着色器编辑器并按确定。

好的,难的部分是您必须了解HCR语法。

你可以看看在

[EclipseFolder] /net.sf.colorer_0.9.9/colorer/hrc/common.jar

学习如何做到这一点,并探索其他许多HCR的文件。在这一刻,我没有找到任何文件。

我的礼物是一个基本的和不完整的iptables语法突出显示。如果你改善,请与我分享。

<?xml version="1.0" encoding="Windows-1251"?> 
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN" "http://colorer.sf.net/2003/hrc.dtd"> 
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd"> 
    <type name="iptables"> 
     <annotation> 
      <develby> Mario Moura - moura.mario gmail.com</develby> 
      <documentation>Support iptables EQL language</documentation> 
      <appinfo> 
        <prototype name="iptables" group="database" description="iptables"> 
         <location link="iptables.hrc"/> 
         <filename>/\.epl$/i</filename> 
        </prototype> 
      </appinfo> 
     </annotation> 

     <region name="iptablesTable" parent="def:Keyword"/> 
     <region name="iptablesChainFilter" parent="def:Symbol"/> 
     <region name="iptablesChainNatMangle" parent="def:NumberDec"/> 
     <region name="iptablesCustomDefaultChains" parent="def:Keyword"/> 
     <region name="iptablesOptions" parent="def:String"/> 
     <region name="iptablesParameters" parent="def:Operator"/> 
     <region name="iptablesOtherOptions" parent="def:Comment"/> 
     <region name="iptablesMatchExtensions" parent="def:ParameterStrong"/> 
     <region name="iptablesTargetExtensions" parent="def:FunctionKeyword"/> 
     <region name="pyComment" parent="def:Comment"/> 
      <region name="pyOperator" parent="def:Operator"/> 
      <region name="pyDelimiter" parent="def:Symbol"/> 


     <scheme name="iptablesTable"> 
      <keywords ignorecase="no" region="iptablesTable"> 
       <word name="mangle"/> 
       <word name="filter"/> 
       <word name="nat"/> 
       <word name="as"/> 
       <word name="at"/> 
       <word name="asc"/> 
       <word name="avedev"/> 
       <word name="avg"/> 
       <word name="between"/> 
       <word name="by"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesChainFilter"> 
      <keywords ignorecase="no" region="iptablesChainFilter"> 
       <word name="FORWARD"/> 
       <word name="INPUT"/> 
       <word name="OUTPUT"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesChainNatMangle"> 
      <keywords ignorecase="no" region="iptablesChainNatMangle"> 
       <word name="PREROUTING"/> 
       <word name="POSTROUTING"/> 
       <word name="OUTPUT"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesCustomDefaultChains"> 
      <keywords ignorecase="no" region="iptablesCustomDefaultChains"> 
       <word name="CHTTP"/> 
       <word name="CHTTPS"/> 
       <word name="CSSH"/> 
       <word name="CDNS"/> 
       <word name="CFTP"/> 
       <word name="CGERAL"/> 
       <word name="CICMP"/> 
      </keywords> 
     </scheme> 


     <scheme name="iptablesOptions"> 
      <keywords ignorecase="no" region="iptablesOptions"> 
       <word name="-A"/> 
       <word name="--append"/> 
       <word name="-D"/> 
       <word name="--delete"/> 
       <word name="-I"/> 
       <word name="--insert"/> 
       <word name="-R"/> 
       <word name="--replace"/> 
       <word name="-L"/> 
       <word name="--list"/> 
       <word name="-F"/> 
       <word name="--flush"/> 
       <word name="-Z"/> 
       <word name="--zero"/> 
       <word name="-N"/> 
       <word name="--new-chain"/> 
       <word name="-X"/> 
       <word name="--delete-chain"/> 
       <word name="-P"/> 
       <word name="--policy"/> 
       <word name="-E"/> 
       <word name="--rename-chain"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesParameters"> 
      <keywords ignorecase="no" region="iptablesParameters"> 
       <word name="-p"/> 
       <word name="--protocol"/> 
       <word name="-s"/> 
       <word name="--source"/> 
       <word name="-d"/> 
       <word name="--destination"/> 
       <word name="-j"/> 
       <word name="--jump"/> 
       <word name="-g"/> 
       <word name="--goto"/> 
       <word name="-i"/> 
       <word name="--in-interface"/> 
       <word name="-o"/> 
       <word name="--out-interface"/> 
       <word name="-f"/> 
       <word name="--fragment"/> 
       <word name="-c"/> 
       <word name="--set-counters"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesOtherOptions"> 
      <keywords ignorecase="no" region="iptablesOtherOptions"> 
       <word name="-v"/> 
       <word name="--verbose"/> 
       <word name="-n"/> 
       <word name="--numeric"/> 
       <word name="-x"/> 
       <word name="--exact"/> 

       <word name="--line-numbers"/> 
       <word name="--modprobe"/> 
      </keywords> 
     </scheme> 

     <scheme name="iptablesMatchExtensions"> 
      <keywords ignorecase="no" region="iptablesMatchExtensions"> 
       <word name="account"/> 
       <word name="addrtype"/> 
       <word name="childlevel"/> 
       <word name="comment"/> 
       <word name="connbytes"/> 
       <word name="connlimit"/> 
       <word name="connmark"/> 
       <word name="connrate"/> 
       <word name="conntrack"/> 
       <word name="dccp"/> 
       <word name="dscp"/> 
       <word name="dstlimit"/> 
       <word name="ecn"/> 
       <word name="esp"/> 
       <word name="hashlimit"/> 
       <word name="helper"/> 
       <word name="icmp"/> 
       <word name="ipv4options"/> 
       <word name="length"/> 
       <word name="limit"/> 
       <word name="mac"/> 
       <word name="mark"/> 
       <word name="mport"/> 
       <word name="multiport"/> 
       <word name="nth"/> 
       <word name="osf"/> 
       <word name="owner"/> 
       <word name="physdev"/> 
       <word name="pkttype"/> 
       <word name="policy"/> 
       <word name="psd"/> 
       <word name="quota"/> 
       <word name="realm"/> 
       <word name="recent"/> 
       <word name="sctp"/> 
       <word name="set"/> 
       <word name="state"/> 
       <word name="string"/> 
       <word name="tcp"/> 
       <word name="tcpmss"/> 
       <word name="tos"/> 
       <word name="u32"/> 
       <word name="udp"/>                    
      </keywords> 
     </scheme> 


    <scheme name="iptablesTargetExtensions"> 
      <keywords ignorecase="no" region="iptablesTargetExtensions"> 
       <word name="BALANCE"/> 
       <word name="CLASSIFY"/> 
       <word name="CLUSTERIP"/> 
       <word name="CONNMARK"/> 
       <word name="DNAT"/> 
       <word name="DSCP"/> 
       <word name="ECN"/> 
       <word name="IPMARK"/> 
       <word name="IPV4OPTSSTRIP"/> 
       <word name="LOG"/> 
       <word name="MARK"/> 
       <word name="MASQUERADE"/> 
       <word name="MIRROR"/> 
       <word name="NETMAP"/> 
       <word name="NFQUEUE"/> 
       <word name="NOTRACK"/> 
       <word name="REDIRECT"/> 
       <word name="REJECT"/> 
       <word name="SAME"/> 
       <word name="SET"/> 
       <word name="SNAT"/> 
       <word name="TARPIT"/> 
       <word name="TCPMSS"/> 
       <word name="TOS"/> 
       <word name="TRACE"/> 
       <word name="TTL"/> 
       <word name="ULOG"/> 
       <word name="XOR"/>                   
      </keywords> 
     </scheme> 



     <scheme name="iptables"> 
       <inherit scheme="iptablesTable"/> 
       <inherit scheme="iptablesChainFilter"/> 
       <inherit scheme="iptablesChainNatMangle"/> 
       <inherit scheme="iptablesCustomDefaultChains"/>          
       <inherit scheme="iptablesOptions"/> 
       <inherit scheme="iptablesParameters"/> 
       <inherit scheme="iptablesOtherOptions"/> 
       <inherit scheme="iptablesMatchExtensions"/> 
       <inherit scheme="iptablesTargetExtensions"/> 

    <!-- python operators : http://docs.python.org/ref/keywords.html --> 
    <keywords region="pyOperator"> 
    <symb name="+"/> 
    <symb name="-"/> 
    <symb name="*"/> 
    <symb name="**"/> 
    <symb name="/"/> 
    <symb name="//"/> 
    <symb name="%"/> 
    <symb name="&lt;&lt;"/> 
    <symb name=">>"/> 
    <symb name="&amp;"/> 
    <symb name="|"/> 
    <symb name="^"/> 
    <symb name="~"/> 
    <symb name="&lt;"/> 
    <symb name=">"/> 
    <symb name="&lt;="/> 
    <symb name=">="/> 
    <symb name="=="/> 
    <symb name="!="/> 
    <symb name="&lt;>"/> 
    </keywords> 


    <!-- basic python comment - consider it everything after # till the end of line --> 
    <block start="/#/" end="/$/" region="pyComment" scheme="def:Comment"/> 

    <block start="/(u|U)?(r|R)?(&quot;{3}|&apos;{3})/" end="/\y3/" 
     region00="def:PairStart" region10="def:PairEnd" 
     scheme="def:Comment" region="pyComment" /> 
     <!-- TODO: better scheme for multiline comments/docstrings --> 
     <!-- scheme="StringCommon" region="pyString" /> --> 


    <!-- python delimiters : http://docs.python.org/ref/delimiters.html --> 
    <keywords region="pyDelimiter"> 
    <symb name="+"/> 
    <symb name="("/> 
    <symb name=")"/> 
    <symb name="["/> 
    <symb name="]"/> 
    <symb name="{"/> 
    <symb name="}"/> 
    <symb name="@"/> 
    <symb name=","/> 
    <symb name=":"/> 
    <symb name="."/> 
    <symb name="`"/> 
    <symb name="="/> 
    <symb name=";"/> 
    <symb name="+="/> 
    <symb name="-="/> 
    <symb name="*="/> 
    <symb name="/="/> 
    <symb name="//="/> 
    <symb name="%="/> 
    <symb name="&amp;="/> 
    <symb name="|="/> 
    <symb name="^="/> 
    <symb name=">>="/> 
    <symb name="&lt;&lt;="/> 
    <symb name="**="/> 
    </keywords> 



     </scheme> 
    </type> 

在这之后,你必须将文件保存为iptables.hcr并添加罐内:

[EclipseFolder] /net.sf.colorer_0.9.9/colorer/hrc/common.jar

基于: https://ohadsc.wordpress.com/2012/05/26/adding-syntax-highlighting-for-new-languages-to-eclipse-with-the-colorer-library/

+0

我通过添加通常的Eclipse“帮助/安装/添加站点”路径(eclipse站点:http://colorer.sf.net/eclipsecolorer/)来安装EclipseColorer,它是无痛的。然后我重新启动了,Colorer很快地向我展示了我想用语法突出的漂亮的bash脚本。对于那些只想为脚本添加颜色的人来说,这看起来不像我在博客和评论中看到的那样安装ShellEd,但我只是尝试了这一点,而不是两者。 –

2

ShellEd是Eclipse的一个很好的插件。

此链接帮助我进行安装:http://mattnorris.me/blog/install-eclipse-shelled-plugin/

步骤:

  1. 下载炮轰:http://sourceforge.net/projects/shelled/files/latest/download - 该文件名为类似net.sourceforge.shelled现场-2.0压缩文档。 x.zip。

  2. 然后单击帮助>安装新软件...

  3. 单击Add ...在右上角。
  4. 单击归档...
  5. 导航到保存压缩归档文件net.sourceforge.shelled-site-2.0.x.zip的位置并将其选中。
  6. 单击确定。 (不要担心可选的Name字段,Eclipse会自动命名它。)
  7. 选择新的Shell脚本复选框。
  8. 单击下一步。
  9. 再次点击下一步。
  10. 选择“我接受许可协议的条款”。
  11. 单击完成。
  12. 重新启动Eclipse。
0

它适用于我在氧气。

1)转到帮助> Eclipse Marketplace ...并搜索“DLTK”。你会发现像“Shell脚本(DLTK)5.8.0”。安装它并重新启动Eclipse。

(或拖放从这个网页 “Install” 按钮到Eclipse:https://marketplace.eclipse.org/content/shell-script-dltk)在项目资源管理器外壳/批处理文件

Shell Script (DLTK)

2)右击>打开方式>其他...并选择Shell脚本编辑器。您还可以将编辑器与该扩展的所有文件关联。

Shell script editor

+0

回购不再有效。纠正它。 –

1

现在存在着插件叫做 “击编辑器” 专用bash脚本。 它可以在Eclipse的市场:

Bash editor log

您可以在https://marketplace.eclipse.org/content/bash-editor或市场客户端找到它的“庆典”搜索时。

该插件目前标记为BETA,但是稳定。

+0

该插件不再是BETA,但标记为生产/稳定 – hexadez

+0

死链接。更改。 –

+0

不,它不是一个死链接:我刚刚打开https://marketplace.eclipse.org/content/bash-editor并且它完全响应。也许你有代理或网络问题? – hexadez