News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Vim syntax file
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
Vim syntax file

I've been poking at Vim's lua syntax file for quite a while now, adding little bits here and there from murgaLua. Since i recently started exploring the built-in tables in murgaLua, i've found it now much easier to work on my syntax file.

This is not a complete syntax file, but instead is a complement to the existing Lua syntax file. In order to make it work, create the directory <vim_path>/after/syntax/ and add this file to that direcory as lua.vim

Edit: I made some drastic changes to it that reduced the filesize but made individual lines extrememly long. Rather than posting the text, the file is attached.



Attached File(s)
.gz File  ml_syntax_v4.tar.gz (Size: 8.54 KB / Downloads: 3)

This post was last modified: 01-01-2011 01:02 AM by mikshaw.

09-10-2007 10:52 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: Vim syntax file (WARNING: very long post!)

I think I'll try this out tonight :-)

THANKS !!

Cheers
JohnM

09-10-2007 05:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #3
RE: Vim syntax file (WARNING: very long post!)

Updated the original post with the additions from this morning. I've gotten as far as Fl_Text_Display with searching the individual widgets.

I don't quite understand the syntax of some parts of murgaLua...some things seem to be inconsistent with the majority (such as Fl_Shared_Image), so there are and may be in the future minor changes to those things. For example, I had originally used "Fl_Shared_Image.get" as a syntax string, but discovered that Fl_Shared_Image has most of the same methods as other image objects, so changed it simply to "Fl_Shared_Image". This means any script that currently uses "Fl_Shared_Image<dot>get" rather than "Fl_Shared_Image<colon>get" won't fully highlight that string.

That colon-or-dot thing makes my head hurt. It makes no sense to me.

Also, a note about the actual colors used:
I chose keywords that produced colors that looked comfortable to me, rather than focusing on the relationship of the keyword to the actual type of object is being highlighted. This might be annoying to some people.

This post was last modified: 09-11-2007 12:46 AM by mikshaw.

09-11-2007 12:39 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #4
RE: Vim syntax file

Another update. I'm going to consider this a completed project for now so I can get back to other things. I'm sure it will still need some work in the future, but nearly everything in murgaLua 0.5.5 is covered.

It's been changed to use expressions to cut down the long series of commands, so hopefully it will be easier to use/edit.

Edit: I carelessly omitted a vital part of the syntax patterns (end-of-word), so there were a lot of badly-detected words in the previous upoad. I've replaced it with a fixed version (Monday 16:40 EST)

This post was last modified: 09-11-2007 07:41 AM by mikshaw.

09-11-2007 05:42 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #5
RE: Vim syntax file

I've been gradually adding bits to the file as features are added to murgaLua and as I notice things I've overlooked, but one serious thing I've overlooked is that some functions can be used as a method by a named object. For example, here's a small piece from a script in Damn Small Linux:

Code:
timeserver = socket.tcp()
timeserver:settimeout(timeout)
_,err = timeserver:connect(host,port)

The current syntax file properly matches socket.tcp, but the other functions are not matched. If it was socket.connect it would be matched, but instead the script uses timeserver:connect.

I believe I'm going to have to rethink my method of matching strings If I'm going to address these variables without making the file too huge.
Maybe I'll simplify it so that all keywords are matched regardless of their context. I've seen it done this way in other syntax files, where certain keywords are highlighted regardless of their context. I was trying to be specific so these words would not be highlighted unless they are technically supposed to be, but that's beginning to become more complex than I'd like.

02-29-2008 04:46 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #6
RE: Vim syntax file

I added a lot of the newer stuff to it, and did a simple fix that should address the previous problem.

It still is incomplete, but it will be an ongoing process.
murga-projects.com/forum/attachment.php?aid=37 updated file at top

This post was last modified: 10-23-2010 02:23 PM by mikshaw.

02-29-2008 06:19 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #7
RE: Vim syntax file

An update for MurgaLua 0.7.0
Still kinda sloppy, still incomplete, but still works.
murga-projects.com/forum/attachment.php?aid=62 updated file at top

EDIT: I added the fann stuff to my own copy today, as well as the additional fltk bits that have been put in over the last couple of ML releases. But I'm looking into learning more about the way these syntax files are built so I can streamline it more before uploading the newer version.

This post was last modified: 01-01-2011 01:04 AM by mikshaw.

10-23-2010 02:20 PM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #8
RE: Vim syntax file

Two months later and I still haven't gotten back to it.
So I'll just post what I have now, since I probably won't get back to it again for a while.

http://www.murga-projects.com/forum/atta...php?aid=68

This post was last modified: 01-01-2011 01:03 AM by mikshaw.

01-01-2011 12:59 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: