diff options
Diffstat (limited to 'doc/manual/7_Modules.md')
-rw-r--r-- | doc/manual/7_Modules.md | 106 |
1 files changed, 60 insertions, 46 deletions
diff --git a/doc/manual/7_Modules.md b/doc/manual/7_Modules.md index 50461062..1b915c85 100644 --- a/doc/manual/7_Modules.md +++ b/doc/manual/7_Modules.md @@ -8,94 +8,105 @@ module: generic and language-specific. ## Generic This class of modules is usually available globally for programming in all -languages or writing plain-text. An example is the -[textadept](../modules/_M.textadept.html) module which implements most of -Textadept's functionality (find/replace, key commands, menus, snippets, etc.). -These kinds of modules are generally loaded on startup. See the -[preferences](9_Preferences.html#user_init) page for instructions on how to load -generic modules when Textadept starts. +languages or writing plain-text. An example is the [textadept module][] which +implements most of Textadept's functionality (find/replace, key commands, menus, +snippets, etc.). These kinds of modules are generally loaded on startup. See the +[preferences][] page for instructions on how to load generic modules when +Textadept starts. + +[textadept module]: ../api/_M.textadept.html +[preferences]: 9_Preferences.html#User.Init ## Language Specific Each module of this class of modules is named after a language lexer in the `lexers/` directory and is only available only for editing code in that particular programming language unless you specify otherwise. Examples are the -[cpp](../modules/_M.cpp.html) and [lua](../modules/_M.lua.html) modules which -provide special editing features for the C/C++ and Lua languages respectively. +[cpp][] and [lua][] modules which provide special editing features for the C/C++ +and Lua languages respectively. + +[cpp]: ../api/_M.cpp.html +[lua]: ../api/_M.lua.html -#### Lexer +### Lexer -All languages have a [lexer](../modules/lexer.html) that performs syntax -highlighting on the source code. While the lexer itself is not part of the -module, its existence in `lexers/` is required. +All languages have a [lexer][] that performs syntax highlighting on the source +code. While the lexer itself is not part of the module, its existence in +`lexers/` is required. -#### Activation +[lexer]: ../api/lexer.html + +### Activation Language-specific modules are automatically loaded when a file of that language is loaded or a buffer's lexer is set to that language. -#### Snippets +### Snippets -Most language-specific modules have a set of -[snippets](../modules/_M.textadept.snippets.html). Press `Ctrl+K` (`⌥⇥` on Mac -OSX) for a list of available snippets or see the module's Lua code. To insert a -snippet, type its trigger followed by the `Tab` (`⇥`) key. Subsequent presses of -`Tab` (`⇥`) causes the caret to enter tab stops in sequential order, `Shift+Tab` -(`⇧⇥`) goes back to the previous tab stop, and `Ctrl+Shift+K` (`⌥⇧⇥` on Mac OSX) -cancels the current snippet. Snippets can be nested (inserted from within -another snippet). +Most language-specific modules have a set of [snippets][]. Press `Ctrl+K` (`⌥⇥` +on Mac OSX) for a list of available snippets or see the module's Lua code. To +insert a snippet, type its trigger followed by the `Tab` (`⇥`) key. Subsequent +presses of `Tab` (`⇥`) causes the caret to enter tab stops in sequential order, +`Shift+Tab` (`⇧⇥`) goes back to the previous tab stop, and `Ctrl+Shift+K` (`⌥⇧⇥` +on Mac OSX) cancels the current snippet. Snippets can be nested (inserted from +within another snippet).   -#### Commands +[snippets]: ../api/_M.textadept.snippets.html + +### Commands -Most language-specific modules have a set of [key -commands](../modules/_M.textadept.keys.html). See the module's Lua code for -which key commands are available. They are typically stored in the `Ctrl+L` -(`⌘L` on Mac OSX) key prefix. +Most language-specific modules have a set of [key commands][]. See the module's +Lua code for which key commands are available. They are typically stored in the +`Ctrl+L` (`⌘L` on Mac OSX) key prefix. -##### Run +[key commands]: ../api/_M.textadept.keys.html + +#### Run Most language-specific modules have a command that runs the code in the current file. Pressing `Ctrl+R` (`⌘R` on Mac OSX) runs that command. -##### Compile +#### Compile Most language-specific modules have a command that compiles the code in the current file. Pressing `Ctrl+Shift+R` (`⌘⇧R` on Mac OSX) runs that command. -##### Block Comments +#### Block Comments Pressing `Ctrl+/` (`⌘/` on Mac OSX) comments or uncomments the code on the selected lines. -#### Buffer Properties +### Buffer Properties Sometimes language-specific modules set default buffer properties like tabs and indentation size. See the module's Lua code for these settings. If you wish to change them or use different settings, see the -[Customizing Modules](#customizing_modules) section below. +[Customizing Modules](#Customizing.Modules) section below. -#### Context Menu +### Context Menu Some language-specific modules add extra actions to the context menu. Right-click inside the view to bring up this menu. ## Getting Modules -The officially supported language modules are hosted on -[Bitbucket](https://bitbucket.org/mitchell) and are available as a separate -download. To upgrade to the most recent version of a module, you can either use -[Mercurial](http://mercurial.selenic.com) (run `hg pull` and then `hg update` on -or from within the module) or download a zipped version from the module's -repository homepage and overwrite the existing one. If you do not have access to -`_HOME`, place the updated module in your `_USERHOME` and replace all instances -of `_HOME` with `_USERHOME` in the module's `init.lua`. +The officially supported language modules are hosted [here][] and are available +as a separate download. To upgrade to the most recent version of a module, you +can either use [Mercurial][] (run `hg pull` and then `hg update` on or from +within the module) or download a zipped version from the module's repository +homepage and overwrite the existing one. If you do not have access to `_HOME`, +place the updated module in your `_USERHOME` and replace all instances of +`_HOME` with `_USERHOME` in the module's `init.lua`. + +For now, user-created modules are obtained from the [wiki][]. -For now, user-created modules are obtained from the -[wiki](http://caladbolg.net/textadeptwiki). +[here]: http://foicica.com/hg +[Mercurial]: http://mercurial.selenic.com +[wiki]: http://caladbolg.net/textadeptwiki ## Installing Modules @@ -107,7 +118,9 @@ module, it will be loaded instead of the one that comes with Textadept. ## Developing Modules -See the [LuaDoc](../modules/_M.html) for modules. +See the [LuaDoc][] for modules. + +[LuaDoc]: ../api/_M.html ## Customizing Modules @@ -140,5 +153,6 @@ from `post_init.lua`: end Similarly, you can use `post_init.lua` to change the compile/run commands, load -more [Adeptsense tags](../modules/_M.textadept.adeptsense.html#load_ctags), and -add additional key commands and snippets. +more [Adeptsense tags][], and add additional key commands and snippets. + +[Adeptsense tags]: ../api/_M.textadept.adeptsense.html#load_ctags |