diff options
-rw-r--r-- | doc/manual/6_Startup.md | 30 | ||||
-rw-r--r-- | init.lua | 9 | ||||
-rw-r--r-- | modules/textadept/command_entry.lua (renamed from core/ext/command_entry.lua) | 0 | ||||
-rw-r--r-- | modules/textadept/find.lua (renamed from core/ext/find.lua) | 0 | ||||
-rw-r--r-- | modules/textadept/init.lua | 6 | ||||
-rw-r--r-- | modules/textadept/key_commands.lua (renamed from core/ext/key_commands.lua) | 4 | ||||
-rw-r--r-- | modules/textadept/menu.lua (renamed from core/ext/menu.lua) | 2 |
7 files changed, 28 insertions, 23 deletions
diff --git a/doc/manual/6_Startup.md b/doc/manual/6_Startup.md index ffdfa298..e5c98dac 100644 --- a/doc/manual/6_Startup.md +++ b/doc/manual/6_Startup.md @@ -32,21 +32,29 @@ Your `~/.textadept/init.lua` is a great place to specify what modules you want to use. They can be Textadept's default ones, or ones that you create. As an example: - -- ~/.textadept/init.lua - require 'ext/keys' - require 'ext/find' - require 'ext/command_entry' - require 'ext/mime_types' + -- In ~/.textadept/init.lua - require 'textadept' -- bookmarks, editing, snippets, etc. - - -- require 'ext/menu' -- do not load the menubar - require 'ext/key_commands' - - -- my modules in ~/.textadept/modules + -- Load my modules in '~/.textadept/modules'. require 'foo' require 'bar' + -- Do not load all of textadept's modules. + --require 'textadept' + + -- Instead, load a subset of them from 'modules/textadept/init.lua'. + --require 'textadept.bookmarks' + --require 'textadept.command_entry' + require 'textadept.editing' + require 'textadept.find' + require 'textadept.mime_types' + --require 'textadept.run' + require 'textadept.session' + require 'textadept.snippets' + + -- These need to be loaded last. + --require 'textadept.menu' + require 'textadept.key_commands' + Please note Textadept does NOT load your `~/.textadept/init.lua`'s modules in addition to its own. This defeats the purpose of maximum extensibility. If your `init.lua` exists, Textadept assumes that file tells it exactly what to load. @@ -11,16 +11,7 @@ local paths = { package.path = table.concat(paths, ';') if not user_dofile('init.lua') then --- Core extension modules to load on startup. -require 'ext/find' -- provides functionality for find/replace -require 'ext/command_entry' -- provides tab-completion for the command entry - --- Generic modules to load on startup. require 'textadept' - --- Core extension modules that must be loaded last. -require 'ext/menu' -- provides the menu bar -require 'ext/key_commands' -- provides key command support end if not RESETTING then diff --git a/core/ext/command_entry.lua b/modules/textadept/command_entry.lua index 296244f4..296244f4 100644 --- a/core/ext/command_entry.lua +++ b/modules/textadept/command_entry.lua diff --git a/core/ext/find.lua b/modules/textadept/find.lua index eafef5ed..eafef5ed 100644 --- a/core/ext/find.lua +++ b/modules/textadept/find.lua diff --git a/modules/textadept/init.lua b/modules/textadept/init.lua index bd4245c9..d2c038f3 100644 --- a/modules/textadept/init.lua +++ b/modules/textadept/init.lua @@ -6,8 +6,14 @@ module('_m.textadept', package.seeall) require 'textadept.bookmarks' +require 'textadept.command_entry' require 'textadept.editing' +require 'textadept.find' require 'textadept.mime_types' require 'textadept.run' require 'textadept.session' require 'textadept.snippets' + +-- These need to be loaded last. +require 'textadept.menu' +require 'textadept.key_commands' diff --git a/core/ext/key_commands.lua b/modules/textadept/key_commands.lua index 310db7aa..cdfda538 100644 --- a/core/ext/key_commands.lua +++ b/modules/textadept/key_commands.lua @@ -6,7 +6,7 @@ local events = _G.events --- -- Manages and defines key commands in Textadept. -- This set of key commands is pretty standard among other text editors. -module('keys', package.seeall) +module('_m.textadept.keys', package.seeall) -- Markdown: -- ## Overview @@ -124,7 +124,7 @@ local SHIFT = 's'..ADD local ALT = 'a'..ADD -- end settings -local keys = keys +local keys = _M local b, v = 'buffer', 'view' local gui = gui diff --git a/core/ext/menu.lua b/modules/textadept/menu.lua index 60e5679c..de1a3a59 100644 --- a/core/ext/menu.lua +++ b/modules/textadept/menu.lua @@ -6,7 +6,7 @@ local events = _G.events --- -- Provides dynamic menus for Textadept. -- This module, like ext/key_commands, should be 'require'ed last. -module('menu', package.seeall) +module('_m.textadept.menu', package.seeall) local gui = gui local l = locale |