简体   繁体   中英

Playframework: what about some Gedit snippets and external tools?

I am an ubuntu user and gedit is my preferred editor. Eclipse is my preferred editor for java project, but in the specific case of play framework, RAD java oriented, i'll prefer to use a light editor like gedit.

So the question is: Is there a plan to provide some gedit plugin/snippets for the playframework ?

Certainly in the next version of the release, there does not seem to be any plans to release GEdit specifics to the framework. I think the TextMate bundle was added as this was the development environment Guillaume uses when building his Play applications for clients, so its made sense to speed his development up.

There is no reason why this functionality could not be created outside of the Play core framework, as a module or plugin.

As for Niels question about the gedit://myfile:3, it does appear that GEdit supports opening a file to a specific line number, but I was unable to find a way to open GEdit from a registered URL (again like TextMate). This should be possible, however I am not a strong enough Linux developer to know how, but it would simply be a case of mapping the URL in a format such as

gedit://open?url=file://%s&line=%s

to the linux command

gedit +<line> <file>

It is possible to convert the play url to a gedit compatible commande line with a script.

I did a small script named "textmate" that does the conversion (I think there is some better way to do that but I am not a grep master) :

#!/bin/bash
URL=$1
FILE=`echo $URL | grep -o -E 'file(.*?)line=(.*)' | cut -d':' -f 2 | cut -d'&' -f 1`
LINE=`echo $URL | grep -o -E 'file(.*?)line=(.*)' | cut -d'=' -f 2`
gedit +$LINE $FILE &

In firefox you can associate this script with the txmt protocol as described here http://kb.mozillazine.org/Register_protocol#Firefox_3.5_and_above

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM