Previous Pages
Extending Textadept
Ways to extend Textadept
Adding to ~/.textadept/init.lua
Key commands
local keys = _G.keys
keys.an = { new_buffer }
Snippets
local snippets = _G.snippets
snippets.ta = 'Textadept'
User_dofile
Key commands and snippets can be loaded from separate files in ~/.textadept/ and be loaded with user_dofile:
For example, in init.lua:
user_dofile('my_keys.lua')
user_dofile('my_snippets.lua')
Loading common modules
Modules that provide additional functionality available to all filetypes are by convention put in the common namespace. You can simplify loading them by using a common/init.lua file.
Overwriting existing modules
Copying an existing file in
/modules/textadept/
to
~/.textadept/modules/textadept/
will load the latter version as they have preference in the package path. Useful for example if you use completely different key commands.