Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

TextMate - LSL Language definition file (For Mac users ;-))

Leon Ash
Bushveld Resident
Join date: 8 Jan 2006
Posts: 146
02-20-2006 14:11
After some frustration with trying to compile SciTE for the Mac I gave up and decided to use TextMate. Here is the first version Language definition file I've ended up with.

It isn't as complete as the SciTE-ez version in that is doesn't provide function information, but it does allow for autocompletion and formatting of code. (BTW, completion happens by pressing the esc button)

You can also use the excellent lslint tool as the Compile definition in the LSL bundle.

Please provide updates to the TextMate configuration if you can. Maybe someone will be so kind as to add it to the LSL Wiki? ;-) (I'm too lazy!)

Regards
Leon

Copy and paste everything below to a Language definition in a new Bundle
// language definition for LSL - Linden Scripting Language by Leon Ash
// version 1.2
// Modified constant.numeric.lsl - removed the suffixes ...
// Added entity.name.function.lsl & variable.other.lsl ...
// Made all the alternates word delimited
// Fixed a problem with touch, touch_start, & touch_end not recognised properly
{
/* The name as it will appear in the Syntax Highlight List */
name = 'LSL';
keyEquivalent = '~^u';

/* Scope name used sometimes for styling or limiting the activation
of snippets, commands, and macros to files using this syntax
*/
scopeName = 'source.lsl';

/* So that we can always recognize this syntax */
uuid = 'D334CE18-DA07-475C-BFFD-74702BCF2D16';

/* Which filetypes this highlighting should be applied to automatically */
fileTypes = ( 'esl', 'lsl');

/* Folding, this will start folds at comments (/*) and at {
Stop folding at their counterparts.
*/
foldingStartMarker = '\{\s*$';
foldingStopMarker = '^\s*\}';

/* This is where the actual highlighting is defined. */
patterns = (
{ name = 'comment.line.double-slash.lsl';
begin = '//';
end = '$';
swallow = '\\\s*\n';
},
{ name = 'keyword.control.lsl';
comment = 'LSL Flow-control keywords';
match = '\b(default|state|for|do|while|if|else|jump|return)\b';
},
{ name = 'storage.type.lsl';
comment = 'LSL Types';
match = '\b(integer|float|string|key|vector|rotation|list|function)\b';
},
{ name = 'constant.language.lsl';
comment = 'LSL Constants';
match = '\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2|TRUE|FALSE|NULL_KEY|EOF|ZERO_ROTATION|ZERO_VECTOR|AGENT|ACTIVE|PASSIVE|SCRIPTED)\b';
},
{ name = 'constant.language.lsl.events';
comment = 'LSL Events';
match = '\b(at_rot_target|at_target|attach|changed|collision|collision_end|collision_start|control|dataserver|email|land_collision|land_collision_end|land_collision_start|link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|not_at_target|object_rez|on_rez|remote_data|run_time_permissions|sensor|state_entry|state_exit|timer|(touch|touch_start|touch_end))\b';
},
{ name = 'support.function.lsl';
comment = 'LSL Functions ll*';
match = '\b(llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|llAdjustSoundVolume|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCSV2List|llCeil|llCloseRemoteDataChannel|llCloud|llCollisionFilter|llCollisionSound|llCollisionSprite|llCos|llCreateLink|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llFabs|llFloor|llForceMouselook|llFrand|llGetAccel|llGetAgentInfo|llGetAgentSize|llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAttached|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|llGetCreator|llGetColor|llGetDate|llGetEnergy|llGetForce|llGetFreeMemory|llGetGeometricCenter|llGetGMTclock|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|llGetLandOwnerAt|llGetLinkKey|llGetLinkName|llGetLinkNumber|llGetListEntryType|llGetListLength|llGetLocalPos|llGetLocalRot|llGetMass|llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|llGetNumberOfSides|llGetObjectDesc|llGetObjectMass|llGetObjectName|llGetObjectPermMask|llGetOmega|llGetOwner|llGetOwnerKey|llGetPermissions|llGetPermissionsKey|llGetPos|llGetPrimitiveParams|llGetRegionCorner|llGetRegionFPS|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|llGetRootRotation|llGetRot|llGetScale|llGetScriptName|llGetScriptState|llGetSimulatorHostname|llGetStartParameter|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|llGetTimestamp|llGetTorque|llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|llGodLikeRezObject|llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|llInsertString|llInstantMessage|llIntegerToBase64|llKey2Name|llList2CSV|llList2Float|llList2Integer|llList2Key|llList2List|llList2ListStrided|llList2Rot|llList2String|llList2Vector|llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|llListen|llListenControl|llListenRemove|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|llLoopSoundSlave|llMapDestination|llMD5String|llMessageLinked|llMinEventDelay|llModifyLand|llModPow|llMoveToTarget|llOffsetTexture|llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|llPassCollisions|llPassTouches|llPlaySound|llPlaySoundSlave|llPointAt|llPow|llPreloadSound|llPushObject|llRefreshPrimURL|llReleaseCamera|llReleaseControls|llRemoteDataReply|llRemoteDataSetRegion|llRemoteLoadScriptPin|llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|llRequestAgentData|llRequestInventoryData|llRequestPermissions|llRequestSimulatorData|llResetOtherScript|llResetScript|llResetTime|llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|llRot2Fwd|llRot2Left|llRot2Up|llRotBetween|llRotLookAt|llRotTarget|llRotTargetRemove|llRotateTexture|llRound|llSameGroup|llSay|llScaleTexture|llScriptDanger|llSendRemoteData|llSensor|llSensorRemove|llSensorRepeat|llSetAlpha|llSetBuoyancy|llSetCameraAtOffset|llSetCameraEyeOffset|llSetColor|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|llSetLinkAlpha|llSetLinkColor|llSetLocalRot|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|llSetPos|llSetPrimURL|llSetPrimitiveParams|llSetPayPrice|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|llSetVehicleVectorParam|llShout|llSin|llSitTarget|llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|llStopMoveToTarget|llStopPointAt|llStopSound|llStringLength|llStringToBase64|llSubStringIndex|llTakeCamera|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|llTeleportAgent|llTeleportAgentHome|llToLower|llToUpper|llTriggerSound|llTriggerSoundLimited|llUnescapeURL|llUnSit|llVecDist|llVecMag|llVecNorm|llVolumeDetect|llWater|llWhisper|llWind|llXorBase64Strings)\b';
},
{ name = 'support.constant.lsl';
comment = 'LSL Function Constants';
match = '\b(STATUS_PHYSICS|STATUS_PHANTOM|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|STATUS_SANDBOX|STATUS_BLOCK_GRAB|STATUS_DIE_AT_EDGE|STATUS_RETURN_AT_EDGE|AGENT|ACTIVE|PASSIVE|SCRIPTED|CONTROL_FWD|CONTROL_BACK|CONTROL_LEFT|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|CONTROL_UP|CONTROL_DOWN|CONTROL_LBUTTON|CONTROL_ML_LBUTTON|PERMISSION_DEBIT|PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|AGENT_FLYING|AGENT_ATTACHMENTS|AGENT_SCRIPTED|AGENT_SITTING|AGENT_ON_OBJECT|AGENT_MOUSELOOK|AGENT_AWAY|AGENT_WALKING|AGENT_IN_AIR|AGENT_TYPING|AGENT_CROUCHING|AGENT_BUSY|AGENT_ALWAYS_RUN|PSYS_PART_FLAGS|PSYS_PART_START_COLOR|PSYS_PART_START_ALPHA|PSYS_PART_START_SCALE|PSYS_PART_END_COLOR|PSYS_PART_END_ALPHA|PSYS_PART_END_SCALE|PSYS_PART_MAX_AGE|PSYS_PART_BOUNCE_MASK|PSYS_PART_WIND_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_TARGET_POS_MASK|PSYS_PART_EMISSIVE_MASK|PSYS_PART_TARGET_LINEAR_MASK|PSYS_SRC_PATTERN|PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|PSYS_SRC_ANGLE_BEGIN|PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_RATE|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_MAX_AGE|PSYS_SRC_ACCEL|PSYS_SRC_TEXTURE|PSYS_SRC_TARGET_KEY|PSYS_SRC_OMEGA|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_TYPE_CAR|VEHICLE_TYPE_BOAT|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_REFERENCE_FRAME|VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_FLAG_NO_DEFLECTION_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_UP_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_CAMERA_DECOUPLED|INVENTORY_TEXTURE|INVENTORY_SOUND|INVENTORY_OBJECT|INVENTORY_SCRIPT|INVENTORY_LANDMARK|INVENTORY_CLOTHING|INVENTORY_NOTECARD|INVENTORY_BODYPART|INVENTORY_ANIMATION|INVENTORY_GESTURE|INVENTORY_ALL|ATTACH_CHEST|ATTACH_HEAD|ATTACH_LSHOULDER|ATTACH_RSHOULDER|ATTACH_LHAND|ATTACH_RHAND|ATTACH_LFOOT|ATTACH_RFOOT|ATTACH_BACK|ATTACH_PELVIS|ATTACH_MOUTH|ATTACH_CHIN|ATTACH_LEAR|ATTACH_REAR|ATTACH_LEYE|ATTACH_REYE|ATTACH_NOSE|ATTACH_RUARM|ATTACH_RLARM|ATTACH_LUARM|ATTACH_LLARM|ATTACH_RHIP|ATTACH_RULEG|ATTACH_RLLEG|ATTACH_LHIP|ATTACH_LULEG|ATTACH_LLLEG|ATTACH_BELLY|ATTACH_RPEC|ATTACH_LPEC|LAND_LEVEL|LAND_RAISE|LAND_LOWER|LAND_SMOOTH|LAND_NOISE|LAND_REVERT|LAND_SMALL_BRUSH|LAND_MEDIUM_BRUSH|LAND_LARGE_BRUSH|DATA_ONLINE|DATA_NAME|DATA_BORN|DATA_RATING|DATA_SIM_POS|DATA_SIM_STATUS|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_SET|LINK_ROOT|LINK_ALL_OTHERS|LINK_ALL_CHILDREN|LINK_THIS|CHANGED_INVENTORY|CHANGED_COLOR|CHANGED_SHAPE|CHANGED_SCALE|CHANGED_TEXTURE|CHANGED_LINK|CHANGED_ALLOWED_DROP|TYPE_INTEGER|TYPE_FLOAT|TYPE_STRING|TYPE_KEY|TYPE_VECTOR|TYPE_ROTATION|TYPE_INVALID|REMOTE_DATA_CHANNEL|REMOTE_DATA_REQUEST|REMOTE_DATA_REPLY|PRIM_TYPE|PRIM_MATERIAL|PRIM_PHYSICS|PRIM_TEMP_ON_REZ|PRIM_PHANTOM|PRIM_POSITION|PRIM_SIZE|PRIM_ROTATION|PRIM_TEXTURE|PRIM_COLOR|PRIM_BUMP_SHINY|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PRIM_TYPE_RING|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|PRIM_HOLE_CIRCLE|PRIM_HOLE_TRIANGLE|PRIM_MATERIAL_STONE|PRIM_MATERIAL_METAL|PRIM_MATERIAL_GLASS|PRIM_MATERIAL_WOOD|PRIM_MATERIAL_FLESH|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|PRIM_MATERIAL_LIGHT|PRIM_SHINY_NONE|PRIM_SHINY_LOW|PRIM_SHINY_MEDIUM|PRIM_SHINY_HIGH|PRIM_BUMP_NONE|PRIM_BUMP_BRIGHT|PRIM_BUMP_DARK|PRIM_BUMP_WOOD|PRIM_BUMP_BARK|PRIM_BUMP_BRICKS|PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_TILE|PRIM_BUMP_STONE|PRIM_BUMP_DISKS|PRIM_BUMP_GRAVEL|PRIM_BUMP_BLOBS|PRIM_BUMP_SIDING|PRIM_BUMP_LARGETILE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|PRIM_BUMP_WEAVE|MASK_BASE|MASK_OWNER|MASK_GROUP|MASK_EVERYONE|MASK_NEXT|PERM_TRANSFER|PERM_MODIFY|PERM_COPY|PERM_MOVE|PERM_ALL|PARCEL_MEDIA_COMMAND_STOP|PARCEL_MEDIA_COMMAND_PAUSE|PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_URL|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_AUTO_ALIGN)\b';
},
{
name = 'entity.name.function.lsl';
match = '\b\w+ *(?=\()';
},
{
name = 'variable.other.lsl';
match = '\b\w+\b';
},
{ name = 'string.double-quoted.lsl';
begin = '"'; end = '"'; swallow = '\\\\.';
/* Patterns with begin and end can contain other patterns (nested as far as you want) */
patterns = (
{ name = 'constant.character.untitled';
match = '\\\\[a-zA-Z]';
}
);
},
{ name = 'constant.numeric.lsl';
match = '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b';
},
);
}
Fearless Leader
Sycophant
Join date: 21 Dec 2004
Posts: 19
02-20-2006 14:16
Leon, you're my hero. Thanks for this. :)
Leon Ash
Bushveld Resident
Join date: 8 Jan 2006
Posts: 146
02-20-2006 14:24
From: Fearless Leader
Leon, you're my hero. Thanks for this. :)


Well, pleased someone else will get some benefit from it :-)

BTW, if you create a Command component of the LSL Bundle you can use the following:
CODE
~/Applications/lslint -v "$TM_FILEPATH"

to 'compile' your LSL code.

Providing off course, you have lslint in your Application folder (and it has been chmod'd to allow execution). When creating the command the output should be "Show as HTML"

Regards
Leon

PS. I only downloaded TextMate on Sunday, so am hoping someone more knowledgeable will let us know how to provide the 'function' properties like SciTE-ez does?
Leon Ash
Bushveld Resident
Join date: 8 Jan 2006
Posts: 146
Some snippets I've chucked in
03-02-2006 23:28
for Loop (for)
Code:
for( ${1:i} = ${2:0}; ${1:i} < ${3:count}; ${1:i}++ )
{
$0
}

Tab trigger:
for

Scope Selector:
source.esl, source.lsl

if .. (if)
Code:
if(${1:condition})
{
$0
}

Tab Trigger:
if

Scope Selector
source.esl, source.lsl

do while .. (do)
Code:
do
{
$0
} while( $1 );

Tab trigger:
do

Scope selector:
source.esl, source.lsl
Leon Ash
Bushveld Resident
Join date: 8 Jan 2006
Posts: 146
Command to get LSL Wiki help
03-04-2006 06:26
Will open an HTML window with the appropriate LSL Wiki page.

Command:
echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://secondlife.com/badgeo/wakka.php?wakka=$TM_CURRENT_WORD\">"

Input:
Selected Text

Output:
Show as HTML

Key activation:
Whatever you like ;-)
Theodore Polonsky
Registered User
Join date: 1 Oct 2005
Posts: 57
Has anyone posted this to the TextMate Wiki yet?
04-30-2006 13:43
If not, I'll put mine together and send it up.
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
An Expanded Bundle for LSL in Textmate
05-17-2006 08:53
HI!
I'm testing Textmate and found it to be a wonderful Editor.
I made a Bundle with full autocomplete and clean/indent macros (with and without keepin comments).
Completion Example: llSay ( (integer) channel, (string) text)
I tried to optimize and improve what I found here...
I even added a macro that directly points to the 1st error reported by lslint ;)

Download Link: http://digilander.libero.it/usemac/tm.zip

To install the bundle simply uncompress it and put the resulting folder into your
(home)/Library/Application Support/ Folder
If u already have stuff in Textmate Support Folder just copy the contents...

Then write in terminal:
chmod +x ~/Library/Application\ Support/TextMate/lslint

and you are done!!! (Open Bundle Editor - LSL in Textmate to see/change the shortcuts)

See it in action (just SOME of the features): http://digilander.libero.it/usemac/lsl.mov

IM me for questions/suggestions/comments :)
Leon Ash
Bushveld Resident
Join date: 8 Jan 2006
Posts: 146
06-17-2006 14:05
Piero,

Thank you for this great job. English isn't your first language (Couple of typos in bundle), but it all works well and is a great 'upgrade' to what I started.

Thanks
Leon
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Feedback
06-17-2006 21:24
Yeah, English isn't my first language, but I think I understand it (and some other too ;) ) so if u find some error, want a new function, or even just see a typo in descriptions/names, feel free to IM me :)
Dana Lambeau
Registered User
Join date: 13 Oct 2006
Posts: 1
Thanks for the great bundle!
10-24-2006 16:13
Thanks so much for the great bundle
It make editting really so much easier

I really appreciate so much this excellent piece of work

Thanks
Dana
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
12-17-2006 12:50
You guys rule!

TextMate is AWESOME, and writing LSL scripts with it is even better. I had been hemming and hawing about upgrading to BBEdit whatever the latest version is, I still have the one from os X 10.0... The cost of TestMate compared to BBEdit is great.

Thanks Again
Tuber

PS The "Current Word in WiKi" function is broken though, because the Wiki moved or something. i think the link just needs updated.
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
12-17-2006 14:21
OK, i fixed the wiki thing myself:

in the bundle editor, under Show commands for LSL, Select "Current word in wiki" command, replace the text there with

CODE
echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.lslwiki.com/lslwiki/wakka.php?wakka=$TM_CURRENT_WORD\">"


It should look similar to that, only this is the correct URL.
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Bundle updated
12-18-2006 03:49
I updated the bundle to (L)SL 1.13.

Updated: lslint, language, completion, wiki link.

"Fixed" constants categories:
PI, TWO_PI, PI_BY_TWO, DEG_TO_RAD, RAD_TO_DEG, SQRT2, TRUE, FALSE, NULL_KEY, EOF, ZERO_ROTATION, ZERO_VECTOR can now have their own "color" :eek:

The Link is always the same:
http://digilander.libero.it/usemac/tm.zip

Don't forget to write in terminal:
chmod +x ~/Library/Application\ Support/TextMate/lslint

HAVE FUN! :D

# Piero
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
12-18-2006 08:11
Hi

Thanks for making that change, it will really help people get set up for LSL.

I also found the following instructions for changing TextMate's default language. If you are like me, you hate having to change from Plain Text to LSL every time you open the editor.

below are the instructions.

CODE
> Is there a way to set the default language for new documents to
> something other than "plain text"?

Yes, but it's a little tricky.

First you need to find the UUID of the language you want as default.

All the default languages are stored in TextMate.app/Contents/
SharedSupport/Bundles in the Syntaxes folder of the bundle.

This is in the binary plist format, so you'll need to convert it
first to readable form. Let's say we want HTML to be the new default
language, we would do (from terminal):

% cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/
HTML.tmbundle/Syntaxes
% plutil -convert xml1 HTML.plist
% grep -A1 uuid HTML.plist
<key>uuid</key>
<string>17994EC8-6B1D-11D9-AC3A-000D93589AF6</string>

Here “17994EC8-6B1D-11D9-AC3A-000D93589AF6” is the UUID. Now we need
to tell TM to use that as default by altering its defaults database.
First quit TextMate, then from terminal run:

% defaults write com.macromates.textmate OakDefaultLanguage
17994EC8-6B1D-11D9-AC3A-000D93589AF6

Start TextMate, and notice how all new documents are set to be HTML
by default.



That is straight from the TextMate web site. However, you need to change the instructions a little if you want to do this with LSL.

In the instructions where it says :

CODE
% cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/HTML.tmbundle/Syntaxes
% plutil -convert xml1 HTML.plist
% grep -A1 uuid HTML.plist
<key>uuid</key>
<string>17994EC8-6B1D-11D9-AC3A-000D93589AF6</string>


change it to :

CODE
% cd ~/Library/Application\ Support/TextMate/Bundles/LSL.tmbundle/Syntaxes
% plutil -convert xml1 LSL.plist
% grep -A1 uuid LSL.plist
<key>uuid</key>
<string>17994EC8-6B1D-11D9-AC3A-000D93589AF6</string>


And then when you do the defaults command, copy/paste the the new uuid string.
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Huh?
12-18-2006 08:23
From: Tuber Potato
Hi

Thanks for making that change, it will really help people get set up for LSL.

I also found the following instructions for changing TextMate's default language. If you are like me, you hate having to change from Plain Text to LSL every time you open the editor.


You can just hit ctrl L to change to LSL on the fly with my Bundle
(hit again to check syntax with lslint) :D

# Piero
Gwyneth Llewelyn
Winking Loudmouth
Join date: 31 Jul 2004
Posts: 1,336
12-18-2006 18:14
Well, I just learned about TextMate today on the friendly in-world "Macintosh Users" group. Being a die-hard fanatic of Smultron as a good free alternative to BBedit (Smultron is like TextWrangler on steroids) I thought I'd be giving TextMate a try, after miserably failing to get a language definition LSL to work in Smultron...

Thanks for doing this LSL thingy :) It seems to work fine. Now, let me check what features TextMate is really missing ;)
_____________________

Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Really?
12-18-2006 21:07
From: Gwyneth Llewelyn
Now, let me check what features TextMate is really missing ;)


CHECK? :confused:
You will see that you can actually MAKE the "features" you think it's missing ;)

# Piero :D
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
12-19-2006 15:32
LOL

Yes, pressing COntrol L works just fine, my thing is for people that are too lazy to hit Cntl-L and want the editor to open with LSL Directly...

If you use TextMate for other languages (I do not) you may not want to do this.
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Big Update!
12-21-2006 15:51
Many, many improvements... I bought TextMate and had some free time :)

Notes: external AppleScript (gotoerror) is no more needed
don't miss the popup menu (window bottom) for big scripts navigation...
take a look to the new macros and "'colors'"...

The Link is always the same:
http://digilander.libero.it/usemac/tm.zip

Don't forget to write in terminal:
chmod +x ~/Library/Application\ Support/TextMate/lslint
...or use the macro ;)


HO HO HO
HAVE FUN!
:D

# Piero
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Improved!!!
12-27-2006 08:06
new useful functions
globals in popup list
very useful "snippetizer" to quickly navigate and set ll* parameters
...and more...

See it in Action:
http://digilander.libero.it/usemac/lsl.mov

HAVE FUN! :D

# Piero
Rifkin Habsburg
Registered User
Join date: 17 Nov 2005
Posts: 113
12-27-2006 13:07
This is a thing of beauty, my friend.
_____________________
Procyon Games: makers of Can't Stop, En Garde, Take it Easy, Danger Zone and Frootcake.
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Improving even more while grid is down...
12-29-2006 07:54
THANKS! :D

While grid is down I made definition more consistent (see the nicer popup list: now helps even more for big scripts with many functions/globals)

I added/improved some snippets and autocompletions too ;)

As always, suggestions/comments welcome!

# Piero
Lukas Elswit
Registered User
Join date: 24 Dec 2006
Posts: 2
"def" tab completion doesn't work?
12-29-2006 19:01
I see in your movie there's tab auto-complete for "def" but it doesn't work for me. I don't see any sort of definition for that in the bundle editor either.

There's also a "Hello Avatar" snippet that shows up in the bundle editor but not in the menu. I don't know much about TextMate bundles and how they work, so it's possible I'm doing something wrong.

TextMate Version 1.5.4 (1349)

Thanks so much for making the TextMate bundle. I'd have a hard time living without TextMate. It will make LSL a bit easier for me to tackle.
Kitto Mandala
Registered User
Join date: 1 Mar 2004
Posts: 8
Thanks and escaped quotes bug and fix...
12-29-2006 22:26
Piero, thanks for your efforts, this is great to have for TextMate...

I did notice a bug in how the language syntax hilighting handled the case of escaped quotes, e.g. when you have something like this in your code: "\"" The problem is TextMate things everything after it is part of a string, until it gets an even number of quotes again... clearly it is not handling the escaped quote properly.

This bit of code in the LSL language definition seems to fix it... I just added the 'constant.character.escape.lsl' section to the existing 'string.quoted.double.lsl' section... I leave it to you to verify and include if it makes sense! Thanks again!

CODE

{ name = 'string.quoted.double.lsl';
begin = '"';
end = '"';
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.lsl'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.lsl'; }; };
patterns = (
{ include = '#string_escaped_char'; },
{ include = '#string_placeholder'; },
{ name = 'constant.character.escape.lsl';
match = '\\.';
},
);
},
Piero Padar
#
Join date: 26 Aug 2005
Posts: 42
Many Thanks!
12-30-2006 00:15
THANKS KITTO! I copied that from C, forgot and didn't adjust!
Maybe I'm becoming too lazy with all that autocomplete ;)

I fixed it and now u can even see escaped and INVALID escaped chars highlighted :D

CODE

{ name = 'string.quoted.double.lsl';
begin = '"';
end = '"';
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.lsl'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.lsl'; }; };
patterns = (
{ name = 'constant.character.escape.lsl';
match = '\\(\\|["nt])';
},
{ name = 'invalid.illegal.unknown-escape.lsl';
match = '\\.';
},
);
},

As always, suggestions/comments welcome!

# Piero
1 2 3