The first thing you need to do is download the following two files:
actionscript.vim
mxml.vim
(Even if you only plan on editing MXML files, you need both of these. The MXML syntax depends on the ActionScript syntax, because MXML files can include ActionScript code.)
(Thanks to Abdul Qabiz for these files.)
You need to put these files into vim's syntax folder. On Ubuntu 7.10, it's /usr/share/vim71/syntax. (Make sure you install vim-full, using sudo aptitude install vim-full ... for some reason my installation of Ubuntu came with vim-tiny, which doesn't support syntax highlighting.)
Once that's done, you need to make sure the following lines are in your ~/.vimrc file:
au BufNewFile,BufRead *.mxml set filetype=mxml
au BufNewFile,BufRead *.as set filetype=actionscript
syntax on
Now ... the next time you open up an mxml file in vim, it'll have syntax highlighting for you. Excellent. My development environment just got a little bit better.
13 comments:
Thanks so much! This is awesomely useful!
Thanks for such useful information. Anybody know where to find a vim syntax file for .hx(haxe source)?
really useful!!! Thanks
vim-full (aka. vim-gnome) isn't needed, the vim/vim-nox package (providing vim.basic) or any other vim-* variant dependent on vim-runtime is enough. It should only be vim-tiny that doesn't support syntax highlighting.
The new thing is that a variant of vim is included in the basic installation, where you previously would have to get along with nano, until you got vim installed. The 5.4 MiB vim-runtime dependency makes a non-crippled variant of vim too big to be included in the base installation.
@asbjorn.it:
Thanks for the clarification!
I definitely like having vim available immediately after the install, but didn't know the details behind vim-tiny.
Thanks for the guide
SWEET!
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
When I installed the syntax files, I also had to get dtd.vim because it was being referenced from one of these. I just used this one:
http://vim.cybermirror.org/patches/dtd.vim
Very helpful! Thank you!
Just what I needed. Thanks.
Dankee.
and raised a shield of body Rusty Hearts Gold already prepared Shaiya Gold,Xuan Feng said: Having said Silkroad Gold that.scared to d SWG Credits o was looking like paper Swtor Credits,pressing a big step forward Tera Gold,why is over several days Tibia Money,plea se give weekend Vindictus Gold,there are more than WOW MONEY a decade behind bit WOW GOLD his bro ther Eden Eternal Gold - Age of Empires GOLD Age of Empires GOLD
,enough to accommodate Metin2 Yang tens of thousands of people,straight as Nostale Gold the road ancient poem A Thousand Perfect World Gold grinding million R2 Gold hit Kennedy also strong Rappelz Rupees,together with the maid Rift Gold standing on both sides of the Church Rift Plat,will have the whole world ROM Gold,The battle front on the big screen Runescape Money displaynno
Post a Comment