The Snippets File

The snippets file is heavily based on the TextMate editor bundle for Corona. Many thanks to Darren Osadchuk from Ludicrous Software. If you are using TextMate for the development of Corona SDK apps, check out his site and the TextMate bundle.

How to Use the Snippets

You can use the snippets by entering the snippets trigger and pressing the tab key while in insert mode. For example enter the word forp (the snippets trigger) while in insert mode and then press the tab key. This will result in the following code:

for key, value inpairs( table_name )doprint( key, value )end

You can now use the tab key to cycle through key, value, and tablename_. Use shift-tab to jump backwards.

To see a list of the supported snippet triggers open the snippets file ~/.vim/lua.snippets.

You can also use auto-completion for the snippets. Try this: while in insert mode enter the word native and then press the key combination control-r followed by the tab key. This should open a box where you can select a code snippet using the arrow keys.