TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

vim syntax for tintin?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Tue Dec 26, 2006 6:57 am    Post subject: vim syntax for tintin? Reply with quote

I'm trying, and failing miserably, to put together a simple vim syntax file. I gave it an attempt, but there's something about it that eludes me, and I have better things to waste my time on (like actually writing the tintin scripts).

But... if on the off chance someone has already written a tintin syntax file for vim. I'd greatly appreciate it if you shared it here.
Back to top
View user's profile Send private message Visit poster's website
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Dec 26, 2006 1:12 pm    Post subject: Reply with quote

If you give a list of key combinations and the desired actions I can probably piece something together.
Back to top
View user's profile Send private message Send e-mail
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Tue Dec 26, 2006 2:15 pm    Post subject: Reply with quote

ooo a wishlist for everything that I didn't get on christmas?

- Keyword highlighting (tried to do this for any word starting with #, but screwed something up)
- Perhaps error highlighting any #word that is not a keyword
- basic string highlighting
- mark ';' characters in some way that is glaringly obvious
- highlight #NOPs as comments

It's nothing that hasn't been done before. I can read (or maybe decipher is the better word) regular expressions, but I've got a long way to go before I can write anything complex with any efficiency. Hence the begging for a an easy way out here.
Back to top
View user's profile Send private message Visit poster's website
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Dec 27, 2006 12:55 am    Post subject: Reply with quote

Misread your initial post, I thought you were talking about vi keybindings opposed to emacs. I'll have a look at it though sometime if nobody else does. Someone made a syntax file for joe once and it was pretty nifty.
Back to top
View user's profile Send private message Send e-mail
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Sat Sep 22, 2007 8:14 am    Post subject: Reply with quote

I finally got around to fixing this up a bit. It's nothing too robust, but maybe it'll be useful to someone.
(couldn't figure out how to attach a file, so here:)
Code:
" Vim syntax file
" Language:   tintin
" Maintainer:   Dave V
" Last Change:   2007 Sep 22

" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
  finish
endif

"syn keyword ttKeyword #ALIAS #ACTION #ALL #BELL #BUFFER #CHAT #CLASS #COLORS #CONFIG #CR #CREDITS #CURSOR #DELAY #ECHO #END #GAG #GAGLINE #HELP #HIGHLIGHT #HISTORY #IF #IGNORE #DEBUG #ESCAPE #FORALL #FORMAT #FUNCTION #GREP #HISTORY #INFO #KILL #LIST #LOADPATH #LOG #LOGLINE #LOOP #MACRO #MAP #MARK #MATH #MESSAGE #NOP #PARSE #PATH #PATHDIR #PROMPT #READ #REPLACESTRING #SAVEPATH #RETURN #SCAN #SEND #SESSION #SHOWME #SNOOP #SPEEDWALK #SPLIT #SUBSTITUTE #SUSPEND #SYSTEM #TAB #TEXTIN #TICK #UNACTION #UNALIAS #UNCLASS #UNFUNCTION #UNGAG #UNHIGHLIGHT #UNMACRO #UNPATH #UNPROMPT #UNSPLIT #UNSUBSTITUTE #UNTAB #UNTICK #UNVARIABLE #VARIABLE #WALK #WRITE #ZAP

syn keyword ttKeyword ACTION ALIAS ALL BELL BUFFER CHAT CLASS COLORS CONFIG CR CURSOR DEBUG DELAY ECHO END ESCAPE EVENT FORALL FORMAT FUNCTION GAG GAGLINE GREP HELP HIGHLIGHT HISTORY IF IGNORE INFO KILL LIST LOG LOGLINE LOOP MACRO MAP MATH MESSAGE NOP PARSE PATH PATHDIR PROMPT READ REPLACESTRING RETURN RUN SCAN SCRIPT SEND SESSION SHOWME SNOOP SPEEDWALK SPLIT SUBSTITUTE SUSPEND SYSTEM TAB TEXTIN TICKER VARIABLE WRITE ZAP
syn keyword ttKeyword UNACTION UNALIAS UNDELAY UNEVENT UNFUNCTION UNGAG UNHIGHLIGHT UNMACRO UNPROMPT UNSPLIT UNTAB UNTICKER UNVARIABLE
syn keyword ttKeyword VAR UNVAR

syn keyword ttListKeyword CLR DEL FND GET INS LEN SET SRT


"syn match ttCommand "#[^\s\d]*"
syn region ttQuotes start=/"/ end=/"/
"syn region ttBraces transparent start=/{/ end=/}/ contains=ttBraces,ttQuotes
syn region ttBraces start=/{/ end=/}/ transparent fold

hi def link ttListKeyword ttKeyword
hi def link ttKeyword Keyword

"hi def link ttCommand Operator
hi def link ttQuotes  String
hi def link ttBraces  Special

let b:current_syntax = "tintin"


if I get around to posting it somewhere where it can be updated, I'll post the address here.
Back to top
View user's profile Send private message Visit poster's website
svakanda



Joined: 25 Jan 2008
Posts: 18
Location: Missoula, MT

PostPosted: Fri Jan 25, 2008 2:49 pm    Post subject: wow Reply with quote

Davevnj this is awesome! vim is my buddy. I haven't been able to get this to quite work all the way though. It kind of works, but the coloring and stuff is a little bit erradic. Did you ever fix this up more?

if so I'd love to have a current copy...if not I may just hunker down and try to learn some vim syntax code
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Roady



Joined: 28 Mar 2006
Posts: 25

PostPosted: Tue Jan 29, 2008 9:36 pm    Post subject: Reply with quote

ive tweaked this some, to include a few more bits and peices.

im pretty new to vim syntax file creation too - only been doing it for an hour - but everything seems to work ok.

http://www.vim.org/scripts/script.php?script_id=2133


* Keyword highlighting - done
* Perhaps error highlighting any #word that is not a keyword - not sure how do this yet
* basic string highlighting - think ive done this, but if its not right can you explain it to me?
* mark ';' characters - done
* highlight #NOP - ive highlighted #NOP as a keyword/command

(i'd recomend using /* <comment> */ for comments)


Also, here's a good tip for tweaking syntax colors: http://www.vim.org/tips/tip.php?tip_id=53
Back to top
View user's profile Send private message
svakanda



Joined: 25 Jan 2008
Posts: 18
Location: Missoula, MT

PostPosted: Thu Jan 31, 2008 2:44 pm    Post subject: new syntax file Reply with quote

I eventually just broke down and figured out how to write a syntax file, it's available at http://www.vim.org/scripts/script.php?script_id=2135!
This is using my personal colorscheme, the default vim colorscheme looks different.

Here is a screenie...omgosh i'm so in love with tt now! this is all I needed!
[/img][/url]
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Jan 31, 2008 6:43 pm    Post subject: Reply with quote

I linked both pages from the download page, unless you guys can agree on one version.

A link to the tintin sf page in the script page's description would be appreciated Roady Wink
Back to top
View user's profile Send private message Send e-mail
Roady



Joined: 28 Mar 2006
Posts: 25

PostPosted: Thu Feb 07, 2008 1:35 am    Post subject: Reply with quote

Ive added a link to the tintin sourceforge page, and also linked to svakanda's script which is without a doubt better than mine - so much so that ive switched!

to be honest, i wouldnt bother linking to mine.

Great job svakanda! Thanks very much.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Feb 07, 2008 5:06 am    Post subject: Reply with quote

Okay, glad that's settled. Just linking to Svakanda's version now.
Back to top
View user's profile Send private message Send e-mail
svakanda



Joined: 25 Jan 2008
Posts: 18
Location: Missoula, MT

PostPosted: Thu Feb 07, 2008 1:16 pm    Post subject: few changes i need to update Reply with quote

hey Roady, thanks for the link...there are some things from your script that I want to copy over, as well as a few other additions. For one...i believe this script doesn't correctly identify keywords with capital letters or in allcaps, like yours did. er heres a list Coffee


Todo
1. Modify to make it caps-flexible
2. it needs support for highlighting comments NOP for sure...does /* */ 'C' commenting work too?
3. it needs a few more regions defined I think...namely a 'group-linked' region for IF statement expressions...
4. need to define regions for " " and something else that i noticed last night...but forget now.

i dropped a bloglink from http://www.terrazoa.org too scandum, there is a short exerpt on muds, but is mostly not a mud blog...but the more i think about it the more that sounds pretty cool, does anyone know of any mudblogs?
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Feb 07, 2008 6:56 pm    Post subject: Reply with quote

Thanks for the links Smile

The only mud related blog site I know is http://social.mudconnect.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group