Quickie: Using Vim for Actionscript

Friday, October 9th, 2009 2:05 pm

Okay, we all know vim is the best IDE out there. But what is a fella to do when he wants to use the best IDE with the best closed-source vector-based browser plugin scripting language? Why, hack at his vim install! :)

First, download the actionscript.vim file from this place. The actionscript.vim file is a syntax file, so it should go in the appropriate folder as you see fit. However, note that in OS X the .vim folder seems to have no impact, so you have to put it in the /usr/share/vim/vim72/syntax folder. (Use sudo, and you may need to use a different vim folder if it has a newer version.)

Next, we have to hack at the filetype.vim file in the /usr/share/vim* folder in order to disable the default treatment of *.as files. Change the lines that say:

" Atlas
au BufNewFile,BufRead *.atl,*as     setf atlas

…into the following series of lines:

" Atlas
au BufNewFile,BufRead *.atl     setf atlas

" ActionScript
au BufNewFile,BufRead *.as           setf actionscript

Voila! Opening .as files in vim should work now.

One Response to “Quickie: Using Vim for Actionscript”

  1. Yuce Tekol says:

    Thanks for mentioning actionscript.vim! Having it in ~/.vim/syntax directory and the following in .vimrc works for me:

    au BufNewFile,BufRead *.as set filetype=actionscript

Leave a Reply