Re: Keyboard short cuts

From: mitchell <mforal.n....at.gmail.com>
Date: Sat, 20 Mar 2010 08:13:30 -0700 (PDT)

Robert,

> > > currently one has to copy key_commands.lua to ~/.textadept, change it
> > > to your needs and require it in your init.lua.
> > > Would it be an option for you to have the default key_commands.lua
> > > loaded and then load an additional key_commands.lua in ~/.textadept
> > > that can overwrite or add to the default one?
> > > A little bit more complexity in Textadept, but less for the user,
> > > because no init.lua would be necessary. Additionaly, If I now forget
> > > closing some brackets or something when editing my key_commands,
> > > resulting in an error I end up with no keyboard short cuts at all.
>
> > In your init.lua
>
> >   require 'ext/key_commands.lua' -- standard key commands
>
> >   local keys = _G.keys
> >   keys.cb = nil
> >   keys.cB = { textadept.switch_buffer }
>
> > I suppose a 'dofile()' could be put at the end of core/ext/
> > key_commands.lua for overrides in ~/.textadept. I will consider this.
>
> Mitchell,
> do your changes to the manual (hg bc68cdf72a) mean that there will be
> no dofile option?
> I think it would be easier to simply be able to drop a
> key_commands.lua in .textadept.
> Further, it would be similar to having an additional mime_types.conf,
> additional lexers in .textadept.
> A file added with dofile could do both adding to the global keys table
> as well as completely redefining it, right?

My only concern for dofile() is a performance penalty if a user
chooses to redefine _G.keys (runtime in original key_commands.lua is
worthless, and Lua GC has to run). I agree a user key_commands.lua is
more intuitive. I think I will reconsider my changes in hg.

Mitchell

>
> - Robert
>
> - Robert
Received on Sat 20 Mar 2010 - 11:13:30 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:40:28 EST