【问题标题】:Bash script plugin for Eclipse? [closed]Eclipse 的 Bash 脚本插件? [关闭]
【发布时间】:2010-11-24 07:37:06
【问题描述】:

Eclipse 有没有像样的bash 插件?我唯一的要求是语法高亮。我用谷歌搜索但没有看到任何看起来像 "the" bash 插件的东西。

【问题讨论】:

标签: eclipse bash ide


【解决方案1】:

ShellEd 看起来很有前途,可以突出显示语法,并且有正面评价,尽管我自己没有尝试过。 Redhat 的发行版包含 approved。在 Eclipse 网站上的 ShellEd plugin page 和他们的 wiki 上的 installation instructions 上有更多信息。

请注意,如果您运行的不是最新版本的 Eclipse(在撰写本文时,Juno),您将需要使用旧版本,例如 2.0.1 与 Indigo 兼容。

【讨论】:

  • 我在用这个插件,挺好用的。
  • 如果我错了,请纠正我。目前,ShellEd 似乎不支持 audo-word-completion、重构或调试,使其几乎与任何具有语法高亮和 sn-ps 支持的文本编辑器相同。
  • 它不适用于 Eclipse 4。有人知道其他插件吗?
  • ShellEd 与 Eclipse 4.5 完美配合。要安装,请从 Eclipse 帮助菜单中选择“安装新软件...”并输入此 URL:sourceforge.net/projects/shelled/files/shelled/update
  • 现在转到eclipse.org/dltk/install.php。通过 Eclipse 中的 Eclipse 标准更新站点安装(例如 http://download.eclipse.org/releases/neon/)然后查找 Programming languagesDynamic Languages Toolkit - ShellEd
【解决方案2】:

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

编辑(2/25/2013):无需在 Eclipse 4.2.1 上为 shelled 2.0.2 安装 linux 工具。此外,无需下载 zip 文件。这是shelled 2.0.2的更新站点:http://sourceforge.net/projects/shelled/files/shelled/ShellEd%202.0.2/update/

旧帖:

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

安装 man 插件
http://download.eclipse.org/technology/linuxtools/update

【讨论】:

  • 压缩文件的直接链接:ppl.ug/tvjARs_cKQE/dl
  • +1 这是今天最有价值的信息。我希望我在一小时前安装 Juno SR2 之前拥有它……
  • +1 获取确切的 ShellEd 下载 URL。您不能再在 Eclipse Marketplace 中下载 ShellEd。 ShellEd 效果很好。
  • ShellEd 可在标准 Eclipse Mars 更新站点 download.eclipse.org/releases/mars ...条目 Programming Languages -> Dynamic Languages Toolkit - ShellEd IDE.
【解决方案3】:

Bash 版本 3 的调试器(Bourne again shell)。
Eclipse 插件。仅适用于 shell 脚本编辑器 ShellEd。 basheclipse

【讨论】:

    【解决方案4】:

    只需按照ShellEd's InstallGuide的官方说明进行操作

    【讨论】:

    【解决方案5】:

    免费的EclipseColorer Editor 可以为 bash 脚本进行语法高亮。

    但是,它不使用 Eclipse 的“大纲视图”,即它不使用函数定义列表填充它。 有时语法高亮只是在脚本中间停止。然后重新打开脚本会有所帮助。

    【讨论】:

    • 我使用了一段时间的 ShellEd,但它被大文件所困,我发现它的自动缩进选择令人沮丧。 EclipseColorer 编辑器在我的目的上运行良好。让这个插件包含其他文件类型的大量列表也很不错。
    • 我也用了两年的 ShellEd,但是它总是弄乱缩进,有一个非常烦人的习惯,一开始折叠所有 cmets(不可配置),而且速度很慢。刚刚切换到 EclipseColorer,似乎工作正常。
    【解决方案6】:

    现在有一个名为“Bash 编辑器”的专用 bash 脚本插件。 它在 eclipse 市场有售:

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

    该插件还提供了一个调试器。 Inisde官方Bash EditorYouTube playlist可以找到一些使用教程等。

    PS:我是上述插件的作者。

    【讨论】:

    • 插件不再是测试版,而是标记为生产/稳定
    • 死链接。改变它。
    • 不,它不是死链接:我刚刚打开marketplace.eclipse.org/content/bash-editor,它确实响应。也许您遇到了代理或网络问题?
    • 哇!!它现在工作。不管怎样,谢谢。我不在防火墙后面。感谢您的转变。
    • 谢谢。有没有办法切换多行的评论? (与 python 编辑器一样)
    【解决方案7】:

    ShellEd

    以下如何安装 ShellEd 的解决方案对我不起作用。依赖项有很多错误。找到了适合我的解决方案。

    系统:

    Linux Lubuntu 12.04

    IDE:

    Eclipse 开普勒

    在 Eclipse 中,转到帮助 > 安装新软件

    点击添加...

    添加以下位置http://download.eclipse.org/releases/kepler,并将其命名为“Eclipse Kepler”。

    点击确定。

    选择新创建的 Eclipse Kepler 站点。

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

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

    重启 Eclipse

    然后像上面列出的一样添加 ShellEd repo: http://sourceforge.net/projects/shelled/files/shelled/update/

    然后安装它。

    重启 Eclipse。

    还曾在 Eclipse Indigo 中工作,如此处所述: http://docs.wraithmonster.com/install-shelled

    享受:)

    【讨论】:

    • 不知道为什么,但这也解决了我之前两次安装不成功后的问题;我在 Mac OS X 上使用 Eclipse Kepler
    【解决方案8】:

    我会在这里复制一个很好的教程,因为我丢失了这篇文章,需要一些时间才能重新找到它!

    使用 Colorer 库向 Eclipse 添加新语言的语法高亮显示

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

    使用 EclipseColorer 插件,您可以轻松添加对它的支持。

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

    选择您刚刚在工作中添加的条目:组合框,等待组件列表填充并单击全选

    单击下一步并按照说明进行操作

    安装插件后,关闭 Eclipse。

    将您的 HRC 文件复制到 [EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\types

    [EclipseFolder] = /home/myusername/.eclipse

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

    [EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\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 并转到 Window -> Preferences -> General -> Editors -> File Associations

    在文件类型部分,单击添加.. 并填写适当的文件类型(例如 .d)

    单击“确定”并单击列表中新添加的条目

    在关联的编辑器部分,单击添加..,选择 Colorer Editor 并按 OK

    好的,困难的部分是您必须了解 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 并添加到 jar 中:

    [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/

    【讨论】:

    • 我通过通常的 Eclipse“帮助/安装/添加站点”路径(Eclipse 站点:colorer.sf.net/eclipsecolorer)添加安装了 EclipseColorer,它很轻松。然后我重新启动,Colorer 很快就向我展示了我想要使用的 bash 脚本,并以语法高亮显示的优点。对于只想为脚本添加颜色的人来说,这似乎比从我在博客和 cmets 中看到的安装 ShellEd 更简单,但我只尝试了这个,而不是两者。
    【解决方案9】:

    ShellEd 是一个很好的 Eclipse 插件。

    这个链接帮我安装了它:http://mattnorris.me/blog/install-eclipse-shelled-plugin/

    步骤:

    1. 下载 ShellEd:http://sourceforge.net/projects/shelled/files/latest/download - 该文件是一个名为 net.sourceforge.shelled-site-2.0.x.zip 的压缩存档。

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

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

    【讨论】:

      【解决方案10】:

      我尝试了 ShellEd,但它无法识别我的任何 shell 脚本,即使我重新启动了 eclipse。我添加了 ksh 解释器并将其设为默认值,但没有任何区别。

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

      【讨论】:

        【解决方案11】:

        它在氧气中对我有用。

        1) 转到帮助 > Eclipse Marketplace... 并搜索“DLTK”。您会发现类似“Shell Script (DLTK) 5.8.0”的内容。安装它并重新启动 Eclipse。

        (或将“安装”按钮从该网页拖放到您的 Eclipse:https://marketplace.eclipse.org/content/shell-script-dltk

        2) 在 Project Explorer 中右键单击 shell/batch 文件 > 打开方式 > 其他...,然后选择 Shell Script Editor。您还可以将编辑器与该扩展名的所有文件相关联。

        【讨论】:

        • 回购不再有效。更正它。
        猜你喜欢
        • 1970-01-01
        • 2013-04-06
        • 2012-01-08
        • 1970-01-01
        • 2010-12-30
        • 1970-01-01
        • 2014-05-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多