Vim Actionscript And Mxml Syntax Files
12 Oct 2007--- layout: post status: publish published: true title: ‘VIM: ActionScript and MXML syntax files’ author: display_name: Abdul Qabiz login: admin email: [email protected] url: http://www.abdulqabiz.com author_login: admin author_email: [email protected] author_url: http://www.abdulqabiz.com wordpress_id: 339 wordpress_url: http://www.abdulqabiz.com/wordpress/?p=339 date: ‘2007-10-12 12:59:41 +0530’ date_gmt: ‘2007-10-12 07:29:41 +0530’ categories: - Flash and Actionscript - Macromedia Flex tags: [] comments: - id: 1725 author: DLikhten author_email: [email protected] author_url: ‘’ date: ‘2007-11-16 02:30:14 +0530’ date_gmt: ‘2007-11-15 21:00:14 +0530’ content: | You rule!!!! This is great! Now all we need is to modify eclipse java editor to take in syntax from actionscript and eclipse jsp editor to handle MXML (after all it is just like JSPs) and we got a semi-working ide :) - id: 1726 author: Devon author_email: [email protected] author_url: ‘’ date: ‘2007-11-21 06:27:09 +0530’ date_gmt: ‘2007-11-21 00:57:09 +0530’ content: | Quick suggestion on implementing them: Add this to your $HOME/.vimrc: au BufNewFile,BufRead *.mxml set filetype=mxml au BufNewFile,BufRead *.as set filetype=actionscript The instructions that are linked to don’t include the mxml line and they don’t work when you’re creating a new file! - id: 1727 author: Geoff author_email: [email protected] author_url: http://www.geoffreymoller.com date: ‘2007-12-01 01:22:40 +0530’ date_gmt: ‘2007-11-30 19:52:40 +0530’ content: | Incredibly helpful - thanks! For Actionscript 3 within an mxml file script tag, the syntax coloring is different than actionscript in a standalone *.as file - is that your intention (or maybe my environment is messed up :) ? - id: 1728 author: Martin author_email: [email protected] author_url: ‘’ date: ‘2008-08-20 00:20:44 +0530’ date_gmt: ‘2008-08-19 18:50:44 +0530’ content: ‘Is there a way to enable/add folding on the actionscript syntax file? ‘ - id: 1729 author: Burteen author_email: [email protected] author_url: ‘’ date: ‘2008-12-22 10:29:59 +0530’ date_gmt: ‘2008-12-22 04:59:59 +0530’ content: ‘This is awesome ‘ - id: 1730 author: vuthecuong author_email: [email protected] author_url: ‘’ date: ‘2009-01-05 08:44:40 +0530’ date_gmt: ‘2009-01-05 03:14:40 +0530’ content: | It works very well in mxml file with embedded actionscript functions. However, when I indent above mxml file (gg=G), the mxml parts indented well but the actionscript funtions code did not being indented at all. Does anyone as same as me? If indent well, this is perfect :) Could anyone tell me how can I indent mxml file with embedded actionscript code? thanks and regards - id: 1731 author: Abdul Qabiz author_email: [email protected] author_url: http://abdulqabiz.com/blog/ date: ‘2009-03-07 02:03:57 +0530’ date_gmt: ‘2009-03-06 20:33:57 +0530’ content: | \@vuthecuong I need to check that and probably fix it. \@Martin I would check that too. Thanks for update. -abdul - id: 4363 author: Sam Wilson author_email: [email protected] author_url: http://www.storypixel.com date: ‘2009-07-07 18:21:32 +0530’ date_gmt: ‘2009-07-07 13:21:32 +0530’ content: Very nice stuff, I’m going to try to implement these files today. My dream would be a vim plugin that matches Eclipse (FDT). There is a Ruby vim plugin that allows the functionality of clicking on a class name and doing some key command and you go to that class’s definition. That’s exactly what I’d like to see here, maybe I can learn enough to make that happen. - id: 4372 author: Abdul Qabiz author_email: [email protected] author_url: http://www.abdulqabiz.com date: ‘2009-07-07 23:10:17 +0530’ date_gmt: ‘2009-07-07 18:10:17 +0530’ content: |- \@Sam Thanks. I know, I also wanted a VIM plugin for Eclipse and realized there are couple of such plugins, not really stable and usable. Then I realized, Eclipse is different thing and while using existing VIM plugins for Eclipse, my experience has not been good. It’s like trying to fit something meant for different world into something else. However, I would see when one appears. -abdul - id: 6640 author: queria author_email: [email protected] author_url: ‘’ date: ‘2009-08-25 13:14:08 +0530’ date_gmt: ‘2009-08-25 08:14:08 +0530’ content: “Hi Abdul.\r\n\r\nIts great ... thanks very much!\r\n\r\nQ.” - id: 7258 author: morch author_email: [email protected] author_url: ‘’ date: ‘2009-09-23 03:27:00 +0530’ date_gmt: ‘2009-09-22 21:57:00 +0530’ content: “Patch: Let syntax files be stored in ~/.vim/syntax\n\nI’m sure if I put the syntax files under /usr/share they’d work fine. But when I put them under ~/.vim/syntax, I got this error:\n\nError detected while processing /home/pvm/.vim/syntax/mxml.vim:\nline \ 302:\nE484: Can’t open file /home/pvm/.vim/syntax/dtd.vim\n\nThis patch fixed that for me, allowing me to put the syntax files in my user .vim dir:\n> svn diff\nIndex: mxml.vim\n===================================================================\n--- mxml.vim\t(revision 1527)\n+++ mxml.vim\t(working copy)\n@@ -299,7 +299,7 @@\n \n syn keyword xmlDocTypeKeyword contained DOCTYPE PUBLIC SYSTEM\n syn region \ xmlInlineDTD contained matchgroup=xmlDocTypeDecl start=\”[\” end=\”]\” contains=@xmlDTD\n-syn include \@xmlDTD :p:h/dtd.vim\n+runtime ! syntax/dtd.vim\n unlet b:current_syntax\n” - id: 7259 author: morch author_email: [email protected] author_url: ‘’ date: ‘2009-09-23 03:28:00 +0530’ date_gmt: ‘2009-09-22 21:58:00 +0530’ content: And I second Geoff’s comment about actionscript inside a CDATA in a MXML file being syntax highlighted differently than in an actionscript file. It looks wierd... - id: 7410 author: Puppies for Sale author_email: [email protected] author_url: http://www.k9stud.com date: ‘2010-05-21 07:53:00 +0530’ date_gmt: ‘2010-05-21 02:23:00 +0530’ content: There is a Ruby vim plugin that allows the functionality of clicking on a class name and doing some key command and you go to that class’s definition. - id: 7450 author: Orlando Puppies author_email: [email protected] author_url: http://www.9breedershappytails.com date: ‘2010-08-09 20:16:00 +0530’ date_gmt: ‘2010-08-09 14:46:00 +0530’ content: |- Incredibly helpful - thanks! For Actionscript 3 within an mxml file script tag, the syntax coloring is different than actionscript in a standalone *.as file - is that your intention (or maybe my environment is messed up :) ? - id: 7529 author: Anon author_email: [email protected] author_url: ‘’ date: ‘2011-03-31 19:21:00 +0530’ date_gmt: ‘2011-03-31 13:51:00 +0530’ content: thx for your work! ---
I am sharing VIM syntax files for ActionScript and MXML, which I was about to share last-year, I got lazy after Manish’s post. I hope, these syntax files would provide more (if not better) syntax-highlighting :-)
Click following links to download/see:-
You can refer to Manish’s post to learn how to use these files. Instruction applies to any VIM syntax file.
Credit goes to original creators of actionscript.vim and xml.vim. These files were starting points.
Disclaimer:These files work for me, these are not perfect or clean. I would try to clean up, add more (if any missing) syntax and share whenever I get time.
Technorati Tags: vim, syntax, actionscript, mxml, flex, flash