Re: XML tag completion script

From: <brian-sch....at.cox.net>
Date: Mon, 15 Mar 2010 18:23:54 -0400

The following is my commands.lua for xml (placed in ~/.textadept/modules/xml/commands.lua)

=============================================================
-- Copyright 2007-2009 Mitchell Foral mitchell<att>caladbolg.net. See LICENSE.

---
-- Commands for the xml module.
module('_m.xml.commands', package.seeall)
require 'common.xmlcomplete'
-- xml-specific key commands.
local keys = _G.keys
if type(keys) == 'table' then
	keys.xml = {
		al = {
			m = { textadept.io.open,
				textadept.iconv(_HOME..'/modules/xml/init.lua',
				'UTF-8', _CHARSET) },
		},
		['c\n'] = {completeClosingTag},
		['>'] = {completeClosingTagBracket},
		['<'] = {autoTag},
		['/'] = {singleTag},
		[' '] = {
			function ()
				local pos = buffer.current_pos
				buffer:clear_selections()
				buffer:set_sel(pos, pos)
				buffer:add_text(" ")
			end
		}
	}
end
=============================================================
---- phayz <russelldicken....at.gmail.com> wrote: 
> Brian, anyone in fact! :P
> 
> I have RTFM but am still unsure how I enable this function. I have
> copied the LUA script to TA's "scripts" folder. I now need to enable
> the key bindings and that's where I am lost. Brian has provided all
> the necessary additions to the key bindings file but I'm not ure where
> I need to put these. I presume I shouldn't touch any of Textadept's
> own files, since they will be overwritten if/when I upgrade.
> 
> 
> Regards,
> 
> Russell Dickenson (AKA phayz)
Received on Mon 15 Mar 2010 - 18:23:54 EDT

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