Page 1 of 3

What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 8:54 am
by Roland_Yonaba
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.

Re: What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 4:41 pm
by Inny
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.

Re: What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 8:16 pm
by cval
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.

Re: What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 9:17 pm
by pgimeno
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.

Re: What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 10:13 pm
by airstruck
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.

Re: What's your Lua/Love setup ?

Posted: Thu Jul 14, 2016 11:09 pm
by josefnpat
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.

Re: What's your Lua/Love setup ?

Posted: Fri Jul 15, 2016 1:20 am
by Ikroth
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.

Re: What's your Lua/Love setup ?

Posted: Fri Jul 15, 2016 2:04 pm
by kikito
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.

Re: What's your Lua/Love setup ?

Posted: Fri Jul 15, 2016 4:27 pm
by arampl
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!

Re: What's your Lua/Love setup ?

Posted: Mon Jul 18, 2016 7:46 pm
by Plu
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 :(