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

From: Brian Schott <briancsch....at.gmail.com>
Date: Wed, 07 Apr 2010 23:27:54 -0700

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
>
>
Received on Thu 08 Apr 2010 - 02:27:54 EDT

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