Corona SDK Meets Vim
Using Vim for Corona SDK development is really a good option. Here are the tips you need to use Vim together with Corona.
When you use a recent version of Vim (< 7.x) it should support syntax highlighting for Lua 5.1out of the box. You can download a Vim syntax file for Lua, if you use an earlier version.
Lua Reference Manual
You can access the reference manual for Lua 5.0 and 5.1 from within Vim. Download and install the Lua reference manual for Vim first.
Installation is easy:
- Download and unzip the package.
- Copy lua51refvim.txt to
- Copy luarefvim.vim to
- Copy help.vim to
Now when you have a Lua file open in Vim, you can access the Lua reference by moving the cursor on a keyword and entering the keyboard sequence
\lc to get the table of contents.
Please note that you need to enter the key sequence quite quickly in one flow. If you stop after the first key for a second, Vim will not recognize it as a key sequence!
Starting the Simulator From within Vim
If you want to start the Corona SDK simulator from within Vim you need to add the following lines to your
" Start the Corna Simulator with F3 for iPhone skin. Shift-F3 for iPad skin. map <F3> :!/Applications/CoronaSDK/simulator -project %:p -skin iPhone<CR> map <S-F3> :!/Applications/CoronaSDK/simulator -project %:p -skin iPad<CR>
Now you can start the iPhone simulator with the F3 key and the iPad simulator with Shift-F3.
If you need to work on different Corona projects you will be glad to have session support.
Create a folder where you want to store your session files. My folder is named
.vimSessions and is in my home directory.
Add the following lines to your
" Session support. Save Session As and Session Open. nmap SSA :wa<CR>:mksession! ~/.vimSessions/ nmap SO :wa<CR>:so ~/.vimSessions/
Now, when you want to save your session, just enter
SSA and enter a session name. To return to a previously saved session just enter
SO and enter the session name. You can use file name completion here by using the
I use both the vim command line version, which you can access from within a terminal session, and the Mac application version MacVim.
I’m curious about your Vim tips and tricks for working with Corona. Please let me know them.