views:

1045

answers:

5

I'm trying to setup VIM for editing Actionscript 3 for some upcoming Flash projects. I dislike working in an IDE and prefer VIM. Right now, I know that I want:

  • Omnicomplete (with tab completion)
  • Syntax highlighting (there is an actionscript.vim file on vim.org but the highlighting is not as good as other syntax files)
  • AS3 compiler accessible from bash/terminal

I've tried setting up Omnicomplete but was running into issues.

How can I set up Omnicomplete with tab completion properly?

Where can I find a good AS3 syntax file?

What is a good AS3 compiler for terminal/bash?

Are there any other plugins you can suggest?

Any advice is appreciated.

Thanks!

+1  A: 

Back in my ActionScripting days I did okay using a javascript syntax file -- as both are based on ECMAScript, the syntax is mostly the same. There also seem to be some syntax files out there that do both, like this one.

I don't know if you'll get very far with an AS3 compiler, as you pretty much need to build the source from within the Flash editor itself as there are dependencies on the various assets (movies, images etc).

Ether
A: 

I don't know about setting up VIM, but i've used FCSH successfully as a terminal/bash shell compiler for AS3:

Reuben
+1  A: 

I used to use this as3 syntax file: http://www.vim.org/scripts/script.php?script_id=1061 If you want to interpret ActionScript, you must do it through the Adobe software. It is a proprietary language so unless Adobe comes up with a command line interpreter, your not going to find one. (Edit: In fact Adobe Labs does have this FCSH, I have not tried it but it may be what your looking for). Check out http://bitbucket.org/kuy/dotfiles-x40/src/tip/vimfiles/dict/actionscript.dict for a dictionary file for ActionScript. Once you copy that file to your dict folder, add the following to your .vimrc:

autocmd FileType actionscript set omnifunc=actionscriptcomplete#CompleteAS
autocmd FileType actionscript :set dictionary=$HOME/vimfiles/dict/actionscript.dict

Pierre-Antoine LaFayette
A: 

Turns out this syntax file works pretty well for me in MacVim.

Luke Bayes
A: 

The link to actionscript.dict in the best answer is broken but if you google around you can find one.

Alternately, the neocomplcache vim plugin also supports actionscript completion. I've installed it and it's quite good:

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

starpause