Re: How to create new snippets for a file type?

From: phayz <russelldicken....at.gmail.com>
Date: Thu, 8 Apr 2010 15:38:39 -0700 (PDT)

On Apr 8, 4:27 pm, Brian Schott <briancsch....at.gmail.com> wrote:
> You'll need an init.lua in the modules/hypertext folder. I've uploaded
> my hypertext module to my website. I may add this to the wiki later.
>
> http://www.hackerpilot.org/src/textadept/hypertext/
>
> On 04/07/10 22:51, phayz wrote:
>
> > As I have mentioned several times in postings to this group, I
> > commonly edit HTML files. I thought that it would be useful if I
> > created some personal snippets for 'hypertext' files so I did. However
> > when I am editing an HTML file, the snippets don't work - i.e. when I
> > have typed in the 'trigger' text and pressed [Tab], the trigger text
> > is not replaced with the snippet. In fact nothing happens, other than
> > a tab is entered in the current buffer.
>
> > To create the snippets file for hypertext-type documents I copied the
> > snippets.lua file from <prefix>\textadept\modules\lua and edited it so
> > that "lua" was replaced with "hypertext" and replaced the Lua snippets
> > with my personal snippets and saved the file to $HOME\.textadept
> > \modules\hypertext.
>
> > Below is the content of the snippets.lua file I created. Can anyone
> > see where I went wrong? Do I have the file in the wrong format or
> > perhaps the wrong location?
>
> > -- Copyright 2007-2010 Mitchell Foral mitchell<att>caladbolg.net. See
> > LICENSE.
>
> > ---
> > -- Snippets for the hypertext module.
> > module('_m.hypertext.snippets', package.seeall)
>
> > local snippets = _G.snippets
>
> > if type(snippets) == 'table' then
> >   snippets.hypertext = {
> >     hh   = 'hello there',
> >   }
> > end

Brian,

Thanks! I now have hypertext snippets working. Of course I now have to
think of some snippets that I want to add. If you do add your files to
the wiki (and PLEASE DO! :) ), you may need to mention the need for
the xmlcomplete.lua file, or perhaps remove this and make it available
separately?

I have some questions about snippets but I'll raise these in another
"thread".

Regards,

Russell Dickenson

-- 
You received this message because you are subscribed to the Google Groups "textadept" group.
To post to this group, send email to textadept.at.googlegroups.com.
To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
Received on Thu 08 Apr 2010 - 18:38:39 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:42:43 EST