LÖVE snippets for Vim (with snipMate plugin)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

LÖVE snippets for Vim (with snipMate plugin)

Post by Santos »

Here are some Lua/LÖVE snippets for use with the snipMate Vim plugin.

I suggest looking through the lua.snippets file to see what the snippet names are, edit them to your taste, and add your own snippets for code/libraries you use often.
Attachments
lua.snippets.zip
(2.64 KiB) Downloaded 179 times
Last edited by Santos on Sun Oct 23, 2011 10:19 am, edited 2 times in total.
User avatar
kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

Re: LÖVE snippets for Vim (with snipMate plugin)

Post by kraftman »

I tried vim, I couldn't even get the tutorial to work :/
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: LÖVE snippets for Vim (with snipMate plugin)

Post by Santos »

kraftman wrote:I tried vim, I couldn't even get the tutorial to work :/
That's not such a bad thing, I remember that tutorial being... uncomfortable. :ultrahappy:

I'd suggest for someone interested in Vim to check out this guide: http://yannesposito.com/Scratch/en/blog ... ressively/

And then the top answer here for some advanced stuff: http://stackoverflow.com/questions/1218 ... t-with-vim

Also, don't be afraid to add things to the vimrc file. For example...

Code: Select all

imap <F4> <ESC>:call Loveconsole()<CR><CR>
nmap <F4> :call Loveconsole()<CR><CR>
imap <F5> <ESC>:call Love()<CR><CR>
nmap <F5> :call Love()<CR><CR>

fun! Loveconsole()
    exec "w"
    exec "!start love --console \"%:p:h\""
endf

fun! Love()
    exec "w"
    exec "!start love \"%:p:h\""
endf
Vim can also be customized with color schemes and plugins, such as snipMate (screencast) for snippets, lua.vim for Lua related things including syntax error checking, NERD Tree (screencast) for filesystem navigation and Taglist for function navigation (you'll probably want to add mappings in your vimrc file for NERD Tree and Taglist).

You may also want to change the font to something nicer (perhaps Droid Sans Mono or Inconsolata?). ;) To do so, create/edit .gvimrc (_gvimrc on Windows, in the same folder as _vimrc) and enter something like...

Code: Select all

set guifont=Droid_Sans_Mono:h20
Oh, and swapping the escape key with caps lock is something I'd highly recommend. AutoHotkey can do this on Windows.

Code: Select all

Capslock::Esc
Esc::Capslock
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: LÖVE snippets for Vim (with snipMate plugin)

Post by kikito »

Please don't write more awesome vim stuff, or I will not be able to do anything else than watch/read all of it.
When I write def I mean function.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: LÖVE snippets for Vim (with snipMate plugin)

Post by adnzzzzZ »

Well, thank you for bringing this to my attention. Useful as [expletive]!

Also, for those who want to get into Vim:
http://yannesposito.com/Scratch/en/blog ... ressively/
http://www.openvim.com/tutorial.html
Post Reply

Who is online

Users browsing this forum: No registered users and 65 guests