【发布时间】:2010-11-24 07:37:06
【问题描述】:
Eclipse 有没有像样的bash 插件?我唯一的要求是语法高亮。我用谷歌搜索但没有看到任何看起来像 "the" bash 插件的东西。
【问题讨论】:
-
你的操作系统是什么?您是否尝试在 Windows 上将其作为 shell 模拟器运行?有点像 Cygwin
Eclipse 有没有像样的bash 插件?我唯一的要求是语法高亮。我用谷歌搜索但没有看到任何看起来像 "the" bash 插件的东西。
【问题讨论】:
ShellEd 看起来很有前途,可以突出显示语法,并且有正面评价,尽管我自己没有尝试过。 Redhat 的发行版包含 approved。在 Eclipse 网站上的 ShellEd plugin page 和他们的 wiki 上的 installation instructions 上有更多信息。
请注意,如果您运行的不是最新版本的 Eclipse(在撰写本文时,Juno),您将需要使用旧版本,例如 2.0.1 与 Indigo 兼容。
【讨论】:
http://download.eclipse.org/releases/neon/)然后查找 Programming languages 和 Dynamic Languages Toolkit - ShellEd。
编辑(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
【讨论】:
Bash 版本 3 的调试器(Bourne again shell)。
Eclipse 插件。仅适用于 shell 脚本编辑器 ShellEd。 basheclipse
【讨论】:
只需按照ShellEd's InstallGuide的官方说明进行操作
【讨论】:
免费的EclipseColorer Editor 可以为 bash 脚本进行语法高亮。
但是,它不使用 Eclipse 的“大纲视图”,即它不使用函数定义列表填充它。 有时语法高亮只是在脚本中间停止。然后重新打开脚本会有所帮助。
【讨论】:
现在有一个名为“Bash 编辑器”的专用 bash 脚本插件。 它在 eclipse 市场有售:
您可以在https://marketplace.eclipse.org/content/bash-editor 或市场客户搜索“bash”时找到它。
该插件还提供了一个调试器。 Inisde官方Bash EditorYouTube playlist可以找到一些使用教程等。
PS:我是上述插件的作者。
【讨论】:
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
享受:)
【讨论】:
我会在这里复制一个很好的教程,因为我丢失了这篇文章,需要一些时间才能重新找到它!
使用 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="<<"/>
<symb name=">>"/>
<symb name="&"/>
<symb name="|"/>
<symb name="^"/>
<symb name="~"/>
<symb name="<"/>
<symb name=">"/>
<symb name="<="/>
<symb name=">="/>
<symb name="=="/>
<symb name="!="/>
<symb name="<>"/>
</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)?("{3}|'{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="&="/>
<symb name="|="/>
<symb name="^="/>
<symb name=">>="/>
<symb name="<<="/>
<symb name="**="/>
</keywords>
</scheme>
</type>
在此之后,您必须将文件保存为 iptables.hcr 并添加到 jar 中:
[EclipseFolder]/net.sf.colorer_0.9.9/colorer/hrc/common.jar
【讨论】:
ShellEd 是一个很好的 Eclipse 插件。
这个链接帮我安装了它:http://mattnorris.me/blog/install-eclipse-shelled-plugin/
步骤:
下载 ShellEd:http://sourceforge.net/projects/shelled/files/latest/download - 该文件是一个名为 net.sourceforge.shelled-site-2.0.x.zip 的压缩存档。
然后点击帮助 > 安装新软件...
【讨论】:
我尝试了 ShellEd,但它无法识别我的任何 shell 脚本,即使我重新启动了 eclipse。我添加了 ksh 解释器并将其设为默认值,但没有任何区别。
最后,我关闭了打开并显示 ksh 文件的选项卡,然后重新打开它。这使它正常工作。用了一段时间后,也可以推荐一下。
【讨论】:
它在氧气中对我有用。
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。您还可以将编辑器与该扩展名的所有文件相关联。
【讨论】: