Added example init.lua file

This commit is contained in:
Hackerpilot 2013-08-18 12:48:31 +00:00
parent 6a13723533
commit adf389c083
2 changed files with 41 additions and 12 deletions

View File

@ -1,15 +1,5 @@
#Textadept Integration
###Installation
1. Copy the dcd.lua file into your ~/.textadept/modules/dmd/ folder
2. Modify your ~/.textadept/modules/dmd/init.lua file:
1. Require the dcd module
_M.dcd = require "dmd.dcd"
2. Register the autocomplete function
events.connect(events.CHAR_ADDED, function(ch)
_M.dcd.autocomplete(ch)
end)
* Copy the dcd.lua and init.lua file into your ~/.textadept/modules/dmd/ folder.
* Start the dcd-server program.

View File

@ -0,0 +1,39 @@
local M = {}
_M.dcd = require "dmd.dcd"
if type(_G.snippets) == 'table' then
_G.snippets.dmd = {}
end
if type(_G.keys) == 'table' then
_G.keys.dmd = {}
end
events.connect(events.CHAR_ADDED, function(ch)
_M.dcd.autocomplete(ch)
end)
local function autocomplete()
_M.dcd.registerImages()
_M.dcd.autocomplete(string.byte('.'))
if not buffer:auto_c_active() then
_M.textadept.editing.autocomplete_word(keywords)
end
end
-- D-specific key commands.
keys.dmd = {
[keys.LANGUAGE_MODULE_PREFIX] = {
m = { io.open_file,
(_USERHOME..'/modules/dmd/init.lua'):iconv('UTF-8', _CHARSET) },
},
['c\n'] = {autocomplete},
['down'] = {_M.dcd.cycleCalltips, 1},
['up'] = {_M.dcd.cycleCalltips, -1},
}
function M.set_buffer_properties()
end
return M