[Geany-Users] enabling automatic indentation/unindentation in Lua

James Brierley jmb8710 at xxxxx
Sat Nov 9 20:22:02 UTC 2013


Also, you can try adding something like this to snippets.conf 
(Tools->Configuration files):

[Lua]
if=if %cursor% then\n\t%cursor%
else=else\n\t

You will need to add a keybinding (Preferences dialog) to 'Move cursor 
in snippet' — I use Shift+Tab.

So in this example, you would type if, then press tab, then type the 
condition, then type Shift+Tab (or whatever keybinding you use) to 
automatically insert a new line and indent. Same for else; hit tab after 
typing it and you will get a free newline with your tab. :)

Hope this helps, also, good luck with recovery from your stroke.

James

On 09/11/13 19:56, James Brierley wrote:
> Hi Doug,
>
> For a start, try copying filetypes.lua from /usr/share/geany to
> $HOME/.config/geany/filedefs, and uncommenting the indentation options
> (set them to tab width 2, I think that’s Lua style). Then when you type
> 'do' or 'function' or whatever and indent, every successive line will be
> at that indentation level.
>
> Hope this helps,
>
> James
>
> On 09/11/13 19:08, Doug Darrow wrote:
>> I've been using Geany on Ubuntu 'Precise' 12.04 for a year (both 1.21
>> and now 1.23.1 since it came out). I'm no programmer ( far from it!) and
>> I've only gotten my hands and fingers to work well enough, since my
>> stroke, to have any competence at typing. The big thing I liked in Scite
>> was its ability to automatically indent based on Lua rules. I can't even
>> get that to work in Scite now. Is there any way to do that with Geany?
>> Can I set it to indent such lines as 'for' or 'do' and, possibly,
>> UNindent 'end' lines? I mean short of C coding. I've tried fiddling with
>> all the settings in Preferences but I'm just not competent enough to
>> make the auto indentation work for Lua. (It's a struggle just to make
>> Lua do what I want)
>>
>> Thanks for any help or trying to help.
>> Doug
>> _______________________________________________
>> Users mailing list
>> Users at lists.geany.org
>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>

-- 
"Unix is the worst computer operating system, except
all the others that have been tried."


More information about the Users mailing list