[code] I need help adding a language-specific snippet

From: Russell Dickenson <russelldickenson.att.gmail.com>
Date: Fri, 3 May 2013 10:52:23 +1000

As I have mentioned in earlier postings to this mailing list, I want to
learn how to tweak Textadept to my needs. Previously I have tried enabling
XML tag autoclosure and had some help from Robert (thankyou). I realise I
need to start from the very basics.

Note: Here I am using Textadept 6.6 Beta on Fedora 18 (x86_64).

In this case I wanted to better understand how to customise the handling of
a specific file type. I read the following text and thought, "OK, I'll try
adding a snippet that is specific to XML."

"Similarly, you can use *post_init.lua* to change the module’s compile and
run <http://foicica.com/textadept/07_Modules.html#Compile.and.Run>commands,
load more Adeptsense
tags<http://foicica.com/textadept/api/_M.textadept.adeptsense.html#load_ctags>,
and add additional key
bindings<http://foicica.com/textadept/08_Preferences.html#Key.Bindings>and
snippets <http://foicica.com/textadept/08_Preferences.html#Snippets>(instead
of in
*~/.textadept/init.lua*)."

I created in ~/.textadept/modules/xml/ a file named "post_init.lua", with
the contents:

snippets.xml['hi'] = 'hello there'

I then open an existing XML file, which is properly recognised by TA as of
type "xml" and I type the snippet "hi", then press [Tab]. The snippet is
not converted to the text "hello there".

Where am I going wrong here?

I need to highlight just how dumb I am. When I first read the instructions
above, I first created the file "post_init.xml". :| This should highlight
just what level of intelligence you're dealing with here.

Thanks in advance for any help.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 02 May 2013 - 20:52:23 EDT

This archive was generated by hypermail 2.2.0 : Fri 03 May 2013 - 06:30:23 EDT