Re: [textadept] Re: snapopen

From: Robert <ro....at.web.de>
Date: Wed, 4 Aug 2010 10:00:34 +0200

On Wed, Aug 4, 2010 at 1:42 AM, phayz <russelldicken....at.gmail.com> wrote:
> On Jun 30, 1:22 pm, mitchell <c....at.caladbolg.net> wrote:
>> Snapopen for ta:http://caladbolg.net/textadeptwiki/index.php?n=Main.Snapopen
>>
>> Kind of like:http://www.upperbound.net/snap-open/
>>
>> Currently I set `_m.textadept.snapopen.PATHS = { 'path/to/rails/app' }` for Rails work. It gets the job done.
>>
>> mitchell
>
> Us usual I have to ask...how do you "activate" the snap open
> functionality? Does it need to be bound to a keypress?
>
>
> Regards,
>
> Russell Dickenson
>

I have this in my init.lua:

require 'textadept.snapopen'

keys.ct.t = { _m.textadept.snapopen.open, { _HOME } }
keys.ct.u = { _m.textadept.snapopen.open, { _USERHOME } }
-- current directory
keys.cao = { function ()
  local buffer = buffer
  _m.textadept.snapopen.open({ buffer.filename:match('(.+)/') })
end }

The exclusive flag in the open function isn't checked for, I think. I
added a hardcoded check for ".hg" directories in the add_directory
function. (But if you don't use version control you probably don't
need this.)

I added these examples to the wiki, whose sidepane got spammed while
everyone was on summer vacation. As it doesn't show up in the recent
changes I don't know how to fix it.

- Robert
Received on Wed 04 Aug 2010 - 04:00:34 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:49:31 EST