What's your Lua/Love setup ?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

What's your Lua/Love setup ?

Post by Roland_Yonaba » Thu Jul 14, 2016 8:54 am

I recently moved to a new computer and I would like to try a new Lua setup. And I want it to be optimal.
Ideally, I will be more focused on writing Lua scripts/libraries and be able to switch between Lua 5.1, 5.2 ou 5.3.
And sometimes, work on LÖVE games, run some LÖVE games... I would love the main editor to support that.

I am looking for ideas. Can you please share your Lua setup ? How do you work with that ? What editor/plugins/packages do you have installed ? How does it suits your needs ?

Many thanks in advance.

User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: What's your Lua/Love setup ?

Post by Inny » Thu Jul 14, 2016 4:41 pm

Let me first apologize for being the first reply, because I'm going to drop some Vim up in this house.

To make Vim handle Love and Lua, I configure it like so (and I do this from a Windows box, and I'm removing pieces of the config that are unrelated):

Code: Select all

set wildmenu
set wildmode=list,full
if has("win32") || has("win64")
  command -nargs=* Love10  :!"C:\Program Files\LOVE-0.10.1\love.exe" . <args>
  command -nargs=* Lua51 :!"C:\Program Files (x86)\Lua\5.1\lua.exe" <args>
end
function SetLovePrefs()
    if has("win32") || has("win64")
        setlocal dictionary-=~/vimfiles/love-dictionary/love.dict dictionary+=~/vimfiles/love-dictionary/love.dict
        setlocal dictionary-=~/vimfiles/lua.dict dictionary+=~/vimfiles/lua.dict
    end
endfunction
if has("autocmd")
  augroup prog
    autocmd FileType lua setlocal tabstop=2 shiftwidth=2 softtabstop=2
    autocmd FileType lua call SetLovePrefs()
    autocmd FileType lua setlocal iskeyword+=:
    autocmd FileType lua setlocal iskeyword+=.
  augroup END
end
what this gets me is
- I can run Love or Lua from the added :Love10 or :Lua51 commands
- the autocomplete can recognize lua and love identifiers, which those two files can be found on these very forums if you want to search a bit.
- autocomplete can will work like this: love.g<tab> becomes love.graphics.setColor and shows me a list of all the other options I can tab through.

As for other plugins, the relevant ones are nerdtree, supertab, taglist, buffergator, and fugitive. nerdtree, taglist, and fugitive are essentially must haves in Vim.

This is all from Stockholm syndrome, mind you. People will say it makes you really fast or its a perfect text surgery tool. Nobody ever mentions it ruins you from using other editors. Even when I use visual studio I need the vsvim plugin, and I can't tell you how many times I've accidentally closed a dialog box (like tortoisegit) by pressing escape while typing. Otherwise it works pretty well for me.

cval
Citizen
Posts: 58
Joined: Sun Apr 20, 2014 2:15 pm
Location: Ukraine

Re: What's your Lua/Love setup ?

Post by cval » Thu Jul 14, 2016 8:16 pm

Almost vanilla Notepad++ with basic Lua syntax highlight. The only thing i did to ease development is i've added a run command and bound the following code

Code: Select all

"C:\Program Files\LOVE\love.exe" $(CURRENT_DIRECTORY) "--console"
to a key shortcut Ctrl+D to launch the code rightaway (i have to save manually tho before i run it). And also it does not allow to launch the code if the file that you are working on is a subdirectory of a folder where main.lua is located (e.g. "game/modules/module.lua"), but quick tab switching deals with that.

Tried to look at different IDE's but their features usually just get in the way instead of making development more rapid and effective.

User avatar
pgimeno
Party member
Posts: 2035
Joined: Sun Oct 18, 2015 2:58 pm

Re: What's your Lua/Love setup ?

Post by pgimeno » Thu Jul 14, 2016 9:17 pm

Vanilla Kate, except I have the terminal plugin active and the background colour a bit darker. I want to take a more detailed look at ZeroBraneStudio, though. It looks like a good IDE.

Kate fits my workflow quite well. I use the terminal to run 'love .' when needed. I'm not sure to recommend it, though; I'm a bit weird when it comes to editors.

User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: What's your Lua/Love setup ?

Post by airstruck » Thu Jul 14, 2016 10:13 pm

pgimeno wrote:I use the terminal to run 'love .' when needed.
Same here. Launching it from the editor doesn't seem particularly useful when alt-tab, up, enter will do the same thing. I set up a few aliases for different versions of Love (love9, love10 and just love). I switch back and forth between gedit, atom, and vim depending on what I'm working on. Gedit's nice for small one-off stuff, atom and vim are nice for bigger projects. I'd probably use vim more, but it gives me sort of an irrational anxiety after a while; I can't help but associate it with being ssh'd into a production server, frantically trying to fix stuff that never had any sane deployment scheme or version control, written by a never-ending stream of random freelancers hired off odesk or wherever who barely speak English. But that's not vim's fault.

I have PUC Lua 5.1 and 5.2 and LuaJIT 2.0.3 installed through Debian's package repo, but no PUC 5.3 or newer LuaJIT because it's not in the repo and I can't be assed. I use a Travis setup that runs tests with more versions, it's in airstruck/knife if anyone wants it.

User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: What's your Lua/Love setup ?

Post by josefnpat » Thu Jul 14, 2016 11:09 pm

I'm going to chime in with Inny;

I use a configured Vim instance inside of tmux. Then I either just type `love .` in a terminal or I have a `./run.sh` script which will package it up as a .tmp.love and then run it.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push

User avatar
Ikroth
Citizen
Posts: 76
Joined: Thu Jul 18, 2013 4:44 am

Re: What's your Lua/Love setup ?

Post by Ikroth » Fri Jul 15, 2016 1:20 am

Also chiming in with Vim. I'm running on Windows 10 and using babun (Cygwin) for a terminal. I have "love ." bound to <Leader>l which lets me run the game quickly. My favorite vim plugin is ctrlpvim which lets you open a fuzzy search dialog for files. It has basically replaced nerdtree for me. I don't really have any other love specific settings, other than a plugin for improving lua indentation.

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

Re: What's your Lua/Love setup ?

Post by kikito » Fri Jul 15, 2016 2:04 pm

I use vim and a good console (fish shell on iterm2 on a mac). No special config besides a Lua syntax highlighter. I run vim inside a console, so the other console tabs are a keystroke away. I just switch back and forth between vim and the console.

Personally, I wouldn't recommend my own setup. Learning vim took me too much effort. If I could go back and redo it I would probably learn a more straightforward editor like sublime. As things are now, I am kind of "trapped in vim" - I have enough muscle memory to make changing a hassle, but not enough motivation to get the hyper-productivity others get from vim.
When I write def I mean function.

User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: What's your Lua/Love setup ?

Post by arampl » Fri Jul 15, 2016 4:27 pm

I use medit in Xubuntu.
"Cobalt" scheme, tab = 2 characters.
Shell script (bound to F12) used for running love projects also capable to execute my C programs:

Code: Select all

if [ $DOC_EXT = ".lua" ]
then
  love $DOC_DIR
else
  make -B
  ./main
fi
For some ridiculous reason, I can't setup this in Windows: to run love project should write absolute path to folder containing it. Meaning $DOC_DIR is not working in Windows. Annoying!

User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: What's your Lua/Love setup ?

Post by Plu » Mon Jul 18, 2016 7:46 pm

I use ZeroBrane studio for all my editing and running. Don't think I've changed any settings. It's quite nifty, although there seems to be a bug in the Ubuntu version, which crashes a lot when I switch project directories :(

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests