Saturday, February 12, 2011

Another Scintilla Editor

http://caladbolg.net/luadoc/textadept/manual/1_Introduction.html

require 'textadept'

local keys = _G.keys
local b, v = 'buffer', 'view'
local gui = gui

keys.can = { new_buffer }
keys.cl = { 'char_right', b }
keys.cL = { 'char_right_extend', b }
keys.cal = { 'word_right', b }
keys.caL = { 'word_right_extend', b }
keys.cj = { 'char_left', b }
keys.cJ = { 'char_left_extend', b }
keys.caj = { 'word_left', b }
keys.caJ = { 'word_left_extend', b }
keys.ck = { 'line_down', b }
keys.cak = { 'line_down', b }
keys.cK = { 'line_down_extend', b }
keys.caK = { 'line_down_extend', b }
keys.ci = { 'line_up', b }
keys.cai = { 'line_up', b }
keys.cI = { 'line_up_extend', b }
keys.caI = { 'line_up_extend', b }
keys.ch = { 'vc_home', b }
keys.cah = { 'vc_home', b }
keys.cH = { 'home_extend', b }
keys.caH = { 'home_extend', b }
keys['c;'] = { 'line_end', b }
keys['ca;'] = { 'line_end', b }
keys['c:'] = { 'line_end_extend', b }
keys['ca:'] = { 'line_end_extend', b }
keys.cd = { 'clear', b }
keys.caN = { gui.switch_buffer }
keys.cn = { 'goto_buffer', v, 1, false }
keys.cN = { 'goto_buffer', v, -1, false }
keys.ce = {
function()
buffer:line_end_extend()
buffer:cut()
end
}