Jedit


From Docunext Technology Wiki

Jump to: navigation, search

Contents

jEdit Summary

jedit is a great cross platform editor. I use it for PHP, XSL, XML, Ruby and Python - basically everything!

Settings

My preferred settings:

  • Appearance: Disable show splash and show tips
  • Docking: File Brower: Right
  • Editing: tab/indent width: 2, soft tab
  • Gutter: Line numbering on
  • Tool bar: do not show tool bar
  • The soft-wrap is a nice editor function, I set mine to about 100 characters wide.

Plugins - Settings

  • XML - Allows jedit to parse and potentially validate xml docs - so when there is a missing close tag it will let you know
  • XML Indenter - changes the space of the indents to 2 space for xml, and 4 for everything else


Configurable Fold Handler

Configuration is a little tricky - its a combination of global buffer options, and plugin options. The folding, when active - jedit will have a little arrow in the gutter which allows you to fold or unfold the section.

    • To set the folding mode to custom, you have to go to the plugin options
    • Select the configurable folder (from the plugin options menu, not the drop down)
    • for default section
      • fold start string is: <!--
      • fold end string is: -->
    • choose xml from the mode
    • uncheck the box "use default fold strings"

Image:Plugins.png

Image:Folding.png

Grrr... in the end I (albert) was unable to get the different fold strings to work for different edit modes, so now I'm using this for my PHP headers:

/* <!--
--> */

UPDATE 2: I (albert) eventually figured out how to have different fold syntax for different file types. The tricky part is that jEdit remembers the file types that individual files use, so when debugging, I make sure to use multiple test files. For example, if I'm setting fold markers for a Ruby file, then I'll set some configuration options, then click apply, then open a different Ruby file, and check to see if my new markers work.

I'm using these for Ruby, by the way:

### Start
# Middle
## Close

Works well so far.

UPDATE 3: Actually, I'm not using separate fold markers for different file types, I'm using Regex to support a variety of markers:

Fold Start String

^[\s]+(###|<!--)$

Fold Stop String

^[\s]+(##|-->)$

Configurable Fold Settings

Installation

Exception in thread "main"

I'm trying to install the latest version of jEdit on Ubuntu, but I keep getting this error:

4:24:54 PM [error] main: Exception in thread "main" 
4:24:54 PM [error] main: java.lang.NullPointerException
4:24:54 PM [error] main:  at org.gjt.sp.jedit.gui.SplashScreen.<init>(SplashScreen.java:60)
4:24:54 PM [error] main:  at org.gjt.sp.jedit.GUIUtilities.showSplashScreen(GUIUtilities.java:1736)
4:24:54 PM [error] main:  at org.gjt.sp.jedit.jEdit.main(jEdit.java:308)

Grrr. I've got sun's 1.6 java installed. Not sure what the problem is, but I don't really feel like messing with this now. I finally did get it to work, I downgraded to sun-java5-jre instead. Other info: I'm running XFCE4 on debian etch / testing.

Locking assertion failure.

Now another problem:

 Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb7601767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb76018b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb191429d]
#3 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/xawt/libmawt.so [0xb1a01d7e]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/xawt/libmawt.so [0xb19ebd47]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/xawt/libmawt.so [0xb19ebec3]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x26) [0xb19ec106]
#7 [0xb25f6bfa]
#8 [0xb25f0b3b]
#9 [0xb25f0b3b]
#10 [0xb25ee219]
#11 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so [0xb77ab1ac]
#12 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so [0xb78bfc18]
#13 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so [0xb77aafdf]
#14 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x32d) [0xb7808a8d]
#15 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb75a330d]
#16 [0xb25f64ab]
#17 [0xb25f0a64]
#18 [0xb25ee219]
#19 /usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so [0xb77ab1ac]
java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.

Big thanks to Dave Schuck

Errors

NFS Problems

This isn't an obvious error, but when using jEdit and an NFS volume, jEdit will freeze up. I wish I knew what it was. I don't think its just NFS freezing up, either.

Still no answer on this one, but I've been delving into NFS a bunch and it appears that these options are working well for me now:

server:/etc/exports

/var/www/dev/   192.168.8.0/16(rw,async,insecure,no_subtree_check)

client:/etc/fstab

server:/var/www/dev/ /mnt/imports/nfs  nfs     hard,nolock,noacl,rsize=1024,wsize=1024,user,noauto,rw,timeo=14,intr 0 0

I'm using 1024 because the network is over the public internet via IPSec. The ISP is Verizon FIOS which requires an MTU of 1492, too. I think I might have figured this out. I set the mtu on the machines (not the VPN gateways) to 1420 and it all seems to be OK.

nfs4 I'm now using nfs4, which is just a little different in the /etc/exports file:

/var/www  wrk-240-gr.savonix.com(rw,async,fsid=0,crossmnt,no_subtree_check)

and thankfully the problems seem to have subsided, so far. YES! NFS4 has fixed the freezing problem for me. :-)

Java and Awesomewm

There are problems with Java Swing and certain types of window managers, awesomewm included. To work around this, I use the 32 bit version of java and set WMToolkit in a jedit binary override.

Still, I have some problems with autocomplete suggestions, so I disable them altogether.

Versions

jEdit Version 4.3pre15

This version is fresh as of August 2008. I'm really impressed with how its operating on my Debian powered laptop. So nice! It uses Pango icons and the GTK theme looks beautiful. :-)

Links

Personal tools