Bash script plugin for Eclipse?

EclipseBashIde

Eclipse Problem Overview


Are there any decent bash plug-ins for Eclipse? My only requirement is syntax highlighting. I've googled about but did not see anything that looked like "the" bash plug-in.

Eclipse Solutions


Solution 1 - Eclipse

ShellEd looks promising, does syntax highlighting, and has positive reviews, although I've not tried it myself. It was approved for distro inclusion by Redhat. There's a little more info on the ShellEd plugin page on the Eclipse site, and installation instructions on their wiki.

Note that if you're not running an up-to-date version of Eclipse (as of this writing, Juno) you'll need to use an older version, for instance 2.0.1 is compatible with Indigo.

Solution 2 - Eclipse

EDIT (8/3/2013): Use http://sourceforge.net/projects/shelled/files/shelled/update/ for latest version

EDIT (2/25/2013): Non need to install linux tool for shelled 2.0.2 on Eclipse 4.2.1. Also, no need to download zip file. Here's the update site of shelled 2.0.2: http://sourceforge.net/projects/shelled/files/shelled/ShellEd%202.0.2/update/

OLD POST:

I like Shelled as well. If you install it now, you need to download the zip file and point to it in the install new software wizard in Eclipse. You'll also need to install the man plugin from

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

Solution 3 - Eclipse

Debugger for Bash version 3(Bourne again shell).
Plugin for Eclipse. Will only work with shell script editor ShellEd. basheclipse

Solution 4 - Eclipse

Just follow the official instructions from ShellEd's InstallGuide

Solution 5 - Eclipse

The free EclipseColorer Editor can do syntax highlighting for bash scripts.

However, It does not use Eclipse's "Outline view", i.e it does not fill it with a list of function definitions. Sometimes syntax highlighting just stops in the middle of the script. Then reopening the script helps.

Solution 6 - Eclipse

There exists now a dedicated bash script plugin called "Bash editor". It's available at eclipse market place:

Bash editor log

You can find it at https://marketplace.eclipse.org/content/bash-editor or by marketplace client when searching for "bash".

The plugin does also provide a debugger. Inisde official Bash Editor YouTube playlist you can find some tutorials about usage etc.

PS: I am the author of the mentioned plugin.

Solution 7 - Eclipse

ShellEd

Solutions below how to install ShellEd don't work for me. A lot of error on dependencies. Found solution that works for me.

System:

Linux Lubuntu 12.04

IDE:

Eclipse Kepler

In Eclipse, go to Help > Install New Software

Click Add...

Add the following Location, http://download.eclipse.org/releases/kepler, and name it "Eclipse Kepler".

Click OK.

Select the newly-created Eclipse Kepler site.

Expand the Web, XML, Java EE and OSGi Enterprise Development section at the bottom. Select WST Server Adaptors.

Click Next, and install like usual.

Restart Eclipse

Then add ShellEd repo likewise as listed above: http://sourceforge.net/projects/shelled/files/shelled/update/

And install it.

Restart Eclipse.

Also worked in Eclipse Indigo as said here: http://docs.wraithmonster.com/install-shelled

Enjoy :)

Solution 8 - Eclipse

I will reproduce a good tutorial here, because I lost this article and take some time to find it again!

Adding syntax highlighting for new languages to Eclipse with the Colorer library

Say you have an HRC file containing the syntax and lexical structure of some programming language Eclipse does not support (for example D / Iptables or any other script language).

Using the EclipseColorer plugin, you can easily add support for it.

Go to Help -> Install New Software and click Add.. In the Name field write Colorer and in the Location field write http://colorer.sf.net/eclipsecolorer/

Select the entry you’ve just added in the work with: combo box, wait for the component list to populate and click Select All

Click Next and follow the instructions

Once the plugin is installed, close Eclipse.

Copy your HRC file to [EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\types

[EclipseFolder] = /home/myusername/.eclipse

Use your favorite text editor to open

[EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\empty.hrc

Add the appropriate prototype element. For example, if your HRC file is d.hrc, empty.hrc will look like this:

<?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>

Save the changes and close the text editor

Open Eclipse and go to Window -> Preferences -> General -> Editors -> File Associations

In the file types section, click Add.. and fill in the appropriate filetype (for example .d)

Click OK and click your newly added entry in the list

In the associated editors section, click Add.., select Colorer Editor and press OK

ok, the hard part is you must learn about HCR syntax.

You can look in

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

to learn how do it and explore many other hcr's files. At this moment I didn't find any documentation.

My gift is a basic and incomplete iptables syntax highlight. If you improve please share with me.

<?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>

After this you must save the file as iptables.hcr and add inside the jar:

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

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

Solution 9 - Eclipse

ShellEd is a good plugin for Eclipse.

This link helped me to install it: http://mattnorris.me/blog/install-eclipse-shelled-plugin/

Steps:

  1. Download ShellEd: http://sourceforge.net/projects/shelled/files/latest/download - The file is a zipped archive named something like net.sourceforge.shelled-site-2.0.x.zip.

  2. Then click Help > Install New Software...

  3. Click Add... in the upper right.

  4. Click Archive...

  5. Navigate to where you saved the zipped archive net.sourceforge.shelled-site-2.0.x.zip and select it.

  6. Click OK. (Don't worry about the optional Name field. Eclipse will name it automatically.)

  7. Select the new Shell Script checkbox.

  8. Click Next.

  9. Click Next again.

  10. Select "I accept the terms of the license agreement."

  11. Click Finish.

  12. Restart Eclipse.

Solution 10 - Eclipse

I tried ShellEd, but it wouldn't recognize any of my shell scripts, even when I restarted eclipse. I added the ksh interpreter and made it the default, but it made no diffence.

Finally, I closed the tab that was open and displaying a ksh file, then re-opened it. That made it work correctly. After having used it for a while, I can also recommend it.

Solution 11 - Eclipse

It works for me in Oxygen.

1) Go to Help > Eclipse Marketplace... and search for "DLTK". You'll find something like "Shell Script (DLTK) 5.8.0". Install it and reboot Eclipse.

(Or drag'n'drop "Install" button from this web page to your Eclipse: https://marketplace.eclipse.org/content/shell-script-dltk)

Shell Script (DLTK)

2) Right-click on the shell/batch file in Project Explorer > Open With > Other... and select Shell Script Editor. You can also associate the editor with all files of that extension.

Shell script editor

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStu ThompsonView Question on Stackoverflow
Solution 1 - Eclipseire_and_cursesView Answer on Stackoverflow
Solution 2 - EclipseAlikElzin-kilakaView Answer on Stackoverflow
Solution 3 - EclipseavkosinskyView Answer on Stackoverflow
Solution 4 - Eclipseuser819893View Answer on Stackoverflow
Solution 5 - EclipseknbView Answer on Stackoverflow
Solution 6 - Eclipsede-jcupView Answer on Stackoverflow
Solution 7 - Eclipseuser3439968View Answer on Stackoverflow
Solution 8 - EclipsemacmView Answer on Stackoverflow
Solution 9 - EclipseStevenView Answer on Stackoverflow
Solution 10 - EclipseivanlanView Answer on Stackoverflow
Solution 11 - EclipseAlexander IshmuradovView Answer on Stackoverflow