Zenlike

Summary

This module provides snippets similar to those found in the "Zen Coding" modules for various other editors.

If you find a bug, please let me know. You can find my email address by looking at the license block of the script to get my name, and the Textadept mailing list for my email address. (This wiki is frequented by spammers)

modules/hypertext/zen.lua

Suggested key bindings

---
-- Commands for the hypertext module.
module('_m.hypertext.commands', package.seeall)

require 'hypertext.zen'

local function tabkey()
        if _m.textadept.snippets._insert() == true then return true end
        if #buffer:get_sel_text() == 0
                        and _m.hypertext.zen.process_zen() == true then
                return true
        else
                return false
        end
end

-- hypertext-specific key commands.
local keys = _G.keys
if type(keys) == 'table' then
        keys.hypertext = {
                al = {
                        m = { io.open_file,
                        (_USERHOME..'/modules/hypertext/init.lua'):iconv('UTF-8', _CHARSET) },
                },
                ['\t']= {tabkey},
        }
end

History

Added the file “zen.lua”.


Edited on Monday, March 12th 2012 at 7:18 PM.