Vim: Editing ActionScript

It took me an embarrassingly long time to figure out how to install the ActionScript plugin for Vim. First, download it from here. Put it in ~/.vim/syntax. Now, update your ~/.vimrc file to look something like this:
set autoindent
syntax on
filetype plugin on

" Use .as for ActionScript files, not Atlas files.
au BufNewFile,BufRead *.as set filetype=actionscript

" Put these in an autocmd group, so that we can delete them easily.
augroup vimrc
au!
autocmd FileType actionscript setlocal sw=4 sts=4 et
autocmd FileType python setlocal sw=4 sts=4 et tw=72
autocmd FileType ruby setlocal sw=2 sts=2 et
augroup END

Comments

bsergean said…
Do you do it the hard way and compile with mxmlc and then play your swf in a browser, or is it just to edit some AS files and then start the whole thing in Flex ?

I'm glad I read your post, because I have always seen a black and write screen when editing AS files and it's a pain :)
I'm doing it the hard way, and we're using mxmlc to compile simple Flash, not Flex.
bsergean said…
That's very brave and the Linux way of doing things ! Big up :)

You probably know about this, there's another bin for building .swc file that are kind of C static libraries, useful for sharing code and decrease compile time. There's also RSL files that are like shared library.
> That's very brave and the Linux way of doing things ! Big up :)

For some definition of brave ;) Eclipse scares me, and all the other tools are proprietary ;)

> You probably know about this, there's another bin for building .swc file that are kind of C static libraries, useful for sharing code and decrease compile time. There's also RSL files that are like shared library.

Thanks. I didn't know all that. I'm an ActionScript newb.